AmpGen 2.1
Loading...
Searching...
No Matches
AmpGen::Tensor Class Reference

Detailed Description

Definition at line 30 of file Tensor.h.

Classes

struct  Dim
 
class  Index
 

Public Member Functions

 Tensor ()
 
 Tensor (const std::vector< Expression > &elements)
 
 Tensor (const std::vector< unsigned > &dim)
 
 Tensor (const Tensor::Dim &dim)
 
template<class TYPE>
 Tensor (const std::initializer_list< TYPE > &elements, const std::vector< unsigned > &dim)
 
template<class TYPE>
 Tensor (const std::vector< TYPE > &elements, const std::vector< unsigned > &dim)
 
Expressionoperator[] (const unsigned &i)
 Low level access of elements, either by coordinates or by index ///.
 
Expressionoperator[] (const std::vector< unsigned > &co)
 
const Expressionoperator[] (const unsigned &i) const
 
const Expressionoperator[] (const std::vector< unsigned > &co) const
 
Expression get (const unsigned &co)
 
Expression get (const unsigned &co) const
 
Expression get (const std::vector< unsigned > &_co) const
 
Expressionoperator() (const unsigned &a)
 TensorProxy access to class members High level access is done via these commands, i.e.
 
Expressionoperator() (const unsigned &a, const unsigned &b)
 
const Expression operator() (const unsigned &a) const
 
const Expressionoperator() (const unsigned &a, const unsigned &b) const
 
TensorProxy operator() (const Tensor::Index &a) const
 
TensorProxy operator() (const Tensor::Index &a, const Tensor::Index &b) const
 
TensorProxy operator() (const Tensor::Index &a, const Tensor::Index &b, const Tensor::Index &c) const
 
TensorProxy operator() (const Tensor::Index &a, const Tensor::Index &b, const Tensor::Index &c, const Tensor::Index &d) const
 
TensorProxy operator() (const std::vector< Tensor::Index > &indices) const
 
Tensor operator- () const
 
void st (const bool simplify=false)
 
bool rankMatches (const Tensor &other)
 
void imposeSymmetry (unsigned indexA, unsigned indexB)
 
void imposeSymmetry (std::vector< unsigned > indices)
 
Tensor Invert () const
 
std::string to_string (const ASTResolver *resolver=nullptr) const
 
int metricSgn (const std::vector< unsigned > &coordinates) const
 
int metricSgn (const unsigned &index) const
 
void append (const Expression &expression)
 
void append (const real_t &value)
 
void append (const complex_t &value)
 
void append (const std::string &value)
 
void setupCoordinates ()
 
unsigned nDim () const
 
unsigned rank () const
 
unsigned size () const
 
unsigned index (const std::vector< unsigned > &_co) const
 
unsigned symmetrisedIndex (const std::vector< unsigned > &_co) const
 
unsigned nElements () const
 
const std::vector< unsigned > coords (const unsigned &index) const
 
const std::vector< unsigned > & dims () const
 
const std::string dimString () const
 
void print (const bool &eval=false) const
 
const std::vector< unsigned > & uniqueElements () const
 
void operator+= (const Tensor &rhs)
 
void operator-= (const Tensor &rhs)
 
Tensor conjugate () const
 

Static Public Member Functions

static std::vector< unsigned > index_to_coordinates (const unsigned &index, const std::vector< unsigned > &dim)
 
static unsigned coordinates_to_index (const std::vector< unsigned > &coords, const std::vector< unsigned > &dim)
 
static std::string coordinates_to_string (const std::vector< unsigned > &coordinates)
 
template<class... ARGS>
static std::vector< unsigned > dim (const ARGS &... args)
 

Constructor & Destructor Documentation

◆ Tensor() [1/6]

AmpGen::Tensor::Tensor ( )

◆ Tensor() [2/6]

AmpGen::Tensor::Tensor ( const std::vector< Expression > & elements)
explicit

◆ Tensor() [3/6]

AmpGen::Tensor::Tensor ( const std::vector< unsigned > & dim)
explicit

◆ Tensor() [4/6]

AmpGen::Tensor::Tensor ( const Tensor::Dim & dim)
inlineexplicit

Definition at line 58 of file Tensor.h.

◆ Tensor() [5/6]

template<class TYPE>
AmpGen::Tensor::Tensor ( const std::initializer_list< TYPE > & elements,
const std::vector< unsigned > & dim )
inline

Definition at line 60 of file Tensor.h.

◆ Tensor() [6/6]

template<class TYPE>
AmpGen::Tensor::Tensor ( const std::vector< TYPE > & elements,
const std::vector< unsigned > & dim )
inline

Definition at line 67 of file Tensor.h.

Member Function Documentation

◆ append() [1/4]

void AmpGen::Tensor::append ( const complex_t & value)

◆ append() [2/4]

void AmpGen::Tensor::append ( const Expression & expression)

◆ append() [3/4]

void AmpGen::Tensor::append ( const real_t & value)

◆ append() [4/4]

void AmpGen::Tensor::append ( const std::string & value)

◆ conjugate()

Tensor AmpGen::Tensor::conjugate ( ) const

◆ coordinates_to_index()

static unsigned AmpGen::Tensor::coordinates_to_index ( const std::vector< unsigned > & coords,
const std::vector< unsigned > & dim )
static

◆ coordinates_to_string()

static std::string AmpGen::Tensor::coordinates_to_string ( const std::vector< unsigned > & coordinates)
static

◆ coords()

const std::vector< unsigned > AmpGen::Tensor::coords ( const unsigned & index) const

◆ dim()

template<class... ARGS>
static std::vector< unsigned > AmpGen::Tensor::dim ( const ARGS &... args)
inlinestatic

Definition at line 140 of file Tensor.h.

◆ dims()

const std::vector< unsigned > & AmpGen::Tensor::dims ( ) const
inline

Definition at line 126 of file Tensor.h.

◆ dimString()

const std::string AmpGen::Tensor::dimString ( ) const

◆ get() [1/3]

Expression AmpGen::Tensor::get ( const std::vector< unsigned > & _co) const

◆ get() [2/3]

Expression AmpGen::Tensor::get ( const unsigned & co)

◆ get() [3/3]

Expression AmpGen::Tensor::get ( const unsigned & co) const

◆ imposeSymmetry() [1/2]

void AmpGen::Tensor::imposeSymmetry ( std::vector< unsigned > indices)

◆ imposeSymmetry() [2/2]

void AmpGen::Tensor::imposeSymmetry ( unsigned indexA,
unsigned indexB )

◆ index()

unsigned AmpGen::Tensor::index ( const std::vector< unsigned > & _co) const

◆ index_to_coordinates()

static std::vector< unsigned > AmpGen::Tensor::index_to_coordinates ( const unsigned & index,
const std::vector< unsigned > & dim )
static

◆ Invert()

Tensor AmpGen::Tensor::Invert ( ) const

◆ metricSgn() [1/2]

int AmpGen::Tensor::metricSgn ( const std::vector< unsigned > & coordinates) const

◆ metricSgn() [2/2]

int AmpGen::Tensor::metricSgn ( const unsigned & index) const

◆ nDim()

unsigned AmpGen::Tensor::nDim ( ) const

◆ nElements()

unsigned AmpGen::Tensor::nElements ( ) const

◆ operator()() [1/9]

TensorProxy AmpGen::Tensor::operator() ( const std::vector< Tensor::Index > & indices) const

◆ operator()() [2/9]

TensorProxy AmpGen::Tensor::operator() ( const Tensor::Index & a) const

◆ operator()() [3/9]

TensorProxy AmpGen::Tensor::operator() ( const Tensor::Index & a,
const Tensor::Index & b ) const

◆ operator()() [4/9]

TensorProxy AmpGen::Tensor::operator() ( const Tensor::Index & a,
const Tensor::Index & b,
const Tensor::Index & c ) const

◆ operator()() [5/9]

TensorProxy AmpGen::Tensor::operator() ( const Tensor::Index & a,
const Tensor::Index & b,
const Tensor::Index & c,
const Tensor::Index & d ) const

◆ operator()() [6/9]

Expression & AmpGen::Tensor::operator() ( const unsigned & a)
inline

() operators

Definition at line 87 of file Tensor.h.

◆ operator()() [7/9]

const Expression AmpGen::Tensor::operator() ( const unsigned & a) const
inline

Definition at line 89 of file Tensor.h.

◆ operator()() [8/9]

Expression & AmpGen::Tensor::operator() ( const unsigned & a,
const unsigned & b )
inline

Definition at line 88 of file Tensor.h.

◆ operator()() [9/9]

const Expression & AmpGen::Tensor::operator() ( const unsigned & a,
const unsigned & b ) const
inline

Definition at line 90 of file Tensor.h.

◆ operator+=()

void AmpGen::Tensor::operator+= ( const Tensor & rhs)

◆ operator-()

Tensor AmpGen::Tensor::operator- ( ) const

◆ operator-=()

void AmpGen::Tensor::operator-= ( const Tensor & rhs)

◆ operator[]() [1/4]

Expression & AmpGen::Tensor::operator[] ( const std::vector< unsigned > & co)

◆ operator[]() [2/4]

const Expression & AmpGen::Tensor::operator[] ( const std::vector< unsigned > & co) const

◆ operator[]() [3/4]

Expression & AmpGen::Tensor::operator[] ( const unsigned & i)

◆ operator[]() [4/4]

const Expression & AmpGen::Tensor::operator[] ( const unsigned & i) const

◆ print()

void AmpGen::Tensor::print ( const bool & eval = false) const

◆ rank()

unsigned AmpGen::Tensor::rank ( ) const

◆ rankMatches()

bool AmpGen::Tensor::rankMatches ( const Tensor & other)

◆ setupCoordinates()

void AmpGen::Tensor::setupCoordinates ( )

◆ size()

unsigned AmpGen::Tensor::size ( ) const

◆ st()

void AmpGen::Tensor::st ( const bool simplify = false)

◆ symmetrisedIndex()

unsigned AmpGen::Tensor::symmetrisedIndex ( const std::vector< unsigned > & _co) const

◆ to_string()

std::string AmpGen::Tensor::to_string ( const ASTResolver * resolver = nullptr) const

◆ uniqueElements()

const std::vector< unsigned > & AmpGen::Tensor::uniqueElements ( ) const
inline

Definition at line 131 of file Tensor.h.


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