numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Base class of iterative solvers. More...
#include <num_collect/linear/iterative_solver_base.h>
Public Types | |
enum | { ColsAtCompileTime = MatrixType::ColsAtCompileTime , MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
using | matrix_type = MatrixType |
Type of matrices. | |
using | MatrixType |
Type of matrices. (For Eigen library.) | |
using | real_scalar_type = RealScalar |
Type of real scalars. | |
using | RealScalar = typename MatrixType::RealScalar |
Type of real scalars. (For Eigen library.) | |
using | Scalar = typename MatrixType::Scalar |
Type of scalars. (For Eigen library.) | |
using | scalar_type = Scalar |
Type of scalars. | |
using | storage_index_type = StorageIndex |
Type of indices in storages. | |
using | StorageIndex = typename MatrixType::StorageIndex |
Type of indices in storages. (For Eigen library.) | |
Public Member Functions | |
iterative_solver_base () | |
Constructor. | |
template<base::concepts::dense_vector_of< scalar_type > Right, base::concepts::dense_vector_of< scalar_type > Solution> | |
void | _solve_impl (const Right &right, Solution &solution) const |
Internal function to solve for a right-hand-side vector. | |
template<base::concepts::dense_vector_of< scalar_type > Right, base::concepts::dense_vector_of< scalar_type > Solution> | |
void | _solve_with_guess_impl (const Right &right, Solution &solution) const |
Internal function to solve for a right-hand-side vector. | |
auto | cols () const noexcept -> Eigen::Index |
Get the number of columns. | |
auto | compute (const matrix_type &coeff) -> Derived & |
Initialize this solver using a coefficient matrix. | |
auto | max_iterations () const noexcept -> index_type |
Get the maximum number of iterations. | |
auto | max_iterations (index_type val) -> Derived & |
Set the maximum number of iterations. | |
auto | rows () const noexcept -> Eigen::Index |
Get the number of rows. | |
template<base::concepts::dense_vector_of< scalar_type > Right> | |
auto | solve (const Right &right) const -> Eigen::Solve< Derived, Right > |
Solve a linear equation. | |
template<base::concepts::dense_vector_of< scalar_type > Right, base::concepts::dense_vector_of< scalar_type > Solution> | |
auto | solve_with_guess (const Right &right, const Solution &solution) const -> Eigen::SolveWithGuess< Derived, Right, Solution > |
Solve a linear equation with a guess of the solution. | |
auto | tolerance () const noexcept -> real_scalar_type |
Get the tolerance of rate of residual. | |
auto | tolerance (const real_scalar_type &val) -> Derived & |
Set the tolerance of rate of residual. | |
Protected Types | |
using | Base = Eigen::SparseSolverBase<Derived> |
Base class. | |
Protected Member Functions | |
auto | coeff () const noexcept -> const matrix_type & |
Get the coefficient matrix. | |
Private Attributes | |
const matrix_type * | coeff_ {nullptr} |
Coefficient matrix. | |
index_type | max_iterations_ {default_max_iterations} |
Maximum number of iterations. | |
real_scalar_type | tolerance_ {default_tolerance} |
Tolerance of rate of residual. | |
Static Private Attributes | |
static constexpr index_type | default_max_iterations = 10000 |
Default maximum number of iterations. | |
static constexpr auto | default_tolerance |
Default tolerance of rate of residual. | |
Base class of iterative solvers.
Derived | Derived class. |
Definition at line 53 of file iterative_solver_base.h.
|
protected |
Base class.
Definition at line 56 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::matrix_type = MatrixType |
Type of matrices.
Definition at line 71 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::MatrixType |
Type of matrices. (For Eigen library.)
Definition at line 61 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::real_scalar_type = RealScalar |
Type of real scalars.
Definition at line 77 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::RealScalar = typename MatrixType::RealScalar |
Type of real scalars. (For Eigen library.)
Definition at line 68 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::Scalar = typename MatrixType::Scalar |
Type of scalars. (For Eigen library.)
Definition at line 64 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::scalar_type = Scalar |
Type of scalars.
Definition at line 73 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::storage_index_type = StorageIndex |
Type of indices in storages.
Definition at line 75 of file iterative_solver_base.h.
using num_collect::linear::iterative_solver_base< Derived >::StorageIndex = typename MatrixType::StorageIndex |
Type of indices in storages. (For Eigen library.)
Definition at line 66 of file iterative_solver_base.h.
anonymous enum |
Enumerator | |
---|---|
ColsAtCompileTime | Number of columns at compile time. (For Eigen library.) |
MaxColsAtCompileTime | Maximum number of columns at compile time. (For Eigen library.) |
Definition at line 79 of file iterative_solver_base.h.
|
inline |
Constructor.
Definition at line 91 of file iterative_solver_base.h.
|
inline |
Internal function to solve for a right-hand-side vector.
Right | Type of the right-hand-side vector. |
Solution | Type of the solution vector. |
[in] | right | Right-hand-side vector. |
[in,out] | solution | Solution vector. |
Definition at line 212 of file iterative_solver_base.h.
|
inline |
Internal function to solve for a right-hand-side vector.
Right | Type of the right-hand-side vector. |
Solution | Type of the solution vector. |
[in] | right | Right-hand-side vector. |
[in,out] | solution | Solution vector. |
Definition at line 230 of file iterative_solver_base.h.
|
inlinenodiscardprotectednoexcept |
Get the coefficient matrix.
Definition at line 243 of file iterative_solver_base.h.
|
inlinenodiscardnoexcept |
Get the number of columns.
Definition at line 121 of file iterative_solver_base.h.
|
inline |
Initialize this solver using a coefficient matrix.
[in] | coeff | Coefficient matrix. |
Definition at line 101 of file iterative_solver_base.h.
|
inlinenodiscardnoexcept |
Get the maximum number of iterations.
Definition at line 152 of file iterative_solver_base.h.
|
inline |
Set the maximum number of iterations.
[in] | val | Maximum number of iterations. |
Definition at line 162 of file iterative_solver_base.h.
|
inlinenodiscardnoexcept |
Get the number of rows.
Definition at line 112 of file iterative_solver_base.h.
|
inlinenodiscard |
Solve a linear equation.
Right | Type of the right-hand-side vector. |
[in] | right | Right-hand-side vector. |
Definition at line 177 of file iterative_solver_base.h.
|
inlinenodiscard |
Solve a linear equation with a guess of the solution.
Right | Type of the right-hand-side vector. |
Solution | Type of the solution vector. |
[in] | right | Right-hand-side vector. |
[in] | solution | Solution vector. |
Definition at line 194 of file iterative_solver_base.h.
|
inlinenodiscardnoexcept |
Get the tolerance of rate of residual.
Definition at line 130 of file iterative_solver_base.h.
|
inline |
Set the tolerance of rate of residual.
[in] | val | Tolerance of rate of residual. |
Definition at line 140 of file iterative_solver_base.h.
|
private |
Coefficient matrix.
Definition at line 263 of file iterative_solver_base.h.
|
staticconstexprprivate |
Default maximum number of iterations.
Definition at line 250 of file iterative_solver_base.h.
|
staticconstexprprivate |
Default tolerance of rate of residual.
Definition at line 256 of file iterative_solver_base.h.
|
private |
Maximum number of iterations.
Definition at line 253 of file iterative_solver_base.h.
|
private |
Tolerance of rate of residual.
Definition at line 260 of file iterative_solver_base.h.