ug4
ug::FixedArray1< T, n > Class Template Reference

#include <fixed_array.h>

Public Types

typedef size_t size_type
 
typedef static_type storage_type
 
typedef T value_type
 

Public Member Functions

T & at (size_type i)
 
const T & at (size_type i) const
 
size_type capacity () const
 
 FixedArray1 ()
 
 FixedArray1 (const FixedArray1< T, n > &other)
 
 FixedArray1 (size_type n_)
 
T & operator[] (size_type i)
 
const T & operator[] (size_type i) const
 
bool reserve (size_type newN) const
 
bool resize (size_type newN, bool bCopyValues=true)
 
size_type size () const
 
 ~FixedArray1 ()
 

Protected Attributes

values [n]
 

Friends

template<typename _T , size_type _n>
std::ostream & operator<< (std::ostream &out, const FixedArray1< _T, _n > &arr)
 

Detailed Description

template<typename T, size_t n>
class ug::FixedArray1< T, n >

FixedArray1 is a one-dimensional array which supports most of the interface of std::vector. (some functions and iterators have to be added). You can use FixedArray1 in DenseVector to get a fixed size mathematical Vector. Use storage_traits<type>::is_static to distinguish between fixed and variable vectors. Functions like resize(newN) assert N == newN. So FixedArray1<T, N>::size is always N.

Parameters
Ttype of object in Array (i.e. double)
nnumber of elements in the fixed array (T values[n]; )

Member Typedef Documentation

◆ size_type

template<typename T , size_t n>
typedef size_t ug::FixedArray1< T, n >::size_type

◆ storage_type

template<typename T , size_t n>
typedef static_type ug::FixedArray1< T, n >::storage_type

◆ value_type

template<typename T , size_t n>
typedef T ug::FixedArray1< T, n >::value_type

Constructor & Destructor Documentation

◆ FixedArray1() [1/3]

template<typename T , size_t n>
ug::FixedArray1< T, n >::FixedArray1

◆ FixedArray1() [2/3]

template<typename T , size_t nT>
ug::FixedArray1< T, nT >::FixedArray1 ( size_type  n_)

◆ FixedArray1() [3/3]

template<typename T , size_t n>
ug::FixedArray1< T, n >::FixedArray1 ( const FixedArray1< T, n > &  other)

◆ ~FixedArray1()

template<typename T , size_t n>
ug::FixedArray1< T, n >::~FixedArray1

Member Function Documentation

◆ at() [1/2]

template<typename T , size_t n>
T& ug::FixedArray1< T, n >::at ( size_type  i)
inline

◆ at() [2/2]

◆ capacity()

template<typename T , size_t n>
size_type ug::FixedArray1< T, n >::capacity ( ) const
inline

◆ operator[]() [1/2]

template<typename T , size_t n>
T & ug::FixedArray1< T, n >::operator[] ( size_type  i)
inline

◆ operator[]() [2/2]

template<typename T , size_t n>
const T & ug::FixedArray1< T, n >::operator[] ( size_type  i) const
inline

◆ reserve()

template<typename T , size_t n>
bool ug::FixedArray1< T, n >::reserve ( size_type  newN) const
inline

◆ resize()

template<typename T , size_t n>
bool ug::FixedArray1< T, n >::resize ( size_type  newN,
bool  bCopyValues = true 
)
inline

◆ size()

template<typename T , size_t n>
size_t ug::FixedArray1< T, n >::size
inline

Referenced by ug::operator<<().

Friends And Related Function Documentation

◆ operator<<

template<typename T , size_t n>
template<typename _T , size_type _n>
std::ostream& operator<< ( std::ostream &  out,
const FixedArray1< _T, _n > &  arr 
)
friend

Member Data Documentation

◆ values


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