From e4dedc2992149d245ea65132131253072d3276b8 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 28 May 2015 16:14:21 +0800 Subject: add mul_elem and log_elem; add dimension checking in cumatrix methods --- examples/cumatrix_example.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'examples/cumatrix_example.lua') diff --git a/examples/cumatrix_example.lua b/examples/cumatrix_example.lua index 084dcca..544fc7f 100644 --- a/examples/cumatrix_example.lua +++ b/examples/cumatrix_example.lua @@ -1,5 +1,5 @@ -m = 10 -n = 10 +m = 4 +n = 4 fm = nerv.CuMatrixFloat(m, n) dm = nerv.CuMatrixDouble(m, n) for i = 0, m - 1 do @@ -23,3 +23,9 @@ print(fs + fs) print(ds + ds) print(fs - fs) print(ds - ds) + +a = fs:create() +a:mul_elem(fs, fs) +print(a) +a:log_elem(fs) +print(a) -- cgit v1.2.3