def test_swapcols(): M1 = mMat([1, 2], [3, 4]) M1.iswap_cols(0, 1) M2 = Mat([2, 1], [4, 3]) assert M1 == M2
def test_rowadd(): M1 = mMat([1, 2, 3], [4, 5, 6]) M1.isum_row(1, (1, 1, 1)) M2 = mMat([1, 2, 3], [5, 6, 7]) assert M1 == M2
def test_swaprows(): M1 = mMat([1, 2], [3, 4]) M1.iswap_rows(0, 1) M2 = Mat([3, 4], [1, 2]) assert M1 == M2
def test_coladd(): M1 = mMat([1, 2], [3, 4]) M1.isum_col(1, (1, 1)) M2 = Mat([1, 3], [3, 5]) assert M1 == M2
def test_rowadd_sqr(): M1 = mMat([1, 2], [3, 4]) M1.isum_row(1, (1, 1)) M2 = Mat([1, 2], [4, 5]) assert M1 == M2
def test_colmul(): M1 = mMat([1, 2], [3, 4]) M1.imul_col(1, 2) M2 = Mat([1, 4], [3, 8]) assert M1 == M2
def test_rowmul(): M1 = mMat([1, 2], [3, 4]) M1.imul_row(1, 2) M2 = Mat([1, 2], [6, 8]) assert M1 == M2
def test_setvalue(): M1 = mMat([1, 2], [3, 4]) M1[0] = [1, 1] M1[1] = [2, 2] assert list(M1.flat) == [1, 1, 2, 2]