Manages a std::vector of Index, to be used by an TensorElement. More...
#include <index.h>
Public Member Functions | |
| IndexStructure () | |
| Default constructor, empty structure. | |
| IndexStructure (int t_nIndices) | |
| Constructor that initializes only the size of index. More... | |
| IndexStructure (const IndexStructure &structure) | |
| Copy constructor. More... | |
| IndexStructure (IndexStructure &&)=default | |
| IndexStructure & | operator= (IndexStructure &&)=default |
| IndexStructure (const std::initializer_list< Index > &structure) | |
| Constructor with one parameter: the list of indices in the structure. More... | |
| IndexStructure (const std::vector< Index > &structure) | |
| Constructor with one parameter: the list of indices in the structure. More... | |
| ~IndexStructure () | |
| Destructor. | |
| std::vector< Index > const & | getIndex () const |
| const std::vector< Index > & | getIndexView () const |
| std::vector< Index > & | getIndex () |
| std::vector< Index >::const_iterator | find (const Index &t_index) const |
| Search for a particular Index in the structure. More... | |
| std::vector< Index >::iterator | find (const Index &t_index) |
| IndexStructure | getFreeStructure () const |
| IndexStructure | getSinglePermutation (int i1, int i2) const |
| IndexStructure | getPermutation (const std::vector< int > &permutation) const |
| void | setIndex (const Index &newIndex, int iIndex=0) |
| Sets the Index in position iIndex to newIndex. More... | |
| void | reset () |
| IndexStructure & | operator= (const IndexStructure &structure)=default |
| operator=, Copies the IndexStructure structure. C++ default. More... | |
| IndexStructure & | operator+= (const Index &newIndex) |
| operator+=, adds an index to the IndexStructure. More... | |
| IndexStructure & | operator+= (const IndexStructure &structure) |
| operator+=, adds another IndexStructure at the end of the current. This function concatenates the two structures. More... | |
| IndexStructure | operator+ (const csl::Index &index) const |
| IndexStructure | operator+ (const IndexStructure &structure) const |
| operator+, concatenates the current IndexStructure with structure and returns the result. More... | |
| bool | hasCommonIndex (csl::IndexStructure const &other) const |
| bool | exactMatch (const IndexStructure &structure) const |
| Compares the IndexStructure with structure. Each index must match exactly (see Index::exactMatch()) with the Index at the same place in the second structure. More... | |
| bool | compareWithDummy (const IndexStructure &structure) const |
| Compares *this with structure index by index (in order) using the function Index::compareWithDummy(). More... | |
| bool | compareWithDummy (const IndexStructure &structure, std::map< Index, Index > &constraints, bool keepAllCosntraints=false) const |
| Compares *this with structure index by index (in order) using the function Index::compareWithDummy(). More... | |
| bool | operator== (const IndexStructure &structure) const |
| operator==, compares the IndexStructure to structure in terms of free structure, independently of the dummy indices or the order of free indices. More... | |
| bool | operator!= (const IndexStructure &structure) const |
| operator!=, returns the opposite of IndexStructure::operator==(). More... | |
| bool | operator|= (const IndexStructure &structure) const |
| operator|=, simplicity comparator using comparators between indices, starting by comparing the first ones. More... | |
| bool | operator &= (const IndexStructure &structure) const |
| operator&=, simplicity comparator using comparators between indices, starting by comparing the first ones. More... | |
| bool | operator< (const IndexStructure &structure) const |
| operator<, simplicity comparator using comparators between indices, starting by comparing the first ones. More... | |
| bool | operator> (const IndexStructure &structure) const |
| operator>, simplicity comparator using comparators between indices, starting by comparing the first ones. More... | |
| bool | operator<= (const IndexStructure &structure) const |
| operator<=, simplicity comparator using comparators between indices, starting by comparing the first ones. More... | |
| bool | operator>= (const IndexStructure &structure) const |
| operator>=, simplicity comparator using comparators between indices, starting by comparing the first ones. More... | |
| Index | operator[] (int i) const |
| operator[], accessor to the Index at position i. More... | |
| Index & | operator[] (int i) |
| operator[], accessor to the Index at position i. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &fout, const IndexStructure &structure) |
| Displays the IndexStructure in output /b fout. More... | |
Manages a std::vector of Index, to be used by an TensorElement.
|
inlineexplicit |
Constructor that initializes only the size of index.
| t_nIndices | Number of indices in the IndexStructure. |
|
inline |
Copy constructor.
| structure | IndexStructure to copy in initialization. |
|
inlineexplicit |
Constructor with one parameter: the list of indices in the structure.
| structure | The list of indices initializating the IndexStructure. |
|
explicit |
Constructor with one parameter: the list of indices in the structure.
| structure | A std::vector of Index initializating the IndexStructure. |
| bool csl::IndexStructure::compareWithDummy | ( | const IndexStructure & | structure | ) | const |
Compares *this with structure index by index (in order) using the function Index::compareWithDummy().
| structure | IndexStructure to compare. |
| bool csl::IndexStructure::compareWithDummy | ( | const IndexStructure & | structure, |
| std::map< Index, Index > & | constraints, | ||
| bool | keepAllCosntraints = false |
||
| ) | const |
Compares *this with structure index by index (in order) using the function Index::compareWithDummy().
The map between indices contains matches between dummy indices. Dummy indices can a priori match between each other independently of their names, but one an Index has been matched with another, the pair is put into constraints. This constraints map allows then to compare properly complex expressions containing dummy indices. The map constraints is modified in the function.
| structure | IndexStructure to compare. |
| constraints | Map of Index to Index storing constraints of correpondance between dummy indices. |
| bool csl::IndexStructure::exactMatch | ( | const IndexStructure & | structure | ) | const |
Compares the IndexStructure with structure. Each index must match exactly (see Index::exactMatch()) with the Index at the same place in the second structure.
| structure | IndexStructure to compare. |
Search for a particular Index in the structure.
| IndexStructure csl::IndexStructure::getFreeStructure | ( | ) | const |
| std::vector< Index > const & csl::IndexStructure::getIndex | ( | ) | const |
| std::vector< Index > & csl::IndexStructure::getIndex | ( | ) |
| IndexStructure csl::IndexStructure::getPermutation | ( | const std::vector< int > & | permutation | ) | const |
| permutation | std::vector of integers of the size of the IndexStructure that permutes indices. |
| IndexStructure csl::IndexStructure::getSinglePermutation | ( | int | i1, |
| int | i2 | ||
| ) | const |
| bool csl::IndexStructure::operator&= | ( | const IndexStructure & | structure | ) | const |
operator&=, simplicity comparator using comparators between indices, starting by comparing the first ones.
| structure | IndexStructure to compare. |
| bool csl::IndexStructure::operator!= | ( | const IndexStructure & | structure | ) | const |
operator!=, returns the opposite of IndexStructure::operator==().
| structure | IndexStructure to compares |
| IndexStructure csl::IndexStructure::operator+ | ( | const IndexStructure & | structure | ) | const |
operator+, concatenates the current IndexStructure with structure and returns the result.
| structure | IndexStructure with which *this is concatenated. |
| IndexStructure & csl::IndexStructure::operator+= | ( | const Index & | newIndex | ) |
operator+=, adds an index to the IndexStructure.
| newIndex | Index to append at the end of the IndexStructure. |
| IndexStructure & csl::IndexStructure::operator+= | ( | const IndexStructure & | structure | ) |
operator+=, adds another IndexStructure at the end of the current. This function concatenates the two structures.
| structure | IndexStructure to concatenate to *this. |
| bool csl::IndexStructure::operator< | ( | const IndexStructure & | structure | ) | const |
operator<, simplicity comparator using comparators between indices, starting by comparing the first ones.
| structure | IndexStructure to compare. |
| bool csl::IndexStructure::operator<= | ( | const IndexStructure & | structure | ) | const |
operator<=, simplicity comparator using comparators between indices, starting by comparing the first ones.
| structure | IndexStructure to compare. |
|
default |
operator=, Copies the IndexStructure structure. C++ default.
| structure | IndexStructure to copy. |
| bool csl::IndexStructure::operator== | ( | const IndexStructure & | structure | ) | const |
operator==, compares the IndexStructure to structure in terms of free structure, independently of the dummy indices or the order of free indices.
| structure | IndexStructure to compare with *this. |
| bool csl::IndexStructure::operator> | ( | const IndexStructure & | structure | ) | const |
operator>, simplicity comparator using comparators between indices, starting by comparing the first ones.
| structure | IndexStructure to compare. |
| bool csl::IndexStructure::operator>= | ( | const IndexStructure & | structure | ) | const |
operator>=, simplicity comparator using comparators between indices, starting by comparing the first ones.
| structure | IndexStructure to compare. |
| Index csl::IndexStructure::operator[] | ( | int | i | ) | const |
| Index & csl::IndexStructure::operator[] | ( | int | i | ) |
| bool csl::IndexStructure::operator|= | ( | const IndexStructure & | structure | ) | const |
operator|=, simplicity comparator using comparators between indices, starting by comparing the first ones.
| structure | IndexStructure to compare. |
| void csl::IndexStructure::setIndex | ( | const Index & | newIndex, |
| int | iIndex = 0 |
||
| ) |
Sets the Index in position iIndex to newIndex.
| newIndex | New Index to place in the IndexStructure. |
| iIndex | Position where to place newIndex, default 0 if not given by the user. |
|
friend |
Displays the IndexStructure in output /b fout.
| fout | Output flux. |
| structure | IndexStructure to display. |
1.8.13