Skip to content

Commit 7dd8e25

Browse files
committed
Use lapack_sys in OperatorNorm_ trait impl
1 parent 6d3924b commit 7dd8e25

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

lax/src/opnorm.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Operator norms of matrices
22
3-
use super::NormType;
3+
use super::{AsPtr, NormType};
44
use crate::{layout::MatrixLayout, *};
55
use cauchy::*;
66

@@ -18,18 +18,27 @@ macro_rules! impl_opnorm {
1818
MatrixLayout::F { .. } => t,
1919
MatrixLayout::C { .. } => t.transpose(),
2020
};
21-
let mut work = if matches!(t, NormType::Infinity) {
21+
let mut work: Vec<Self::Real> = if matches!(t, NormType::Infinity) {
2222
unsafe { vec_uninit(m as usize) }
2323
} else {
2424
Vec::new()
2525
};
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+
}
2736
}
2837
}
2938
};
3039
} // impl_opnorm!
3140

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

Comments
 (0)