Canonical logic
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix | |||
integer, | intent(inout) | :: | row | |||
integer, | intent(inout) | :: | column | |||
logical, | intent(inout) | :: | transpose | |||
integer, | intent(out), | optional | :: | processor |
PURE SUBROUTINE get_stored_canonical(matrix, row, column, &
!! Canonical logic
transpose, processor)
TYPE(dbcsr_type), INTENT(IN) :: matrix
INTEGER, INTENT(INOUT) :: row, column
LOGICAL, INTENT(INOUT) :: transpose
INTEGER, INTENT(OUT), OPTIONAL :: processor
INTEGER :: tmp
LOGICAL :: straight
! The old way
!straight = matrix%transpose .OR. matrix%symmetry
straight = matrix%symmetry
straight = (.NOT. matrix%symmetry) &
.OR. &
(straight .EQV. .NOT. checker_tr(row, column))
!transpose = .NOT. straight! .NEQV. transpose
transpose = straight .EQV. transpose
IF (.NOT. straight) THEN
tmp = row
row = column
column = tmp
END IF
IF (PRESENT(processor)) THEN
processor = dbcsr_distribution_processor(matrix%dist, row, column)
END IF
END SUBROUTINE get_stored_canonical