File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ pub struct LeastSquaresOwned<A: Scalar> {
12
12
pub rank : i32 ,
13
13
}
14
14
15
+ /// Result of LeastSquares
16
+ pub struct LeastSquaresRef < ' work , A : Scalar > {
17
+ /// singular values
18
+ pub singular_values : & ' work [ A :: Real ] ,
19
+ /// The rank of the input matrix A
20
+ pub rank : i32 ,
21
+ }
22
+
15
23
#[ cfg_attr( doc, katexit:: katexit) ]
16
24
/// Solve least square problem
17
25
pub trait LeastSquaresSvdDivideConquer_ : Scalar {
@@ -29,7 +37,18 @@ pub trait LeastSquaresSvdDivideConquer_: Scalar {
29
37
a : & mut [ Self ] ,
30
38
b_layout : MatrixLayout ,
31
39
b : & mut [ Self ] ,
32
- ) -> Result < LeastSquaresOutput < Self > > ;
40
+ ) -> Result < LeastSquaresOwned < Self > > ;
41
+ }
42
+
43
+ pub struct LeastSquaresWork < T : Scalar > {
44
+ pub work : Vec < MaybeUninit < T > > ,
45
+ }
46
+
47
+ pub trait LeastSquaresWorkImpl : Sized {
48
+ type Elem : Scalar ;
49
+ fn new ( a_layout : MatrixLayout , b_layout : MatrixLayout ) -> Result < Self > ;
50
+ fn calc ( & mut self , a : & mut [ Self ] , b : & mut [ Self ] ) -> Result < LeastSquaresRef < Self :: Elem > > ;
51
+ fn eval ( self , a : & mut [ Self ] , b : & mut [ Self ] ) -> Result < LeastSquaresOwned < Self :: Elem > > ;
33
52
}
34
53
35
54
macro_rules! impl_least_squares {
You can’t perform that action at this time.
0 commit comments