From 650c4400c63d8ec8473321862046240cb873ec8d Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 2 Dec 2017 01:10:02 +0100 Subject: Add matrix op impl. and test, minor spec change Signed-off-by: pacien --- test/common/matrix.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/common/matrix.c (limited to 'test') 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 @@ +#include "common/matrix.h" +#include + +static void test_matrix_int_det() { + IntSquareMatrix matrix; + IntVector *elements[3]; + + matrix_reshape(elements, (IntVector[]) {-2, +2, -3, + -1, +1, +3, + +2, +0, -1}, 3, 3); + + matrix.dim = 3; + matrix.elements = elements; + + assert(matrix_int_det(&matrix) == 18); +} + +int main(int argc, char **argv) { + test_matrix_int_det(); + return 0; +} -- cgit v1.2.3