pomerol
2.1
|
Base class for sparse container types whose elements are addressable by two single-particle indices. More...
#include <IndexContainer2.hpp>
Public Member Functions | |
template<typename... IndexTypes> | |
IndexContainer2 (SourceObject const &Source, IndexClassification< IndexTypes... > const &IndexInfo) | |
void | fill (std::set< IndexCombination2 > Indices=std::set< IndexCombination2 >()) |
ElementType & | create (IndexCombination2 const &Indices) |
bool | isInContainer (IndexCombination2 const &Indices) const |
bool | isInContainer (ParticleIndex Index1, ParticleIndex Index2) const |
ElementType & | operator() (IndexCombination2 const &Indices) |
ElementType & | operator() (ParticleIndex Index1, ParticleIndex Index2) |
Protected Member Functions | |
std::set< IndexCombination2 > | enumerateIndices () const |
Protected Attributes | |
ParticleIndex | NumIndices |
Each of the two indices can change in the range [0; NumIndices[. More... | |
std::map< IndexCombination2, std::shared_ptr< ElementType > > | ElementsMap |
Sparse storage for the elements. More... | |
SourceObject const & | Source |
Stored elements are created by calling Source.createElement(Indices). More... | |
Base class for sparse container types whose elements are addressable by two single-particle indices.
ElementType | Type of an element. |
SourceObject | Type of the source object used to create the elements. |
Definition at line 37 of file IndexContainer2.hpp.
|
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().
IndexTypes | Types of indices carried by a single creation/annihilation operator. |
[in] | Source | Source object used to create stored elements. |
[in] | IndexInfo | Classification of single-particle indices. |
Definition at line 59 of file IndexContainer2.hpp.
ElementType & Pomerol::IndexContainer2< ElementType, SourceObject >::create | ( | IndexCombination2 const & | Indices | ) |
Create a stored element from the source object by its index combination.
[in] | Indices | Index combination of the element to be created. |
Definition at line 125 of file IndexContainer2.hpp.
|
inlineprotected |
Generate a complete set of index combinations usable to address elements in the container.
Definition at line 156 of file IndexContainer2.hpp.
void Pomerol::IndexContainer2< ElementType, SourceObject >::fill | ( | std::set< IndexCombination2 > | Indices = std::set<IndexCombination2>() | ) |
Fill the container with elements from the source object. Each element is created by calling Source.createElement(IndexCombination).
[in] | Indices | Set 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 106 of file IndexContainer2.hpp.
bool Pomerol::IndexContainer2< ElementType, SourceObject >::isInContainer | ( | IndexCombination2 const & | Indices | ) | const |
Check if an element for a given index combination is stored in the container.
[in] | Indices | Index combination. |
Definition at line 96 of file IndexContainer2.hpp.
bool Pomerol::IndexContainer2< ElementType, SourceObject >::isInContainer | ( | ParticleIndex | Index1, |
ParticleIndex | Index2 | ||
) | const |
Check if an element for a given index combination is stored in the container.
[in] | Index1 | First index in the combination. |
[in] | Index2 | Second index in the combination. |
Definition at line 101 of file IndexContainer2.hpp.
ElementType & Pomerol::IndexContainer2< ElementType, SourceObject >::operator() | ( | IndexCombination2 const & | Indices | ) |
Get a reference to a stored element by its index combination.
[in] | Indices | Index combination. |
Definition at line 138 of file IndexContainer2.hpp.
ElementType & Pomerol::IndexContainer2< ElementType, SourceObject >::operator() | ( | ParticleIndex | Index1, |
ParticleIndex | Index2 | ||
) |
Get a reference to a stored element by its index combination.
[in] | Index1 | First index in the combination. |
[in] | Index2 | Second index in the combination. |
Definition at line 151 of file IndexContainer2.hpp.
|
protected |
Sparse storage for the elements.
Definition at line 42 of file IndexContainer2.hpp.
|
protected |
Each of the two indices can change in the range [0; NumIndices[.
Definition at line 40 of file IndexContainer2.hpp.
|
protected |
Stored elements are created by calling Source.createElement(Indices).
Definition at line 45 of file IndexContainer2.hpp.