@@ -52,7 +52,7 @@ use crate::layout::*;
5252use crate :: triangular:: IntoTriangular ;
5353use crate :: types:: * ;
5454
55- pub use crate :: lapack_traits :: UPLO ;
55+ pub use crate :: lapack :: UPLO ;
5656
5757/// Cholesky decomposition of Hermitian (or real symmetric) positive definite matrix
5858pub struct CholeskyFactorized < S : Data > {
@@ -66,7 +66,7 @@ pub struct CholeskyFactorized<S: Data> {
6666
6767impl < A , S > CholeskyFactorized < S >
6868where
69- A : Scalar ,
69+ A : Scalar + Lapack ,
7070 S : DataMut < Elem = A > ,
7171{
7272 /// Returns `L` from the Cholesky decomposition `A = L * L^H`.
@@ -96,10 +96,10 @@ where
9696
9797impl < A , S > DeterminantC for CholeskyFactorized < S >
9898where
99- A : Absolute ,
99+ A : Scalar + Lapack ,
100100 S : Data < Elem = A > ,
101101{
102- type Output = <A as AssociatedReal >:: Real ;
102+ type Output = <A as Scalar >:: Real ;
103103
104104 fn detc ( & self ) -> Self :: Output {
105105 self . ln_detc ( ) . exp ( )
@@ -109,17 +109,17 @@ where
109109 self . factor
110110 . diag ( )
111111 . iter ( )
112- . map ( |elem| elem. abs_sqr ( ) . ln ( ) )
112+ . map ( |elem| elem. square ( ) . ln ( ) )
113113 . sum :: < Self :: Output > ( )
114114 }
115115}
116116
117117impl < A , S > DeterminantCInto for CholeskyFactorized < S >
118118where
119- A : Absolute ,
119+ A : Scalar + Lapack ,
120120 S : Data < Elem = A > ,
121121{
122- type Output = <A as AssociatedReal >:: Real ;
122+ type Output = <A as Scalar >:: Real ;
123123
124124 fn detc_into ( self ) -> Self :: Output {
125125 self . detc ( )
@@ -132,7 +132,7 @@ where
132132
133133impl < A , S > InverseC for CholeskyFactorized < S >
134134where
135- A : Scalar ,
135+ A : Scalar + Lapack ,
136136 S : Data < Elem = A > ,
137137{
138138 type Output = Array2 < A > ;
@@ -148,7 +148,7 @@ where
148148
149149impl < A , S > InverseCInto for CholeskyFactorized < S >
150150where
151- A : Scalar ,
151+ A : Scalar + Lapack ,
152152 S : DataMut < Elem = A > ,
153153{
154154 type Output = ArrayBase < S , Ix2 > ;
@@ -163,7 +163,7 @@ where
163163
164164impl < A , S > SolveC < A > for CholeskyFactorized < S >
165165where
166- A : Scalar ,
166+ A : Scalar + Lapack ,
167167 S : Data < Elem = A > ,
168168{
169169 fn solvec_inplace < ' a , Sb > ( & self , b : & ' a mut ArrayBase < Sb , Ix1 > ) -> Result < & ' a mut ArrayBase < Sb , Ix1 > >
@@ -226,7 +226,7 @@ pub trait CholeskyInplace {
226226
227227impl < A , S > Cholesky for ArrayBase < S , Ix2 >
228228where
229- A : Scalar ,
229+ A : Scalar + Lapack ,
230230 S : Data < Elem = A > ,
231231{
232232 type Output = Array2 < A > ;
@@ -239,7 +239,7 @@ where
239239
240240impl < A , S > CholeskyInto for ArrayBase < S , Ix2 >
241241where
242- A : Scalar ,
242+ A : Scalar + Lapack ,
243243 S : DataMut < Elem = A > ,
244244{
245245 type Output = Self ;
@@ -252,7 +252,7 @@ where
252252
253253impl < A , S > CholeskyInplace for ArrayBase < S , Ix2 >
254254where
255- A : Scalar ,
255+ A : Scalar + Lapack ,
256256 S : DataMut < Elem = A > ,
257257{
258258 fn cholesky_inplace ( & mut self , uplo : UPLO ) -> Result < & mut Self > {
@@ -289,7 +289,7 @@ pub trait FactorizeCInto<S: Data> {
289289
290290impl < A , S > FactorizeCInto < S > for ArrayBase < S , Ix2 >
291291where
292- A : Scalar ,
292+ A : Scalar + Lapack ,
293293 S : DataMut < Elem = A > ,
294294{
295295 fn factorizec_into ( self , uplo : UPLO ) -> Result < CholeskyFactorized < S > > {
@@ -302,7 +302,7 @@ where
302302
303303impl < A , Si > FactorizeC < OwnedRepr < A > > for ArrayBase < Si , Ix2 >
304304where
305- A : Scalar ,
305+ A : Scalar + Lapack ,
306306 Si : Data < Elem = A > ,
307307{
308308 fn factorizec ( & self , uplo : UPLO ) -> Result < CholeskyFactorized < OwnedRepr < A > > > {
@@ -343,7 +343,7 @@ pub trait SolveC<A: Scalar> {
343343
344344impl < A , S > SolveC < A > for ArrayBase < S , Ix2 >
345345where
346- A : Scalar ,
346+ A : Scalar + Lapack ,
347347 S : Data < Elem = A > ,
348348{
349349 fn solvec_inplace < ' a , Sb > ( & self , b : & ' a mut ArrayBase < Sb , Ix1 > ) -> Result < & ' a mut ArrayBase < Sb , Ix1 > >
@@ -372,7 +372,7 @@ pub trait InverseCInto {
372372
373373impl < A , S > InverseC for ArrayBase < S , Ix2 >
374374where
375- A : Scalar ,
375+ A : Scalar + Lapack ,
376376 S : Data < Elem = A > ,
377377{
378378 type Output = Array2 < A > ;
@@ -384,7 +384,7 @@ where
384384
385385impl < A , S > InverseCInto for ArrayBase < S , Ix2 >
386386where
387- A : Scalar ,
387+ A : Scalar + Lapack ,
388388 S : DataMut < Elem = A > ,
389389{
390390 type Output = Self ;
@@ -430,10 +430,10 @@ pub trait DeterminantCInto {
430430
431431impl < A , S > DeterminantC for ArrayBase < S , Ix2 >
432432where
433- A : Scalar ,
433+ A : Scalar + Lapack ,
434434 S : Data < Elem = A > ,
435435{
436- type Output = Result < <A as AssociatedReal >:: Real > ;
436+ type Output = Result < <A as Scalar >:: Real > ;
437437
438438 fn detc ( & self ) -> Self :: Output {
439439 Ok ( self . ln_detc ( ) ?. exp ( ) )
@@ -446,10 +446,10 @@ where
446446
447447impl < A , S > DeterminantCInto for ArrayBase < S , Ix2 >
448448where
449- A : Scalar ,
449+ A : Scalar + Lapack ,
450450 S : DataMut < Elem = A > ,
451451{
452- type Output = Result < <A as AssociatedReal >:: Real > ;
452+ type Output = Result < <A as Scalar >:: Real > ;
453453
454454 fn detc_into ( self ) -> Self :: Output {
455455 Ok ( self . ln_detc_into ( ) ?. exp ( ) )
0 commit comments