blob: 3bfddb0377e40f154885e68d38c777f1bb0d77c6 [file] [log] [blame]
Wenzel Jakob57082212015-09-04 23:42:12 +02001#!/usr/bin/env python
2from __future__ import print_function
Wenzel Jakob38bd7112015-07-05 20:05:44 +02003import sys
4sys.path.append('.')
5
6from example import Matrix
7import numpy as np
8
9m = Matrix(5, 5)
10
11print(m[2, 3])
12m[2, 3] = 4
13print(m[2, 3])
14
15m2 = np.array(m, copy=False)
16print(m2)
17print(m2[2, 3])
18m2[2, 3] = 5
19print(m[2, 3])
20
21m3 = np.array([[1,2,3],[4,5,6]]).astype(np.float32)
22print(m3)
23m4 = Matrix(m3)
24for i in range(m4.rows()):
25 for j in range(m4.cols()):
26 print(m4[i, j], end = ' ')
27 print()