openGPMP
Open Source Mathematics Package
test_linalg.py
Go to the documentation of this file.
1 import linalg
2 import numpy as np
3 
4 mtx = linalg.Mtx()
5 
6 print(type(mtx))
7 
8 # Example usage for int matrices
9 A = np.array([1, 2, 3, 4], dtype=np.int32)
10 B = np.array([5, 6, 7, 8], dtype=np.int32)
11 C = np.zeros(4, dtype=np.int32)
12 
13 rows = 2
14 cols = 2
15 
16 mtx.mtx_add(A, B, C, rows, cols)
17 print(C) # Should print [6, 8, 10, 12]
18 
19