Flow123d  JS_before_hm-62-ge56f9d5
Public Member Functions | Private Attributes | List of all members
Armor::Array< Type > Class Template Reference

#include <armor.hh>

Collaboration diagram for Armor::Array< Type >:
Collaboration graph
[legend]

Public Member Functions

 Array (uint size, uint nr, uint nc=1)
 
void resize (uint size)
 
void push_back (const std::vector< Type > &p)
 
template<uint nr, uint nc = 1>
Mat< Type, nr, nc > get (uint i) const
 

Private Attributes

uint nRows
 
uint nCols
 
std::vector< Type > data
 

Detailed Description

template<class Type>
class Armor::Array< Type >

Array of Armor::Mat with given shape. Provides contiguous storage for the data and access to the array elements. The shape of the matrices is specified at run time, so the class Array is independent of additional template parameters. However, to access the array elements, one must use the templated method get().

Definition at line 123 of file armor.hh.

Constructor & Destructor Documentation

template<class Type >
Armor::Array< Type >::Array ( uint  size,
uint  nr,
uint  nc = 1 
)
inline

Construct array of Armor matrices.

Parameters
sizeNumber of matrices in the array.
nrNumber of rows in each matrix.
ncNumber of columnts in each matrix.

Definition at line 131 of file armor.hh.

Member Function Documentation

template<class Type >
template<uint nr, uint nc = 1>
Mat<Type,nr,nc> Armor::Array< Type >::get ( uint  i) const
inline

Return matrix at given position in array. The returned object is a Armor::Mat pointing to the respective data block in the Array's storage.

Parameters
iIndex of matrix.

Definition at line 162 of file armor.hh.

Here is the caller graph for this function:

template<class Type >
void Armor::Array< Type >::push_back ( const std::vector< Type > &  p)
inline

Insert new matrix to the end of the array.

Parameters
pVector of values for the new matrix.

Definition at line 150 of file armor.hh.

Here is the caller graph for this function:

template<class Type >
void Armor::Array< Type >::resize ( uint  size)
inline

Change number of elements in the array, while keeping the shape of arrays.

Parameters
sizeNew size of array.

Definition at line 141 of file armor.hh.

Here is the caller graph for this function:

Member Data Documentation

template<class Type >
std::vector<Type> Armor::Array< Type >::data
private

Definition at line 171 of file armor.hh.

template<class Type >
uint Armor::Array< Type >::nCols
private

Definition at line 170 of file armor.hh.

template<class Type >
uint Armor::Array< Type >::nRows
private

Definition at line 169 of file armor.hh.


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