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";
81 typename gsMatrix<T>::EigenSolver eigen_values;
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;
Creates a mapped object or data pointer to a const matrix without copying data.
Definition gsAsMatrix.h:141
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Utility class for PDE's solver related utils.
Definition gsSolverUtils.h:25
static T conditionNumber(const gsMatrix< T > &matrix, bool removeSingularity=false)
Finds the spectral condition number of a small matrix.
Definition gsSolverUtils.h:70
static T conditionNumber(const gsSparseMatrix< T > &matrix)
Finds the spectral condition number of a small matrix.
Definition gsSolverUtils.h:118
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
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
#define gsDebug
Definition gsDebug.h:61
#define gsWarn
Definition gsDebug.h:50
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
The G+Smo namespace, containing all definitions for the library.