A base class used in other derived classes to solve 1-D (single variable) equation f(x)=0 with at least one real-value root/solution.
More...
#include <RootFind1dBase.h>
|
| RootFind1dBase (double f_tol=1e-5, int max_iter=20, std::optional< double > x_tol={}) |
| A default constructor with absolute tolerances for "x" and "f(x)" plus max number of iterations.
|
|
| RootFind1dBase (int max_iter) |
| A constructor with max number of iterations.
|
|
double | func_tol () const |
| Get the absolute tolerance for function value.
|
|
int | max_num_iter () const |
| Get max number of iteration being set.
|
|
std::optional< double > | var_tol () const |
| Get the absolute tolerance for function variable "x" if set It returns std::nullopt if "x_tol" is not specified at object creation.
|
|
|
double | f_tol |
|
int | max_iter |
|
std::optional< double > | x_tol |
|
A base class used in other derived classes to solve 1-D (single variable) equation f(x)=0 with at least one real-value root/solution.
Each derived class must represent a unique solver/method. All derived class must have a method called "root" returning a tuple of four scalars: {solution, function value, convergence flag, number of iterations}.
◆ RootFind1dBase() [1/2]
isce3::math::detail::RootFind1dBase::RootFind1dBase |
( |
double | f_tol = 1e-5, |
|
|
int | max_iter = 20, |
|
|
std::optional< double > | x_tol = {} ) |
|
inline |
A default constructor with absolute tolerances for "x" and "f(x)" plus max number of iterations.
- Parameters
-
[in] | f_tol | (optional) absolute tolerance for function eval "f(x)". Default is 1e-5. |
[in] | max_iter | (optional) max number of iterations. Default is 20. |
[in] | x_tol | (optional) absolute tolerance for function variable "x". If not specified or set to {} or std::nullopt, it will be ignored, otherwise it will be an extra layer of tolerance checking on top of "f_val"! |
- Exceptions
-
◆ RootFind1dBase() [2/2]
isce3::math::detail::RootFind1dBase::RootFind1dBase |
( |
int | max_iter | ) |
|
|
inline |
A constructor with max number of iterations.
- Parameters
-
[in] | max_iter | max number of iterations. Note that the absolute tolerance for the function value is 1e-5. |
- Exceptions
-
◆ func_tol()
double isce3::math::detail::RootFind1dBase::func_tol |
( |
| ) |
const |
|
inline |
Get the absolute tolerance for function value.
- Returns
- tolerance
◆ max_num_iter()
int isce3::math::detail::RootFind1dBase::max_num_iter |
( |
| ) |
const |
|
inline |
Get max number of iteration being set.
- Returns
- number of iterations
◆ poly2func()
static std::function< double(double)> isce3::math::detail::RootFind1dBase::poly2func |
( |
const isce3::core::Poly1d & | f | ) |
|
|
inlinestatic |
Convert isce3 Poly1d object into a single-variavle function object "f(x)".
- Parameters
-
- Returns
- single-variable function object
◆ var_tol()
std::optional< double > isce3::math::detail::RootFind1dBase::var_tol |
( |
| ) |
const |
|
inline |
Get the absolute tolerance for function variable "x" if set It returns std::nullopt if "x_tol" is not specified at object creation.
- Returns
- optional double precision variable tolerance.
The documentation for this class was generated from the following file:
1.13.2.