Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit f5f23d8

Browse files
committed
test row mat matrix multiplication
1 parent 9d0a06f commit f5f23d8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/bin/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ use std::rc::Rc;
99
fn main() -> Result<(),MechError> {
1010

1111
let input = r#"
12-
x = [1 2; 3 4]
13-
y = x ** x'
14-
#test = stats/sum(table: y)"#;
12+
x = [1 2 3]
13+
y = [4 5; 6 7; 8 9]
14+
z = x ** y
15+
#test = stats/sum(row: z)"#;
1516
let input = String::from(input);
1617

1718
let mut ast = Ast::new();

tests/compiler.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ test_mech!(math_matrix_multiply_mat_mat_2,"
250250
x = [1 2; 3 4] ** [5 6 7; 8 9 10]
251251
#test = stats/sum(table: x)", Value::F32(F32::new(234.0)));
252252

253+
test_mech!(math_matrix_multiply_row_mat,"
254+
x = [1 2 3]
255+
y = [4 5; 6 7; 8 9]
256+
z = x ** y
257+
#test = stats/sum(row: z)", Value::F32(F32::new(86.0)));
258+
253259
test_mech!(math_matrix_transpose_row,"
254260
x = [1 2 3]
255261
#test = x ** x'", Value::F32(F32::new(14.0)));

0 commit comments

Comments
 (0)