OpenWalnut  1.3.1
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
WTensorBaseSym< 0, dim, Data_T > Class Template Reference

#include <WTensorBase.h>

Public Types

enum  { dataSize = 1 }
 Declare a compile-time constant as enum and not as static constant. More...
 

Public Member Functions

 WTensorBaseSym ()
 Standard constructor. More...
 
 WTensorBaseSym (WTensorBaseSym const &t)
 Copy constructor. More...
 
WTensorBaseSym const & operator= (WTensorBaseSym const &t)
 Copy operator. More...
 
std::size_t getDimension () const
 Get the dimension of this tensor. More...
 
std::size_t getOrder () const
 Get the order of this tensor. More...
 
template<typename Index_T >
Data_T & operator[] (std::vector< Index_T > const &)
 Get the value of this scalar. More...
 
template<typename Index_T >
Data_T const & operator[] (std::vector< Index_T > const &) const
 Get the value of this scalar. More...
 
template<typename Index_T >
Data_T & operator[] (Index_T[])
 Get the value of this scalar. More...
 
template<typename Index_T >
Data_T const & operator[] (Index_T[]) const
 Get the value of this scalar. More...
 
bool operator== (WTensorBaseSym const &other) const
 Compare this WTensorBase to another one. More...
 
bool operator!= (WTensorBaseSym const &other) const
 Compare this WTensorBase to another one. More...
 

Protected Attributes

Data_T m_data
 Stores the value. More...
 

Friends

class ::WTensorBaseSymTest
 
class ::WTensorFuncTest
 

Detailed Description

template<std::size_t dim, typename Data_T>
class WTensorBaseSym< 0, dim, Data_T >

Template Parameters
dimThe dimension of the tensor, i.e. the number of components in each direction.
Data_TThe datatype of the components, double by default.

Specialization for order = 0. This essentially encapsulates a scalar. The purpose of this specialization is compatibility for generic tensor functions.

Definition at line 1022 of file WTensorBase.h.

Member Enumeration Documentation

template<std::size_t dim, typename Data_T >
anonymous enum

Declare a compile-time constant as enum and not as static constant.

Enumerator
dataSize 

The number of elements to store.

Definition at line 1153 of file WTensorBase.h.

Constructor & Destructor Documentation

template<std::size_t dim, typename Data_T >
WTensorBaseSym< 0, dim, Data_T >::WTensorBaseSym ( )
inline

Standard constructor.

All elements are set to Data_T().

Definition at line 1034 of file WTensorBase.h.

template<std::size_t dim, typename Data_T >
WTensorBaseSym< 0, dim, Data_T >::WTensorBaseSym ( WTensorBaseSym< 0, dim, Data_T > const &  t)
inline

Copy constructor.

Parameters
tThe tensor to copy from.

Definition at line 1044 of file WTensorBase.h.

Member Function Documentation

template<std::size_t dim, typename Data_T >
std::size_t WTensorBaseSym< 0, dim, Data_T >::getDimension ( ) const
inline

Get the dimension of this tensor.

Returns
The dimension of this tensor.

Definition at line 1067 of file WTensorBase.h.

template<std::size_t dim, typename Data_T >
std::size_t WTensorBaseSym< 0, dim, Data_T >::getOrder ( ) const
inline

Get the order of this tensor.

Returns
The order of this tensor.

Definition at line 1077 of file WTensorBase.h.

template<std::size_t dim, typename Data_T >
bool WTensorBaseSym< 0, dim, Data_T >::operator!= ( WTensorBaseSym< 0, dim, Data_T > const &  other) const
inline

Compare this WTensorBase to another one.

Parameters
otherThe WBensorBase to compare to.
Returns
True, iff this tensors' elements are not equal to another tensors' elements.

Definition at line 1145 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

template<std::size_t dim, typename Data_T >
WTensorBaseSym const& WTensorBaseSym< 0, dim, Data_T >::operator= ( WTensorBaseSym< 0, dim, Data_T > const &  t)
inline

Copy operator.

Parameters
tThe tensor to copy from.
Returns
*this.

Definition at line 1056 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

template<std::size_t dim, typename Data_T >
bool WTensorBaseSym< 0, dim, Data_T >::operator== ( WTensorBaseSym< 0, dim, Data_T > const &  other) const
inline

Compare this WTensorBase to another one.

Parameters
otherThe WBensorBase to compare to.
Returns
True, iff this tensors' elements are equal to another tensors' elements.

Definition at line 1133 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

template<std::size_t dim, typename Data_T >
template<typename Index_T >
Data_T& WTensorBaseSym< 0, dim, Data_T >::operator[] ( std::vector< Index_T > const &  )
inline

Get the value of this scalar.

Returns
A reference to the element.

Definition at line 1088 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

template<std::size_t dim, typename Data_T >
template<typename Index_T >
Data_T const& WTensorBaseSym< 0, dim, Data_T >::operator[] ( std::vector< Index_T > const &  ) const
inline

Get the value of this scalar.

Returns
A reference to the element.

Definition at line 1099 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

template<std::size_t dim, typename Data_T >
template<typename Index_T >
Data_T& WTensorBaseSym< 0, dim, Data_T >::operator[] ( Index_T  [])
inline

Get the value of this scalar.

Returns
A reference to the element.

Definition at line 1110 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

template<std::size_t dim, typename Data_T >
template<typename Index_T >
Data_T const& WTensorBaseSym< 0, dim, Data_T >::operator[] ( Index_T  []) const
inline

Get the value of this scalar.

Returns
A reference to the element.

Definition at line 1121 of file WTensorBase.h.

References WTensorBaseSym< order, dim, Data_T >::m_data.

Member Data Documentation

template<std::size_t dim, typename Data_T >
Data_T WTensorBaseSym< 0, dim, Data_T >::m_data
protected

Stores the value.

Definition at line 1165 of file WTensorBase.h.


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