1
1
//! Operator norms of matrices
2
2
3
- use super :: NormType ;
3
+ use super :: { AsPtr , NormType } ;
4
4
use crate :: { layout:: MatrixLayout , * } ;
5
5
use cauchy:: * ;
6
6
@@ -18,18 +18,27 @@ macro_rules! impl_opnorm {
18
18
MatrixLayout :: F { .. } => t,
19
19
MatrixLayout :: C { .. } => t. transpose( ) ,
20
20
} ;
21
- let mut work = if matches!( t, NormType :: Infinity ) {
21
+ let mut work: Vec < Self :: Real > = if matches!( t, NormType :: Infinity ) {
22
22
unsafe { vec_uninit( m as usize ) }
23
23
} else {
24
24
Vec :: new( )
25
25
} ;
26
- unsafe { $lange( t as u8 , m, n, a, m, & mut work) }
26
+ unsafe {
27
+ $lange(
28
+ t. as_ptr( ) ,
29
+ & m,
30
+ & n,
31
+ AsPtr :: as_ptr( a) ,
32
+ & m,
33
+ AsPtr :: as_mut_ptr( & mut work) ,
34
+ )
35
+ }
27
36
}
28
37
}
29
38
} ;
30
39
} // impl_opnorm!
31
40
32
- impl_opnorm ! ( f64 , lapack :: dlange ) ;
33
- impl_opnorm ! ( f32 , lapack :: slange ) ;
34
- impl_opnorm ! ( c64, lapack :: zlange ) ;
35
- impl_opnorm ! ( c32, lapack :: clange ) ;
41
+ impl_opnorm ! ( f64 , lapack_sys :: dlange_ ) ;
42
+ impl_opnorm ! ( f32 , lapack_sys :: slange_ ) ;
43
+ impl_opnorm ! ( c64, lapack_sys :: zlange_ ) ;
44
+ impl_opnorm ! ( c32, lapack_sys :: clange_ ) ;
0 commit comments