File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
//! Define trait for Hermite matrices
2
2
3
- use ndarray:: { Ix2 , Array } ;
3
+ use ndarray:: { Ix2 , Array , RcArray } ;
4
4
use lapack:: c:: Layout ;
5
5
6
6
use matrix:: { Matrix , MFloat } ;
@@ -71,3 +71,25 @@ impl<A: HMFloat> HermiteMatrix for Array<A, Ix2> {
71
71
Ok ( rt * rt)
72
72
}
73
73
}
74
+
75
+ impl < A : HMFloat > HermiteMatrix for RcArray < A , Ix2 > {
76
+ fn eigh ( self ) -> Result < ( Self :: Vector , Self ) , LinalgError > {
77
+ // XXX unnecessray clone (should use into_owned())
78
+ let ( e, v) = self . to_owned ( ) . eigh ( ) ?;
79
+ Ok ( ( e. into_shared ( ) , v. into_shared ( ) ) )
80
+ }
81
+ fn ssqrt ( self ) -> Result < Self , LinalgError > {
82
+ // XXX unnecessray clone (should use into_owned())
83
+ let s = self . to_owned ( ) . ssqrt ( ) ?;
84
+ Ok ( s. into_shared ( ) )
85
+ }
86
+ fn cholesky ( self ) -> Result < Self , LinalgError > {
87
+ // XXX unnecessray clone (should use into_owned())
88
+ let s = self . to_owned ( ) . cholesky ( ) ?;
89
+ Ok ( s. into_shared ( ) )
90
+ }
91
+ fn deth ( self ) -> Result < Self :: Scalar , LinalgError > {
92
+ // XXX unnecessray clone (should use into_owned())
93
+ self . to_owned ( ) . deth ( )
94
+ }
95
+ }
You can’t perform that action at this time.
0 commit comments