Dot product of DBCSR matrices \result the dot product of the matrices
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix_a |
DBCSR matrices DBCSR matrices |
||
type(dbcsr_type), | intent(in) | :: | matrix_b |
DBCSR matrices DBCSR matrices |
||
real(kind=real_8), | intent(inout) | :: | trace |
SUBROUTINE dbcsr_dot_sd(matrix_a, matrix_b, trace)
!! Dot product of DBCSR matrices
!! \result the dot product of the matrices
TYPE(dbcsr_type), INTENT(IN) :: matrix_a, matrix_b
!! DBCSR matrices
!! DBCSR matrices
REAL(kind=real_8), INTENT(INOUT) :: trace
CHARACTER(len=*), PARAMETER :: routineN = 'dbcsr_dot_sd'
INTEGER :: handle
REAL(kind=real_4) :: trace_4
CALL timeset(routineN, handle)
IF (dbcsr_get_data_type(matrix_a) .EQ. dbcsr_type_real_8 .AND. &
dbcsr_get_data_type(matrix_b) .EQ. dbcsr_type_real_8) THEN
CALL dbcsr_dot_d(matrix_a, matrix_b, trace)
ELSEIF (dbcsr_get_data_type(matrix_a) .EQ. dbcsr_type_real_4 .AND. &
dbcsr_get_data_type(matrix_b) .EQ. dbcsr_type_real_4) THEN
trace_4 = 0.0_real_4
CALL dbcsr_dot_s(matrix_a, matrix_b, trace_4)
trace = REAL(trace_4, real_8)
ELSE
DBCSR_ABORT("Invalid combination of data type, NYI")
END IF
CALL timestop(handle)
END SUBROUTINE dbcsr_dot_sd