@@ -137,7 +137,8 @@ pub trait Solve<A: Scalar> {
137
137
}
138
138
139
139
/// Represents the LU factorization of a matrix `A` as `A = P*L*U`.
140
- pub struct LUFactorized < S : Data > {
140
+ #[ derive( Clone ) ]
141
+ pub struct LUFactorized < S : Data + RawDataClone > {
141
142
/// The factors `L` and `U`; the unit diagonal elements of `L` are not
142
143
/// stored.
143
144
pub a : ArrayBase < S , Ix2 > ,
@@ -148,7 +149,7 @@ pub struct LUFactorized<S: Data> {
148
149
impl < A , S > Solve < A > for LUFactorized < S >
149
150
where
150
151
A : Scalar + Lapack ,
151
- S : Data < Elem = A > ,
152
+ S : Data < Elem = A > + RawDataClone ,
152
153
{
153
154
fn solve_inplace < ' a , Sb > ( & self , rhs : & ' a mut ArrayBase < Sb , Ix1 > ) -> Result < & ' a mut ArrayBase < Sb , Ix1 > >
154
155
where
@@ -226,14 +227,14 @@ where
226
227
}
227
228
228
229
/// An interface for computing LU factorizations of matrix refs.
229
- pub trait Factorize < S : Data > {
230
+ pub trait Factorize < S : Data + RawDataClone > {
230
231
/// Computes the LU factorization `A = P*L*U`, where `P` is a permutation
231
232
/// matrix.
232
233
fn factorize ( & self ) -> Result < LUFactorized < S > > ;
233
234
}
234
235
235
236
/// An interface for computing LU factorizations of matrices.
236
- pub trait FactorizeInto < S : Data > {
237
+ pub trait FactorizeInto < S : Data + RawDataClone > {
237
238
/// Computes the LU factorization `A = P*L*U`, where `P` is a permutation
238
239
/// matrix.
239
240
fn factorize_into ( self ) -> Result < LUFactorized < S > > ;
@@ -242,7 +243,7 @@ pub trait FactorizeInto<S: Data> {
242
243
impl < A , S > FactorizeInto < S > for ArrayBase < S , Ix2 >
243
244
where
244
245
A : Scalar + Lapack ,
245
- S : DataMut < Elem = A > ,
246
+ S : DataMut < Elem = A > + RawDataClone ,
246
247
{
247
248
fn factorize_into ( mut self ) -> Result < LUFactorized < S > > {
248
249
let ipiv = unsafe { A :: lu ( self . layout ( ) ?, self . as_allocated_mut ( ) ?) ? } ;
@@ -279,7 +280,7 @@ pub trait InverseInto {
279
280
impl < A , S > InverseInto for LUFactorized < S >
280
281
where
281
282
A : Scalar + Lapack ,
282
- S : DataMut < Elem = A > ,
283
+ S : DataMut < Elem = A > + RawDataClone ,
283
284
{
284
285
type Output = ArrayBase < S , Ix2 > ;
285
286
@@ -292,7 +293,7 @@ where
292
293
impl < A , S > Inverse for LUFactorized < S >
293
294
where
294
295
A : Scalar + Lapack ,
295
- S : Data < Elem = A > ,
296
+ S : Data < Elem = A > + RawDataClone ,
296
297
{
297
298
type Output = Array2 < A > ;
298
299
@@ -308,7 +309,7 @@ where
308
309
impl < A , S > InverseInto for ArrayBase < S , Ix2 >
309
310
where
310
311
A : Scalar + Lapack ,
311
- S : DataMut < Elem = A > ,
312
+ S : DataMut < Elem = A > + RawDataClone ,
312
313
{
313
314
type Output = Self ;
314
315
@@ -408,7 +409,7 @@ where
408
409
impl < A , S > Determinant < A > for LUFactorized < S >
409
410
where
410
411
A : Scalar + Lapack ,
411
- S : Data < Elem = A > ,
412
+ S : Data < Elem = A > + RawDataClone ,
412
413
{
413
414
fn sln_det ( & self ) -> Result < ( A , A :: Real ) > {
414
415
self . a . ensure_square ( ) ?;
@@ -419,7 +420,7 @@ where
419
420
impl < A , S > DeterminantInto < A > for LUFactorized < S >
420
421
where
421
422
A : Scalar + Lapack ,
422
- S : Data < Elem = A > ,
423
+ S : Data < Elem = A > + RawDataClone ,
423
424
{
424
425
fn sln_det_into ( self ) -> Result < ( A , A :: Real ) > {
425
426
self . a . ensure_square ( ) ?;
@@ -448,7 +449,7 @@ where
448
449
impl < A , S > DeterminantInto < A > for ArrayBase < S , Ix2 >
449
450
where
450
451
A : Scalar + Lapack ,
451
- S : DataMut < Elem = A > ,
452
+ S : DataMut < Elem = A > + RawDataClone ,
452
453
{
453
454
fn sln_det_into ( self ) -> Result < ( A , A :: Real ) > {
454
455
self . ensure_square ( ) ?;
@@ -494,7 +495,7 @@ pub trait ReciprocalConditionNumInto<A: Scalar> {
494
495
impl < A , S > ReciprocalConditionNum < A > for LUFactorized < S >
495
496
where
496
497
A : Scalar + Lapack ,
497
- S : Data < Elem = A > ,
498
+ S : Data < Elem = A > + RawDataClone ,
498
499
{
499
500
fn rcond ( & self ) -> Result < A :: Real > {
500
501
unsafe { A :: rcond ( self . a . layout ( ) ?, self . a . as_allocated ( ) ?, self . a . opnorm_one ( ) ?) }
@@ -504,7 +505,7 @@ where
504
505
impl < A , S > ReciprocalConditionNumInto < A > for LUFactorized < S >
505
506
where
506
507
A : Scalar + Lapack ,
507
- S : Data < Elem = A > ,
508
+ S : Data < Elem = A > + RawDataClone ,
508
509
{
509
510
fn rcond_into ( self ) -> Result < A :: Real > {
510
511
self . rcond ( )
@@ -524,7 +525,7 @@ where
524
525
impl < A , S > ReciprocalConditionNumInto < A > for ArrayBase < S , Ix2 >
525
526
where
526
527
A : Scalar + Lapack ,
527
- S : DataMut < Elem = A > ,
528
+ S : DataMut < Elem = A > + RawDataClone ,
528
529
{
529
530
fn rcond_into ( self ) -> Result < A :: Real > {
530
531
self . factorize_into ( ) ?. rcond_into ( )
0 commit comments