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
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
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