summaryrefslogtreecommitdiff
path: root/cumatrix_example.lua
blob: ccd88b822bd8a052c3ed466d059aff0818144ea4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
m = 2
n = 3
t = nerv.FloatCuMatrix(m, n)
t2 = nerv.FloatCuMatrix(m, n)
print(t)
a = t[1]
for i = 0, m - 1 do
    for j = 0, n - 1 do
        t[i][j] = i + j
        t2[i][j] = t[i][j]
    end
end
print(a)
print(t)
print(t2)
print(t + t2)
d = nerv.FloatCuMatrix(3, 3)
for i = 0, 2 do
    for j = 0, 2 do
        d[i][j] = 0
    end
end
d[0][0] = 1
d[1][1] = 2
d[2][2] = 3
print(d)
print(t * d)