diff options
Diffstat (limited to 'tests.c')
-rw-r--r-- | tests.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -4,6 +4,7 @@ #include "vector.h" #include <assert.h> +#include <stdlib.h> void test_LR() { @@ -11,15 +12,17 @@ void test_LR() Vector *b = vector_from_str("[-1;2;3]"); Matrix **LR = matrix_LR(A, b); - Matrix *L = LR[0]; - Matrix *R = LR[1]; - Vector *y = matrix_forwardel(L, b); - Vector *x = matrix_backsubst(R, y); + Vector *y = matrix_forwardel(LR[0], b); + Vector *x = matrix_backsubst(LR[1], y); vector_print(x); /* TODO: Implement matrix vector multiplication */ /* assert(matrix_eq(matrix_mult(A, x), b, 0.01)); */ + + matrix_free(A); + matrix_free_many1(LR); + vector_free_many(3, x, y, b); } void run_tests() |