-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestRowEchelonForm.py
More file actions
47 lines (47 loc) · 1004 Bytes
/
testRowEchelonForm.py
File metadata and controls
47 lines (47 loc) · 1004 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from FpClass import *
from Matrices import *
Fp = PrimeFiniteField(5)
A = Matrix(Fp, 3, 3)
A[0] = [Fp(0), Fp(1), Fp(2)]
A[1] = [Fp(3), Fp(4), Fp(5)]
A[2] = [Fp(6), Fp(7), Fp(8)]
print("A is ")
print(A)
print("the reduced row echelon form of A is")
"""should be (calculated in sage)
[1 0 4]
[0 1 2]
[0 0 0]
"""
Arref = A.reduced_row_echelon_form()
print(Arref)
A = Matrix(Fp, 3, 4)
A[0] = [Fp(0), Fp(1), Fp(2), Fp(1)]
A[1] = [Fp(3), Fp(4), Fp(5), Fp(2)]
A[2] = [Fp(6), Fp(7), Fp(8), Fp(3)]
print("A is ")
print(A)
print("the reduced row echelon form of A is")
"""should be (calculated in sage)
[1 0 4 1]
[0 1 2 1]
[0 0 0 0]
"""
Arref = A.reduced_row_echelon_form()
print(Arref)
A = Matrix(Fp, 4, 3)
A[0] = [Fp(1), Fp(2), Fp(1)]
A[1] = [Fp(4), Fp(5), Fp(2)]
A[2] = [Fp(7), Fp(8), Fp(3)]
A[3] = [Fp(1), Fp(1), Fp(1)]
print("A is ")
print(A)
print("the reduced row echelon form of A is")
"""should be (calculated in sage)
[1 0 0]
[0 1 0]
[0 0 1]
[0 0 0]
"""
Arref = A.reduced_row_echelon_form()
print(Arref)