ug4
ug::ParallelMatrix< TMatrix > Class Template Reference

Wrapper for sequential matrices to handle them in parallel. More...

#include <parallel_matrix.h>

+ Inheritance diagram for ug::ParallelMatrix< TMatrix >:

Public Types

enum  { rows_sorted =TMatrix::rows_sorted }
 
typedef ParallelMatrix< TMatrix > this_type
 own type More...
 

Public Member Functions

void add_storage_type (uint type)
 adds a storage type More...
 
template<typename TPVector >
bool apply (TPVector &res, const TPVector &x) const
 calculate res = A x More...
 
template<typename TPVector >
bool apply_transposed (TPVector &res, const TPVector &x) const
 calculate res = A.T x More...
 
bool change_storage_type (ParallelStorageType type)
 changes to the requested storage type if possible More...
 
uint get_storage_mask () const
 returns storage type mask More...
 
ParallelStorageType get_storage_type () const
 
bool has_storage_type (uint type) const
 returns if the current storage type has a given representation More...
 
ConstSmartPtr< AlgebraLayoutslayouts () const
 returns the algebra layouts More...
 
template<typename TPVector >
bool matmul_minus (TPVector &res, const TPVector &x) const
 calculate res -= A x More...
 
this_typeoperator= (const this_type &M)
 assignment More...
 
 ParallelMatrix ()
 Default Constructor. More...
 
 ParallelMatrix (SmartPtr< AlgebraLayouts > layouts)
 Constructor setting the layouts. More...
 
void remove_storage_type (uint type)
 removes a storage type More...
 
void set_layouts (ConstSmartPtr< AlgebraLayouts > layouts)
 sets the algebra layouts More...
 
void set_storage_type (uint type)
 sets the storage type More...
 

Private Member Functions

 ParallelMatrix (const ParallelMatrix &)
 

Private Attributes

ConstSmartPtr< AlgebraLayoutsm_spAlgebraLayouts
 algebra layouts and communicators More...
 
uint m_type
 type of storage (i.e. consistent, additiv, additiv unique) More...
 

Detailed Description

template<typename TMatrix>
class ug::ParallelMatrix< TMatrix >

Wrapper for sequential matrices to handle them in parallel.

A ParallelMatrix is a wrapper around a sequential vector to make it usable in parallel. It has all the function a sequential matrix supports, since it is derived from it. Furthermore the ParallelStorageType is remembered. Currently only additive storage type is implemented. In addition some functions of the sequential matrix are overwritten to adapted the functionality to parallel (e.g. set)

Please Note: The Implementation is not yet finished.

Template Parameters
TMatrixSequential Matrix Type

Member Typedef Documentation

◆ this_type

template<typename TMatrix >
typedef ParallelMatrix<TMatrix> ug::ParallelMatrix< TMatrix >::this_type

own type

Member Enumeration Documentation

◆ anonymous enum

template<typename TMatrix >
anonymous enum
Enumerator
rows_sorted 

Constructor & Destructor Documentation

◆ ParallelMatrix() [1/3]

template<typename TMatrix >
ug::ParallelMatrix< TMatrix >::ParallelMatrix ( const ParallelMatrix< TMatrix > &  )
private

◆ ParallelMatrix() [2/3]

template<typename TMatrix >
ug::ParallelMatrix< TMatrix >::ParallelMatrix ( )
inline

Default Constructor.

◆ ParallelMatrix() [3/3]

template<typename TMatrix >
ug::ParallelMatrix< TMatrix >::ParallelMatrix ( SmartPtr< AlgebraLayouts layouts)
inline

Constructor setting the layouts.

Member Function Documentation

◆ add_storage_type()

template<typename TMatrix >
void ug::ParallelMatrix< TMatrix >::add_storage_type ( uint  type)
inline

adds a storage type

type may be any or-combination of constants enumerated in ug::ParallelStorageType.

References ug::ParallelMatrix< TMatrix >::m_type.

◆ apply()

template<typename TMatrix >
template<typename TPVector >
bool ug::ParallelMatrix< TMatrix >::apply ( TPVector &  res,
const TPVector &  x 
) const

calculate res = A x

References PROFILE_FUNC_GROUP, ug::PST_ADDITIVE, ug::PST_CONSISTENT, and UG_THROW.

Referenced by ug::EnergyProd(), and ug::MultiEnergyProd().

◆ apply_transposed()

template<typename TMatrix >
template<typename TPVector >
bool ug::ParallelMatrix< TMatrix >::apply_transposed ( TPVector &  res,
const TPVector &  x 
) const

calculate res = A.T x

References PROFILE_FUNC_GROUP, ug::PST_ADDITIVE, ug::PST_CONSISTENT, and UG_THROW.

◆ change_storage_type()

template<typename TMatrix >
bool ug::ParallelMatrix< TMatrix >::change_storage_type ( ParallelStorageType  type)

changes to the requested storage type if possible

References ug::PST_UNDEFINED, UG_LOG, and UG_THROW.

◆ get_storage_mask()

template<typename TMatrix >
uint ug::ParallelMatrix< TMatrix >::get_storage_mask ( ) const
inline

◆ get_storage_type()

template<typename TMatrix >
ParallelStorageType ug::ParallelMatrix< TMatrix >::get_storage_type ( ) const
inline

◆ has_storage_type()

template<typename TMatrix >
bool ug::ParallelMatrix< TMatrix >::has_storage_type ( uint  type) const
inline

returns if the current storage type has a given representation

type may be any or-combination of constants enumerated in ug::ParallelStorageType.

References ug::ParallelMatrix< TMatrix >::m_type, and ug::PST_UNDEFINED.

Referenced by ug::GetMultType().

◆ layouts()

◆ matmul_minus()

template<typename TMatrix >
template<typename TPVector >
bool ug::ParallelMatrix< TMatrix >::matmul_minus ( TPVector &  res,
const TPVector &  x 
) const

calculate res -= A x

References PROFILE_FUNC_GROUP, ug::PST_ADDITIVE, ug::PST_CONSISTENT, and UG_THROW.

◆ operator=()

template<typename TMatrix >
ParallelMatrix< TMatrix >::this_type & ug::ParallelMatrix< TMatrix >::operator= ( const this_type M)

◆ remove_storage_type()

template<typename TMatrix >
void ug::ParallelMatrix< TMatrix >::remove_storage_type ( uint  type)
inline

removes a storage type

type may be any or-combination of constants enumerated in ug::ParallelStorageType.

References ug::ParallelMatrix< TMatrix >::m_type.

◆ set_layouts()

◆ set_storage_type()

Member Data Documentation

◆ m_spAlgebraLayouts

template<typename TMatrix >
ConstSmartPtr<AlgebraLayouts> ug::ParallelMatrix< TMatrix >::m_spAlgebraLayouts
private

algebra layouts and communicators

Referenced by ug::ParallelMatrix< TMatrix >::layouts(), and ug::ParallelMatrix< TMatrix >::set_layouts().

◆ m_type


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