Flow123d  DF_profiler_memory_monitor-83fd579
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)
 
Type * operator() (uint i_row, uint i_col) const
 
Arraymultiply_comp (uint i_row, uint i_col, Type multi)
 
Arrayadd_comp (uint i_row, uint i_col, uint i_row_b, uint i_col_b, const Array &B)
 
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

◆ add_comp()

template<class Type >
Array& Armor::Array< Type >::add_comp ( uint  i_row,
uint  i_col,
uint  i_row_b,
uint  i_col_b,
const Array< Type > &  B 
)
inline

Return reference to data of one component

Definition at line 729 of file armor.hh.

◆ 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 784 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 793 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 896 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 911 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 829 of file armor.hh.

Here is the caller graph for this function:

◆ multiply_comp()

template<class Type >
Array& Armor::Array< Type >::multiply_comp ( uint  i_row,
uint  i_col,
Type  multi 
)
inline

Multiply data of component (i_row, i_col)

Definition at line 716 of file armor.hh.

◆ n_cols()

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

Definition at line 768 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 763 of file armor.hh.

Here is the caller graph for this function:

◆ operator()()

template<class Type >
Type* Armor::Array< Type >::operator() ( uint  i_row,
uint  i_col 
) const
inline

Return vector of data of one component

Definition at line 706 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 746 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 758 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 879 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 886 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 776 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 924 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 869 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 921 of file armor.hh.

◆ n_cols_

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

Definition at line 926 of file armor.hh.

◆ n_rows_

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

Definition at line 925 of file armor.hh.

◆ reserved_

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

Definition at line 928 of file armor.hh.

◆ size_

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

Definition at line 927 of file armor.hh.


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