from decimal import *
from matrix import Matrix
import copy

matrnr = 12345678
x7 = Decimal(int((matrnr / 1) % 10))
x6 = Decimal(int((matrnr / 10) % 10))
x5 = Decimal(int((matrnr / 100) % 10))
x4 = Decimal(int((matrnr / 1000) % 10))
x3 = Decimal(int((matrnr / 10000) % 10))
x2 = Decimal(int((matrnr / 100000) % 10))
x1 = Decimal(int((matrnr / 1000000) % 10))

t = Matrix(14,14)
t[0]  = 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x7
t[1]  = 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x6, 0
t[2]  = 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, x5, 0, 0
t[3]  = 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, x4, 0, 0, 0
t[4]  = 0, 0, 0, 0, 10, 0, 0, 0, 0, x3, 0, 0, 0, 0
t[5]  = 0, 0, 0, 0, 0, 10, 0, 0, x2, 0, 0, 0, 0, 0
t[6]  = 0, 0, 0, 0, 0, 0, 10, x1, 0, 0, 0, 0, 0, 0
t[7]  = 0, 0, 0, 0, 0, 0, x7, 10, 0, 0, 0, 0, 0, 0
t[8]  = 0, 0, 0, 0, 0, x6, 0, 0, 10, 0, 0, 0, 0, 0
t[9]  = 0, 0, 0, 0, x5, 0, 0, 0, 0, 10, 0, 0, 0, 0
t[10] = 0, 0, 0, x4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0
t[11] = 0, 0, x3, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0
t[12] = 0, x2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0
t[13] = x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10
(c, l,r) = t.getLR()
print(c)
print(l)
print(r)
#print(l*r)

from decimal import *
from matrix import Matrix
import copy

sg = Matrix(6,5)
sg[0] = 1, 1, 0, 0, 0
sg[1] = 0, 1, 1, 0, 0
sg[2] = 0, 0, 1, 0, 0
sg[3] = 1, 0, 0, 1, 1
sg[4] = 0, 0, 0, 1, 0
sg[5] = 0, 0, 0, 0, 1
a = Matrix(5,5)
for i in range(5):
    a[i] = sg[i]
b = Matrix(5,5)
b[0] =  1, -1,  1,  0,  0
b[1] =  0,  1, -1,  0,  0
b[2] =  0,  0,  1,  0,  0
b[3] =  0,  0,  0,  0,  1
b[4] = -1,  1, -1,  1, -1

x1 = b.columnAt(0)
x2 = b.columnAt(1)
x3 = b.columnAt(2)
x4 = b.columnAt(3)
x5 = b.columnAt(4)

print("x1: " + str(sg*x1))
print("x2: " + str(sg*x2))
print("x3: " + str(sg*x3))
print("x4: " + str(sg*x4))
print("x5: " + str(sg*x5))

Implement homework 7.3