1
1
//! Implement Norms for matrices
2
2
3
- use lapack:: fortran:: * ;
4
- use num_traits:: Zero ;
3
+ use lapack:: c:: * ;
5
4
6
5
pub trait ImplNorm : Sized {
7
6
fn norm_1 ( m : usize , n : usize , mut a : Vec < Self > ) -> Self ;
@@ -13,16 +12,13 @@ macro_rules! impl_norm {
13
12
( $scalar: ty, $lange: path) => {
14
13
impl ImplNorm for $scalar {
15
14
fn norm_1( m: usize , n: usize , mut a: Vec <Self >) -> Self {
16
- let mut work = Vec :: <Self >:: new( ) ;
17
- $lange( b'o' , m as i32 , n as i32 , & mut a, m as i32 , & mut work)
15
+ $lange( Layout :: ColumnMajor , b'o' , m as i32 , n as i32 , & mut a, m as i32 )
18
16
}
19
17
fn norm_i( m: usize , n: usize , mut a: Vec <Self >) -> Self {
20
- let mut work = vec![ Self :: zero( ) ; m] ;
21
- $lange( b'i' , m as i32 , n as i32 , & mut a, m as i32 , & mut work)
18
+ $lange( Layout :: ColumnMajor , b'i' , m as i32 , n as i32 , & mut a, m as i32 )
22
19
}
23
20
fn norm_f( m: usize , n: usize , mut a: Vec <Self >) -> Self {
24
- let mut work = Vec :: <Self >:: new( ) ;
25
- $lange( b'f' , m as i32 , n as i32 , & mut a, m as i32 , & mut work)
21
+ $lange( Layout :: ColumnMajor , b'f' , m as i32 , n as i32 , & mut a, m as i32 )
26
22
}
27
23
}
28
24
} } // end macro_rules
0 commit comments