示例#1
0
def test_modulus(test_Matrixinit):
    dummy=Matrix(nrow=1,ncol=1,data=[[1]])
    try:
        for i in range(len(test_Matrixinit)):
            test_Matrixinit[i]%dummy
    except divisionErrorException :
        pass
示例#2
0
文件: test_U5.py 项目: Abhi-1U/pyrix
def test_Matrixinit5():
    (rows, cols) = [2, 3, 4, 5], [2, 3, 4, 5]
    objects = []
    traversal = 0
    try:
        for (r, c, d) in zip(rows, cols, data):
            objects.append(Matrix(nrow=r, ncol=c, data=d))
            traversal += 1
    except incompaitableTypeException:
        print("Incompaitable Sizes")
    return objects
示例#3
0
def test_XMatrixinit():
    (rows, cols) = [2, 3, 4, 5], [2, 3, 4, 5]
    objects = []
    traversal = 0
    for (r, c, d) in zip(rows, cols, data):
        if r == 2:
            try:
                objects.append(BinaryMatrix(nrow=r, ncol=c, data=d,
                                            mode="EBM"))
            except binaryMatrixException as e:
                print(e, "\n", "Test passed succesfully")
                objects.append(Matrix(nrow=r, ncol=c, data=d))
        if r == 4 and c == 4:
            try:
                objects.append(Matrix(nrow=r, ncol=c, data=d))
            except incompaitableTypeException:
                print("Incompaitable Sizes")
                objects.append(Matrix(nrow=2, ncol=c, data=d))
        else:
            objects.append(Matrix(nrow=r, ncol=c, data=d))
        traversal += 1
    return objects