File tree Expand file tree Collapse file tree 4 files changed +42
-32
lines changed Expand file tree Collapse file tree 4 files changed +42
-32
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ pub mod layout;
48
48
pub mod impls;
49
49
pub mod impl2;
50
50
51
- pub mod traits;
51
+ pub mod qr;
52
+ pub mod opnorm;
52
53
53
54
pub mod vector;
54
55
pub mod matrix;
Original file line number Diff line number Diff line change
1
+
2
+ use ndarray:: * ;
3
+
4
+ use super :: types:: * ;
5
+ use super :: error:: * ;
6
+ use super :: layout:: * ;
7
+
8
+ pub use impl2:: NormType ;
9
+ use impl2:: LapackScalar ;
10
+
11
+ pub trait OperationNorm {
12
+ type Output ;
13
+ fn opnorm ( & self , t : NormType ) -> Self :: Output ;
14
+ fn opnorm_one ( & self ) -> Self :: Output {
15
+ self . opnorm ( NormType :: One )
16
+ }
17
+ fn opnorm_inf ( & self ) -> Self :: Output {
18
+ self . opnorm ( NormType :: Infinity )
19
+ }
20
+ fn opnorm_fro ( & self ) -> Self :: Output {
21
+ self . opnorm ( NormType :: Frobenius )
22
+ }
23
+ }
24
+
25
+ impl < A , S > OperationNorm for ArrayBase < S , Ix2 >
26
+ where A : LapackScalar + AssociatedReal ,
27
+ S : Data < Elem = A >
28
+ {
29
+ type Output = Result < A :: Real > ;
30
+
31
+ fn opnorm ( & self , t : NormType ) -> Self :: Output {
32
+ let l = self . layout ( ) ?;
33
+ let a = self . as_allocated ( ) ?;
34
+ Ok ( A :: opnorm ( t, l, a) )
35
+ }
36
+ }
Original file line number Diff line number Diff line change @@ -5,4 +5,6 @@ pub use hermite::HermiteMatrix;
5
5
pub use triangular:: * ;
6
6
pub use util:: * ;
7
7
pub use assert:: * ;
8
- pub use traits:: * ;
8
+
9
+ pub use qr:: * ;
10
+ pub use opnorm:: * ;
Original file line number Diff line number Diff line change 1
1
2
- pub use impl2:: LapackScalar ;
3
- pub use impl2:: NormType ;
4
-
5
2
use num_traits:: Zero ;
6
3
use ndarray:: * ;
7
4
8
- use super :: types:: * ;
9
5
use super :: error:: * ;
10
6
use super :: layout:: * ;
11
7
12
- pub trait OperationNorm {
13
- type Output ;
14
- fn opnorm ( & self , t : NormType ) -> Self :: Output ;
15
- fn opnorm_one ( & self ) -> Self :: Output {
16
- self . opnorm ( NormType :: One )
17
- }
18
- fn opnorm_inf ( & self ) -> Self :: Output {
19
- self . opnorm ( NormType :: Infinity )
20
- }
21
- fn opnorm_fro ( & self ) -> Self :: Output {
22
- self . opnorm ( NormType :: Frobenius )
23
- }
24
- }
25
-
26
- impl < A , S > OperationNorm for ArrayBase < S , Ix2 >
27
- where A : LapackScalar + AssociatedReal ,
28
- S : Data < Elem = A >
29
- {
30
- type Output = Result < A :: Real > ;
31
-
32
- fn opnorm ( & self , t : NormType ) -> Self :: Output {
33
- let l = self . layout ( ) ?;
34
- let a = self . as_allocated ( ) ?;
35
- Ok ( A :: opnorm ( t, l, a) )
36
- }
37
- }
8
+ use impl2:: LapackScalar ;
38
9
39
10
pub trait QR < Q , R > {
40
11
fn qr ( self ) -> Result < ( Q , R ) > ;
You can’t perform that action at this time.
0 commit comments