38 std::vector<T>
const & h_list)
40 if (error_list.size() != h_list.size())
42 gsWarn <<
"The lists does not have same size!\n";
46 const index_t Nsize = error_list.size();
55 gsVector<T> rate = A.fullPivHouseholderQr().solve(y);
72 GISMO_ENSURE(matrix.cols() == matrix.rows(),
"Matrix must be square!");
74 unsigned N_size = matrix.cols();
77 gsWarn <<
"Matrix has dimension " << N_size <<
". It might take long to find eigenvalues...\n";
82 eigen_values.compute(matrix,
false);
84 T tmp =
math::abs(eigen_values.eigenvalues()(0,0).real());
90 for (
unsigned k=0; k< N_size; ++k)
92 tmp =
math::abs(eigen_values.eigenvalues()(k,0).real());
95 if (tmp < 1e-13 && removeSingularity)
97 removeSingularity =
false;
98 gsDebug <<
"Removed the eigen value: " << tmp <<
"\n";
102 tmp =
math::abs(eigen_values.eigenvalues()(k+1,0).real());
109 if (tmp < eigen_low ) {eigen_low = tmp;}
110 if (tmp > eigen_high) {eigen_high = tmp;}
114 return eigen_high/eigen_low;
120 unsigned N_size = matrix.cols();
123 gsWarn <<
"Matrix has dimension " << N_size <<
". It might take long to find eigenvalues...\n" << std::flush;
#define gsDebug
Definition: gsDebug.h:61
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
static T conditionNumber(const gsSparseMatrix< T > &matrix)
Finds the spectral condition number of a small matrix.
Definition: gsSolverUtils.h:118
#define gsWarn
Definition: gsDebug.h:50
static T convergenceRateLS(std::vector< T > const &error_list, std::vector< T > const &h_list)
Finds the convergence rate for a list of errors and a list with elements sizes by the least square me...
Definition: gsSolverUtils.h:37
Creates a mapped object or data pointer to a const matrix without copying data.
Definition: gsLinearAlgebra.h:127
static T conditionNumber(const gsMatrix< T > &matrix, bool removeSingularity=false)
Finds the spectral condition number of a small matrix.
Definition: gsSolverUtils.h:70
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4488
Utility class for PDE's solver related utils.
Definition: gsSolverUtils.h:24