From b03471e2b0d604806773b540551cd047979b7b3b Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 14 May 2015 18:23:46 +0800 Subject: add matrix indexing support --- matrix_example.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'matrix_example.lua') 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) -- cgit v1.2.3