Public Member Functions | Private Attributes | List of all members
oomph::FixedSizeVector< T, N > Class Template Reference

Class for fixed-size vector storing N objects of type T. No resize or other STL functionality but (therefore) much less run-time overhead. More...

#include <fixed_size_vector.h>

Public Member Functions

 FixedSizeVector ()
 Constructor; no initialisiation.
 
 FixedSizeVector (const T &value)
 Constructor with initialisation to value.
 
 FixedSizeVector (std::initializer_list< T > values)
 Constructor from initializer list. Allows FixedSizeVector<double,3> = {0.0,1.0,2.0}; say.
 
void fill (const T &value)
 Fill all entries with specified value.
 
unsigned size () const
 Size of vector.
 
T & operator[] (const unsigned &i)
 Read/write access to i-th entry.
 
const T & operator[] (const unsigned &i) const
 Read access to i-th entry.
 

Private Attributes

T Data [N]
 The data, stored as a raw C-style array.
 

Detailed Description

template<class T, unsigned N>
class oomph::FixedSizeVector< T, N >

Class for fixed-size vector storing N objects of type T. No resize or other STL functionality but (therefore) much less run-time overhead.

Definition at line 47 of file fixed_size_vector.h.

Constructor & Destructor Documentation

◆ FixedSizeVector() [1/3]

template<class T , unsigned N>
oomph::FixedSizeVector< T, N >::FixedSizeVector ( )
inline

Constructor; no initialisiation.

Definition at line 51 of file fixed_size_vector.h.

◆ FixedSizeVector() [2/3]

template<class T , unsigned N>
oomph::FixedSizeVector< T, N >::FixedSizeVector ( const T &  value)
inline

Constructor with initialisation to value.

Definition at line 54 of file fixed_size_vector.h.

References oomph::FixedSizeVector< T, N >::fill().

◆ FixedSizeVector() [3/3]

template<class T , unsigned N>
oomph::FixedSizeVector< T, N >::FixedSizeVector ( std::initializer_list< T >  values)
inline

Constructor from initializer list. Allows FixedSizeVector<double,3> = {0.0,1.0,2.0}; say.

Definition at line 63 of file fixed_size_vector.h.

References i.

Member Function Documentation

◆ fill()

template<class T , unsigned N>
void oomph::FixedSizeVector< T, N >::fill ( const T &  value)
inline

Fill all entries with specified value.

Definition at line 89 of file fixed_size_vector.h.

References i.

Referenced by oomph::FixedSizeVector< T, N >::FixedSizeVector().

◆ operator[]() [1/2]

template<class T , unsigned N>
T & oomph::FixedSizeVector< T, N >::operator[] ( const unsigned &  i)
inline

Read/write access to i-th entry.

Definition at line 104 of file fixed_size_vector.h.

References i.

◆ operator[]() [2/2]

template<class T , unsigned N>
const T & oomph::FixedSizeVector< T, N >::operator[] ( const unsigned &  i) const
inline

Read access to i-th entry.

Definition at line 123 of file fixed_size_vector.h.

References i.

◆ size()

template<class T , unsigned N>
unsigned oomph::FixedSizeVector< T, N >::size ( ) const
inline

Size of vector.

Definition at line 98 of file fixed_size_vector.h.

Member Data Documentation

◆ Data

template<class T , unsigned N>
T oomph::FixedSizeVector< T, N >::Data[N]
private

The data, stored as a raw C-style array.

Definition at line 142 of file fixed_size_vector.h.


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