Return matrix product of complex n x n matrices a and b:
C = Op(A) Op(B)
transa = 'N' ==> Op(A) = A transa = 'T' ==> Op(A) = transpose(A) transa = 'C' ==> Op(A) = congj(transpose(A))
similarly for B
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(out) | :: | c(n,n) | |||
complex(kind=dp), | intent(in) | :: | a(n,n) | |||
character(len=1), | intent(in) | :: | transa | |||
complex(kind=dp), | intent(in) | :: | b(n,n) | |||
character(len=1), | intent(in) | :: | transb | |||
integer, | intent(in) | :: | n |
subroutine utility_zgemm(c, a, transa, b, transb, n)
!=============================================================!
! !
!! Return matrix product of complex n x n matrices a and b:
!!
!! C = Op(A) Op(B)
!!
!! transa = 'N' ==> Op(A) = A
!! transa = 'T' ==> Op(A) = transpose(A)
!! transa = 'C' ==> Op(A) = congj(transpose(A))
!!
!! similarly for B
! !
!=============================================================!
use w90_constants, only: cmplx_0, cmplx_1
implicit none
integer, intent(in) :: n
character(len=1), intent(in) :: transa
character(len=1), intent(in) :: transb
complex(kind=dp), intent(in) :: a(n, n)
complex(kind=dp), intent(in) :: b(n, n)
complex(kind=dp), intent(out) :: c(n, n)
call zgemm(transa, transb, n, n, n, cmplx_1, a, n, b, n, cmplx_0, c, n)
return
end subroutine utility_zgemm