Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hammer::MultiDimensional::LabeledIndexing< BasicIndexing > Class Template Reference

#include <LabeledIndexing.hh>

+ Inheritance diagram for Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >:
+ Collaboration diagram for Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >:

Public Member Functions

 LabeledIndexing ()
 
 LabeledIndexing (IndexList dimensions, LabelsList labels)
 
 LabeledIndexing (const LabeledIndexing &)=default
 
 LabeledIndexing (LabeledIndexing &&)=default
 
LabeledIndexingoperator= (const LabeledIndexing &)=default
 
LabeledIndexingoperator= (LabeledIndexing &&)=default
 
 ~LabeledIndexing ()=default
 
IndexType dim (IndexLabel label) const
 dimension of a specific component by label. More...
 
const LabelsListlabels () const
 get the labels of all the indices at once More...
 
UniqueLabelsList spinIndices () const
 returns only the labels corresponding to spin indices More...
 
IndexPairList getSameLabelPairs (const LabelsList &otherLabels, const UniqueLabelsList &indices, bool sortedBySecond=true) const
 returns the position of the indices in the two tensor (this and another) that can be contracted together, given a set of allowed index labels More...
 
IndexPairList getOppositeLabelPairs (const UniqueLabelsList &indices) const
 returns the position of the indices that can be traced together, given a set of allowed index labels More...
 
IndexType labelIndex (IndexLabel label) const
 
bool isSameLabelShape (const LabelsList &otherLabels, const IndexList &otherIndices) const
 
template<typename S >
bool isSameLabelShape (const LabeledIndexing< S > &other) const
 
bool canAddAt (const LabelsList &otherLabels, const IndexList &otherIndices, IndexLabel coord, IndexType position) const
 
void flipLabels ()
 

Protected Member Functions

UniqueLabelsList sameIndices (const LabelsList &otherLabels) const
 returns the set of indices of this tensor that can be contracted using dot with those of another given tensor More...
 
LabelPairsSet oppositeIndices () const
 returns the pairs of indices that can be traced over. More...
 

Private Attributes

LabelsList _labels
 the labels of each tensor index More...
 

Detailed Description

template<class BasicIndexing>
class Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >

Definition at line 23 of file LabeledIndexing.hh.

Constructor & Destructor Documentation

Definition at line 55 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::LabeledIndexing ( IndexList  dimensions,
LabelsList  labels 
)

Definition at line 60 of file LabeledIndexingDefs.hh.

template<class BasicIndexing>
Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::LabeledIndexing ( const LabeledIndexing< BasicIndexing > &  )
default
template<class BasicIndexing>
Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::~LabeledIndexing ( )
default

Member Function Documentation

template<class BasicIndexing >
bool Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::canAddAt ( const LabelsList otherLabels,
const IndexList otherIndices,
IndexLabel  coord,
IndexType  position 
) const

Definition at line 170 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
IndexType Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::dim ( IndexLabel  label) const

dimension of a specific component by label.

    If multiple components with the same label exists,
    returns the dimension of first (they should all be the same
    by consistency)
Parameters
[in]labelthe component label
Returns
the dimension

Definition at line 28 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
void Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::flipLabels ( )

Definition at line 186 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
IndexPairList Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::getOppositeLabelPairs ( const UniqueLabelsList indices) const

returns the position of the indices that can be traced together, given a set of allowed index labels

Parameters
[in]indicesthe list of labels of the allowed indices to be traced
Returns
pairs of coordinate indices that needs to be traced together

Definition at line 128 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
IndexPairList Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::getSameLabelPairs ( const LabelsList otherLabels,
const UniqueLabelsList indices,
bool  sortedBySecond = true 
) const

returns the position of the indices in the two tensor (this and another) that can be contracted together, given a set of allowed index labels

Parameters
[in]otherLabelsthe list of labels of the other tensor
[in]indicesthe list of labels of the allowed indices to be contracted
[in]sortedBySecondwhether the result should be sorted according to the second element of the pair
Returns
pairs of indices corresponding to coordinates in this and other tensor that needs to be contracted together

Definition at line 94 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
bool Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::isSameLabelShape ( const LabelsList otherLabels,
const IndexList otherIndices 
) const

Definition at line 145 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
template<typename S >
bool Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::isSameLabelShape ( const LabeledIndexing< S > &  other) const

Definition at line 155 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
IndexType Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::labelIndex ( IndexLabel  label) const

Definition at line 163 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
const LabelsList & Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::labels ( ) const

get the labels of all the indices at once

Returns
the list of labels

Definition at line 39 of file LabeledIndexingDefs.hh.

template<class BasicIndexing>
LabeledIndexing& Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::operator= ( const LabeledIndexing< BasicIndexing > &  )
default
template<class BasicIndexing>
LabeledIndexing& Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::operator= ( LabeledIndexing< BasicIndexing > &&  )
default
template<class BasicIndexing >
LabelPairsSet Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::oppositeIndices ( ) const
protected

returns the pairs of indices that can be traced over.

Valid pairs are composed by opposite sign labels which correspond to (reference) spin indices

Returns
the set of label pairs

Definition at line 80 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
UniqueLabelsList Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::sameIndices ( const LabelsList otherLabels) const
protected

returns the set of indices of this tensor that can be contracted using dot with those of another given tensor

Parameters
[in]otherLabelsthe other tensor
Returns
the set of labels

Definition at line 69 of file LabeledIndexingDefs.hh.

template<class BasicIndexing >
UniqueLabelsList Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::spinIndices ( ) const

returns only the labels corresponding to spin indices

Returns
the set of labels of the spin indices (squashes repetitions if present)

Definition at line 44 of file LabeledIndexingDefs.hh.

Member Data Documentation

template<class BasicIndexing>
LabelsList Hammer::MultiDimensional::LabeledIndexing< BasicIndexing >::_labels
private

the labels of each tensor index

Definition at line 101 of file LabeledIndexing.hh.


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