7#include <isce3/core/Poly1d.h>
8#include <isce3/except/Error.h>
10namespace isce3 {
namespace math {
namespace detail {
38 std::optional<double> x_tol = {})
39 : f_tol {f_tol}, max_iter {max_iter}, x_tol {x_tol}
42 throw isce3::except::InvalidArgument(
43 ISCE_SRCINFO(),
"Max number of iterations must be >=1!");
45 throw isce3::except::InvalidArgument(ISCE_SRCINFO(),
46 "Tolerance for function value must be positive!");
49 throw isce3::except::InvalidArgument(ISCE_SRCINFO(),
50 "Tolerance for function variable must be positive!");
85 return x_tol ? *x_tol : std::optional<double> {};
95 return [=](
double x) {
return f.
eval(x); };
102 std::optional<double> x_tol;
Data structure for representing 1D polynomials.
Definition Poly1d.h:23
double eval(double x) const
Evaluate polynomial at x.
Definition Poly1d.cpp:12
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.
Definition RootFind1dBase.h:37
RootFind1dBase(int max_iter)
A constructor with max number of iterations.
Definition RootFind1dBase.h:59
static std::function< double(double)> poly2func(const isce3::core::Poly1d &f)
Convert isce3 Poly1d object into a single-variavle function object "f(x)".
Definition RootFind1dBase.h:93
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...
Definition RootFind1dBase.h:83
int max_num_iter() const
Get max number of iteration being set.
Definition RootFind1dBase.h:76
double func_tol() const
Get the absolute tolerance for function value.
Definition RootFind1dBase.h:70
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5