Documentation for module dbcsr_tensor_index

tensor index and mapping to DBCSR index.

source: dbcsr_tensor_index.F
Loading...

public Types:

nd_to_2d_mapping
...

public Subroutines/Functions:

FUNCTION
INTEGER
combine_index (ind_in, dims, base, col_major)
transform nd index to flat index
Create all data needed to quickly map between nd index and 2d index.
FUNCTION
INTEGER
dbcsr_t_inverse_order (order)
Invert order
...
FUNCTION
INTEGER
get_2d_indices (map, ind_in)
transform nd index to 2d index, using info from index mapping.
get mapping info
FUNCTION
INTEGER
get_nd_indices (map, ind_in)
transform 2d index to nd index, using info from index mapping.
FUNCTION
INTEGER PURE
ndims_mapping (map)
...
reorder tensor index (no data)
FUNCTION
INTEGER
split_index (ind_in, dims, base, col_major)
transform flat index to nd index

public Types:

TYPE :: nd_to_2d_mapping

...


INTEGER
:: ndim_nd ...
INTEGER
:: ndim1_2d ...
INTEGER
:: ndim2_2d ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: dims_nd ...
INTEGER,
DIMENSION(2) :: dims_2d ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: dims1_2d ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: dims2_2d ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: map1_2d ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: map2_2d ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: map_nd ...
INTEGER
:: base ...
LOGICAL
:: col_major ...

FUNCTIONcombine_index(ind_in, dims, base, col_major)

transform nd index to flat index

Return Value ::
INTEGER
flat index
Arguments:
INTEGER,
INTENT(in)
:: ind_in(:) nd index
INTEGER,
INTENT(in)
:: dims(:) nd dimensions
INTEGER,
INTENT(in),
OPTIONAL
:: base base index, default 1 (Fortran style)
LOGICAL,
INTENT(in),
OPTIONAL
:: col_major column major ordering, default .TRUE. (Fortran style)

SUBROUTINEcreate_nd_to_2d_mapping(map, dims, map1_2d, map2_2d, base, col_major)

Create all data needed to quickly map between nd index and 2d index.

Arguments:
INTENT(out)
:: map index mapping data
INTEGER,
INTENT(in)
:: dims(:) nd sizes
INTEGER,
INTENT(in)
:: map1_2d(:) which nd-indices map to first matrix index and in which order
INTEGER,
INTENT(in)
:: map2_2d(:) 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.).

FUNCTIONdbcsr_t_inverse_order(order)

Invert order

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: order(:) ...

SUBROUTINEdestroy_nd_to_2d_mapping(map)

...

Arguments:
INTENT(inout)
:: map ...

FUNCTIONget_2d_indices(map, ind_in)

transform nd index to 2d index, using info from index mapping.

Return Value ::
INTEGER
2d index
Arguments:
INTENT(in)
:: map index mapping
INTEGER,
INTENT(in)
:: ind_in(ndims_mapping(map)) nd index

SUBROUTINEget_mapping_info(map, ndim_nd, ndim1_2d, ndim2_2d, dims_2d, dims_nd, dims1_2d, dims2_2d, map1_2d, map2_2d, map_nd, base, col_major)

get mapping info

Arguments:
INTENT(in)
:: map index mapping data.
INTEGER,
INTENT(out),
OPTIONAL
:: ndim_nd number of dimensions
INTEGER,
INTENT(out),
OPTIONAL
:: ndim1_2d number of dimensions that map to first 2d index
INTEGER,
INTENT(out),
OPTIONAL
:: ndim2_2d number of dimensions that map to first 2d index
INTEGER,
INTENT(out),
OPTIONAL
:: dims_2d(2) 2d dimensions
INTEGER,
INTENT(out),
OPTIONAL
:: dims_nd(ndims_mapping(map)) nd dimensions
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: dims1_2d(:) dimensions that map to first 2d index
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: dims2_2d(:) dimensions that map to second 2d index
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: map1_2d(:) indices that map to first 2d index
INTEGER,
INTENT(out),
ALLOCATABLE, OPTIONAL
:: map2_2d(:) indices that map to second 2d index
INTEGER,
INTENT(out),
OPTIONAL
:: map_nd(ndims_mapping(map)) 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

FUNCTIONget_nd_indices(map, ind_in)

transform 2d index to nd index, using info from index mapping.

Return Value ::
INTEGER
nd index
Arguments:
INTENT(in)
:: map index mapping
INTEGER,
INTENT(in)
:: ind_in(2) 2d index

PURE FUNCTIONndims_mapping(map)

...

Return Value ::
INTEGER
Arguments:
INTENT(in)
:: map ...

SUBROUTINEpermute_index(map_in, map_out, order)

reorder tensor index (no data)

Arguments:
INTENT(in)
:: map_in ...
INTENT(out)
:: map_out ...
INTEGER,
INTENT(in)
:: order(ndims_mapping(map_in)) ...

FUNCTIONsplit_index(ind_in, dims, base, col_major)

transform flat index to nd index

Return Value ::
INTEGER
nd index
Arguments:
INTEGER,
INTENT(in)
:: ind_in flat index
INTEGER,
INTENT(in)
:: dims(:) nd dimensions
INTEGER,
INTENT(in),
OPTIONAL
:: base base index, default 1 (Fortran style)
LOGICAL,
INTENT(in),
OPTIONAL
:: col_major column major ordering, default .TRUE. (Fortran style)