ug4
|
Wrapper for sequential matrices to handle them in parallel. More...
#include <parallel_matrix.h>
Public Types | |
enum | { rows_sorted =TMatrix::rows_sorted } |
typedef ParallelMatrix< TMatrix > | this_type |
own type | |
Public Member Functions | |
void | add_storage_type (uint type) |
adds a storage type | |
template<typename TPVector > | |
bool | apply (TPVector &res, const TPVector &x) const |
calculate res = A x | |
template<typename TPVector > | |
bool | apply_transposed (TPVector &res, const TPVector &x) const |
calculate res = A.T x | |
bool | change_storage_type (ParallelStorageType type) |
changes to the requested storage type if possible | |
uint | get_storage_mask () const |
returns storage type mask | |
ParallelStorageType | get_storage_type () const |
bool | has_storage_type (uint type) const |
returns if the current storage type has a given representation | |
ConstSmartPtr< AlgebraLayouts > | layouts () const |
returns the algebra layouts | |
template<typename TPVector > | |
bool | matmul_minus (TPVector &res, const TPVector &x) const |
calculate res -= A x | |
this_type & | operator= (const this_type &M) |
assignment | |
ParallelMatrix () | |
Default Constructor. | |
ParallelMatrix (SmartPtr< AlgebraLayouts > layouts) | |
Constructor setting the layouts. | |
void | remove_storage_type (uint type) |
removes a storage type | |
void | set_layouts (ConstSmartPtr< AlgebraLayouts > layouts) |
sets the algebra layouts | |
void | set_storage_type (uint type) |
sets the storage type | |
Private Member Functions | |
ParallelMatrix (const ParallelMatrix &) | |
Private Attributes | |
ConstSmartPtr< AlgebraLayouts > | m_spAlgebraLayouts |
algebra layouts and communicators | |
uint | m_type |
type of storage (i.e. consistent, additiv, additiv unique) | |
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.
TMatrix | Sequential Matrix Type |
typedef ParallelMatrix<TMatrix> ug::ParallelMatrix< TMatrix >::this_type |
own type
|
private |
|
inline |
Default Constructor.
References new().
|
inline |
Constructor setting the layouts.
|
inline |
adds a storage type
type may be any or-combination of constants enumerated in ug::ParallelStorageType.
References ug::ParallelMatrix< TMatrix >::m_type.
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.
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.
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.
|
inline |
returns storage type mask
References ug::ParallelMatrix< TMatrix >::m_type.
Referenced by ug::ParallelMatrix< TMatrix >::operator=(), and ug::SerializeUniquePart().
|
inline |
References ug::ParallelMatrix< TMatrix >::m_type.
Referenced by ug::GetMultType().
|
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().
|
inline |
returns the algebra layouts
References ug::ParallelMatrix< TMatrix >::m_spAlgebraLayouts.
Referenced by ug::CheckDiagonalInvertible(), ug::MakeConsistent(), ug::ParallelMatrix< TMatrix >::operator=(), and ug::ParallelMatrix< TMatrix >::set_layouts().
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.
ParallelMatrix< TMatrix >::this_type & ug::ParallelMatrix< TMatrix >::operator= | ( | const this_type & | M | ) |
assignment
References ug::ParallelMatrix< TMatrix >::get_storage_mask(), and ug::ParallelMatrix< TMatrix >::layouts().
|
inline |
removes a storage type
type may be any or-combination of constants enumerated in ug::ParallelStorageType.
References ug::ParallelMatrix< TMatrix >::m_type.
|
inline |
sets the algebra layouts
References ug::ParallelMatrix< TMatrix >::layouts(), and ug::ParallelMatrix< TMatrix >::m_spAlgebraLayouts.
Referenced by ug::MakeConsistent(), ug::IExternalSolver< TAlgebra >::mat_preprocess(), and ug::ILUTScalarPreconditioner< TAlgebra >::preprocess().
|
inline |
sets the storage type
type may be any or-combination of constants enumerated in ug::ParallelStorageType.
References ug::ParallelMatrix< TMatrix >::m_type.
Referenced by ug::DeserializeUniquePart(), ug::IExternalSolver< TAlgebra >::mat_preprocess(), and ug::ILUTScalarPreconditioner< TAlgebra >::preprocess().
|
private |
algebra layouts and communicators
Referenced by ug::ParallelMatrix< TMatrix >::layouts(), and ug::ParallelMatrix< TMatrix >::set_layouts().
|
private |
type of storage (i.e. consistent, additiv, additiv unique)
Referenced by ug::ParallelMatrix< TMatrix >::add_storage_type(), ug::ParallelMatrix< TMatrix >::get_storage_mask(), ug::ParallelMatrix< TMatrix >::get_storage_type(), ug::ParallelMatrix< TMatrix >::has_storage_type(), ug::ParallelMatrix< TMatrix >::remove_storage_type(), and ug::ParallelMatrix< TMatrix >::set_storage_type().