Fuse an index
create a composite index out of two indices, assuming they are unordered i.e. their ordering does not matter.
Note
Note that this function does not preserve order if we assume lexicographical ordering.
If (p_1, q_1) <= (p_2, q_2), then we don’t have necessarily
fuse_sym_idx(p_1, q_1) <= fuse_symm_idx(p_2, q_2).
@endote
The ordering looks like this:
1 2 4 7 3 5 8 6 9 10
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | q |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Fuse an index
create a composite index out of two indices, assuming they are unordered i.e. their ordering does not matter.
Note
Note that this function does not preserve order if we assume lexicographical ordering.
If (p_1, q_1) <= (p_2, q_2), then we don’t have necessarily
fuse_sym_idx(p_1, q_1) <= fuse_symm_idx(p_2, q_2).
@endote
The ordering looks like this:
1 2 4 7 3 5 8 6 9 10
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | q |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Invert the fuse_symm_idx routine
Returns index pair x <= y for the fused index xy. This assumes that the underlying matrix is symmetric, i.e. (x, y) and (y, x) map to the same xy.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | pq |
The fused index |
||
| integer(kind=int32), | intent(out) | :: | p |
The index pair x <= y |
||
| integer(kind=int32), | intent(out) | :: | q |
The index pair x <= y |
Invert the fuse_symm_idx routine
Returns index pair x <= y for the fused index xy. This assumes that the underlying matrix is symmetric, i.e. (x, y) and (y, x) map to the same xy.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | pq |
The fused index |
||
| integer(kind=int64), | intent(out) | :: | p |
The index pair x <= y |
||
| integer(kind=int64), | intent(out) | :: | q |
The index pair x <= y |
Fuse p, q into one contiguous index
If fortran is true, then this assumes columnwise Fortran order, i.e. the index looks like this:
1 5 2 6 3 7 4 8
Otherwise it is C-order, i.e. row major (but still one-indexed).
Note
Note that this function does preserve lexicographical ordering, if fortran == .false..
If (p_1, q_1) <= (p_2, q_2)
fuse_idx(p_1, q_1, n_dim, fortran=.false.) <= fuse_idx(p_2, q_2, fortran=.false.).
@endote
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | n_dim |
number of rows for Fortran (column-major), number of columns for C (row-major). |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
contiguous 1d-array index
Fuse p, q into one contiguous index
If fortran is true, then this assumes columnwise Fortran order, i.e. the index looks like this:
1 5 2 6 3 7 4 8
Otherwise it is C-order, i.e. row major (but still one-indexed).
Note
Note that this function does preserve lexicographical ordering, if fortran == .false..
If (p_1, q_1) <= (p_2, q_2)
fuse_idx(p_1, q_1, n_dim, fortran=.false.) <= fuse_idx(p_2, q_2, fortran=.false.).
@endote
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | n_dim |
number of rows for Fortran (column-major), number of columns for C (row-major). |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
contiguous 1d-array index
Fuse p, q into one contiguous index
This assumes columnwise Fortran order, i.e. the index looks like this:
1 5 2 6 3 7 4 8
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | pq |
contiguous 1d-array index |
||
| integer(kind=int32), | intent(in) | :: | n_dim |
number of rows |
||
| integer(kind=int32), | intent(out) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(out) | :: | q |
2d-array indices |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
Fuse p, q into one contiguous index
This assumes columnwise Fortran order, i.e. the index looks like this:
1 5 2 6 3 7 4 8
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | pq |
contiguous 1d-array index |
||
| integer(kind=int64), | intent(in) | :: | n_dim |
number of rows |
||
| integer(kind=int64), | intent(out) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(out) | :: | q |
2d-array indices |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
Fuse an index
create a composite index out of two indices, assuming they are unordered i.e. their ordering does not matter.
Note
Note that this function does not preserve order if we assume lexicographical ordering.
If (p_1, q_1) <= (p_2, q_2), then we don’t have necessarily
fuse_sym_idx(p_1, q_1) <= fuse_symm_idx(p_2, q_2).
@endote
The ordering looks like this:
1 2 3 4 5 6 7 8 9 10
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | n_dim |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Fuse an index
create a composite index out of two indices, assuming they are unordered i.e. their ordering does not matter.
Note
Note that this function does not preserve order if we assume lexicographical ordering.
If (p_1, q_1) <= (p_2, q_2), then we don’t have necessarily
fuse_sym_idx(p_1, q_1) <= fuse_symm_idx(p_2, q_2).
@endote
The ordering looks like this:
1 2 3 4 5 6 7 8 9 10
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | n_dim |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
Fuse an index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | q |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Fuse an index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | n_dim |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Fuse p, q into one contiguous index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int32), | intent(in) | :: | n_dim |
number of rows for Fortran (column-major), number of columns for C (row-major). |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
contiguous 1d-array index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | n |
Fuse an index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | q |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Fuse an index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | n_dim |
2d-array indices |
1d-array index assuming the array is symmetric w.r. p<->q
Fuse p, q into one contiguous index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | q |
2d-array indices |
||
| integer(kind=int64), | intent(in) | :: | n_dim |
number of rows for Fortran (column-major), number of columns for C (row-major). |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
contiguous 1d-array index
Invert the fuse_symm_idx routine
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | pq |
The fused index |
||
| integer(kind=int32), | intent(out) | :: | p |
The index pair x <= y |
||
| integer(kind=int32), | intent(out) | :: | q |
The index pair x <= y |
Fuse p, q into one contiguous index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | pq |
contiguous 1d-array index |
||
| integer(kind=int32), | intent(in) | :: | n_dim |
number of rows |
||
| integer(kind=int32), | intent(out) | :: | p |
2d-array indices |
||
| integer(kind=int32), | intent(out) | :: | q |
2d-array indices |
||
| logical, | intent(in) | :: | fortran |
Use column major order |
Invert the fuse_symm_idx routine
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | pq |
The fused index |
||
| integer(kind=int64), | intent(out) | :: | p |
The index pair x <= y |
||
| integer(kind=int64), | intent(out) | :: | q |
The index pair x <= y |
Fuse p, q into one contiguous index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | pq |
contiguous 1d-array index |
||
| integer(kind=int64), | intent(in) | :: | n_dim |
number of rows |
||
| integer(kind=int64), | intent(out) | :: | p |
2d-array indices |
||
| integer(kind=int64), | intent(out) | :: | q |
2d-array indices |
||
| logical, | intent(in) | :: | fortran |
Use column major order |