ug4
ug::ReservableArray2< T, T_ordering > Class Template Reference

#include <reservable_array.h>

Public Types

enum  { is_static =false }
 
enum  { static_num_rows =0 }
 
enum  { static_num_cols =0 }
 
typedef size_t size_type
 
typedef variable_type storage_type
 
typedef T value_type
 

Public Member Functions

T & at (size_type r, size_type c)
 
const T & at (size_type r, size_type c) const
 
size_type capacity_num_cols () const
 
size_type capacity_num_rows () const
 
size_type num_cols () const
 
size_type num_rows () const
 
T & operator() (size_type r, size_type c)
 
const T & operator() (size_type r, size_type c) const
 
 ReservableArray2 ()
 
 ReservableArray2 (const VariableArray2< T, T_ordering > &other)
 
 ReservableArray2 (size_type rows_, size_type cols_)
 
bool reserve (size_type nrRows, size_type nrCols) const
 
bool resize (size_type newRows, size_type newCols, bool bCopyValues=true)
 
 ~ReservableArray2 ()
 

Static Public Attributes

static const eMatrixOrdering ordering = T_ordering
 

Protected Attributes

size_type arraySize
 
size_type cols
 
size_type rows
 
T * values
 

Friends

template<typename _T , eMatrixOrdering _T_Ordering>
std::ostream & operator<< (std::ostream &out, const ReservableArray2< _T, _T_Ordering > &arr)
 

Detailed Description

template<typename T, eMatrixOrdering T_ordering = ColMajor>
class ug::ReservableArray2< T, T_ordering >

ReservableArray2 is a two-dimensional array which supports a similar interface like stl::vector. You can use FixedArray2 in GeMatrix to get a variable size Matrix. Use is_static to distinguish between fixed and variable arrays.

Parameters
Ttype of object in Array (i.e. double)
T_orderingOrdering of columns/rows. Default is ColMajor.
See also
eMatrixOrdering

Member Typedef Documentation

◆ size_type

template<typename T , eMatrixOrdering T_ordering = ColMajor>
typedef size_t ug::ReservableArray2< T, T_ordering >::size_type

◆ storage_type

template<typename T , eMatrixOrdering T_ordering = ColMajor>
typedef variable_type ug::ReservableArray2< T, T_ordering >::storage_type

◆ value_type

template<typename T , eMatrixOrdering T_ordering = ColMajor>
typedef T ug::ReservableArray2< T, T_ordering >::value_type

Member Enumeration Documentation

◆ anonymous enum

template<typename T , eMatrixOrdering T_ordering = ColMajor>
anonymous enum
Enumerator
is_static 

◆ anonymous enum

template<typename T , eMatrixOrdering T_ordering = ColMajor>
anonymous enum
Enumerator
static_num_rows 

◆ anonymous enum

template<typename T , eMatrixOrdering T_ordering = ColMajor>
anonymous enum
Enumerator
static_num_cols 

Constructor & Destructor Documentation

◆ ReservableArray2() [1/3]

template<typename T , eMatrixOrdering T_ordering>
ug::ReservableArray2< T, T_ordering >::ReservableArray2

◆ ReservableArray2() [2/3]

template<typename T , eMatrixOrdering T_ordering>
ug::ReservableArray2< T, T_ordering >::ReservableArray2 ( size_type  rows_,
size_type  cols_ 
)

References resize().

◆ ReservableArray2() [3/3]

template<typename T , eMatrixOrdering T_ordering = ColMajor>
ug::ReservableArray2< T, T_ordering >::ReservableArray2 ( const VariableArray2< T, T_ordering > &  other)

◆ ~ReservableArray2()

template<typename T , eMatrixOrdering T_ordering>
ug::ReservableArray2< T, T_ordering >::~ReservableArray2

Member Function Documentation

◆ at() [1/2]

template<typename T , eMatrixOrdering T_ordering = ColMajor>
T& ug::ReservableArray2< T, T_ordering >::at ( size_type  r,
size_type  c 
)
inline

◆ at() [2/2]

template<typename T , eMatrixOrdering T_ordering = ColMajor>
const T& ug::ReservableArray2< T, T_ordering >::at ( size_type  r,
size_type  c 
) const
inline

◆ capacity_num_cols()

template<typename T , eMatrixOrdering T_ordering = ColMajor>
size_type ug::ReservableArray2< T, T_ordering >::capacity_num_cols ( ) const
inline

◆ capacity_num_rows()

template<typename T , eMatrixOrdering T_ordering = ColMajor>
size_type ug::ReservableArray2< T, T_ordering >::capacity_num_rows ( ) const
inline

◆ num_cols()

template<typename T , eMatrixOrdering T_ordering>
size_t ug::ReservableArray2< T, T_ordering >::num_cols
inline

Referenced by ug::operator<<().

◆ num_rows()

template<typename T , eMatrixOrdering T_ordering>
size_t ug::ReservableArray2< T, T_ordering >::num_rows
inline

Referenced by ug::operator<<().

◆ operator()() [1/2]

template<typename T , eMatrixOrdering T_ordering>
T & ug::ReservableArray2< T, T_ordering >::operator() ( size_type  r,
size_type  c 
)
inline

References ug::RowMajor.

◆ operator()() [2/2]

template<typename T , eMatrixOrdering T_ordering>
const T & ug::ReservableArray2< T, T_ordering >::operator() ( size_type  r,
size_type  c 
) const
inline

◆ reserve()

template<typename T , eMatrixOrdering T_ordering = ColMajor>
bool ug::ReservableArray2< T, T_ordering >::reserve ( size_type  nrRows,
size_type  nrCols 
) const
inline

◆ resize()

template<typename T , eMatrixOrdering T_ordering>
bool ug::ReservableArray2< T, T_ordering >::resize ( size_type  newRows,
size_type  newCols,
bool  bCopyValues = true 
)
inline

References ug::RowMajor, and UG_ASSERT.

Friends And Related Function Documentation

◆ operator<<

template<typename T , eMatrixOrdering T_ordering = ColMajor>
template<typename _T , eMatrixOrdering _T_Ordering>
std::ostream& operator<< ( std::ostream &  out,
const ReservableArray2< _T, _T_Ordering > &  arr 
)
friend

Member Data Documentation

◆ arraySize

template<typename T , eMatrixOrdering T_ordering = ColMajor>
size_type ug::ReservableArray2< T, T_ordering >::arraySize
protected

◆ cols

template<typename T , eMatrixOrdering T_ordering = ColMajor>
size_type ug::ReservableArray2< T, T_ordering >::cols
protected

◆ ordering

template<typename T , eMatrixOrdering T_ordering = ColMajor>
const eMatrixOrdering ug::ReservableArray2< T, T_ordering >::ordering = T_ordering
static

◆ rows

template<typename T , eMatrixOrdering T_ordering = ColMajor>
size_type ug::ReservableArray2< T, T_ordering >::rows
protected

◆ values

template<typename T , eMatrixOrdering T_ordering = ColMajor>
T* ug::ReservableArray2< T, T_ordering >::values
protected

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