summaryrefslogtreecommitdiff
path: root/matrix_example.lua
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-14 18:23:46 +0800
committerDeterminant <[email protected]>2015-05-14 18:23:46 +0800
commitb03471e2b0d604806773b540551cd047979b7b3b (patch)
tree3bc14575d8fd4534975f09f12ad74dd63de293a7 /matrix_example.lua
parentf48dc493b5b77fd4e4472dd6c78b7542a4884129 (diff)
add matrix indexing support
Diffstat (limited to 'matrix_example.lua')
-rw-r--r--matrix_example.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/matrix_example.lua b/matrix_example.lua
index 1ff129d..361e126 100644
--- a/matrix_example.lua
+++ b/matrix_example.lua
@@ -4,4 +4,13 @@ t:set_elem(1, 3.23432);
print(t:get_elem(1))
print(t)
t = nerv.FloatMatrix(10, 20)
+t:set_elem(1, 3.34);
print(t)
+a = t[1]
+for i = 0, 9 do
+ for j = 0, 19 do
+ t[i][j] = i + j
+ end
+end
+print(t)
+print(a)