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

Tensor class including arithmetics. More...

#include <f_matrix.h>

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

Public Types

typedef T value_type
 
typedef T element_type
 
typedef T aligned_value_type TALIGN (MIN_ALIGN2)
 
- Public Types inherited from CTensor< T >
typedef T value_type
 
typedef T element_type
 
typedef T aligned_value_type TALIGN (MIN_ALIGN2)
 

Public Member Functions

 Tensor ()
 
 Tensor (const unsigned dim_rank)
 
 Tensor (const Index &ix)
 
 Tensor (const T &value, const Index &ix)
 
 Tensor (const Tensor< T > &ct)
 
 Tensor (vararg va,...)
 
 Tensor (const T, vararg va,...)
 
 ~Tensor ()
 
Tensor< T > & operator+= (const Tensor< T > &)
 
Tensor< T > & operator-= (const Tensor< T > &)
 
Tensor< Toperator+ (const Tensor< T > &) const
 
Tensor< Toperator- (const Tensor< T > &) const
 
Tensor< T > & operator*= (const T m)
 
Tensor< T > & operator/= (const T m)
 
Tensor< T > & operator+= (const T m)
 
Tensor< T > & operator-= (const T m)
 
Tensor< Toperator* (const T m) const
 
Tensor< Tmult (const T) const
 
Tensor< Toperator/ (const T m) const
 
Tensor< Toperator- () const
 
Tensor< Tcontract (const unsigned, const unsigned) const
 
Tensor< Tdrctmul (const Tensor< T > &) const
 
Tensor< Tcntrmul (const Tensor< T > &, const unsigned, const unsigned) const
 
- Public Member Functions inherited from CTensor< T >
 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
 

Friends

Tensor< T > FRIEND_TBCI2__ dctmul FGD (const Tensor< T > &, const Tensor< T > &)
 
Tensor< T > FRIEND_TBCI2__ ctrmul FGD (const Tensor< T > &, const Tensor< T > &, const unsigned, const unsigned)
 
Tensor< T > FRIEND_TBCI2__ metrmul FGD (const Tensor< T > &, const Tensor< T > &, const unsigned, const unsigned)
 

Additional Inherited Members

- Protected Member Functions inherited from CTensor< T >
unsigned long calcsize (void)
 
unsigned calclayout ()
 
- Protected Attributes inherited from CTensor< T >
Vector< Tdata
 
unsigned rank
 
unsigned long noel
 
Index shape
 
Index layout
 

Detailed Description

template<typename T>
class Tensor< T >

Tensor class including arithmetics.

Definition at line 53 of file f_matrix.h.

Member Typedef Documentation

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

Definition at line 475 of file tensor.h.

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

Definition at line 476 of file tensor.h.

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

Definition at line 474 of file tensor.h.

Constructor & Destructor Documentation

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

Definition at line 478 of file tensor.h.

template<typename T>
Tensor< T >::Tensor ( const unsigned  dim_rank)
inline

Definition at line 479 of file tensor.h.

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

Definition at line 480 of file tensor.h.

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

Definition at line 481 of file tensor.h.

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

Definition at line 482 of file tensor.h.

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

Definition at line 563 of file tensor.h.

References i, and CTensor< T >::resize().

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

Definition at line 546 of file tensor.h.

References i, and CTensor< T >::resize().

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

Definition at line 485 of file tensor.h.

Member Function Documentation

template<typename T >
Tensor< T > Tensor< T >::cntrmul ( const Tensor< T > &  t2,
const unsigned  i1,
const unsigned  i2 
) const
template<typename T >
Tensor< T > Tensor< T >::contract ( const unsigned  i1,
const unsigned  i2 
) const
template<typename T >
Tensor< T > Tensor< T >::drctmul ( const Tensor< T > &  t1) const
template<typename T >
Tensor< T > Tensor< T >::mult ( const T  m) const

Definition at line 817 of file tensor.h.

References CTensor< T >::data, i, and res.

Referenced by operator*().

template<typename T>
Tensor<T> Tensor< T >::operator* ( const T  m) const
inline

Definition at line 499 of file tensor.h.

References CTensor< T >::data, i, CTensor< T >::noel, and CTensor< T >::shape.

template<typename T>
Tensor<T>& Tensor< T >::operator*= ( const T  m)
inline

Definition at line 494 of file tensor.h.

References CTensor< T >::data.

template<typename T >
Tensor< T > Tensor< T >::operator+ ( const Tensor< T > &  t) const
template<typename T >
Tensor< T > & Tensor< T >::operator+= ( const Tensor< T > &  t)
template<typename T>
Tensor<T>& Tensor< T >::operator+= ( const T  m)
inline

Definition at line 496 of file tensor.h.

References CTensor< T >::data.

template<typename T >
Tensor< T > Tensor< T >::operator- ( const Tensor< T > &  t) const
template<typename T>
Tensor<T> Tensor< T >::operator- ( ) const
inline

Definition at line 519 of file tensor.h.

References CTensor< T >::data, i, CTensor< T >::noel, and CTensor< T >::shape.

template<typename T >
Tensor< T > & Tensor< T >::operator-= ( const Tensor< T > &  t)
template<typename T>
Tensor<T>& Tensor< T >::operator-= ( const T  m)
inline

Definition at line 497 of file tensor.h.

References CTensor< T >::data.

template<typename T>
Tensor<T> Tensor< T >::operator/ ( const T  m) const
inline

Definition at line 511 of file tensor.h.

References CTensor< T >::data, i, CTensor< T >::noel, and CTensor< T >::shape.

template<typename T>
Tensor<T>& Tensor< T >::operator/= ( const T  m)
inline

Definition at line 495 of file tensor.h.

References CTensor< T >::data.

Friends And Related Function Documentation

template<typename T>
Tensor<T> FRIEND_TBCI2__ dctmul FGD ( const Tensor< T > &  ,
const Tensor< T > &   
)
friend
template<typename T>
Tensor<T> FRIEND_TBCI2__ ctrmul FGD ( const Tensor< T > &  ,
const Tensor< T > &  ,
const unsigned  ,
const unsigned   
)
friend
template<typename T>
Tensor<T> FRIEND_TBCI2__ metrmul FGD ( const Tensor< T > &  ,
const Tensor< T > &  ,
const unsigned  ,
const unsigned   
)
friend

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