GMRES method to solve a linear equation.
More...
#include <Gmres.h>
|
| using | AmulFunc = std::function< Eigen::VectorXd(const Eigen::Ref< const Eigen::VectorXd > &)> |
| | Type of function that returns x multiplied by A. More...
|
| |
|
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW | Gmres () |
| | Constructor. More...
|
| |
| void | solve (const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::VectorXd > &b, Eigen::Ref< Eigen::VectorXd > x, int k_max=100, double eps=1e-10) |
| | Solve. More...
|
| |
| void | solve (const AmulFunc &Amul_func, const Eigen::Ref< const Eigen::VectorXd > &b, Eigen::Ref< Eigen::VectorXd > x, int k_max=100, double eps=1e-10) |
| | Solve. More...
|
| |
GMRES method to solve a linear equation.
See the following articles about the GMRES method:
Definition at line 21 of file Gmres.h.
◆ AmulFunc
Type of function that returns x multiplied by A.
Definition at line 25 of file Gmres.h.
◆ Gmres()
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW nmpc_cgmres::Gmres::Gmres |
( |
| ) |
|
|
inline |
Constructor.
Definition at line 31 of file Gmres.h.
◆ solve() [1/2]
| void nmpc_cgmres::Gmres::solve |
( |
const AmulFunc & |
Amul_func, |
|
|
const Eigen::Ref< const Eigen::VectorXd > & |
b, |
|
|
Eigen::Ref< Eigen::VectorXd > |
x, |
|
|
int |
k_max = 100, |
|
|
double |
eps = 1e-10 |
|
) |
| |
|
inline |
Solve.
- Parameters
-
| Amul_func | the function to return where is given |
| b | the vector of linear equation |
| x | the initial guess of solution, which is overwritten by the final solution |
| k_max | the maximum number of GMRES iteration |
| eps | the required solution tolerance |
Solve the linear equation:
.
Refer to the Algorithm 3.5.1. in [1] for the case that make_triangular_ is true. Refer to the Algorithm 3.4.2. in [1] for the case that make_triangular_ is false. [1] Kelley, Carl T. Iterative methods for linear and nonlinear equations. Society for Industrial and Applied Mathematics, 1995.
Definition at line 67 of file Gmres.h.
◆ solve() [2/2]
| void nmpc_cgmres::Gmres::solve |
( |
const Eigen::Ref< const Eigen::MatrixXd > & |
A, |
|
|
const Eigen::Ref< const Eigen::VectorXd > & |
b, |
|
|
Eigen::Ref< Eigen::VectorXd > |
x, |
|
|
int |
k_max = 100, |
|
|
double |
eps = 1e-10 |
|
) |
| |
|
inline |
Solve.
- Parameters
-
| A | the matrix of linear equation |
| b | the vector of linear equation |
| x | the initial guess of solution, which is overwritten by the final solution |
| k_max | the maximum number of GMRES iteration |
| eps | the required solution tolerance |
Solve the linear equation:
.
Definition at line 42 of file Gmres.h.
◆ apply_reorth_
| bool nmpc_cgmres::Gmres::apply_reorth_ = true |
◆ basis_
| std::vector<Eigen::VectorXd> nmpc_cgmres::Gmres::basis_ |
◆ err_list_
| std::vector<double> nmpc_cgmres::Gmres::err_list_ |
◆ g_
| Eigen::VectorXd nmpc_cgmres::Gmres::g_ |
◆ H_
| Eigen::MatrixXd nmpc_cgmres::Gmres::H_ |
◆ make_triangular_
| bool nmpc_cgmres::Gmres::make_triangular_ = true |
The documentation for this class was generated from the following file:
- /home/runner/work/NMPC/NMPC/catkin_ws/src/NMPC/nmpc_cgmres/include/nmpc_cgmres/Gmres.h