z_matmul_ Function

function z_matmul_(A, B) result(C)

Arguments

Type IntentOptional Attributes Name
complex(kind=8), intent(in), dimension(:,:) :: A
complex(kind=8), intent(in), dimension(:,:) :: B

Return Value complex(kind=8), dimension(size(A,1),size(B,2))


Calls

proc~~z_matmul_~~CallsGraph proc~z_matmul_ z_matmul_ zgemm zgemm proc~z_matmul_->zgemm

Source Code

function z_matmul_(A,B) result(C)
  complex(8),dimension(:,:),intent(in)      :: A ![N,K]
  complex(8),dimension(:,:),intent(in)      :: B ![K,M]
  complex(8),dimension(size(A,1),size(B,2)) :: C ![N,M]
  integer                                :: N,K,M
  !
  ! C = alfa*A*B + beta*C
  !
  N = size(A,1)
  K = size(A,2) !==size(B,1)
  M = size(B,2)
  if(any(shape(B)/=[K,M]))stop "d_matmul error: B has illegal shape"
  if(any(shape(C)/=[N,M]))stop "d_matmul error: C has illegal shape"
  !
  call ZGEMM('N', 'N', N, M, K, dcmplx(1d0,0d0), A, N, B, K, dcmplx(0d0,0d0), C, N)
  !
  return
end function z_matmul_