numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class to solve linear equations using BiCGstab [7]. More...
#include <num_collect/ode/impl/bicgstab.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 | |
bicgstab () | |
Constructor. | |
auto | iterations () -> index_type |
Get the number of iterations. | |
template<base::concepts::invocable< const vector_type &, vector_type & > CoeffFunction> | |
void | solve (CoeffFunction &&coeff_function, const vector_type &rhs, vector_type &solution) |
Solve. | |
auto | tolerances (const error_tolerances< vector_type > &val) -> bicgstab & |
Set the error tolerances. | |
Public Member Functions inherited from num_collect::logging::logging_mixin | |
logging_mixin (log_tag_view tag) | |
Constructor. | |
template<typename Child > | |
void | configure_child_algorithm_logger_if_exists (Child &child) |
Configure a logger of a child algorithm if exists. | |
auto | logger () const noexcept -> const num_collect::logging::logger & |
Access to the logger. | |
auto | logger () noexcept -> num_collect::logging::logger & |
Access to the logger. | |
Private Member Functions | |
template<base::concepts::invocable< const vector_type &, vector_type & > CoeffFunction> | |
void | initialize (CoeffFunction &&coeff_function, const vector_type &rhs, const vector_type &solution) |
Initialize. | |
Private Attributes | |
index_type | iterations_ {} |
Number of iterations. | |
index_type | max_iterations_ {default_max_iterations} |
Maximum number of iterations. | |
vector_type | residual_ {} |
Residual. | |
scalar_type | tolerance_rate_ {default_tolerance_rate} |
Rate of tolerance in this solver. | |
error_tolerances< vector_type > | tolerances_ {} |
Tolerances. | |
Intermediate variables as in notation of \cite Golub2013. | |
vector_type | r0_ {} |
vector_type | p_ {} |
scalar_type | rho_ {} |
vector_type | ap_ {} |
vector_type | as_ {} |
Static Private Attributes | |
static constexpr index_type | default_max_iterations = 1000 |
Default maximum number of iterations. | |
static constexpr auto | default_tolerance_rate |
Default rate of tolerance in this solver. | |
Class to solve linear equations using BiCGstab [7].
Vector | Type of vectors. |
Definition at line 48 of file bicgstab.h.
using num_collect::ode::impl::bicgstab< Vector >::matrix_type = Eigen::MatrixX<scalar_type> |
Type of matrices.
Definition at line 57 of file bicgstab.h.
using num_collect::ode::impl::bicgstab< Vector >::scalar_type = typename vector_type::Scalar |
Type of scalars.
Definition at line 54 of file bicgstab.h.
using num_collect::ode::impl::bicgstab< Vector >::vector_type = Vector |
Type of vectors.
Definition at line 51 of file bicgstab.h.
|
inline |
Constructor.
Definition at line 60 of file bicgstab.h.
|
inlineprivate |
Initialize.
CoeffFunction | Type of the function to multiply coefficient matrix. |
[in] | coeff_function | Function to multiply coefficient matrix. |
[in] | rhs | Right-hand-side vector. |
[in] | solution | Solution. (Given vector is used as the initial solution.) |
Definition at line 166 of file bicgstab.h.
|
inline |
Get the number of iterations.
Definition at line 151 of file bicgstab.h.
|
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.) |
Definition at line 80 of file bicgstab.h.
|
inline |
Set the error tolerances.
[in] | val | Value. |
Definition at line 141 of file bicgstab.h.
|
private |
Intermediate variable.
Definition at line 205 of file bicgstab.h.
|
private |
Intermediate variable.
Definition at line 206 of file bicgstab.h.
|
staticconstexprprivate |
Default maximum number of iterations.
Definition at line 179 of file bicgstab.h.
|
staticconstexprprivate |
Default rate of tolerance in this solver.
Definition at line 188 of file bicgstab.h.
|
private |
Number of iterations.
Definition at line 176 of file bicgstab.h.
|
private |
Maximum number of iterations.
Definition at line 182 of file bicgstab.h.
|
private |
Intermediate variable.
Definition at line 203 of file bicgstab.h.
|
private |
Intermediate variable.
Definition at line 202 of file bicgstab.h.
|
private |
Residual.
Definition at line 195 of file bicgstab.h.
|
private |
Intermediate variable.
Definition at line 204 of file bicgstab.h.
|
private |
Rate of tolerance in this solver.
Definition at line 192 of file bicgstab.h.
|
private |
Tolerances.
Definition at line 185 of file bicgstab.h.