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 --- include/common/matrix.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/common') diff --git a/include/common/matrix.h b/include/common/matrix.h index 6c35cc0..726a8ab 100644 --- a/include/common/matrix.h +++ b/include/common/matrix.h @@ -3,6 +3,7 @@ /** * File: matrix.h + * Matrices representation and useful operations. * * See also: * The film @@ -15,7 +16,7 @@ * Represents a square integer matrix. */ typedef struct { - IntVector *elements; + IntVector **elements; IntVector dim; } IntSquareMatrix; @@ -31,4 +32,16 @@ typedef struct { */ IntVector matrix_int_det(IntSquareMatrix *matrix); +/** + * Function: matrix_reshape + * Reshapes a flat vector into a bi-dimensional row pointer array. + * + * Parameters: + * **bi_dim - pointer to the result row array + * *flat - flat vector + * width - number of elements per row + * height - number of rows + */ +void matrix_reshape(IntVector **bi_dim, IntVector *flat, int width, int height); + #endif -- cgit v1.2.3