Intrepid
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Intrepid::TensorBase< T > Class Template Referenceabstract

#include <Intrepid_MiniTensor_TensorBase.h>

Inheritance diagram for Intrepid::TensorBase< T >:
Intrepid::Tensor< T > Intrepid::Tensor3< T > Intrepid::Tensor4< T > Intrepid::Vector< T >

Public Types

typedef T type
 

Public Member Functions

 TensorBase ()
 
 TensorBase (Index const dimension, Index const order)
 
 TensorBase (Index const dimension, Index const order, ComponentValue value)
 
 TensorBase (Index const dimension, Index const order, T const &s)
 
 TensorBase (Index const dimension, Index const order, T const *data_ptr)
 
 TensorBase (TensorBase< T > const &X)
 
virtual ~TensorBase ()
 
T const & operator[] (Index const i) const
 
T & operator[] (Index const i)
 
Index get_dimension () const
 
void set_dimension (Index const dimension)
 
Index get_number_components () const
 
void fill (ComponentValue value)
 
void fill (T const *data_ptr)
 
TensorBase< T > & operator= (TensorBase< T > const &X)
 
TensorBase< T > & operator+= (TensorBase< T > const &X)
 
TensorBase< T > & operator-= (TensorBase< T > const &X)
 
void clear ()
 
virtual Index get_order () const =0
 

Protected Member Functions

void set_number_components (Index const number_components)
 

Protected Attributes

Index dimension_
 
MiniTensor::StorageRCPArray< T > components_
 

Detailed Description

template<typename T>
class Intrepid::TensorBase< T >

Base class for all vector and tensor types.

Definition at line 65 of file Intrepid_MiniTensor_TensorBase.h.

Member Typedef Documentation

template<typename T>
typedef T Intrepid::TensorBase< T >::type

Component type

Definition at line 72 of file Intrepid_MiniTensor_TensorBase.h.

Constructor & Destructor Documentation

template<typename T >
Intrepid::TensorBase< T >::TensorBase ( )
inline

Default constructor

Definition at line 172 of file Intrepid_MiniTensor_TensorBase.i.h.

template<typename T >
Intrepid::TensorBase< T >::TensorBase ( Index const  dimension,
Index const  order 
)
inline

Constructor that initializes to NaNs

Parameters
dimensionthe space dimension
orderthe order of the tensor

Definition at line 183 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::set_number_components().

template<typename T >
Intrepid::TensorBase< T >::TensorBase ( Index const  dimension,
Index const  order,
ComponentValue  value 
)
inline

Create with specified value

Parameters
dimensionthe space dimension
orderthe order of the tensor
valueall components are set equal to this

Definition at line 203 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::fill(), and Intrepid::TensorBase< T >::set_number_components().

template<typename T>
Intrepid::TensorBase< T >::TensorBase ( Index const  dimension,
Index const  order,
T const &  s 
)
inline

Create from a scalar

Parameters
dimensionthe space dimension
orderthe order of the tensor
sall components are set equal to this value

Definition at line 224 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::set_number_components().

template<typename T>
Intrepid::TensorBase< T >::TensorBase ( Index const  dimension,
Index const  order,
T const *  data_ptr 
)
inline

Create from array

Parameters
dimensionthe space dimension
orderthe order of the tensor
data_ptrpointer into the array

Definition at line 247 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::fill(), and Intrepid::TensorBase< T >::set_number_components().

template<typename T>
Intrepid::TensorBase< T >::TensorBase ( TensorBase< T > const &  X)
inline

Copy constructor

Parameters
Xthe values of its components are copied to the new vector

Definition at line 268 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::dimension_, Intrepid::TensorBase< T >::get_dimension(), Intrepid::TensorBase< T >::get_order(), and Intrepid::TensorBase< T >::set_number_components().

template<typename T >
Intrepid::TensorBase< T >::~TensorBase ( )
inlinevirtual

Simple destructor

Definition at line 296 of file Intrepid_MiniTensor_TensorBase.i.h.

Member Function Documentation

template<typename T >
void Intrepid::TensorBase< T >::clear ( )
inline

Fill with zeros

Definition at line 405 of file Intrepid_MiniTensor_TensorBase.i.h.

template<typename T >
void Intrepid::TensorBase< T >::fill ( ComponentValue  value)
inline

Fill components with value

Parameters
valueall components are set equal to this

Definition at line 110 of file Intrepid_MiniTensor_TensorBase.i.h.

Referenced by Intrepid::Tensor< T >::fill(), and Intrepid::TensorBase< T >::TensorBase().

template<typename T>
void Intrepid::TensorBase< T >::fill ( T const *  data_ptr)
inline

Fill components from array defined by pointer.

Parameters
data_ptrpointer into array for filling components

Definition at line 153 of file Intrepid_MiniTensor_TensorBase.i.h.

template<typename T >
Index Intrepid::TensorBase< T >::get_dimension ( ) const
inline
template<typename T >
Index Intrepid::TensorBase< T >::get_number_components ( ) const
inline
Returns
total number of components

Definition at line 54 of file Intrepid_MiniTensor_TensorBase.i.h.

template<typename T>
virtual Index Intrepid::TensorBase< T >::get_order ( ) const
pure virtual
template<typename T>
TensorBase< T > & Intrepid::TensorBase< T >::operator+= ( TensorBase< T > const &  X)
inline

Component increment

Parameters
Xcomponents are added to current components

Definition at line 363 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::get_dimension(), and Intrepid::TensorBase< T >::get_order().

template<typename T>
TensorBase< T > & Intrepid::TensorBase< T >::operator-= ( TensorBase< T > const &  X)
inline

Component decrement

Parameters
Xcomponents are subtracted to current components

Definition at line 384 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::get_dimension(), and Intrepid::TensorBase< T >::get_order().

template<typename T>
TensorBase< T > & Intrepid::TensorBase< T >::operator= ( TensorBase< T > const &  X)
inline

Copy assignment

Parameters
Xthe values of its components are copied to this vector

Definition at line 331 of file Intrepid_MiniTensor_TensorBase.i.h.

References Intrepid::TensorBase< T >::get_dimension(), and Intrepid::TensorBase< T >::get_order().

template<typename T >
T const & Intrepid::TensorBase< T >::operator[] ( Index const  i) const
inline

Linear access to components

Parameters
ithe index

Definition at line 307 of file Intrepid_MiniTensor_TensorBase.i.h.

template<typename T >
T & Intrepid::TensorBase< T >::operator[] ( Index const  i)
inline

Linear access to components

Parameters
ithe index

Definition at line 319 of file Intrepid_MiniTensor_TensorBase.i.h.

template<typename T >
void Intrepid::TensorBase< T >::set_dimension ( Index const  dimension)
inline
Parameters
dimensionof vector

Definition at line 89 of file Intrepid_MiniTensor_TensorBase.i.h.

Referenced by Intrepid::Tensor< T >::Tensor(), and Intrepid::Vector< T >::Vector().

template<typename T >
void Intrepid::TensorBase< T >::set_number_components ( Index const  number_components)
inlineprotected
Parameters
number_componentsset storage for this number of components

Definition at line 65 of file Intrepid_MiniTensor_TensorBase.i.h.

Referenced by Intrepid::TensorBase< T >::TensorBase().

Member Data Documentation

template<typename T>
MiniTensor::StorageRCPArray<T> Intrepid::TensorBase< T >::components_
protected

TensorBase components

Definition at line 220 of file Intrepid_MiniTensor_TensorBase.h.

template<typename T>
Index Intrepid::TensorBase< T >::dimension_
protected

TensorBase dimension

Definition at line 214 of file Intrepid_MiniTensor_TensorBase.h.

Referenced by Intrepid::TensorBase< T >::TensorBase().


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