TBCI Numerical high perf. C++ Library  2.8.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CTensor< T > Class Template Reference

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

#include <tensor.h>

Inheritance diagram for CTensor< T >:
Inheritance graph
[legend]
Collaboration diagram for CTensor< T >:
Collaboration graph
[legend]

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

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

Definition at line 81 of file tensor.h.

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

Definition at line 82 of file tensor.h.

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

Definition at line 80 of file tensor.h.

Constructor & Destructor Documentation

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

Definition at line 84 of file tensor.h.

References CTensor< T >::rank.

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

Definition at line 221 of file tensor.h.

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

Definition at line 230 of file tensor.h.

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

Definition at line 239 of file tensor.h.

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

Definition at line 250 of file tensor.h.

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

Definition at line 92 of file tensor.h.

Member Function Documentation

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, and large.

template<typename T >
unsigned long CTensor< T >::calc_offs ( const Index ix) const
inline
template<typename T>
unsigned CTensor< T >::calclayout ( )
inlineprotected
template<typename T>
unsigned long CTensor< T >::calcsize ( void  )
inlineprotected
template<typename T>
CTensor<T>& CTensor< T >::fill ( const T value)
inline

Definition at line 140 of file tensor.h.

References CTensor< T >::data.

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

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

Definition at line 120 of file tensor.h.

References i.

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.

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

Definition at line 445 of file tensor.h.

References BCHK, and i.

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

Definition at line 207 of file tensor.h.

References CTensor< T >::shape.

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

Definition at line 285 of file tensor.h.

References i, and T.

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

Definition at line 205 of file tensor.h.

References CTensor< T >::noel.

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

Definition at line 177 of file tensor.h.

References CTensor< T >::data.

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

Definition at line 180 of file tensor.h.

References CTensor< T >::data.

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

Definition at line 178 of file tensor.h.

References CTensor< T >::data.

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

Definition at line 181 of file tensor.h.

References CTensor< T >::data.

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

Definition at line 201 of file tensor.h.

References CTensor< T >::operator==().

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

Definition at line 101 of file tensor.h.

References CTensor< T >::calc_offs(), and CTensor< T >::data.

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 CTensor< T >::calc_offs(), and CTensor< T >::data.

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

Definition at line 416 of file tensor.h.

References BCHK, and i.

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, and i.

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

Definition at line 110 of file tensor.h.

References BCHKNR, CTensor< T >::data, and CTensor< T >::noel.

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, CTensor< T >::data, and CTensor< T >::noel.

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

Definition at line 151 of file tensor.h.

References CTensor< T >::fill().

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

Definition at line 209 of file tensor.h.

References CTensor< T >::rank.

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

Definition at line 183 of file tensor.h.

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< T >::layout, CTensor< T >::rank, CTensor< T >::shape, and TBCI::SWAP().

Friends And Related Function Documentation

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

Member Data Documentation

template<typename T>
Vector<T> CTensor< T >::data
protected
template<typename T>
Index CTensor< T >::layout
protected
template<typename T>
unsigned long CTensor< T >::noel
protected
template<typename T>
unsigned CTensor< T >::rank
protected
template<typename T>
Index CTensor< T >::shape
protected

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