Created
September 18, 2019 14:35
-
-
Save tmmsartor/c4102e20eb10a5475ce082eb17f56db7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.linalg import blas | |
import numpy | |
A = numpy.array([ | |
[1,1], | |
[0,1] | |
]) | |
B = numpy.array([ | |
[1,4], | |
[2,5], | |
[3,6] | |
]) | |
# expected results | |
C1e = numpy.array([ | |
[1.,5.], | |
[2.,7.], | |
[3.,9.] | |
]) | |
C0e = numpy.array([ | |
[5., 7., 9.], | |
[4., 5., 6.] | |
]) | |
C0 = blas.dtrmm(1.0, A, B.T, side=0) | |
C1 = blas.dtrmm(1.0, A, B, side=1) | |
print("A*B:") | |
print(C0) | |
print("Expected:") | |
print(C0e) | |
print("\nB*A:") | |
print(C1) | |
print("Expected:") | |
print(C1e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment