#include <tensor.h>
Public Types | |
typedef Tensor< RANK-1, DIM, VALUE > | value_type |
typedef size_t | size_type |
Public Member Functions | |
Tensor () | |
void | clear () |
const Tensor< RANK-1, DIM, VALUE > & | operator[] (const size_type i) const |
Tensor< RANK-1, DIM, VALUE > & | operator[] (const size_type i) |
Tensor< RANK, DIM, VALUE > & | operator= (const Tensor< RANK, DIM, VALUE > &) |
bool | operator== (const Tensor< RANK, DIM, VALUE > &) const |
bool | operator!= (const Tensor< RANK, DIM, VALUE > &) const |
Tensor< RANK, DIM, VALUE > & | operator+= (const Tensor< RANK, DIM, VALUE > &) |
void | add (const VALUE s, const Tensor< RANK, DIM, VALUE > &T) |
Tensor< RANK, DIM, VALUE > & | operator-= (const Tensor< RANK, DIM, VALUE > &) |
Tensor< RANK, DIM, VALUE > & | operator*= (const VALUE s) |
Tensor< RANK, DIM, VALUE > & | operator/= (const VALUE s) |
Tensor< RANK, DIM, VALUE > | operator+ (const Tensor< RANK, DIM, VALUE > &) const |
Tensor< RANK, DIM, VALUE > | operator- (const Tensor< RANK, DIM, VALUE > &) const |
Tensor< RANK, DIM, VALUE > | operator- () const |
Static Public Member Functions | |
static const size_type | memory_consumption () |
Static Public Attributes | |
static const unsigned int | dimension = DIM |
static const unsigned int | rank = RANK |
Protected Attributes | |
Tensor< RANK-1, DIM, VALUE > | subtensor [DIM] |
This class models tensors of an arbitrary rank r on the Euclidean space R^d. Most functionality can be handed over to tensors of lower-dimensional rank. Tensors of rank 1 are modeled via template specialization in tensor_base.h .
typedef size_t MathTL::Tensor< RANK, DIM, VALUE >::size_type |
size type
Reimplemented in MathTL::Point< DIM >, and MathTL::Point< 2 >.
typedef Tensor<RANK-1, DIM, VALUE> MathTL::Tensor< RANK, DIM, VALUE >::value_type |
type of internal storage object, due to the recursive structure it is just a tensor with lower rank
Reimplemented in MathTL::Point< DIM >, and MathTL::Point< 2 >.
MathTL::Tensor< RANK, DIM, VALUE >::Tensor | ( | ) | [inline] |
default constructor, yields a zero tensor
void MathTL::Tensor< RANK, DIM, VALUE >::add | ( | const VALUE | s, |
const Tensor< RANK, DIM, VALUE > & | T | ||
) | [inline] |
in place summation *this += s*t
void MathTL::Tensor< RANK, DIM, VALUE >::clear | ( | ) | [inline] |
reset Tensor to a zero one, this is equivalent to the state given by the default constructor
const Tensor< RANK, DIM, VALUE >::size_type MathTL::Tensor< RANK, DIM, VALUE >::memory_consumption | ( | ) | [inline, static] |
estimate memory consumption in bytes
bool MathTL::Tensor< RANK, DIM, VALUE >::operator!= | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | const [inline] |
non-equality test of two tensors
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator*= | ( | const VALUE | s | ) | [inline] |
in-place multiplication of a tensor with a scalar from the left
Tensor< RANK, DIM, VALUE > MathTL::Tensor< RANK, DIM, VALUE >::operator+ | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | const [inline] |
sum of two tensors (makes a copy)
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator+= | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | [inline] |
in-place sum of two tensors
Tensor< RANK, DIM, VALUE > MathTL::Tensor< RANK, DIM, VALUE >::operator- | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | const [inline] |
difference of two tensors (makes a copy)
Tensor< RANK, DIM, VALUE > MathTL::Tensor< RANK, DIM, VALUE >::operator- | ( | ) | const [inline] |
tensor with negated entries
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator-= | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | [inline] |
in-place difference of two tensors
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator/= | ( | const VALUE | s | ) | [inline] |
in-place division of a tensor by a scalar
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator= | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | [inline] |
assignment of a tensor
bool MathTL::Tensor< RANK, DIM, VALUE >::operator== | ( | const Tensor< RANK, DIM, VALUE > & | T | ) | const [inline] |
equality test of two tensors
const Tensor< RANK, DIM, VALUE >::value_type & MathTL::Tensor< RANK, DIM, VALUE >::operator[] | ( | const size_type | i | ) | const [inline] |
read-only access to the subtensors
Tensor< RANK, DIM, VALUE >::value_type & MathTL::Tensor< RANK, DIM, VALUE >::operator[] | ( | const size_type | i | ) | [inline] |
read-write access to the subtensors
const unsigned int MathTL::Tensor< RANK, DIM, VALUE >::dimension = DIM [static] |
dimension of the tensor, available at compile time
const unsigned int MathTL::Tensor< RANK, DIM, VALUE >::rank = RANK [static] |
rank of the tensor, available at compile time