summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorpacien2017-12-02 01:10:02 +0100
committerpacien2017-12-02 01:10:02 +0100
commit650c4400c63d8ec8473321862046240cb873ec8d (patch)
tree4d1a0a6de3491046062efe4b06e71be56bbc3d0b /test
parentc65669a785fba9b1f0f7539f47a677035ea06229 (diff)
downloadmorpher-650c4400c63d8ec8473321862046240cb873ec8d.tar.gz
Add matrix op impl. and test, minor spec change
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'test')
-rw-r--r--test/common/matrix.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/common/matrix.c b/test/common/matrix.c
new file mode 100644
index 0000000..6d85304
--- /dev/null
+++ b/test/common/matrix.c
@@ -0,0 +1,21 @@
1#include "common/matrix.h"
2#include <assert.h>
3
4static void test_matrix_int_det() {
5 IntSquareMatrix matrix;
6 IntVector *elements[3];
7
8 matrix_reshape(elements, (IntVector[]) {-2, +2, -3,
9 -1, +1, +3,
10 +2, +0, -1}, 3, 3);
11
12 matrix.dim = 3;
13 matrix.elements = elements;
14
15 assert(matrix_int_det(&matrix) == 18);
16}
17
18int main(int argc, char **argv) {
19 test_matrix_int_det();
20 return 0;
21}