示例#1
0
def naive(n):
    a = mo.buildRandMatrix(n)
    b = mo.buildRandMatrix(n)
    
    mo.printMatrix(a, "A")
    mo.printMatrix(b, "B")
    
    c = matrixMult(a,b)
    
    mo.printMatrix(c, "C")
def divideAndConquer(n):
    a = mo.buildRandMatrix(n)
    b = mo.buildRandMatrix(n)
    
    mo.printMatrix(a, "A")
    mo.printMatrix(b, "B")
    
    c = [[0 for x in range(n)] for x in range(n)]
    
    c = dcmm(c,a,b)
    mo.printMatrix(c, "C")
    
    if mo.matricesSameSize(a,c) == False:
        print "Warning: Input and output matrices are different sizes"