Skip to content

Commit 0e2d9a2

Browse files
committed
Add into_result
1 parent 7e51ce6 commit 0e2d9a2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/impl2/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,15 @@ pub use self::opnorm::*;
77
pub use self::qr::*;
88
pub use self::svd::*;
99

10+
use super::error::*;
11+
1012
pub trait LapackScalar: OperatorNorm_ + QR_ + SVD_ {}
1113
impl<A> LapackScalar for A where A: OperatorNorm_ + QR_ + SVD_ {}
14+
15+
pub fn into_result<T>(info: i32, val: T) -> Result<T> {
16+
if info == 0 {
17+
Ok(val)
18+
} else {
19+
Err(LapackError::new(info).into())
20+
}
21+
}

0 commit comments

Comments
 (0)