Flow123d  master-f44eb46
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Armor::Array< Type > Class Template Reference

#include <armor.hh>

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

◆ Array() [1/2]

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

◆ Array() [2/2]

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

Definition at line 668 of file armor.hh.

◆ ~Array()

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

Definition at line 676 of file armor.hh.

Member Function Documentation

◆ append() [1/2]

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

Here is the caller graph for this function:

◆ append() [2/2]

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

Definition at line 745 of file armor.hh.

◆ arma_mat()

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

Here is the caller graph for this function:

◆ arma_vec()

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

◆ mat()

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

Here is the caller graph for this function:

◆ n_cols()

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

Definition at line 720 of file armor.hh.

Here is the caller graph for this function:

◆ n_rows()

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

Definition at line 715 of file armor.hh.

Here is the caller graph for this function:

◆ operator=()

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

Definition at line 681 of file armor.hh.

◆ reinit()

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

Here is the caller graph for this function:

◆ resize()

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

Resize active part of the allocated space.

Definition at line 710 of file armor.hh.

Here is the caller graph for this function:

◆ scalar()

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

Definition at line 831 of file armor.hh.

Here is the caller graph for this function:

◆ set()

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

Definition at line 838 of file armor.hh.

Here is the caller graph for this function:

◆ size()

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

Get size of active space.

Definition at line 728 of file armor.hh.

Here is the caller graph for this function:

◆ space_()

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

Definition at line 876 of file armor.hh.

◆ vec()

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

Definition at line 821 of file armor.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ data_

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

Definition at line 873 of file armor.hh.

◆ n_cols_

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

Definition at line 878 of file armor.hh.

◆ n_rows_

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

Definition at line 877 of file armor.hh.

◆ reserved_

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

Definition at line 880 of file armor.hh.

◆ size_

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

Definition at line 879 of file armor.hh.


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