summaryrefslogtreecommitdiff
path: root/include/common
diff options
context:
space:
mode:
authorpacien2017-12-02 01:10:02 +0100
committerpacien2017-12-02 01:10:02 +0100
commit650c4400c63d8ec8473321862046240cb873ec8d (patch)
tree4d1a0a6de3491046062efe4b06e71be56bbc3d0b /include/common
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 'include/common')
-rw-r--r--include/common/matrix.h15
1 files changed, 14 insertions, 1 deletions
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 @@
3 3
4/** 4/**
5 * File: matrix.h 5 * File: matrix.h
6 * Matrices representation and useful operations.
6 * 7 *
7 * See also: 8 * See also:
8 * The film 9 * The film
@@ -15,7 +16,7 @@
15 * Represents a square integer matrix. 16 * Represents a square integer matrix.
16 */ 17 */
17typedef struct { 18typedef struct {
18 IntVector *elements; 19 IntVector **elements;
19 IntVector dim; 20 IntVector dim;
20} IntSquareMatrix; 21} IntSquareMatrix;
21 22
@@ -31,4 +32,16 @@ typedef struct {
31 */ 32 */
32IntVector matrix_int_det(IntSquareMatrix *matrix); 33IntVector matrix_int_det(IntSquareMatrix *matrix);
33 34
35/**
36 * Function: matrix_reshape
37 * Reshapes a flat vector into a bi-dimensional row pointer array.
38 *
39 * Parameters:
40 * **bi_dim - pointer to the result row array
41 * *flat - flat vector
42 * width - number of elements per row
43 * height - number of rows
44 */
45void matrix_reshape(IntVector **bi_dim, IntVector *flat, int width, int height);
46
34#endif 47#endif