ug4
|
#include <lu.h>
Public Types | |
typedef TAlgebra | algebra_type |
Algebra type. | |
typedef IMatrixOperatorInverse< matrix_type, vector_type > | base_type |
Base type. | |
typedef TAlgebra::matrix_type | matrix_type |
Matrix type. | |
typedef TAlgebra::vector_type | vector_type |
Vector type. | |
![]() | |
typedef TAlgebra::vector_type | codomain_function_type |
Range space. | |
typedef TAlgebra::vector_type | domain_function_type |
Domain space. | |
typedef TAlgebra::matrix_type | matrix_type |
Matrix type. | |
![]() | |
typedef Y | codomain_function_type |
Range space. | |
typedef X | domain_function_type |
Domain space. | |
![]() | |
typedef Y | codomain_function_type |
Range space. | |
typedef X | domain_function_type |
Domain space. | |
Public Member Functions | |
virtual bool | apply (vector_type &u, const vector_type &f) |
Compute u = L^{-1} * f. | |
bool | apply_lu (vector_type &x, const vector_type &b) |
virtual bool | apply_return_defect (vector_type &u, vector_type &f) |
Compute u = L^{-1} * f AND return defect f := f - L*u. | |
virtual std::string | config_string () const |
returns information about configuration parameters | |
virtual bool | init (SmartPtr< ILinearOperator< Y, X > > A) |
initializes this inverse operator for a linear operator | |
virtual bool | init (SmartPtr< ILinearOperator< Y, X > > A, const Y &u) |
initializes this inverse operator for a linear operator | |
virtual bool | init (SmartPtr< MatrixOperator< M, Y, X > > A)=0 |
initializes this inverse operator for a matrix-based operator | |
virtual bool | init (SmartPtr< MatrixOperator< matrix_type, vector_type > > Op) |
set operator L, that will be inverted | |
bool | init_lu (const matrix_type *pA) |
initializes the solver for a matrix A | |
LU () | |
constructor | |
virtual const char * | name () const |
returns the name of the operator inverse | |
void | set_info (bool b) |
void | set_minimum_for_sparse (size_t N) |
void | set_show_progress (bool b) |
void | set_sort_sparse (bool b) |
virtual bool | supports_parallel () const |
returns if parallel solving is supported | |
virtual | ~LU () |
Destructor. | |
![]() | |
virtual bool | init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > A) |
initializes this inverse operator for a linear operator | |
virtual bool | init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > A, const TAlgebra::vector_type &u) |
initializes this inverse operator for a linear operator | |
virtual bool | init (SmartPtr< MatrixOperator< TAlgebra::matrix_type, TAlgebra::vector_type, TAlgebra::vector_type > > A)=0 |
initializes this inverse operator for a matrix-based operator | |
virtual | ~IMatrixOperatorInverse () |
virtual destructor | |
![]() | |
virtual bool | apply (Y &u, const X &f)=0 |
applies inverse operator, i.e. returns u = A^{-1} f | |
virtual bool | apply_return_defect (Y &u, X &f)=0 |
applies inverse operator, i.e. returns u = A^{-1} f and returns defect d := f - A*u | |
virtual bool | apply_update_defect (Y &u, X &f) |
compute new correction c = B*d and update defect d := d - A*c | |
virtual SmartPtr< ILinearIterator< X, Y > > | clone () |
clone | |
SmartPtr< IConvergenceCheck< X > > | convergence_check () |
returns the convergence check | |
ConstSmartPtr< IConvergenceCheck< X > > | convergence_check () const |
returns the convergence check | |
number | defect () const |
returns the current defect | |
ILinearOperatorInverse () | |
constructor setting convergence check to (100, 1e-12, 1e-12, true) | |
ILinearOperatorInverse (SmartPtr< IConvergenceCheck< X > > spConvCheck) | |
Default constructor. | |
SmartPtr< ILinearOperator< Y, X > > | linear_operator () |
returns the current Operator this Inverse Operator is initialized for | |
number | reduction () const |
returns the current relative reduction | |
void | set_convergence_check (SmartPtr< IConvergenceCheck< X > > spConvCheck) |
set the convergence check | |
virtual int | standard_offset () const |
returns the standard offset for output | |
int | step () const |
returns the current number of steps | |
virtual | ~ILinearOperatorInverse () |
virtual destructor | |
![]() | |
SmartPtr< IDamping< X, Y > > | damping () |
returns the scaling | |
ILinearIterator () | |
constructor | |
ILinearIterator (const ILinearIterator< X, Y > &parent) | |
copy constructor | |
void | set_damp (number factor) |
sets the damping to a constant factor | |
void | set_damp (SmartPtr< IDamping< X, Y > > spScaling) |
sets a scaling for the correction | |
virtual | ~ILinearIterator () |
virtual destructor | |
Protected Attributes | |
SmartPtr< ILUTScalarPreconditioner< algebra_type > > | ilut_scalar |
CPUAlgebra::vector_type | m_b |
bool | m_bDense |
bool | m_bInfo |
bool | m_bShowProgress |
bool | m_bSortSparse |
size_t | m_iMinimumForSparse |
DenseMatrixInverse< DenseMatrix< VariableArray2< double > > > | m_mat |
inverse | |
const matrix_type * | m_pMatrix |
matrix to invert | |
size_t | m_size |
SmartPtr< MatrixOperator< matrix_type, vector_type > > | m_spOperator |
Operator to invert. | |
DenseVector< VariableArray1< double > > | m_tmp |
CPUAlgebra::vector_type | m_u |
![]() | |
SmartPtr< IConvergenceCheck< X > > | m_spConvCheck |
smart pointer holding the convergence check | |
SmartPtr< ILinearOperator< Y, X > > | m_spLinearOperator |
Operator that is inverted by this Inverse Operator. | |
![]() | |
SmartPtr< IDamping< X, Y > > | m_spDamping |
the scaling | |
Private Member Functions | |
bool | init_dense (const matrix_type &A) |
returns name of solver | |
bool | init_sparse (const matrix_type &A) |
void | init_var (const matrix_type &A) |
void | print_info (const matrix_type &A) |
bool | solve_dense (vector_type &x, const vector_type &b) |
bool | solve_sparse (vector_type &x, const vector_type &b) |
typedef TAlgebra ug::LU< TAlgebra >::algebra_type |
Algebra type.
typedef IMatrixOperatorInverse<matrix_type,vector_type> ug::LU< TAlgebra >::base_type |
Base type.
typedef TAlgebra::matrix_type ug::LU< TAlgebra >::matrix_type |
Matrix type.
typedef TAlgebra::vector_type ug::LU< TAlgebra >::vector_type |
Vector type.
|
inline |
constructor
References ug::LU< TAlgebra >::m_iMinimumForSparse.
|
inlinevirtual |
Compute u = L^{-1} * f.
Implements ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >.
References ug::LU< TAlgebra >::apply_lu(), ug::ILinearOperatorInverse< X, Y >::convergence_check(), ug::LU< TAlgebra >::m_pMatrix, PROFILE_FUNC, ug::PST_ADDITIVE, ug::PST_CONSISTENT, UG_ASSERT, and UG_LOG.
Referenced by ug::LU< TAlgebra >::apply_return_defect().
|
inline |
|
inlinevirtual |
Compute u = L^{-1} * f AND return defect f := f - L*u.
Implements ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >.
References ug::LU< TAlgebra >::apply(), ug::LU< TAlgebra >::m_pMatrix, PROFILE_BEGIN_GROUP, and UG_LOG.
|
inlinevirtual |
returns information about configuration parameters
this should return necessary information about parameters and possibly calling config_string of subcomponents.
Reimplemented from ug::ILinearOperatorInverse< X, Y >.
References ug::LU< TAlgebra >::m_iMinimumForSparse.
|
inlinevirtual |
initializes this inverse operator for a linear operator
This method implements the ILinearOperatorInverse interface method. Basically, the request is forwarded to the matrix-based init method, if the the operator is matrix-based. If the operator is not matrix-based this inverse can not be used and false is returned
[in] | A | linear matrix-based operator to invert |
Reimplemented from ug::ILinearOperatorInverse< X, Y >.
|
inlinevirtual |
initializes this inverse operator for a linear operator
This method implements the ILinearOperatorInverse interface method. Basically, the request is forwarded to the matrix-based init method, if the the operator is matrix-based. If the operator is not matrix-based this inverse can not be used and false is returned
[in] | A | linear matrix-based operator to invert |
[in] | u | linearization point |
Reimplemented from ug::ILinearOperatorInverse< X, Y >.
virtual bool ug::IMatrixOperatorInverse< M, X, Y >::init | ( | SmartPtr< MatrixOperator< M, Y, X > > | A | ) |
initializes this inverse operator for a matrix-based operator
This method passes the operator A that is inverted by this operator. In addition some preparation step can be made.
[in] | A | linear matrix-basewd operator to invert |
|
inlinevirtual |
set operator L, that will be inverted
References ug::MatrixOperator< M, X, Y >::get_matrix(), ug::LU< TAlgebra >::init_lu(), ug::LU< TAlgebra >::m_spOperator, and UG_LOG.
|
inlineprivate |
returns name of solver
References ug::GetBytesSizeString(), ug::GetDenseDoubleFromSparse(), ug::LU< TAlgebra >::m_bDense, ug::LU< TAlgebra >::m_bInfo, ug::LU< TAlgebra >::m_mat, ug::LU< TAlgebra >::m_size, ug::LU< TAlgebra >::print_info(), PROFILE_FUNC, UG_LOG, and UG_THROW.
Referenced by ug::LU< TAlgebra >::init_lu().
|
inline |
initializes the solver for a matrix A
References ug::LU< TAlgebra >::init_dense(), ug::LU< TAlgebra >::init_sparse(), ug::LU< TAlgebra >::init_var(), ug::LU< TAlgebra >::m_iMinimumForSparse, ug::LU< TAlgebra >::m_pMatrix, ug::LU< TAlgebra >::m_size, PROFILE_BEGIN_GROUP, PROFILE_FUNC, UG_ASSERT, UG_CATCH_THROW, and UG_LOG.
Referenced by ug::LU< TAlgebra >::init().
|
inlineprivate |
References ug::LU< TAlgebra >::ilut_scalar, ug::LU< TAlgebra >::m_bDense, ug::LU< TAlgebra >::m_bInfo, ug::LU< TAlgebra >::m_bShowProgress, ug::LU< TAlgebra >::m_bSortSparse, make_sp(), ug::LU< TAlgebra >::print_info(), PROFILE_FUNC, UG_CATCH_THROW, and UG_LOG.
Referenced by ug::LU< TAlgebra >::init_lu().
|
inlineprivate |
References UG_ASSERT.
Referenced by ug::LU< TAlgebra >::init_lu().
|
inlinevirtual |
returns the name of the operator inverse
This method returns the name of the inverse operator. This function is typically needed, when the inverse operator is used inside of another and some debug output should be printed
Implements ug::ILinearOperatorInverse< X, Y >.
|
inlineprivate |
References UG_LOG.
Referenced by ug::LU< TAlgebra >::init_dense(), and ug::LU< TAlgebra >::init_sparse().
|
inline |
References ug::LU< TAlgebra >::m_bInfo.
|
inline |
References ug::LU< TAlgebra >::m_iMinimumForSparse.
|
inline |
References ug::LU< TAlgebra >::m_bShowProgress.
|
inline |
References ug::LU< TAlgebra >::m_bSortSparse.
|
inlineprivate |
References ug::BlockRef(), ug::GetSize(), ug::LU< TAlgebra >::m_mat, ug::LU< TAlgebra >::m_size, ug::LU< TAlgebra >::m_tmp, PROFILE_FUNC, and UG_CATCH_THROW.
Referenced by ug::LU< TAlgebra >::apply_lu().
|
inlineprivate |
References ug::LU< TAlgebra >::ilut_scalar, and PROFILE_FUNC.
Referenced by ug::LU< TAlgebra >::apply_lu().
|
inlinevirtual |
returns if parallel solving is supported
Implements ug::ILinearOperatorInverse< X, Y >.
|
protected |
Referenced by ug::LU< TAlgebra >::init_sparse(), and ug::LU< TAlgebra >::solve_sparse().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by ug::LU< TAlgebra >::init_sparse(), and ug::LU< TAlgebra >::set_show_progress().
|
protected |
Referenced by ug::LU< TAlgebra >::init_sparse(), and ug::LU< TAlgebra >::set_sort_sparse().
|
protected |
|
protected |
inverse
Referenced by ug::LU< TAlgebra >::init_dense(), and ug::LU< TAlgebra >::solve_dense().
|
protected |
matrix to invert
Referenced by ug::LU< TAlgebra >::apply(), ug::LU< TAlgebra >::apply_lu(), ug::LU< TAlgebra >::apply_return_defect(), and ug::LU< TAlgebra >::init_lu().
|
protected |
|
protected |
Operator to invert.
Referenced by ug::LU< TAlgebra >::init().
|
protected |
Referenced by ug::LU< TAlgebra >::solve_dense().
|
protected |