isce3 0.25.0
Loading...
Searching...
No Matches
isce3::math::RootFind1dSecant Class Reference

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>

Inheritance diagram for isce3::math::RootFind1dSecant:
isce3::math::detail::RootFind1dBase

Public Member Functions

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.
 
- Public Member Functions inherited from isce3::math::detail::RootFind1dBase
 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.
 

Protected Types

using func_t = std::function<double(double)>
 
using tuple4_t = std::tuple<double, double, bool, int>
 

Additional Inherited Members

- Static Public Member Functions inherited from isce3::math::detail::RootFind1dBase
static std::function< double(double)> poly2func (const isce3::core::Poly1d &f)
 Convert isce3 Poly1d object into a single-variavle function object "f(x)".
 
- Protected Attributes inherited from isce3::math::detail::RootFind1dBase
double f_tol
 
int max_iter
 
std::optional< double > x_tol
 

Detailed Description

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

Member Function Documentation

◆ 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]fsingle-variable function object to represent "f(x)".
[in]x0first initial guess of the "x".
[in]x1second 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:

Generated for ISCE3.0 by doxygen 1.13.2.