コード例 #1
0
        def matrix_mult_sample():

            A = Array.array([[1, 2], [3, 4]])
            B = Array.array([[10, 3], [7, 4]])

            # double transposition
            A = Array.transpose(A)
            B = Array.transpose(B)

            C = dot(A, B)
            return C
コード例 #2
0
        def matrix_mult_sample():

            A = Array.array([[1, 2], [3, 4]])
            B = Array.array([[10, 3], [7, 4]])

            M = Array.transpose(A)
            N = Array.transpose(B)

            M = Array.array([[1, 1], [3, 0]])

            C = dot(M, N)
            return C
コード例 #3
0
        def matrix_mult_sample():

            A = Array.array([[1, 2], [3, 4]])
            B = Array.array([[10, 3], [7, 4]])

            A = Array.transpose(A)
            B = Array.transpose(B)

            C = dot(A, B)

            # the double transpose in place after the dot call
            A = Array.transpose(A)
            B = Array.transpose(B)

            return C
コード例 #4
0
        def matrix_mult_sample():

            A = Array.array([[1, 2], [3, 4]])
            B = Array.array([[10, 3], [7, 4]])

            M = Array.transpose(A)
            N = Array.transpose(B)

            C = dot(M, N)

            # the double assignment after the dot call
            M = Array.array([[1, 1], [3, 0]])
            N = Array.array([[1, 0], [7, 0]])

            return C
コード例 #5
0
        def matrix_mult_sample():

            B = Array.array([[10, 3], [7, 4]])

            # transposition
            A = Array.array([[1, 2], [3, 4]])
            A = Array.transpose(A)
            C = dot(B, A)
            return C