tensor index and mapping to DBCSR index
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_tensor_index' |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | ndim_nd | = | -1 | ||
integer, | public | :: | ndim1_2d | = | -1 | ||
integer, | public | :: | ndim2_2d | = | -1 | ||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | dims_nd | |||
integer(kind=int_8), | public, | DIMENSION(2) | :: | dims_2d | = | -1_int_8 | |
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | dims1_2d | |||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | dims2_2d | |||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | map1_2d | |||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | map2_2d | |||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | map_nd | |||
integer, | public | :: | base | = | -1 | ||
logical, | public | :: | col_major | = | .FALSE. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
how many tensor dimensions are mapped to matrix row
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
how many tensor dimensions are mapped to matrix column
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
transform nd index to flat index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | ind_in |
nd index nd dimensions |
|
integer, | intent(in), | DIMENSION(:) | :: | dims |
nd index nd dimensions |
flat index
transform nd index to flat index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | ind_in |
nd index nd dimensions |
|
integer, | intent(in), | DIMENSION(:) | :: | dims |
nd index nd dimensions |
flat index
transform flat index to nd index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int_8), | intent(in) | :: | ind_in |
flat index |
||
integer, | intent(in), | DIMENSION(:) | :: | dims |
nd dimensions |
nd index
transform flat index to nd index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ind_in |
flat index |
||
integer, | intent(in), | DIMENSION(:) | :: | dims |
nd dimensions |
nd index
transform nd index to 2d index, using info from index mapping.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
index mapping |
||
integer, | intent(in), | DIMENSION(map%ndim_nd) | :: | ind_in |
nd index |
2d index
transform nd index to 2d index, using info from index mapping.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
index mapping |
||
integer, | intent(in), | DIMENSION(map%ndim_nd) | :: | ind_in |
nd index |
2d index
transform 2d index to nd index, using info from index mapping.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
index mapping |
||
integer(kind=int_8), | intent(in), | DIMENSION(2) | :: | ind_in |
2d index |
nd index
transform 2d index to nd index, using info from index mapping.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
index mapping |
||
integer, | intent(in), | DIMENSION(2) | :: | ind_in |
2d index |
nd index
Invert order
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | order |
Create all data needed to quickly map between nd index and 2d index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(out) | :: | map |
index mapping data |
||
integer, | intent(in), | DIMENSION(:) | :: | dims |
nd sizes which nd-indices map to first matrix index and in which order which nd-indices map to second matrix index and in which order |
|
integer, | intent(in), | DIMENSION(:) | :: | map1_2d |
nd sizes which nd-indices map to first matrix index and in which order which nd-indices map to second matrix index and in which order |
|
integer, | intent(in), | DIMENSION(:) | :: | map2_2d |
nd sizes which nd-indices map to first matrix index and in which order which nd-indices map to second matrix index and in which order |
|
integer, | intent(in), | optional | :: | base |
base index (1 for Fortran-style, 0 for C-style, default is 1) |
|
logical, | intent(in), | optional | :: | col_major |
whether index should be column major order (.TRUE. for Fortran-style, .FALSE. for C-style, default is .TRUE.). |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(inout) | :: | map |
get mapping info
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map |
index mapping data. |
||
integer, | intent(out), | optional | :: | ndim_nd |
number of dimensions number of dimensions that map to first 2d index number of dimensions that map to first 2d index |
|
integer, | intent(out), | optional | :: | ndim1_2d |
number of dimensions number of dimensions that map to first 2d index number of dimensions that map to first 2d index |
|
integer, | intent(out), | optional | :: | ndim2_2d |
number of dimensions number of dimensions that map to first 2d index number of dimensions that map to first 2d index |
|
integer(kind=int_8), | intent(out), | optional, | DIMENSION(2) | :: | dims_2d_i8 | |
integer, | intent(out), | optional, | DIMENSION(2) | :: | dims_2d |
2d dimensions |
integer, | intent(out), | optional, | DIMENSION(ndims_mapping(map)) | :: | dims_nd |
nd dimensions |
integer, | intent(out), | optional, | DIMENSION(ndims_mapping_row(map)) | :: | dims1_2d |
dimensions that map to first 2d index |
integer, | intent(out), | optional, | DIMENSION(ndims_mapping_column(map)) | :: | dims2_2d |
dimensions that map to second 2d index |
integer, | intent(out), | optional, | DIMENSION(ndims_mapping_row(map)) | :: | map1_2d |
indices that map to first 2d index |
integer, | intent(out), | optional, | DIMENSION(ndims_mapping_column(map)) | :: | map2_2d |
indices that map to second 2d index |
integer, | intent(out), | optional, | DIMENSION(ndims_mapping(map)) | :: | map_nd |
inverse of [map1_2d, map2_2d] |
integer, | intent(out), | optional | :: | base |
base index |
|
logical, | intent(out), | optional | :: | col_major |
is index in column major order |
reorder tensor index (no data)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nd_to_2d_mapping), | intent(in) | :: | map_in | |||
type(nd_to_2d_mapping), | intent(out) | :: | map_out | |||
integer, | intent(in), | DIMENSION(ndims_mapping(map_in)) | :: | order |