Created
October 24, 2012 14:46
-
-
Save mrocklin/3946486 to your computer and use it in GitHub Desktop.
Demonstrates the difference between TR and SY prefixed BLAS calls.
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
! Answers discussion in the following SO question | |
! http://stackoverflow.com/questions/4637888/where-can-i-find-blas-example-code-in-fortran/ | |
! Author: Matthew Rocklin | |
! Disclaimer: This is my first Fortran program. Please do not judge. | |
implicit none | |
integer, parameter :: N=2 | |
real*8 :: A(N,N), x(N), y(N) | |
real*8 :: alpha, beta | |
integer :: i, j | |
A(1,1) = 1 | |
A(1,2) = 1 | |
A(2,2) = 1 | |
x(1) = 1 | |
x(2) = 1 | |
y(1) = 0 | |
y(2) = 0 | |
alpha = 1.d0 | |
beta = 0.d0 | |
call dsymv('U', N, alpha, A, N, x, 1, beta, y, 1) | |
call dtrmv('U','N', 'N', N, A, N, x, 1) | |
print*, x | |
print*, y | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output