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

#include <tensor_base.h>

Inheritance diagram for MathTL::Tensor< 1, DIM, VALUE >:
MathTL::Point< DIM, VALUE >

List of all members.

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

Detailed Description

template<unsigned int DIM, class VALUE>
class MathTL::Tensor< 1, DIM, VALUE >

Special version of tensors of rank 1 on the Euclidean space R^d, i.e., vectors of dimension DIM.


Member Typedef Documentation

template<unsigned int DIM, class VALUE >
typedef size_t MathTL::Tensor< 1, DIM, VALUE >::size_type

size type

Reimplemented in MathTL::Point< DIM, VALUE >.

template<unsigned int DIM, class VALUE >
typedef VALUE MathTL::Tensor< 1, DIM, VALUE >::value_type

type of internal storage object: a real number

Reimplemented in MathTL::Point< DIM, VALUE >.


Constructor & Destructor Documentation

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


Member Function Documentation

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

in place summation *this += s*t

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

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

estimate memory consumption in bytes

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

non-equality test of two tensors

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

inner product of two rank 1 tensors (scalar product)

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

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

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

in-place summation of two tensors

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

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

tensor with negated entries

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

in-place subtraction of two tensors

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

in-place division of a tensor by a scalar

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

equality test of two tensors

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

read-only access to the i-th coordinate

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

read-write access to the i-th coordinate

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


Member Data Documentation

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

dimension of the tensor, available at compile time

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

rank of the tensor, available at compile time

template<unsigned int DIM, class VALUE >
FixedArray1D<VALUE,DIM> MathTL::Tensor< 1, DIM, VALUE >::values [protected]

internal storage for the vector entries


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