C C test.f C C Test program that performs a simple matrix-vector multiplication in C single and double precision complex arithmetic, and compares the results. C C If there is a significant mismatch, it prints a failure message. C C Compile this with C C gfortran -o test test.f -lblas C C and test against Atlas: C C ./test C C or reference blas C C LD_PRELOAD=/usr/lib/libblas.so.3.0 ./test C program test implicit none complex a(2,2), b(2), y(2), alpha, beta complex*16 za(2,2), zb(2), zy(2), zalpha, zbeta integer i, j a(1,1) = (1, 2) a(1,2) = (2, 3) a(2,1) = (3, 4) a(2,2) = (4, 5) b(1) = (2, 1) b(2) = (1, 2) do 20 i=1,2 do 30 j=1,2 za(i,j) = a(i,j) 30 continue zb(i) = b(i) 20 continue alpha = 1.0 beta = 0.0 call cgemv('N', 2, 2, alpha, a, 2, b, 1, beta, y, 1) zalpha = 1.0 zbeta = 0.0 call zgemv('N', 2, 2, zalpha, za, 2, zb, 1, zbeta, zy, 1) if (abs(y(1) - zy(1)) > 1e-3) then write(*,*) 'failure' write(*,*) '- complex*8: ', y(1) write(*,*) '- complex*16: ', zy(1) else write(*,*) 'success' end if end