summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--matrix/matrix.lua2
-rwxr-xr-xnerv2
3 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 75e1317..0ebb91a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.PHONY: all clean luajit
OBJS := oop_example.o nerv.o luaT.o common.o matrix/matrix.o matrix/init.o
LIBS := libnerv.so
-LUA_LIBS := matrix/matrix.lua
+LUA_LIBS := matrix/matrix.lua nerv.lua
INCLUDE := -I build/luajit-2.0/include/luajit-2.0/ -DLUA_USE_APICHECK
LDFLAGS := -L luajit-2.0/build/lib/ -llua -lm
CFLAGS :=
diff --git a/matrix/matrix.lua b/matrix/matrix.lua
index 7aa1f12..b9e4876 100644
--- a/matrix/matrix.lua
+++ b/matrix/matrix.lua
@@ -4,7 +4,9 @@ function nerv.FloatMatrix:__tostring__()
local i = 0
local strt = {}
for row = 0, nrow - 1 do
+-- local rp = self[row]
for col = 0, ncol - 1 do
+-- table.insert(strt, string.format("%f ", rp[col]))
table.insert(strt, string.format("%f ", self:get_elem(i)))
i = i + 1
end
diff --git a/nerv b/nerv
index 2eeab76..1072710 100755
--- a/nerv
+++ b/nerv
@@ -1,2 +1,2 @@
#!/bin/bash
-exec 'build/luajit-2.0/bin/luajit' -e "package.cpath=\"${PWD}/build/objs/?.so\"" -e "require 'libnerv'" -e "package.path=\"${PWD}/build/lua/?.lua\"" -e "require 'matrix'" "$@"
+exec 'build/luajit-2.0/bin/luajit' -e "package.cpath=\"${PWD}/build/objs/?.so\"" -e "package.path=\"${PWD}/build/lua/?.lua\"" -e "require 'nerv'" "$@"