SIRIUS 7.5.0
Electronic structure library and applications
Public Types | Public Member Functions | Private Attributes | List of all members
sirius::splindex_chunk< Index_t > Class Template Reference

Externally defined block distribution. More...

#include <splindex.hpp>

Inherits sirius::splindex< basic_index_t< int > >.

Public Types

using value_type = typename splindex< Index_t >::value_type
 
- Public Types inherited from sirius::splindex< basic_index_t< int > >
using value_type = typename Index_t::value_type
 

Public Member Functions

 splindex_chunk ()
 Default constructor. More...
 
 splindex_chunk (value_type size__, n_blocks n_blocks__, block_id block_id__, std::vector< value_type > const counts__)
 Constructor with specific partitioning. More...
 
value_type local_size (block_id block_id__) const
 Return local size of the split index for a given block. More...
 
splindex< Index_t >::location_t location (typename Index_t::global idx__) const
 Return location (block_id and local offset) of the global index. More...
 
Index_t::global global_index (typename Index_t::local idxloc__, block_id block_id__) const
 Return global index by block id and local index. More...
 
auto global_offset () const
 
- Public Member Functions inherited from sirius::splindex< basic_index_t< int > >
 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...
 
value_type local_size () const
 Return local size for the current 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...
 
auto global_index (typename splindex< basic_index_t< int > >::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...
 

Private Attributes

std::vector< std::vector< value_type > > global_index_
 
std::vector< typename splindex< Index_t >::location_t > locations_
 

Additional Inherited Members

- Static Public Member Functions inherited from sirius::splindex< basic_index_t< int > >
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 inherited from sirius::splindex< basic_index_t< int > >
n_blocks n_blocks_
 Number of blocks over which the global index is distributed. More...
 
block_id block_id_
 Index of the block with local fraction of the global index. More...
 
value_type size_
 Size (aka length) of the global index. More...
 

Detailed Description

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

Externally defined block distribution.

Definition at line 443 of file splindex.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 446 of file splindex.hpp.

Constructor & Destructor Documentation

◆ splindex_chunk() [1/2]

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

Default constructor.

Definition at line 453 of file splindex.hpp.

◆ splindex_chunk() [2/2]

template<typename Index_t = basic_index_t<int>>
sirius::splindex_chunk< Index_t >::splindex_chunk ( value_type  size__,
n_blocks  n_blocks__,
block_id  block_id__,
std::vector< value_type > const  counts__ 
)
inline

Constructor with specific partitioning.

Definition at line 458 of file splindex.hpp.

Member Function Documentation

◆ local_size()

template<typename Index_t = basic_index_t<int>>
value_type sirius::splindex_chunk< Index_t >::local_size ( block_id  block_id__) const
inlinevirtual

Return local size of the split index for a given block.

Implements sirius::splindex< basic_index_t< int > >.

Definition at line 474 of file splindex.hpp.

◆ location()

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

Return location (block_id and local offset) of the global index.

Implements sirius::splindex< basic_index_t< int > >.

Definition at line 484 of file splindex.hpp.

◆ global_index()

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

Return global index by block id and local index.

Implements sirius::splindex< basic_index_t< int > >.

Definition at line 491 of file splindex.hpp.

◆ global_offset()

template<typename Index_t = basic_index_t<int>>
auto sirius::splindex_chunk< Index_t >::global_offset ( ) const
inline

Definition at line 499 of file splindex.hpp.

Member Data Documentation

◆ global_index_

template<typename Index_t = basic_index_t<int>>
std::vector<std::vector<value_type> > sirius::splindex_chunk< Index_t >::global_index_
private

Definition at line 448 of file splindex.hpp.

◆ locations_

template<typename Index_t = basic_index_t<int>>
std::vector<typename splindex<Index_t>::location_t> sirius::splindex_chunk< Index_t >::locations_
private

Definition at line 449 of file splindex.hpp.


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