Skip to content

Commit 95c975c

Browse files
authored
Merge pull request #233 from rust-ndarray/least-square-lax-trait-0.12
Add LeastSquaresSvdDivideConquer_ into Lapack trait for 0.12.* branch
2 parents e17087b + 7219590 commit 95c975c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/lapack/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub trait Lapack:
4444
+ Eigh_
4545
+ Triangular_
4646
+ Tridiagonal_
47+
+ LeastSquaresSvdDivideConquer_
4748
{
4849
}
4950

src/least_squares.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ where
152152
/// valid representation for `ArrayBase`.
153153
impl<E, D> LeastSquaresSvd<D, E, Ix1> for ArrayBase<D, Ix2>
154154
where
155-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
155+
E: Scalar + Lapack,
156156
D: Data<Elem = E>,
157157
{
158158
/// Solve a least squares problem of the form `Ax = rhs`
@@ -175,7 +175,7 @@ where
175175
/// valid representation for `ArrayBase`.
176176
impl<E, D> LeastSquaresSvd<D, E, Ix2> for ArrayBase<D, Ix2>
177177
where
178-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
178+
E: Scalar + Lapack,
179179
D: Data<Elem = E>,
180180
{
181181
/// Solve a least squares problem of the form `Ax = rhs`
@@ -200,7 +200,7 @@ where
200200
/// valid representation for `ArrayBase`.
201201
impl<E, D> LeastSquaresSvdInto<D, E, Ix1> for ArrayBase<D, Ix2>
202202
where
203-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
203+
E: Scalar + Lapack,
204204
D: DataMut<Elem = E>,
205205
{
206206
/// Solve a least squares problem of the form `Ax = rhs`
@@ -226,7 +226,7 @@ where
226226
/// valid representation for `ArrayBase`.
227227
impl<E, D> LeastSquaresSvdInto<D, E, Ix2> for ArrayBase<D, Ix2>
228228
where
229-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
229+
E: Scalar + Lapack,
230230
D: DataMut<Elem = E>,
231231
{
232232
/// Solve a least squares problem of the form `Ax = rhs`
@@ -252,7 +252,7 @@ where
252252
/// valid representation for `ArrayBase`.
253253
impl<E, D> LeastSquaresSvdInPlace<D, E, Ix1> for ArrayBase<D, Ix2>
254254
where
255-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
255+
E: Scalar + Lapack,
256256
D: DataMut<Elem = E>,
257257
{
258258
/// Solve a least squares problem of the form `Ax = rhs`
@@ -284,15 +284,15 @@ fn compute_least_squares_srhs<E, D1, D2>(
284284
rhs: &mut ArrayBase<D2, Ix1>,
285285
) -> Result<LeastSquaresResult<E, Ix1>>
286286
where
287-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
287+
E: Scalar + Lapack,
288288
D1: DataMut<Elem = E>,
289289
D2: DataMut<Elem = E>,
290290
{
291291
let LeastSquaresOutput::<E> {
292292
singular_values,
293293
rank,
294294
} = unsafe {
295-
<E as LeastSquaresSvdDivideConquer_>::least_squares(
295+
E::least_squares(
296296
a.layout()?,
297297
a.as_allocated_mut()?,
298298
rhs.as_slice_memory_order_mut()
@@ -333,7 +333,7 @@ fn compute_residual_scalar<E: Scalar, D: Data<Elem = E>>(
333333
/// valid representation for `ArrayBase`.
334334
impl<E, D> LeastSquaresSvdInPlace<D, E, Ix2> for ArrayBase<D, Ix2>
335335
where
336-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
336+
E: Scalar + Lapack,
337337
D: DataMut<Elem = E>,
338338
{
339339
/// Solve a least squares problem of the form `Ax = rhs`
@@ -366,7 +366,7 @@ fn compute_least_squares_nrhs<E, D1, D2>(
366366
rhs: &mut ArrayBase<D2, Ix2>,
367367
) -> Result<LeastSquaresResult<E, Ix2>>
368368
where
369-
E: Scalar + Lapack + LeastSquaresSvdDivideConquer_,
369+
E: Scalar + Lapack,
370370
D1: DataMut<Elem = E>,
371371
D2: DataMut<Elem = E>,
372372
{
@@ -376,7 +376,7 @@ where
376376
singular_values,
377377
rank,
378378
} = unsafe {
379-
<E as LeastSquaresSvdDivideConquer_>::least_squares_nrhs(
379+
E::least_squares_nrhs(
380380
a_layout,
381381
a.as_allocated_mut()?,
382382
rhs_layout,

0 commit comments

Comments
 (0)