Utility procedures for working with arrays.
Calculate the memory offset corresponding to a given index in a multi-dimensional array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | index(:) |
The multi-dimensional index for which to calculate the offset. |
||
| integer, | intent(in) | :: | shape(:) |
The shape of the multi-dimensional array. |
The calculated memory offset corresponding to the given index.
Calculate the index corresponding to a given memory offset in a multi-dimensional array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | offset_in |
The memory offset for which to calculate the multi-dimensional index. |
||
| integer, | intent(in) | :: | shape(:) |
The shape of the multi-dimensional array. |
||
| integer, | intent(inout) | :: | index(:) |
The calculated multi-dimensional index corresponding to the given offset. |
Compute start and count for the p'th partition of an array of size n
where p = 0, 1, ... , k - 1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
The total number of elements in the array to be partitioned. |
||
| integer, | intent(in) | :: | k |
The total number of partitions. |
||
| integer, | intent(in) | :: | p |
The index of the partition for which to compute the start and count (0-based). |
||
| integer, | intent(out) | :: | start |
The starting index (1-based) of the |
||
| integer, | intent(out) | :: | count |
The number of elements in the |