Builds row index array from a columns-per-row count, in-place.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout), | 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 |
PURE SUBROUTINE dbcsr_build_row_index_inplace(rows, nrows) !! Builds row index array from a columns-per-row count, in-place. INTEGER, INTENT(IN) :: nrows !! number of rows INTEGER, DIMENSION(1:nrows + 1), INTENT(INOUT) :: rows !! count of the number of columns per row (input); the row_p index (output) INTEGER :: o, old_count, row old_count = rows(1) rows(1) = 0 IF (nrows .GE. 1) THEN DO row = 2, nrows + 1 o = rows(row) rows(row) = rows(row - 1) + old_count old_count = o END DO END IF END SUBROUTINE dbcsr_build_row_index_inplace