A class with root method to solve 1-D (single variable) equation f(x)=0 with at least one real-value root/solution via Secant approach See Secant method
More...
#include <RootFind1dSecant.h>
|
std::tuple< double, double, bool, int > | root (const std::function< double(double)> &f, double x0, double x1) const |
| Find a root of the function "f(x)" closest to its initial values via Secant approach.
|
|
| 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.
|
|
|
using | func_t = std::function<double(double)> |
|
using | tuple4_t = std::tuple<double, double, bool, int> |
|
|
static std::function< double(double)> | poly2func (const isce3::core::Poly1d &f) |
| Convert isce3 Poly1d object into a single-variavle function object "f(x)".
|
|
double | f_tol |
|
int | max_iter |
|
std::optional< double > | x_tol |
|
A class with root method to solve 1-D (single variable) equation f(x)=0 with at least one real-value root/solution via Secant approach See Secant method
◆ root()
RootFind1dSecant::tuple4_t isce3::math::RootFind1dSecant::root |
( |
const std::function< double(double)> & | f, |
|
|
double | x0, |
|
|
double | x1 ) const |
Find a root of the function "f(x)" closest to its initial values via Secant approach.
- Parameters
-
[in] | f | single-variable function object to represent "f(x)". |
[in] | x0 | first initial guess of the "x". |
[in] | x1 | second guess of the "x". |
- Returns
- solution "x"
-
function eval "f(x)"
-
convergence flag (true or false)
-
number of iterations
The documentation for this class was generated from the following files:
- /home/runner/work/isce3/isce3/cxx/isce3/math/RootFind1dSecant.h
- /home/runner/work/isce3/isce3/cxx/isce3/math/RootFind1dSecant.cpp
1.13.2.