summaryrefslogtreecommitdiff
path: root/matrix-std/src/math.rs
diff options
context:
space:
mode:
Diffstat (limited to 'matrix-std/src/math.rs')
-rw-r--r--matrix-std/src/math.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/matrix-std/src/math.rs b/matrix-std/src/math.rs
index 111544c..503192d 100644
--- a/matrix-std/src/math.rs
+++ b/matrix-std/src/math.rs
@@ -15,7 +15,7 @@ fn trans(_: VmArgs, args: Vec<Value>) -> Result<Value> {
let values = mat
.cols()
.reduce(|mut a, b| {a.extend(b); a})
- .unwrap()
+ .ok_or(exception!(RUNTIME_EXCEPTION, "matrix values smashed"))?
.into_iter()
.map(|e| e.clone())
.collect();
@@ -164,7 +164,7 @@ fn mat_det(mat: Matrix) -> Result<Value> {
.collect::<Vec<Value>>()
)
.reduce(|mut a, b| {a.extend(b); a})
- .unwrap();
+ .ok_or(exception!(RUNTIME_EXCEPTION, "matrix values smashed"))?;
let sub = Matrix::new(mat.domain - 1, mat.domain - 1, sub_values);
let val = mat.get(0, col)?;
let part = (val * mat_det(sub)?)?;