dbcsr_build_row_index_copy Subroutine

private pure subroutine dbcsr_build_row_index_copy(counts, rows, nrows)

Builds row index array from a columns-per-row count.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(1:nrows) :: counts

count of the number of columns per row

integer, intent(out), DIMENSION(1:nrows + 1) :: rows

count of the number of columns per row (input); the row_p index (output)

integer, intent(in) :: nrows

number of rows


Source Code

   PURE SUBROUTINE dbcsr_build_row_index_copy(counts, rows, nrows)
      !! Builds row index array from a columns-per-row count.

      INTEGER, INTENT(IN)                                :: nrows
         !! number of rows
      INTEGER, DIMENSION(1:nrows + 1), INTENT(OUT)       :: rows
         !! count of the number of columns per row (input); the row_p index (output)
      INTEGER, DIMENSION(1:nrows), INTENT(IN)            :: counts
         !! count of the number of columns per row

!WTF?!rows(1) = 0
!WTF?!IF (nrows .GE. 1) THEN
!WTF?!   DO row = 2, nrows+1
!WTF?!      rows(row) = rows(row-1) + counts(rows-1)
!WTF?!   ENDDO
!WTF?!ENDIF

      rows(1:nrows) = counts(1:nrows)
      CALL dbcsr_build_row_index_inplace(rows, nrows)
   END SUBROUTINE dbcsr_build_row_index_copy