covariat arithment operations implemented - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/matrix_decls_source.c
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年10月25日 12:14:22 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年10月25日 12:14:22 +0200
commit16b347628af89740c5cd4f5c6c9fd632fea55360 (patch)
tree99ca6097182a2d52d380367285f3a021fa926b76 /matrix_decls_source.c
parent0f2d2469cbbcf0bd9827d0a391daeb0ae936f1f9 (diff)
downloadgsl-shell-16b347628af89740c5cd4f5c6c9fd632fea55360.tar.gz
covariat arithment operations implemented
Now when we encounter an expression like "a+b" the operands can be matrix of different types and they are promoted as required.
Diffstat (limited to 'matrix_decls_source.c')
-rw-r--r--matrix_decls_source.c 16
1 files changed, 5 insertions, 11 deletions
diff --git a/matrix_decls_source.c b/matrix_decls_source.c
index f23b22e5..a3402bcf 100644
--- a/matrix_decls_source.c
+++ b/matrix_decls_source.c
@@ -28,12 +28,6 @@ static int FUNCTION (matrix, dims) (lua_State *L);
static int FUNCTION (matrix, copy) (lua_State *L);
static int FUNCTION (matrix, slice) (lua_State *L);
-static int FUNCTION (matrix, add) (lua_State *L);
-static int FUNCTION (matrix, sub) (lua_State *L);
-static int FUNCTION (matrix, mul_elements) (lua_State *L);
-static int FUNCTION (matrix, div_elements) (lua_State *L);
-static int FUNCTION (matrix, unm) (lua_State *L);
-
static int FUNCTION (matrix, mul) (lua_State *L);
static int FUNCTION (matrix, inverse) (lua_State *L);
static int FUNCTION (matrix, solve) (lua_State *L);
@@ -41,11 +35,11 @@ static int FUNCTION (matrix, solve) (lua_State *L);
static void FUNCTION (matrix, set_ref) (lua_State *L, int index);
static const struct luaL_Reg FUNCTION (matrix, methods)[] = {
- {"__add", FUNCTION (matrix, add)},
- {"__sub", FUNCTION (matrix, sub)},
- {"__mul", FUNCTION (matrix, mul_elements)},
- {"__div", FUNCTION (matrix, div_elements)},
- {"__unm", FUNCTION (matrix, unm)},
+ {"__add", matrix_add},
+ {"__sub", matrix_sub},
+ {"__mul", matrix_mul_elements},
+ {"__div", matrix_div_elements},
+ {"__unm", matrix_unm},
{"__gc", FUNCTION (matrix, free)},
{"get", FUNCTION (matrix, get)},
{"set", FUNCTION (matrix, set)},
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月23日 21:18:46 +0000

AltStyle によって変換されたページ (->オリジナル) /