Skip to content

Commit d5fa0bf

Browse files
committed
Use ColumnMajor (fixed) in norm_*
1 parent 3f0b262 commit d5fa0bf

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/norm.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Implement Norms for matrices
22
3-
use lapack::fortran::*;
4-
use num_traits::Zero;
3+
use lapack::c::*;
54

65
pub trait ImplNorm: Sized {
76
fn norm_1(m: usize, n: usize, mut a: Vec<Self>) -> Self;
@@ -13,16 +12,13 @@ macro_rules! impl_norm {
1312
($scalar:ty, $lange:path) => {
1413
impl ImplNorm for $scalar {
1514
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)
1816
}
1917
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)
2219
}
2320
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)
2622
}
2723
}
2824
}} // end macro_rules

0 commit comments

Comments
 (0)