pomerol  2.1
Public Member Functions | Protected Member Functions | Protected Attributes
Pomerol::IndexContainer4< ElementType, SourceObject > Class Template Reference

Base class for sparse container types whose elements are addressable by four single-particle indices. More...

#include <IndexContainer4.hpp>

Public Member Functions

template<typename... IndexTypes>
 IndexContainer4 (SourceObject const &Source, IndexClassification< IndexTypes... > const &IndexInfo)
 
void fill (std::set< IndexCombination4 > Indices=std::set< IndexCombination4 >())
 
ElementWithPermFreq< ElementType > & create (IndexCombination4 const &Indices)
 
bool isInContainer (IndexCombination4 const &Indices) const
 
bool isInContainer (ParticleIndex Index1, ParticleIndex Index2, ParticleIndex Index3, ParticleIndex Index4) const
 
ElementWithPermFreq< ElementType > & operator() (IndexCombination4 const &Indices)
 
ElementWithPermFreq< ElementType > & operator() (ParticleIndex Index1, ParticleIndex Index2, ParticleIndex Index3, ParticleIndex Index4)
 

Protected Member Functions

std::set< IndexCombination4enumerateIndices () const
 

Protected Attributes

ParticleIndex NumIndices
 Each of the four indices can change in the range [0; NumIndices[. More...
 
SourceObject const & Source
 Stored elements are created by calling Source.createElement(Indices). More...
 
std::map< IndexCombination4, ElementWithPermFreq< ElementType > > ElementsMap
 Sparse storage for the decorated elements. More...
 
std::map< IndexCombination4, std::shared_ptr< ElementType > > NonTrivialElements
 Sparse storage for the plain (non-decorated) elements. More...
 

Detailed Description

template<typename ElementType, typename SourceObject>
class Pomerol::IndexContainer4< ElementType, SourceObject >

Base class for sparse container types whose elements are addressable by four single-particle indices.

Base class for sparse container types whose elements are addressable by four single-particle indices. The stored elements are also decorated by ElementWithPermFreq.

Template Parameters
ElementTypeType of an element.
SourceObjectType of the source object used to create the elements.

Definition at line 66 of file IndexContainer4.hpp.

Constructor & Destructor Documentation

◆ IndexContainer4()

template<typename ElementType , typename SourceObject >
template<typename... IndexTypes>
Pomerol::IndexContainer4< ElementType, SourceObject >::IndexContainer4 ( SourceObject const &  Source,
IndexClassification< IndexTypes... > const &  IndexInfo 
)
inline

Construct from a source object and an index classification object. The container is initially empty and shall be populated with elements by a subsequent call to fill().

Template Parameters
IndexTypesTypes of indices carried by a single creation/annihilation operator.
Parameters
[in]SourceSource object used to create stored elements.
[in]IndexInfoClassification of single-particle indices.

Definition at line 91 of file IndexContainer4.hpp.

Member Function Documentation

◆ create()

template<typename ElementType , typename SourceObject >
ElementWithPermFreq< ElementType > & Pomerol::IndexContainer4< ElementType, SourceObject >::create ( IndexCombination4 const &  Indices)
inline

Create a stored element from the source object by its index combination.

Parameters
[in]IndicesIndex combination of the element to be created.
Returns
Reference to the created element.

Definition at line 192 of file IndexContainer4.hpp.

◆ enumerateIndices()

template<typename ElementType , typename SourceObject >
std::set< IndexCombination4 > Pomerol::IndexContainer4< ElementType, SourceObject >::enumerateIndices
inlineprotected

Generate a complete set of index combinations usable to address elements in the container.

Definition at line 263 of file IndexContainer4.hpp.

◆ fill()

template<typename ElementType , typename SourceObject >
void Pomerol::IndexContainer4< ElementType, SourceObject >::fill ( std::set< IndexCombination4 Indices = std::set<IndexCombination4>())
inline

Fill the container with elements from the source object. Each element is created by calling Source.createElement(IndexCombination).

Parameters
[in]IndicesSet of index combinations of the elements to be created. An empty set results in creation of elements for all possible index combinations.

Definition at line 172 of file IndexContainer4.hpp.

◆ isInContainer() [1/2]

template<typename ElementType , typename SourceObject >
bool Pomerol::IndexContainer4< ElementType, SourceObject >::isInContainer ( IndexCombination4 const &  Indices) const
inline

Check if an element for a given index combination is stored in the container.

Parameters
[in]IndicesIndex combination.

Definition at line 159 of file IndexContainer4.hpp.

◆ isInContainer() [2/2]

template<typename ElementType , typename SourceObject >
bool Pomerol::IndexContainer4< ElementType, SourceObject >::isInContainer ( ParticleIndex  Index1,
ParticleIndex  Index2,
ParticleIndex  Index3,
ParticleIndex  Index4 
) const
inline

Check if an element for a given index combination is stored in the container.

Parameters
[in]Index1First index in the combination.
[in]Index2Second index in the combination.
[in]Index3Third index in the combination.
[in]Index4Fourth index in the combination.

Definition at line 164 of file IndexContainer4.hpp.

◆ operator()() [1/2]

template<typename ElementType , typename SourceObject >
ElementWithPermFreq< ElementType > & Pomerol::IndexContainer4< ElementType, SourceObject >::operator() ( IndexCombination4 const &  Indices)
inline

Get a reference to a stored element by its index combination.

Parameters
[in]IndicesIndex combination.

Definition at line 241 of file IndexContainer4.hpp.

◆ operator()() [2/2]

template<typename ElementType , typename SourceObject >
ElementWithPermFreq< ElementType > & Pomerol::IndexContainer4< ElementType, SourceObject >::operator() ( ParticleIndex  Index1,
ParticleIndex  Index2,
ParticleIndex  Index3,
ParticleIndex  Index4 
)
inline

Get a reference to a stored element by its index combination.

Parameters
[in]Index1First index in the combination.
[in]Index2Second index in the combination.
[in]Index3Third index in the combination.
[in]Index4Fourth index in the combination.

Definition at line 255 of file IndexContainer4.hpp.

Field Documentation

◆ ElementsMap

template<typename ElementType , typename SourceObject >
std::map<IndexCombination4, ElementWithPermFreq<ElementType> > Pomerol::IndexContainer4< ElementType, SourceObject >::ElementsMap
protected

Sparse storage for the decorated elements.

Definition at line 79 of file IndexContainer4.hpp.

◆ NonTrivialElements

template<typename ElementType , typename SourceObject >
std::map<IndexCombination4, std::shared_ptr<ElementType> > Pomerol::IndexContainer4< ElementType, SourceObject >::NonTrivialElements
protected

Sparse storage for the plain (non-decorated) elements.

Definition at line 81 of file IndexContainer4.hpp.

◆ NumIndices

template<typename ElementType , typename SourceObject >
ParticleIndex Pomerol::IndexContainer4< ElementType, SourceObject >::NumIndices
protected

Each of the four indices can change in the range [0; NumIndices[.

Definition at line 69 of file IndexContainer4.hpp.

◆ Source

template<typename ElementType , typename SourceObject >
SourceObject const& Pomerol::IndexContainer4< ElementType, SourceObject >::Source
protected

Stored elements are created by calling Source.createElement(Indices).

Definition at line 72 of file IndexContainer4.hpp.


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