Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Seldon::TinyVector_Base< T, m_ > Class Template Reference

Class storing a tiny vector whose size is known at compilation time. More...

#include <TinyVector.hxx>

Inheritance diagram for Seldon::TinyVector_Base< T, m_ >:
Seldon::TinyVectorExpression< T, m_, TinyVector< T, m_ > >

Public Types

typedef T value_type
 

Public Member Functions

 TinyVector_Base ()
 all components are set to 0
 
 TinyVector_Base (const T &a)
 all components are initialized to a
 
 TinyVector_Base (const T &a, const T &b)
 first two components are initialized to a and b, others to 0
 
 TinyVector_Base (const T &a, const T &b, const T &c)
 first three components are initialized to a, b and c, others to 0
 
 TinyVector_Base (const T &a, const T &b, const T &c, const T &d)
 first four components are initialized to a, b, c, and d, others to 0
 
 TinyVector_Base (const T &a, const T &b, const T &c, const T &d, const T &e)
 first four components are initialized to a, b, c, and d, others to 0
 
void Init (const T &a)
 sets first component to a
 
void Init (const T &a, const T &b)
 sets two first components of the vector
 
void Init (const T &a, const T &b, const T &c)
 sets three first components of the vector
 
void Init (const T &a, const T &b, const T &c, const T &d)
 sets four first components of the vector
 
void Init (const T &a, const T &b, const T &c, const T &d, const T &e)
 sets five first components of the vector
 
int GetM () const
 Returns the number of stored elements.
 
int GetLength () const
 Returns the number of stored elements.
 
int GetSize () const
 Returns the number of stored elements.
 
size_t GetMemorySize () const
 returns the size used by the object in bytes
 
TinyVector< T, m_ > & GetLeafClass ()
 returns leaf class
 
const TinyVector< T, m_ > & GetLeafClass () const
 
const T & operator() (int i) const
 returns x(i)
 
T & operator() (int i)
 returns x(i)
 
void Print () const
 displays the vector without brackets
 
void Print (ostream &) const
 displays the vector without brackets
 
void Zero ()
 Sets all components to 0.
 
void Fill ()
 Sets the vector to [0, 1, 2, 3, ..., n-1].
 
template<class T0 >
void Fill (const T0 &x)
 Sets all components to a given value.
 
void FillRand ()
 sets randomly the components with function rand()
 
bool IsZero () const
 returns true if all components are 0
 
ClassComplexType< T >::Treal DistanceSquare (const TinyVector< T, m_ > &p) const
 returns |u-v|^2 (usual euclidian norm)
 
ClassComplexType< T >::Treal Distance (const TinyVector< T, m_ > &p) const
 returns |u-v| (usual euclidian norm)
 
 operator TinyVector< T, m_ > & ()
 
 operator TinyVector< T, m_ > const & () const
 

Protected Attributes

data_ [m_]
 

Friends

template<int n>
class TinyVectorLoop
 

Detailed Description

template<class T, int m_>
class Seldon::TinyVector_Base< T, m_ >

Class storing a tiny vector whose size is known at compilation time.

Definition at line 21 of file TinyVector.hxx.


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