33 #ifndef __H__UG__LIB_ALGEBRA__POWER_METHOD_H__
34 #define __H__UG__LIB_ALGEBRA__POWER_METHOD_H__
59 template<
typename TAlgebra>
108 UG_LOG(
"Initializing PowerMethod." << std::endl);
135 for(
size_t i=0; i<A.num_rows(); i++)
139 if(A.is_isolated(i) == 0)
195 (*m_spEigenvector)[i] = 0.0;
216 UG_LOG(
"PowerMethod::calculate_max_eigenvalue() converged after " <<
m_iteration <<
" iterations." << std::endl);
267 (*m_spEigenvector)[i] = 0.0;
288 UG_LOG(
"PowerMethod::calculate_min_eigenvalue() converged after " <<
m_iteration <<
" iterations." << std::endl);
Definition: smart_pointer.h:108
describes a linear mapping X->Y
Definition: linear_operator.h:80
describes an inverse linear mapping X->Y
Definition: linear_operator_inverse.h:80
Definition: matrix_operator.h:49
Definition: power_method.h:61
size_t m_iteration
Definition: power_method.h:104
std::vector< bool > m_vbDirichlet
Definition: power_method.h:99
void print_matrix_B()
Definition: power_method.h:323
vector_type::value_type vector_value_type
Definition: power_method.h:69
TAlgebra algebra_type
Definition: power_method.h:64
SmartPtr< ILinearOperatorInverse< vector_type > > m_spSolver
Definition: power_method.h:89
void set_linear_operator_B(SmartPtr< ILinearOperator< vector_type > > loB)
Definition: power_method.h:144
void print_matrix_A()
Definition: power_method.h:318
double get_min_eigenvalue()
Definition: power_method.h:308
SmartPtr< matrix_operator_type > m_spMatOpB
Definition: power_method.h:79
SmartPtr< ILinearOperator< vector_type > > m_spLinOpA
Definition: power_method.h:73
int calculate_min_eigenvalue()
Definition: power_method.h:231
double B_norm(vector_type &x)
Definition: power_method.h:342
size_t get_iterations()
Definition: power_method.h:313
SmartPtr< vector_type > m_spEigenvector
Definition: power_method.h:83
TAlgebra::matrix_type matrix_type
Definition: power_method.h:68
int calculate_max_eigenvalue()
Definition: power_method.h:165
TAlgebra::vector_type vector_type
Definition: power_method.h:67
void set_linear_operator_A(SmartPtr< ILinearOperator< vector_type > > loA)
Definition: power_method.h:126
void print_eigenvector()
Definition: power_method.h:328
void set_solver(SmartPtr< ILinearOperatorInverse< vector_type > > solver)
Definition: power_method.h:121
int m_numDirichletRows
Definition: power_method.h:100
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Definition: power_method.h:76
SmartPtr< vector_type > m_spResidual
Definition: power_method.h:96
double m_dMinEigenvalue
Definition: power_method.h:86
size_t m_maxIterations
Definition: power_method.h:92
void set_max_iterations(size_t maxIterations)
Definition: power_method.h:155
SmartPtr< matrix_operator_type > m_spMatOpA
Definition: power_method.h:78
double m_dPrecision
Definition: power_method.h:93
PowerMethod()
Definition: power_method.h:106
SmartPtr< ILinearOperator< vector_type > > m_spLinOpB
Definition: power_method.h:77
double get_max_eigenvalue()
Definition: power_method.h:303
void set_precision(double precision)
Definition: power_method.h:160
void set_start_vector(SmartPtr< vector_type > vec)
Definition: power_method.h:150
SmartPtr< vector_type > create_approximation_vector()
Definition: power_method.h:335
double m_dMaxEigenvalue
Definition: power_method.h:85
void normalize_approximations()
Definition: power_method.h:350
SmartPtr< vector_type > m_spEigenvectorOld
Definition: power_method.h:84
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
void VecScaleAdd(vector_t &vOut, typename vector_t::value_type s1, const vector_t &v1, typename vector_t::value_type s2, const vector_t &v2)
Scales two Vectors, adds them and returns the sum in a third vector.
Definition: math_vector_functions_common_impl.hpp:265
double EnergyNorm(vector_type &x, matrix_type &A, vector_type &tmp)
Definition: additional_math.h:115
void PrintMatrix(const matrix_type &mat, const char *name)
Definition: additional_math.h:201
#define PROFILE_FUNC_GROUP(groups)
Definition: profiler.h:258
T value_type
Definition: sparsematrix_interface.h:2