numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class to solve linear equations using generalized minimal residual (GMRES) [7]. More...
#include <num_collect/ode/impl/gmres.h>
Public Types | |
using | matrix_type = Eigen::MatrixX<scalar_type> |
Type of matrices. | |
using | scalar_type = typename vector_type::Scalar |
Type of scalars. | |
using | vector_type = Vector |
Type of vectors. | |
Public Member Functions | |
auto | max_subspace_dim (index_type val) -> gmres & |
Set the maximum number of dimensions of subspace. | |
template<typename CoeffFunction > | |
void | solve (CoeffFunction &&coeff_function, const vector_type &rhs, vector_type &solution) |
Solve. | |
Private Attributes | |
matrix_type | basis_ {} |
Basis of subspace. | |
matrix_type | hessenberg_ {} |
Hessenberg matrix. | |
index_type | max_subspace_dim_ {default_max_subspace_dim} |
Maximum number of dimensions of subspace. | |
Eigen::ColPivHouseholderQR< matrix_type > | qr_ {} |
QR decomposition. | |
vector_type | residual_ {} |
Residual. | |
Eigen::VectorX< scalar_type > | temp_rhs_ {} |
Temporary vector for solving internal equation. | |
Eigen::VectorX< scalar_type > | temp_sol_ {} |
Temporary vector for solving internal equation. | |
Static Private Attributes | |
static constexpr index_type | default_max_subspace_dim = 2 |
Default maximum number of dimensions of subspace. | |
Class to solve linear equations using generalized minimal residual (GMRES) [7].
Vector | Type of vectors. |
using num_collect::ode::impl::gmres< Vector >::matrix_type = Eigen::MatrixX<scalar_type> |
using num_collect::ode::impl::gmres< Vector >::scalar_type = typename vector_type::Scalar |
using num_collect::ode::impl::gmres< Vector >::vector_type = Vector |
|
inline |
|
inline |
Solve.
coeff_function is assumed to have a signature like:
CoeffFunction | Type of the function to multiply coefficient matrix. |
[in] | coeff_function | Function to multiply coefficient matrix. |
[in] | rhs | Right-hand-side vector. |
[in,out] | solution | Solution. (Given vector is used as the initial solution.) |
|
private |
|
staticconstexprprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |