isce3 0.25.0
Loading...
Searching...
No Matches
RootFind1dNewton.h
1// 1-D Newton Root finding class
2#pragma once
3
4#include <functional>
5#include <tuple>
6
7#include <isce3/core/Poly1d.h>
8
9#include "detail/RootFind1dBase.h"
10
11namespace isce3 { namespace math {
12
19class RootFind1dNewton : public detail::RootFind1dBase {
20 // aliases
21protected:
22 using func_t = std::function<double(double)>;
23 using tuple4_t = std::tuple<double, double, bool, int>;
24 using poly1d_t = isce3::core::Poly1d;
25 using func2_t = std::function<std::tuple<double, double>(double)>;
26
27public:
28 // inherit all constructors from base class
29 using detail::RootFind1dBase::RootFind1dBase;
30
31 // methods
44 std::tuple<double, double, bool, int> root(
45 const isce3::core::Poly1d& f, double x0 = 0) const;
46
59 std::tuple<double, double, bool, int> root(
60 const std::function<double(double)>& f,
61 const std::function<double(double)>& f_der, double x0 = 0) const;
62
75 std::tuple<double, double, bool, int> root(
76 const std::function<std::tuple<double, double>(double)>& f,
77 double x0 = 0) const;
78
79private:
93 tuple4_t _newton(const func2_t& f, double x0) const;
94
109 tuple4_t _newton_strict(const func2_t& f, double x0) const;
110};
111
112}} // namespace isce3::math
Data structure for representing 1D polynomials.
Definition Poly1d.h:23
A class with overloaded method to solve 1-D (single variable) equation f(x)=0 with at least one real-...
Definition RootFind1dNewton.h:19
std::tuple< double, double, bool, int > root(const isce3::core::Poly1d &f, double x0=0) const
Find a root of the function "f(x)" closest to its initial value via Newton approach.
Definition RootFind1dNewton.cpp:10
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5

Generated for ISCE3.0 by doxygen 1.13.2.