nalgebra/nalgebra-lapack/src/lapack_check.rs
2020-11-15 16:57:49 +01:00

28 lines
587 B
Rust

#![macro_use]
macro_rules! lapack_check(
($info: expr) => (
// TODO: return a richer error.
if $info != 0 {
return None;
}
// if $info < 0 {
// return Err(Error::from(ErrorKind::LapackIllegalArgument(-$info)));
// } else if $info > 0 {
// return Err(Error::from(ErrorKind::LapackFailure($info)));
// }
);
);
macro_rules! lapack_panic(
($info: expr) => (
assert!($info == 0, "Lapack error.");
);
);
macro_rules! lapack_test(
($info: expr) => (
$info == 0
);
);