Documentation of CSL
Public Types | Public Member Functions
csl::IndexStructure_new< N > Class Template Reference

Public Types

using iterator = typename std::array< csl::Index, N >::iterator
 
using const_iterator = typename std::array< csl::Index, N >::const_iterator
 
using reverse_iterator = typename std::array< csl::Index, N >::reverse_iterator
 
using const_reverse_iterator = typename std::array< csl::Index, N >::const_reverse_iterator
 

Public Member Functions

 IndexStructure_new (IndexStructure_new const &)=default
 
 IndexStructure_new (IndexStructure_new &&)=default
 
IndexStructure_new< N > & operator= (IndexStructure_new< N > const &)=default
 
IndexStructure_new< N > & operator= (IndexStructure_new< N > &&)=default
 
 IndexStructure_new (csl::Index const &first)
 
 IndexStructure_new (IndexStructureView const &other)
 
 IndexStructure_new (std::array< csl::Index, N > const &t_indices)
 
 IndexStructure_new (std::array< csl::Index, N > &&t_indices)
 
constexpr bool empty () const
 
constexpr size_t size () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
csl::Index operator[] (size_t pos) const
 
csl::Indexoperator[] (size_t pos)
 
template<size_t M>
IndexStructure_new< M+N > operator+ (IndexStructure_new< M > const &other) const
 
std::vector< csl::IndexgetVectorIndex () const
 
void reset ()
 
bool exactMatch (const IndexStructure_new< N > &structure) const
 Compares the IndexStructure_new<N> 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_new< N > &structure) const
 Compares *this with structure index by index (in order) using the function Index::compareWithDummy(). More...
 
bool compareWithDummy (const IndexStructure_new< N > &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_new< N > &structure) const
 operator==, compares the IndexStructure_new<N> to structure in terms of free structure, independently of the dummy indices or the order of free indices. More...
 
bool operator!= (const IndexStructure_new< N > &structure) const
 operator!=, returns the opposite of IndexStructure_new<N>::operator==(). More...
 
bool operator< (const IndexStructure_new< N > &structure) const
 operator<, simplicity comparator using comparators between indices, starting by comparing the first ones. More...
 
bool operator> (const IndexStructure_new< N > &structure) const
 operator>, simplicity comparator using comparators between indices, starting by comparing the first ones. More...
 
bool operator<= (const IndexStructure_new< N > &structure) const
 operator<=, simplicity comparator using comparators between indices, starting by comparing the first ones. More...
 
bool operator>= (const IndexStructure_new< N > &structure) const
 operator>=, simplicity comparator using comparators between indices, starting by comparing the first ones. More...
 

Member Function Documentation

◆ compareWithDummy() [1/2]

template<size_t N>
bool csl::IndexStructure_new< N >::compareWithDummy ( const IndexStructure_new< N > &  structure) const
inline

Compares *this with structure index by index (in order) using the function Index::compareWithDummy().

Parameters
structureIndexStructure_new<N> to compare.
Returns
True if the two structures are equal wrt Index::compareWithDummy().
False else.

◆ compareWithDummy() [2/2]

template<size_t N>
bool csl::IndexStructure_new< N >::compareWithDummy ( const IndexStructure_new< N > &  structure,
std::map< Index, Index > &  constraints,
bool  keepAllCosntraints = false 
) const
inline

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.

Parameters
structureIndexStructure_new<N> to compare.
constraintsMap of Index to Index storing constraints of correpondance between dummy indices.
Returns
True if the two structures are equal wrt Index::compareWithDummy().
False else.

◆ exactMatch()

template<size_t N>
bool csl::IndexStructure_new< N >::exactMatch ( const IndexStructure_new< N > &  structure) const
inline

Compares the IndexStructure_new<N> with structure. Each index must match exactly (see Index::exactMatch()) with the Index at the same place in the second structure.

Parameters
structureIndexStructure_new<N> to compare.
Returns
True if the two structures match exactly.
False else.

◆ operator!=()

template<size_t N>
bool csl::IndexStructure_new< N >::operator!= ( const IndexStructure_new< N > &  structure) const
inline

operator!=, returns the opposite of IndexStructure_new<N>::operator==().

Parameters
structureIndexStructure_new<N> to compares
Returns
not IndexStructure_new<N>::operator==(structure).

◆ operator<()

template<size_t N>
bool csl::IndexStructure_new< N >::operator< ( const IndexStructure_new< N > &  structure) const
inline

operator<, simplicity comparator using comparators between indices, starting by comparing the first ones.

Parameters
structureIndexStructure_new<N> to compare.
Returns
True if *this is simpler than structure.

◆ operator<=()

template<size_t N>
bool csl::IndexStructure_new< N >::operator<= ( const IndexStructure_new< N > &  structure) const
inline

operator<=, simplicity comparator using comparators between indices, starting by comparing the first ones.

Parameters
structureIndexStructure_new<N> to compare.
Returns
True if < or |=.

◆ operator==()

template<size_t N>
bool csl::IndexStructure_new< N >::operator== ( const IndexStructure_new< N > &  structure) const
inline

operator==, compares the IndexStructure_new<N> to structure in terms of free structure, independently of the dummy indices or the order of free indices.

Parameters
structureIndexStructure_new<N> to compare with *this.
Returns
True if the two structures are equivalent, i.e. are compatible as two terms of a sum wrt Einstein')s convention.
False else.

◆ operator>()

template<size_t N>
bool csl::IndexStructure_new< N >::operator> ( const IndexStructure_new< N > &  structure) const
inline

operator>, simplicity comparator using comparators between indices, starting by comparing the first ones.

Parameters
structureIndexStructure_new<N> to compare.
Returns
True if structure is simpler than *this.

◆ operator>=()

template<size_t N>
bool csl::IndexStructure_new< N >::operator>= ( const IndexStructure_new< N > &  structure) const
inline

operator>=, simplicity comparator using comparators between indices, starting by comparing the first ones.

Parameters
structureIndexStructure_new<N> to compare.
Returns
True if > or |=.

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