Flow123d  JS_before_hm-1001-gfa0c761
Classes | Public Member Functions | Public Attributes | Private 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]

Classes

class  ArrayMatSet
 

Public Member Functions

 Array (uint nr, uint nc=1, uint size=0)
 
 Array (const Array &other)
 
 ~Array ()
 
Arrayoperator= (const Array &other)
 
void reinit (uint size)
 
void resize (uint size)
 
uint n_rows () const
 
uint n_cols () const
 
unsigned int size () const
 
template<unsigned long long int nr, unsigned long long int nc = 1>
void append (const ArmaMat< Type, nr, nc > &item)
 
template<unsigned long long int nr>
void append (const ArmaVec< Type, nr > &item)
 
template<uint nr, uint nc = 1>
ArmaMat< Type, nr, nc > mat (uint mat_index) const
 
template<uint nr>
ArmaVec< Type, nr > vec (uint mat_index) const
 
Type scalar (uint mat_index) const
 
ArrayMatSet set (uint index)
 
arma::mat arma_mat (uint i) const
 
arma::vec arma_vec (uint i) const
 

Public Attributes

Type * data_
 

Private Member Functions

uint space_ ()
 

Private Attributes

uint n_rows_
 
uint n_cols_
 
uint size_
 
uint reserved_
 

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 597 of file armor.hh.

Constructor & Destructor Documentation

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

Construct array of Armor matrices.

Parameters
nvNumber of matrices in the array.
nrNumber of rows in each matrix.
ncNumber of columns in each matrix.

Definition at line 649 of file armor.hh.

template<class Type>
Armor::Array< Type >::Array ( const Array< Type > &  other)
inline

Definition at line 658 of file armor.hh.

template<class Type>
Armor::Array< Type >::~Array ( )
inline

Definition at line 666 of file armor.hh.

Member Function Documentation

template<class Type>
template<unsigned long long int nr, unsigned long long int nc = 1>
void Armor::Array< Type >::append ( const ArmaMat< Type, nr, nc > &  item)
inline

Increase active space by 1 and store given Mat value to the end of the active space.

Definition at line 726 of file armor.hh.

Here is the caller graph for this function:

template<class Type>
template<unsigned long long int nr>
void Armor::Array< Type >::append ( const ArmaVec< Type, nr > &  item)
inline

Definition at line 735 of file armor.hh.

template<class Type>
arma::mat Armor::Array< Type >::arma_mat ( uint  i) const
inline

Return armadillo matrix at given position in array.

Parameters
iIndex of matrix.

Definition at line 831 of file armor.hh.

template<class Type>
arma::vec Armor::Array< Type >::arma_vec ( uint  i) const
inline

Return armadillo vector at given position in array. Warning! Method can be used only if nCols == 1.

Parameters
iIndex of matrix.

Definition at line 842 of file armor.hh.

template<class Type>
template<uint nr, uint nc = 1>
ArmaMat<Type,nr,nc> Armor::Array< Type >::mat ( uint  mat_index) 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. One can assign to the Armor::Mat which performs postponed evaluation and storing the result to the array.

Parameters
iIndex of the matrix. TODO: Should be renamed to item(), but we have compilation problem in Field::loc_point_value

Definition at line 771 of file armor.hh.

template<class Type>
uint Armor::Array< Type >::n_cols ( ) const
inline

Definition at line 710 of file armor.hh.

Here is the caller graph for this function:

template<class Type>
uint Armor::Array< Type >::n_rows ( ) const
inline

Definition at line 705 of file armor.hh.

Here is the caller graph for this function:

template<class Type>
Array& Armor::Array< Type >::operator= ( const Array< Type > &  other)
inline

Definition at line 671 of file armor.hh.

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

Drop all data and allocate new space of given size. Change number of elements in the array, while keeping the shape of arrays.

Parameters
sizeNew size of array.

Definition at line 688 of file armor.hh.

Here is the caller graph for this function:

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

Resize active part of the allocated space.

Definition at line 700 of file armor.hh.

Here is the caller graph for this function:

template<class Type>
Type Armor::Array< Type >::scalar ( uint  mat_index) const
inline

Definition at line 814 of file armor.hh.

Here is the caller graph for this function:

template<class Type>
ArrayMatSet Armor::Array< Type >::set ( uint  index)
inline

Definition at line 821 of file armor.hh.

Here is the caller graph for this function:

template<class Type>
unsigned int Armor::Array< Type >::size ( ) const
inline

Get size of active space.

Definition at line 718 of file armor.hh.

template<class Type>
uint Armor::Array< Type >::space_ ( )
inlineprivate

Definition at line 852 of file armor.hh.

template<class Type>
template<uint nr>
ArmaVec<Type, nr> Armor::Array< Type >::vec ( uint  mat_index) const
inline

Definition at line 807 of file armor.hh.

Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 849 of file armor.hh.

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

Definition at line 854 of file armor.hh.

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

Definition at line 853 of file armor.hh.

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

Definition at line 856 of file armor.hh.

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

Definition at line 855 of file armor.hh.


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