from cryptofield.fieldmatrix import *

F = FField(2)
m = FMatrix(F, 4, 4)
m.setRow(0, [FElement(F, 0), FElement(F, 0), FElement(F, 0), FElement(F, 1)])
m.setRow(1, [FElement(F, 0), FElement(F, 0), FElement(F, 1), FElement(F, 0)])
m.setRow(2, [FElement(F, 1), FElement(F, 1), FElement(F, 0), FElement(F, 0)])
m.setRow(3, [FElement(F, 1), FElement(F, 0), FElement(F, 1), FElement(F, 1)])

print ('matrix:')
print (m)
print ('size:')
print (m.size())
print ('row index 0:')
print (m.getRow(0))
print ('column index 0:')
print (m.getColumn(0))
print ('transpose matrix:')
print(m.transpose())
print ('inverse matrix:')
print (m.inverse())
print ('solve equation:')
print (m.solve([FElement(F, 1), FElement(F, 0), FElement(F, 1), FElement(F, 1)]))
print ('kenel basis:')
print (m.kerBasis())
