summaryrefslogtreecommitdiff
path: root/test/common/matrix.c
blob: 6d85304cc6fe165844452a251653805b26c51c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "common/matrix.h"
#include <assert.h>

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;
}