TBCI Numerical high perf. C++ Library 2.8.0
CTensor< T > Class Template Reference

Note (KG, 981214): We don't handle rank == 0. More...

#include <tensor.h>

Inheritance diagram for CTensor< T >:
Collaboration diagram for CTensor< T >:

Public Types

typedef T value_type
typedef T element_type
typedef T aligned_value_type TALIGN(MIN_ALIGN2)

Public Member Functions

 CTensor ()
 CTensor (const unsigned dim_rank)
 CTensor (const Index &ix)
 CTensor (const T &value, const Index &ix)
 CTensor (const CTensor &ct)
 CTensor (vararg va,...)
 CTensor (const T, vararg va,...)
 ~CTensor ()
unsigned long calc_offs (const Index &ix) const
Index calc_indx (const unsigned long i) const
Toperator() (const Index &ix)
tbci_traits< T >::const_refval_type operator() (const Index &ix) const
Toperator() (vararg va,...)
tbci_traits< T >::const_refval_type operator() (vararg va,...) const
Toperator() (const unsigned long i)
tbci_traits< T >::const_refval_type operator() (const unsigned long i) const
const Tgetcref (vararg va,...) const
Tget_lin_idx (const unsigned long i)
tbci_traits< T >::const_refval_type get_lin_idx (const unsigned long i) const
unsigned lin_read (vararg va,...)
CTensor< T > & transpose (const unsigned i, const unsigned j)
CTensor< T > & fill (const T &value)
CTensor< T > & operator= (const CTensor< T > &ct)
CTensor< T > & operator= (const T &value)
CTensor< T > & resize (const Index &ix)
CTensor< T > & resize (const T &val, const Index &ix)
CTensor< T > & resize (const CTensor< T > &ct)
T max (unsigned long &pos) const
T min (unsigned long &pos) const
T max () const
T min () const
T trace () const
bool operator== (const CTensor< T > &ct)
bool operator!= (const CTensor< T > &ct)
unsigned long lin_size (void) const
Index index_size (void) const
unsigned rank_size (void) const

Protected Member Functions

unsigned long calcsize (void)
unsigned calclayout ()

Protected Attributes

Vector< Tdata
unsigned rank
unsigned long noel
Index shape
Index layout

Friends

STD__ ostream & operator<<FGD (STD__ ostream &, const CTensor< T > &)
STD__ istream & operator>>FGD (STD__ istream &, CTensor< T > &)

Detailed Description

template<typename T>
class CTensor< T >

Note (KG, 981214): We don't handle rank == 0.

container class without arithmetics

Definition at line 51 of file tensor.h.

Member Typedef Documentation

◆ element_type

template<typename T>
typedef T CTensor< T >::element_type

Definition at line 81 of file tensor.h.

◆ TALIGN

template<typename T>
typedef T aligned_value_type CTensor< T >::TALIGN(MIN_ALIGN2)

Definition at line 82 of file tensor.h.

◆ value_type

template<typename T>
typedef T CTensor< T >::value_type

Definition at line 80 of file tensor.h.

Constructor & Destructor Documentation

◆ CTensor() [1/7]

template<typename T>
CTensor< T >::CTensor ( )
inline

◆ CTensor() [2/7]

template<typename T>
CTensor< T >::CTensor ( const unsigned dim_rank)
inlineexplicit

Definition at line 221 of file tensor.h.

References calclayout(), calcsize(), data, layout, noel, rank, and shape.

◆ CTensor() [3/7]

template<typename T>
CTensor< T >::CTensor ( const Index & ix)
inline

Definition at line 230 of file tensor.h.

References calclayout(), calcsize(), data, layout, noel, rank, and shape.

◆ CTensor() [4/7]

template<typename T>
CTensor< T >::CTensor ( const T & value,
const Index & ix )
inline

Definition at line 239 of file tensor.h.

References calclayout(), calcsize(), data, layout, noel, rank, shape, and T.

◆ CTensor() [5/7]

template<typename T>
CTensor< T >::CTensor ( const CTensor< T > & ct)
inline

Definition at line 250 of file tensor.h.

References CTensor(), data, layout, noel, rank, and shape.

◆ CTensor() [6/7]

template<typename T>
CTensor< T >::CTensor ( vararg va,
... )
inline

Definition at line 271 of file tensor.h.

References calclayout(), calcsize(), data, i, layout, noel, rank, and shape.

◆ CTensor() [7/7]

template<typename T>
CTensor< T >::CTensor ( const T value,
vararg va,
... )
inline

Definition at line 257 of file tensor.h.

References calclayout(), calcsize(), data, i, layout, noel, rank, shape, and T.

◆ ~CTensor()

template<typename T>
CTensor< T >::~CTensor ( )
inline

Definition at line 92 of file tensor.h.

Member Function Documentation

◆ calc_indx()

template<typename T>
Index CTensor< T >::calc_indx ( const unsigned long i) const
inline

Definition at line 334 of file tensor.h.

References BCHK, Vector< T >::fill(), i, index, large, layout, noel, rank, and shape.

◆ calc_offs()

template<typename T>
unsigned long CTensor< T >::calc_offs ( const Index & ix) const
inline

◆ calclayout()

template<typename T>
unsigned CTensor< T >::calclayout ( )
inlineprotected

Definition at line 67 of file tensor.h.

References fac, i, layout, rank, REGISTER, and shape.

Referenced by CTensor(), CTensor(), CTensor(), CTensor(), CTensor(), resize(), resize(), Tensor< T >::Tensor(), and Tensor< T >::Tensor().

◆ calcsize()

template<typename T>
unsigned long CTensor< T >::calcsize ( void )
inlineprotected

Definition at line 60 of file tensor.h.

References i, noel, rank, REGISTER, and shape.

Referenced by CTensor(), CTensor(), CTensor(), CTensor(), CTensor(), resize(), resize(), Tensor< T >::Tensor(), and Tensor< T >::Tensor().

◆ fill()

template<typename T>
CTensor< T > & CTensor< T >::fill ( const T & value)
inline

Definition at line 140 of file tensor.h.

References data, and T.

Referenced by operator=(), and F_TMatrix< T >::operator=().

◆ get_lin_idx() [1/2]

template<typename T>
T & CTensor< T >::get_lin_idx ( const unsigned long i)
inline

Definition at line 120 of file tensor.h.

References i, and T.

◆ get_lin_idx() [2/2]

template<typename T>
tbci_traits< T >::const_refval_type CTensor< T >::get_lin_idx ( const unsigned long i) const
inline

Definition at line 123 of file tensor.h.

References i.

◆ getcref()

template<typename T>
const T & CTensor< T >::getcref ( vararg va,
... ) const

Definition at line 445 of file tensor.h.

References BCHK, data, i, layout, rank, and T.

◆ index_size()

template<typename T>
Index CTensor< T >::index_size ( void ) const
inline

Definition at line 207 of file tensor.h.

References shape.

◆ lin_read()

template<typename T>
unsigned CTensor< T >::lin_read ( vararg va,
... )

Definition at line 285 of file tensor.h.

References data, i, and T.

◆ lin_size()

template<typename T>
unsigned long CTensor< T >::lin_size ( void ) const
inline

Definition at line 205 of file tensor.h.

References noel.

◆ max() [1/2]

template<typename T>
T CTensor< T >::max ( ) const
inline

Definition at line 180 of file tensor.h.

References data, and T.

◆ max() [2/2]

template<typename T>
T CTensor< T >::max ( unsigned long & pos) const
inline

Definition at line 177 of file tensor.h.

References data, and T.

◆ min() [1/2]

template<typename T>
T CTensor< T >::min ( ) const
inline

Definition at line 181 of file tensor.h.

References data, and T.

◆ min() [2/2]

template<typename T>
T CTensor< T >::min ( unsigned long & pos) const
inline

Definition at line 178 of file tensor.h.

References data, and T.

◆ operator!=()

template<typename T>
bool CTensor< T >::operator!= ( const CTensor< T > & ct)
inline

Definition at line 201 of file tensor.h.

References operator==().

◆ operator()() [1/6]

template<typename T>
T & CTensor< T >::operator() ( const Index & ix)
inline

Definition at line 101 of file tensor.h.

References calc_offs(), data, and T.

◆ operator()() [2/6]

template<typename T>
tbci_traits< T >::const_refval_type CTensor< T >::operator() ( const Index & ix) const
inline

Definition at line 104 of file tensor.h.

References calc_offs(), and data.

◆ operator()() [3/6]

template<typename T>
T & CTensor< T >::operator() ( const unsigned long i)
inline

Definition at line 110 of file tensor.h.

References BCHKNR, data, i, noel, and T.

◆ operator()() [4/6]

template<typename T>
tbci_traits< T >::const_refval_type CTensor< T >::operator() ( const unsigned long i) const
inline

Definition at line 114 of file tensor.h.

References BCHKNR, c, data, i, and noel.

◆ operator()() [5/6]

template<typename T>
T & CTensor< T >::operator() ( vararg va,
... )

Definition at line 416 of file tensor.h.

References BCHK, data, i, layout, rank, and T.

◆ operator()() [6/6]

template<typename T>
tbci_traits< T >::const_refval_type CTensor< T >::operator() ( vararg va,
... ) const

Definition at line 430 of file tensor.h.

References BCHK, data, i, layout, and rank.

◆ operator=() [1/2]

template<typename T>
CTensor< T > & CTensor< T >::operator= ( const CTensor< T > & ct)
inline

Definition at line 144 of file tensor.h.

References data, layout, noel, rank, and shape.

◆ operator=() [2/2]

template<typename T>
CTensor< T > & CTensor< T >::operator= ( const T & value)
inline

Definition at line 151 of file tensor.h.

References fill(), and T.

◆ operator==()

template<typename T>
bool CTensor< T >::operator== ( const CTensor< T > & ct)
inline

Definition at line 186 of file tensor.h.

References data, layout, Index::next_idx(), rank, and shape.

Referenced by operator!=().

◆ rank_size()

template<typename T>
unsigned CTensor< T >::rank_size ( void ) const
inline

Definition at line 209 of file tensor.h.

References rank.

◆ resize() [1/3]

template<typename T>
CTensor< T > & CTensor< T >::resize ( const CTensor< T > & ct)
inline

Definition at line 169 of file tensor.h.

References CTensor(), data, layout, noel, rank, and shape.

◆ resize() [2/3]

template<typename T>
CTensor< T > & CTensor< T >::resize ( const Index & ix)
inline

Definition at line 155 of file tensor.h.

References calclayout(), calcsize(), CTensor(), data, layout, noel, rank, shape, and TVector< T >::size().

◆ resize() [3/3]

template<typename T>
CTensor< T > & CTensor< T >::resize ( const T & val,
const Index & ix )
inline

Definition at line 162 of file tensor.h.

References calclayout(), calcsize(), CTensor(), data, layout, noel, rank, shape, TVector< T >::size(), and T.

◆ trace()

template<typename T>
T CTensor< T >::trace ( ) const
inline

Definition at line 183 of file tensor.h.

References T.

◆ transpose()

template<typename T>
CTensor< T > & CTensor< T >::transpose ( const unsigned i,
const unsigned j )
inline

Definition at line 131 of file tensor.h.

References BCHK, CTensor(), i, layout, rank, and shape.

◆ operator<<FGD

template<typename T>
STD__ ostream & operator<<FGD ( STD__ ostream & ,
const CTensor< T > &  )
friend

References STD__.

◆ operator>>FGD

template<typename T>
STD__ istream & operator>>FGD ( STD__ istream & ,
CTensor< T > &  )
friend

References STD__.

Member Data Documentation

◆ data

◆ layout

◆ noel

◆ rank

◆ shape


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