SIRIUS 7.5.0
Electronic structure library and applications
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
sirius::splindex< Index_t > Class Template Referenceabstract

Base class for split index. More...

#include <splindex.hpp>

Classes

struct  location_t
 Pair of <local index, block_id> describing the location of a global index element. More...
 

Public Types

using value_type = typename Index_t::value_type
 

Public Member Functions

 splindex ()
 Default constructor. More...
 
 splindex (value_type size__, n_blocks n_blocks__, block_id block_id__)
 Constructor. More...
 
virtual value_type local_size (block_id block_id__) const =0
 Return local size of the split index for a given block. More...
 
virtual location_t location (typename Index_t::global idx__) const =0
 Return location (block_id and local offset) of the global index. More...
 
virtual Index_t::global global_index (typename Index_t::local idxloc__, block_id block_id__) const =0
 Return global index by block id and local index. More...
 
value_type local_size () const
 Return local size for the current block. More...
 
auto global_index (typename splindex< Index_t >::location_t loc__) const
 Return global index of an element by local index and block id. More...
 
auto global_index (typename Index_t::local idxloc__) const
 
auto size () const noexcept
 Return total length of the index (global number of elements). More...
 

Static Public Member Functions

static auto block_size (value_type size__, n_blocks n_blocks__)
 Compute size of the block from global index size and number of blocks. More...
 

Protected Attributes

n_blocks n_blocks_ {-1}
 Number of blocks over which the global index is distributed. More...
 
block_id block_id_ {-1}
 Index of the block with local fraction of the global index. More...
 
value_type size_ {-1}
 Size (aka length) of the global index. More...
 

Detailed Description

template<typename Index_t = basic_index_t<int>>
class sirius::splindex< Index_t >

Base class for split index.

Definition at line 120 of file splindex.hpp.

Member Typedef Documentation

◆ value_type

template<typename Index_t = basic_index_t<int>>
using sirius::splindex< Index_t >::value_type = typename Index_t::value_type

Definition at line 123 of file splindex.hpp.

Constructor & Destructor Documentation

◆ splindex() [1/2]

template<typename Index_t = basic_index_t<int>>
sirius::splindex< Index_t >::splindex ( )
inline

Default constructor.

Definition at line 152 of file splindex.hpp.

◆ splindex() [2/2]

template<typename Index_t = basic_index_t<int>>
sirius::splindex< Index_t >::splindex ( value_type  size__,
n_blocks  n_blocks__,
block_id  block_id__ 
)
inline

Constructor.

Check and set index size, number of blocks and block id.

Definition at line 158 of file splindex.hpp.

◆ ~splindex()

template<typename Index_t = basic_index_t<int>>
virtual sirius::splindex< Index_t >::~splindex ( )
inlinevirtual

Definition at line 182 of file splindex.hpp.

Member Function Documentation

◆ local_size() [1/2]

template<typename Index_t = basic_index_t<int>>
virtual value_type sirius::splindex< Index_t >::local_size ( block_id  block_id__) const
pure virtual

◆ location()

template<typename Index_t = basic_index_t<int>>
virtual location_t sirius::splindex< Index_t >::location ( typename Index_t::global  idx__) const
pure virtual

◆ global_index() [1/3]

template<typename Index_t = basic_index_t<int>>
virtual Index_t::global sirius::splindex< Index_t >::global_index ( typename Index_t::local  idxloc__,
block_id  block_id__ 
) const
pure virtual

◆ local_size() [2/2]

template<typename Index_t = basic_index_t<int>>
value_type sirius::splindex< Index_t >::local_size ( ) const
inline

Return local size for the current block.

Definition at line 196 of file splindex.hpp.

◆ global_index() [2/3]

template<typename Index_t = basic_index_t<int>>
auto sirius::splindex< Index_t >::global_index ( typename splindex< Index_t >::location_t  loc__) const
inline

Return global index of an element by local index and block id.

Definition at line 202 of file splindex.hpp.

◆ global_index() [3/3]

template<typename Index_t = basic_index_t<int>>
auto sirius::splindex< Index_t >::global_index ( typename Index_t::local  idxloc__) const
inline

Definition at line 207 of file splindex.hpp.

◆ size()

template<typename Index_t = basic_index_t<int>>
auto sirius::splindex< Index_t >::size ( ) const
inlinenoexcept

Return total length of the index (global number of elements).

Definition at line 213 of file splindex.hpp.

◆ block_size()

template<typename Index_t = basic_index_t<int>>
static auto sirius::splindex< Index_t >::block_size ( value_type  size__,
n_blocks  n_blocks__ 
)
inlinestatic

Compute size of the block from global index size and number of blocks.

Definition at line 219 of file splindex.hpp.

Member Data Documentation

◆ n_blocks_

template<typename Index_t = basic_index_t<int>>
n_blocks sirius::splindex< Index_t >::n_blocks_ {-1}
protected

Number of blocks over which the global index is distributed.

Definition at line 126 of file splindex.hpp.

◆ block_id_

template<typename Index_t = basic_index_t<int>>
block_id sirius::splindex< Index_t >::block_id_ {-1}
protected

Index of the block with local fraction of the global index.

Definition at line 129 of file splindex.hpp.

◆ size_

template<typename Index_t = basic_index_t<int>>
value_type sirius::splindex< Index_t >::size_ {-1}
protected

Size (aka length) of the global index.

Definition at line 132 of file splindex.hpp.


The documentation for this class was generated from the following file: