#include <tensor_base.h>
Public Types | |
typedef VALUE | value_type |
typedef size_t | size_type |
Public Member Functions | |
Tensor (const bool initialize=true) | |
void | clear () |
const size_type | size () const |
const VALUE | operator[] (const size_type i) const |
VALUE & | operator[] (const size_type i) |
bool | operator== (const Tensor< 1, DIM, VALUE > &) const |
bool | operator!= (const Tensor< 1, DIM, VALUE > &) const |
Tensor< 1, DIM, VALUE > & | operator+= (const Tensor< 1, DIM, VALUE > &) |
void | add (const VALUE s, const Tensor< 1, DIM, VALUE > &T) |
Tensor< 1, DIM, VALUE > & | operator-= (const Tensor< 1, DIM, VALUE > &) |
Tensor< 1, DIM, VALUE > & | operator*= (const VALUE s) |
Tensor< 1, DIM, VALUE > & | operator/= (const VALUE s) |
Tensor< 1, DIM, VALUE > | operator+ (const Tensor< 1, DIM, VALUE > &) const |
Tensor< 1, DIM, VALUE > | operator- (const Tensor< 1, DIM, VALUE > &) const |
Tensor< 1, DIM, VALUE > | operator- () const |
VALUE | operator* (const Tensor< 1, DIM, VALUE > &) 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 = 1 |
Protected Attributes | |
FixedArray1D< VALUE, DIM > | values |
Special version of tensors of rank 1 on the Euclidean space R^d, i.e., vectors of dimension DIM.
typedef size_t MathTL::Tensor< 1, DIM, VALUE >::size_type |
size type
Reimplemented in MathTL::Point< DIM, VALUE >.
typedef VALUE MathTL::Tensor< 1, DIM, VALUE >::value_type |
type of internal storage object: a real number
Reimplemented in MathTL::Point< DIM, VALUE >.
MathTL::Tensor< 1, DIM, VALUE >::Tensor | ( | const bool | initialize = true | ) | [inline, explicit] |
default constructor, yields a zero tensor; it is possible to choose whether the tensor elements are initialized by zero (default behaviour) or not
void MathTL::Tensor< 1, DIM, VALUE >::add | ( | const VALUE | s, |
const Tensor< 1, DIM, VALUE > & | T | ||
) | [inline] |
in place summation *this += s*t
void MathTL::Tensor< 1, DIM, VALUE >::clear | ( | ) | [inline] |
reset Tensor to a zero one, this is equivalent to the state given by the default constructor
const Tensor< 1, DIM, VALUE >::size_type MathTL::Tensor< 1, DIM, VALUE >::memory_consumption | ( | ) | [inline, static] |
estimate memory consumption in bytes
bool MathTL::Tensor< 1, DIM, VALUE >::operator!= | ( | const Tensor< 1, DIM, VALUE > & | T | ) | const [inline] |
non-equality test of two tensors
VALUE MathTL::Tensor< 1, DIM, VALUE >::operator* | ( | const Tensor< 1, DIM, VALUE > & | T | ) | const [inline] |
inner product of two rank 1 tensors (scalar product)
Tensor< 1, DIM, VALUE > & MathTL::Tensor< 1, DIM, VALUE >::operator*= | ( | const VALUE | s | ) | [inline] |
in-place multiplication of a tensor with a scalar from the left
Tensor< 1, DIM, VALUE > MathTL::Tensor< 1, DIM, VALUE >::operator+ | ( | const Tensor< 1, DIM, VALUE > & | T | ) | const [inline] |
sum of two tensors (makes a copy)
Tensor< 1, DIM, VALUE > & MathTL::Tensor< 1, DIM, VALUE >::operator+= | ( | const Tensor< 1, DIM, VALUE > & | T | ) | [inline] |
in-place summation of two tensors
Tensor< 1, DIM, VALUE > MathTL::Tensor< 1, DIM, VALUE >::operator- | ( | const Tensor< 1, DIM, VALUE > & | T | ) | const [inline] |
difference of two tensors (makes a copy)
Tensor< 1, DIM, VALUE > MathTL::Tensor< 1, DIM, VALUE >::operator- | ( | ) | const [inline] |
tensor with negated entries
Tensor< 1, DIM, VALUE > & MathTL::Tensor< 1, DIM, VALUE >::operator-= | ( | const Tensor< 1, DIM, VALUE > & | T | ) | [inline] |
in-place subtraction of two tensors
Tensor< 1, DIM, VALUE > & MathTL::Tensor< 1, DIM, VALUE >::operator/= | ( | const VALUE | s | ) | [inline] |
in-place division of a tensor by a scalar
bool MathTL::Tensor< 1, DIM, VALUE >::operator== | ( | const Tensor< 1, DIM, VALUE > & | T | ) | const [inline] |
equality test of two tensors
const VALUE MathTL::Tensor< 1, DIM, VALUE >::operator[] | ( | const size_type | i | ) | const [inline] |
read-only access to the i-th coordinate
VALUE & MathTL::Tensor< 1, DIM, VALUE >::operator[] | ( | const size_type | i | ) | [inline] |
read-write access to the i-th coordinate
const Tensor< 1, DIM, VALUE >::size_type MathTL::Tensor< 1, DIM, VALUE >::size | ( | ) | const [inline] |
size of the tensor as a vector (cf. std::vector signature)
Reimplemented in MathTL::Point< DIM, VALUE >.
const unsigned int MathTL::Tensor< 1, DIM, VALUE >::dimension = DIM [static] |
dimension of the tensor, available at compile time
const unsigned int MathTL::Tensor< 1, DIM, VALUE >::rank = 1 [static] |
rank of the tensor, available at compile time
FixedArray1D<VALUE,DIM> MathTL::Tensor< 1, DIM, VALUE >::values [protected] |
internal storage for the vector entries