"""
>>> from mat import Mat
>>> from vec import Vec
>>> from GF2 import one
>>> from ecc_lab import *

Task 4

>>> find_error(Vec({0,1,2}, {0:one}))
Vec({0, 1, 2, 3, 4, 5, 6},{3: one})
>>> find_error(Vec({0,1,2}, {2:one}))
Vec({0, 1, 2, 3, 4, 5, 6},{0: one})
>>> find_error(Vec({0,1,2}, {1:one, 2:one}))
Vec({0, 1, 2, 3, 4, 5, 6},{2: one})


Task 5

>>> S = listlist2mat([[0,one,one,one],[0,one,0,0],[0,0,0,one]])
>>> find_error_matrix(S)
Mat(({0, 1, 2, 3, 4, 5, 6}, {0, 1, 2, 3}), {(1, 2): 0, (3, 2): one, (0, 0): 0, (4, 3): one, (3, 0): 0, (6, 0): 0, (2, 1): 0, (6, 2): 0, (2, 3): 0, (5, 1): one, (4, 2): 0, (1, 0): 0, (0, 3): 0, (4, 0): 0, (0, 1): 0, (3, 3): 0, (4, 1): 0, (6, 1): 0, (3, 1): 0, (1, 1): 0, (6, 3): 0, (2, 0): 0, (5, 0): 0, (2, 2): 0, (1, 3): 0, (5, 3): 0, (5, 2): 0, (0, 2): 0})


Task 8

>>> A = Mat(({0,1,2,3,4,5,6}, {1,2,3}), {(0,3):one, (2, 1): one, (5, 2):one, (5,3):one, (0,2): one})
>>> correct(A)
Mat(({0, 1, 2, 3, 4, 5, 6}, {1, 2, 3}), {(0, 1): 0, (1, 2): 0, (3, 2): 0, (1, 3): 0, (3, 3): 0, (5, 2): one, (6, 1): 0, (3, 1): 0, (2, 1): 0, (0, 2): one, (6, 3): one, (4, 2): 0, (6, 2): one, (2, 3): 0, (4, 3): 0, (2, 2): 0, (5, 1): 0, (0, 3): one, (4, 1): 0, (1, 1): 0, (5, 3): one})


"""

if __name__ == "__main__":
    import doctest
    doctest.testmod()

3401b6d795311049c8ff6e20e14018727faa2b5f
<mask token>

<mask token>
if __name__ == '__main__':
    import doctest
    doctest.testmod()

"""
>>> from mat import Mat
>>> from vec import Vec
>>> from GF2 import one
>>> from ecc_lab import *

Task 4

>>> find_error(Vec({0,1,2}, {0:one}))
Vec({0, 1, 2, 3, 4, 5, 6},{3: one})
>>> find_error(Vec({0,1,2}, {2:one}))
Vec({0, 1, 2, 3, 4, 5, 6},{0: one})
>>> find_error(Vec({0,1,2}, {1:one, 2:one}))
Vec({0, 1, 2, 3, 4, 5, 6},{2: one})


Task 5

>>> S = listlist2mat([[0,one,one,one],[0,one,0,0],[0,0,0,one]])
>>> find_error_matrix(S)
Mat(({0, 1, 2, 3, 4, 5, 6}, {0, 1, 2, 3}), {(1, 2): 0, (3, 2): one, (0, 0): 0, (4, 3): one, (3, 0): 0, (6, 0): 0, (2, 1): 0, (6, 2): 0, (2, 3): 0, (5, 1): one, (4, 2): 0, (1, 0): 0, (0, 3): 0, (4, 0): 0, (0, 1): 0, (3, 3): 0, (4, 1): 0, (6, 1): 0, (3, 1): 0, (1, 1): 0, (6, 3): 0, (2, 0): 0, (5, 0): 0, (2, 2): 0, (1, 3): 0, (5, 3): 0, (5, 2): 0, (0, 2): 0})


Task 8

>>> A = Mat(({0,1,2,3,4,5,6}, {1,2,3}), {(0,3):one, (2, 1): one, (5, 2):one, (5,3):one, (0,2): one})
>>> correct(A)
Mat(({0, 1, 2, 3, 4, 5, 6}, {1, 2, 3}), {(0, 1): 0, (1, 2): 0, (3, 2): 0, (1, 3): 0, (3, 3): 0, (5, 2): one, (6, 1): 0, (3, 1): 0, (2, 1): 0, (0, 2): one, (6, 3): one, (4, 2): 0, (6, 2): one, (2, 3): 0, (4, 3): 0, (2, 2): 0, (5, 1): 0, (0, 3): one, (4, 1): 0, (1, 1): 0, (5, 3): one})


"""

if __name__ == "__main__":
    import doctest
    doctest.testmod()
