aboutsummaryrefslogtreecommitdiff
path: root/matrix/generic/matrix.h
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-15 02:36:55 +0800
committerDeterminant <[email protected]>2015-05-15 02:36:55 +0800
commitefb786d716363dde8f90ef0672f479790befc79c (patch)
tree1d7a6f07db9cae3fd65a437d3ca6ff398a2b684b /matrix/generic/matrix.h
parentb03471e2b0d604806773b540551cd047979b7b3b (diff)
use C macro to implement matrix template
Diffstat (limited to 'matrix/generic/matrix.h')
-rw-r--r--matrix/generic/matrix.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/matrix/generic/matrix.h b/matrix/generic/matrix.h
new file mode 100644
index 0000000..d02b56e
--- /dev/null
+++ b/matrix/generic/matrix.h
@@ -0,0 +1,9 @@
+typedef struct Matrix {
+ long stride; /* size of a row */
+ long ncol, nrow, nmax; /* dimension of the matrix */
+ union {
+ float *f;
+ double *d;
+ } data; /* pointer to actual storage */
+ long *data_ref;
+} Matrix;