@@ -93,6 +93,7 @@ pub mod eig;
93
93
pub mod eigh;
94
94
pub mod eigh_generalized;
95
95
pub mod least_squares;
96
+ pub mod opnorm;
96
97
pub mod qr;
97
98
pub mod rcond;
98
99
pub mod solve;
@@ -101,7 +102,6 @@ pub mod svd;
101
102
pub mod svddc;
102
103
103
104
mod alloc;
104
- mod opnorm;
105
105
mod triangular;
106
106
mod tridiagonal;
107
107
@@ -121,7 +121,7 @@ pub type Pivot = Vec<i32>;
121
121
122
122
#[ cfg_attr( doc, katexit:: katexit) ]
123
123
/// Trait for primitive types which implements LAPACK subroutines
124
- pub trait Lapack : OperatorNorm_ + Triangular_ + Tridiagonal_ {
124
+ pub trait Lapack : Triangular_ + Tridiagonal_ {
125
125
/// Compute right eigenvalue and eigenvectors for a general matrix
126
126
fn eig (
127
127
calc_v : bool ,
@@ -261,6 +261,9 @@ pub trait Lapack: OperatorNorm_ + Triangular_ + Tridiagonal_ {
261
261
///
262
262
/// `anorm` should be the 1-norm of the matrix `a`.
263
263
fn rcond ( l : MatrixLayout , a : & [ Self ] , anorm : Self :: Real ) -> Result < Self :: Real > ;
264
+
265
+ /// Compute operator norm of a matrix
266
+ fn opnorm ( t : NormType , l : MatrixLayout , a : & [ Self ] ) -> Self :: Real ;
264
267
}
265
268
266
269
macro_rules! impl_lapack {
@@ -428,6 +431,12 @@ macro_rules! impl_lapack {
428
431
let mut work = RcondWork :: <$s>:: new( l) ;
429
432
work. calc( a, anorm)
430
433
}
434
+
435
+ fn opnorm( t: NormType , l: MatrixLayout , a: & [ Self ] ) -> Self :: Real {
436
+ use opnorm:: * ;
437
+ let mut work = OperatorNormWork :: <$s>:: new( t, l) ;
438
+ work. calc( a)
439
+ }
431
440
}
432
441
} ;
433
442
}
0 commit comments