Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
numeric::MathVector< T > Class Template Reference

#include <MathVector.hh>

Public Member Functions

 MathVector ()
 default constructor More...
 
 MathVector (const Size SIZE, const T &FILL_VALUE=T(0))
 construct from size and possible filler More...
 
 MathVector (const Size SIZE, const T *DATA)
 construct from length and pointer to data More...
 
 MathVector (MathVector const &VECTOR)
 copy constructor More...
 
MathVector< T > * clone () const
 Clone function. More...
 
 ~MathVector ()
 @ brief destructor More...
 
Size size () const
 size of vector More...
 
const Tbegin () const
 pointer to First Element More...
 
Tbegin ()
 pointer to First Element More...
 
const Tend () const
 pointer to end of range More...
 
Tend ()
 pointer to end of range More...
 
T norm () const
 norm = length of vector More...
 
T square_norm () const
 square norm = square length of vector More...
 
T sum () const
 sum up all elements More...
 
MathVector< TMakeVector (const T &X)
 construct vector from one element More...
 
MathVector< TMakeVector (const T &X, const T &Y)
 construct vector from two elements More...
 
MathVector< TMakeVector (const T &X, const T &Y, const T &Z)
 construct vector from three elements More...
 
bool operator== (MathVector< T > const &rhs) const
 
Toperator() (const Size POS)
 return reference to changeable element ( POS) More...
 
const Toperator() (const Size POS) const
 return copy of element ( POS) More...
 
MathVector< T > & operator= (const MathVector< T > &VECTOR)
 equal operator More...
 
MathVector< T > & operator= (const T &VALUE)
 equal operator More...
 
MathVector< T > & operator+= (const T &VALUE)
 operator += VALUE More...
 
MathVector< T > & operator-= (const T &VALUE)
 operator -= VALUE More...
 
MathVector< T > & operator*= (const T &VALUE)
 operator *= VALUE More...
 
MathVector< T > & operator/= (const T &VALUE)
 operator /= VALUE More...
 
MathVector< T > & operator-= (const MathVector< T > &BASE)
 operator -= BASE More...
 
MathVector< T > & operator+= (const MathVector< T > &BASE)
 operator += BASE More...
 

Protected Member Functions

bool assert_valid_position (const Size POS) const
 check whether position is valid More...
 

Private Attributes

Size size_
 length of vector More...
 
Tdata_
 range of dynamically allocated memory of size size_ More...
 

Constructor & Destructor Documentation

template<typename T>
numeric::MathVector< T >::MathVector ( )
inline

default constructor

template<typename T>
numeric::MathVector< T >::MathVector ( const Size  SIZE,
const T FILL_VALUE = T( 0) 
)
inlineexplicit

construct from size and possible filler

Parameters
SIZEnumber fo elements in Vector
FILL_VALUEassign every element to that value
template<typename T>
numeric::MathVector< T >::MathVector ( const Size  SIZE,
const T DATA 
)
inline

construct from length and pointer to data

template<typename T>
numeric::MathVector< T >::MathVector ( MathVector< T > const &  VECTOR)
inline

copy constructor

Parameters
VECTORcopy the given Vector
template<typename T>
numeric::MathVector< T >::~MathVector ( )
inline

@ brief destructor

Member Function Documentation

template<typename T>
bool numeric::MathVector< T >::assert_valid_position ( const Size  POS) const
inlineprotected

check whether position is valid

Referenced by numeric::MathVector< double >::operator()().

template<typename T>
const T* numeric::MathVector< T >::begin ( ) const
inline
template<typename T>
T* numeric::MathVector< T >::begin ( )
inline

pointer to First Element

Returns
pointer to first element in range containing all elements of Vector
template<typename T>
MathVector< T>* numeric::MathVector< T >::clone ( ) const
inline

Clone function.

Returns
pointer to new Vector< T>
template<typename T>
const T* numeric::MathVector< T >::end ( ) const
inline
template<typename T>
T* numeric::MathVector< T >::end ( )
inline

pointer to end of range

Returns
pointer to address one after last element in Vector
template<typename T>
MathVector< T> numeric::MathVector< T >::MakeVector ( const T X)
inline

construct vector from one element

template<typename T>
MathVector< T> numeric::MathVector< T >::MakeVector ( const T X,
const T Y 
)
inline

construct vector from two elements

template<typename T>
MathVector< T> numeric::MathVector< T >::MakeVector ( const T X,
const T Y,
const T Z 
)
inline

construct vector from three elements

template<typename T>
T numeric::MathVector< T >::norm ( ) const
inline

norm = length of vector

Returns
length of vector

Referenced by numeric::proj_angl().

template<typename T>
T& numeric::MathVector< T >::operator() ( const Size  POS)
inline

return reference to changeable element ( POS)

template<typename T>
const T& numeric::MathVector< T >::operator() ( const Size  POS) const
inline

return copy of element ( POS)

template<typename T>
MathVector< T>& numeric::MathVector< T >::operator*= ( const T VALUE)
inline

operator *= VALUE

template<typename T>
MathVector<T>& numeric::MathVector< T >::operator+= ( const T VALUE)
inline

operator += VALUE

template<typename T>
MathVector< T>& numeric::MathVector< T >::operator+= ( const MathVector< T > &  BASE)
inline

operator += BASE

template<typename T>
MathVector< T>& numeric::MathVector< T >::operator-= ( const T VALUE)
inline

operator -= VALUE

template<typename T>
MathVector< T>& numeric::MathVector< T >::operator-= ( const MathVector< T > &  BASE)
inline

operator -= BASE

template<typename T>
MathVector< T>& numeric::MathVector< T >::operator/= ( const T VALUE)
inline

operator /= VALUE

template<typename T>
MathVector< T>& numeric::MathVector< T >::operator= ( const MathVector< T > &  VECTOR)
inline

equal operator

Parameters
VECTORsource vector
Returns
reference to this assigned Vector
template<typename T>
MathVector< T>& numeric::MathVector< T >::operator= ( const T VALUE)
inline

equal operator

Parameters
VALUEall elements are set to that value
Returns
reference to this assigned Vector
template<typename T>
bool numeric::MathVector< T >::operator== ( MathVector< T > const &  rhs) const
inline
template<typename T>
Size numeric::MathVector< T >::size ( ) const
inline
template<typename T>
T numeric::MathVector< T >::square_norm ( ) const
inline

square norm = square length of vector

Returns
square length of vector

Referenced by numeric::MathVector< double >::norm().

template<typename T>
T numeric::MathVector< T >::sum ( ) const
inline

sum up all elements

Returns
sum of all elements

Member Data Documentation

template<typename T>
T* numeric::MathVector< T >::data_
private
template<typename T>
Size numeric::MathVector< T >::size_
private

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