File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 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> {
1212pub  rank :  i32 , 
1313} 
1414
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+ 
1523#[ cfg_attr( doc,  katexit:: katexit) ]  
1624/// Solve least square problem 
1725pub  trait  LeastSquaresSvdDivideConquer_ :  Scalar  { 
@@ -29,7 +37,18 @@ pub trait LeastSquaresSvdDivideConquer_: Scalar {
2937        a :  & mut  [ Self ] , 
3038        b_layout :  MatrixLayout , 
3139        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 > > ; 
3352} 
3453
3554macro_rules!  impl_least_squares { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments