MathTL
 All Classes Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes
MathTL::Tensor< RANK, DIM, VALUE > Class Template Reference

#include <tensor.h>

List of all members.

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]

Detailed Description

template<unsigned int RANK, unsigned int DIM, class VALUE = double>
class MathTL::Tensor< RANK, DIM, VALUE >

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 .


Member Typedef Documentation

template<unsigned int RANK, unsigned int DIM, class VALUE = double>
typedef size_t MathTL::Tensor< RANK, DIM, VALUE >::size_type

size type

Reimplemented in MathTL::Point< DIM >, and MathTL::Point< 2 >.

template<unsigned int RANK, unsigned int DIM, class VALUE = double>
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 >.


Constructor & Destructor Documentation

template<unsigned int RANK, unsigned int DIM, class VALUE >
MathTL::Tensor< RANK, DIM, VALUE >::Tensor ( ) [inline]

default constructor, yields a zero tensor


Member Function Documentation

template<unsigned int RANK, unsigned int DIM, class VALUE>
void MathTL::Tensor< RANK, DIM, VALUE >::add ( const VALUE  s,
const Tensor< RANK, DIM, VALUE > &  T 
) [inline]

in place summation *this += s*t

template<unsigned int RANK, unsigned int DIM, class VALUE >
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

template<unsigned int RANK, unsigned int DIM, class VALUE >
const Tensor< RANK, DIM, VALUE >::size_type MathTL::Tensor< RANK, DIM, VALUE >::memory_consumption ( ) [inline, static]

estimate memory consumption in bytes

template<unsigned int RANK, unsigned int DIM, class VALUE>
bool MathTL::Tensor< RANK, DIM, VALUE >::operator!= ( const Tensor< RANK, DIM, VALUE > &  T) const [inline]

non-equality test of two tensors

template<unsigned int RANK, unsigned int DIM, class VALUE>
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

template<unsigned int RANK, unsigned int DIM, class VALUE>
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)

template<unsigned int RANK, unsigned int DIM, class VALUE>
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator+= ( const Tensor< RANK, DIM, VALUE > &  T) [inline]

in-place sum of two tensors

template<unsigned int RANK, unsigned int DIM, class VALUE>
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)

template<unsigned int RANK, unsigned int DIM, class VALUE>
Tensor< RANK, DIM, VALUE > MathTL::Tensor< RANK, DIM, VALUE >::operator- ( ) const [inline]

tensor with negated entries

template<unsigned int RANK, unsigned int DIM, class VALUE>
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator-= ( const Tensor< RANK, DIM, VALUE > &  T) [inline]

in-place difference of two tensors

template<unsigned int RANK, unsigned int DIM, class VALUE>
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator/= ( const VALUE  s) [inline]

in-place division of a tensor by a scalar

template<unsigned int RANK, unsigned int DIM, class VALUE>
Tensor< RANK, DIM, VALUE > & MathTL::Tensor< RANK, DIM, VALUE >::operator= ( const Tensor< RANK, DIM, VALUE > &  T) [inline]

assignment of a tensor

template<unsigned int RANK, unsigned int DIM, class VALUE>
bool MathTL::Tensor< RANK, DIM, VALUE >::operator== ( const Tensor< RANK, DIM, VALUE > &  T) const [inline]

equality test of two tensors

template<unsigned int RANK, unsigned int DIM, class VALUE >
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

template<unsigned int RANK, unsigned int DIM, class VALUE >
Tensor< RANK, DIM, VALUE >::value_type & MathTL::Tensor< RANK, DIM, VALUE >::operator[] ( const size_type  i) [inline]

read-write access to the subtensors


Member Data Documentation

template<unsigned int RANK, unsigned int DIM, class VALUE = double>
const unsigned int MathTL::Tensor< RANK, DIM, VALUE >::dimension = DIM [static]

dimension of the tensor, available at compile time

template<unsigned int RANK, unsigned int DIM, class VALUE = double>
const unsigned int MathTL::Tensor< RANK, DIM, VALUE >::rank = RANK [static]

rank of the tensor, available at compile time


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations