summaryrefslogtreecommitdiff
path: root/matrix/mmatrix.c
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-06-07 21:59:10 +0800
committerDeterminant <[email protected]>2015-06-07 21:59:10 +0800
commit0f30b1a4b5e583cb1df7dbb349c1af4378e41369 (patch)
tree967c6326b83cda2b92eee5f597dde0e74b071dbb /matrix/mmatrix.c
parent6e720b961f7edac9c3a41affe0ca40dd0ec9fc85 (diff)
fix minor bugs in cumatrix; clean up part of code
Diffstat (limited to 'matrix/mmatrix.c')
-rw-r--r--matrix/mmatrix.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/matrix/mmatrix.c b/matrix/mmatrix.c
index 81f8dfc..ffc058d 100644
--- a/matrix/mmatrix.c
+++ b/matrix/mmatrix.c
@@ -1,4 +1,15 @@
#define NERV_GENERIC_MMATRIX
+#include "../common.h"
+void nerv_matrix_host_float_init(lua_State *L);
+void nerv_matrix_host_double_init(lua_State *L);
+void nerv_matrix_host_int_init(lua_State *L);
+
+void nerv_mmatrix_init(lua_State *L) {
+ nerv_matrix_host_float_init(L);
+ nerv_matrix_host_double_init(L);
+ nerv_matrix_host_int_init(L);
+}
+
#define MATRIX_USE_FLOAT
#define host_matrix_(NAME) host_matrix_float_##NAME
#define nerv_matrix_(NAME) nerv_matrix_host_float_##NAME
@@ -10,6 +21,7 @@ const char *nerv_matrix_(tname) = "nerv.MMatrixFloat";
#undef MATRIX_ELEM
#undef MATRIX_ELEM_PTR
#undef MATRIX_ELEM_FMT
+#undef MATRIX_ELEM_WRITE_FMT
#define NERV_GENERIC_MMATRIX
#define MATRIX_USE_DOUBLE
@@ -23,6 +35,7 @@ const char *nerv_matrix_(tname) = "nerv.MMatrixDouble";
#undef MATRIX_ELEM
#undef MATRIX_ELEM_PTR
#undef MATRIX_ELEM_FMT
+#undef MATRIX_ELEM_WRITE_FMT
#define NERV_GENERIC_MMATRIX
#define MATRIX_USE_INT