I have the following double loop;
Here, S is a 100x100 symmetric REAL array, ALPHA, b1, and b2 are REAL constants.
I am hoping to incorporate LAPACK dgemm or some other library function to increase the efficiency of this calculation. However, dgemm( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA,B, LDB, BETA, C, LDC ) needs A and B arrays as input. I could define A as the first exponential using a DO loop and B as the second exponential using another DO loop but this approach may be less efficient.
What would be the most efficient way to calculate the above double loop in fortran?
Thanks,
Vahid
Code:
DO i=1,100
DO j=1,100
S(i,j)= S(i,j)+ALPHA*exp[(real(i)/b1)**2]*exp[(real(j)/b2)**2]
ENDDO
ENDDO
Here, S is a 100x100 symmetric REAL array, ALPHA, b1, and b2 are REAL constants.
I am hoping to incorporate LAPACK dgemm or some other library function to increase the efficiency of this calculation. However, dgemm( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA,B, LDB, BETA, C, LDC ) needs A and B arrays as input. I could define A as the first exponential using a DO loop and B as the second exponential using another DO loop but this approach may be less efficient.
What would be the most efficient way to calculate the above double loop in fortran?
Thanks,
Vahid