59 Newton(
const double epsilon, std::function<
double(
double)>
f, std::function<
double(
double)> fPrime) noexcept :
62 fPrime_(std::move(fPrime))
76 const uint32 maxNumIterations,
77 std::function<
double(
double)>
f,
78 std::function<
double(
double)> fPrime) noexcept :
81 fPrime_(std::move(fPrime))
103 double fxPrime = fPrime_(x);
107 x = calculateX(x, fx, fxPrime);
110 fxPrime = fPrime_(x);
120 const std::function<double(
double)> f_;
121 const std::function<double(
double)> fPrime_;
132 static double calculateX(
double x,
double fx,
double fxPrime)
noexcept
134 return x - fx / fxPrime;
ABC for iteration classes to derive from.
Definition: Iteration.hpp:46
Iteration(double epsilon) noexcept
Definition: Iteration.hpp:54
const double epsilon_
Definition: Iteration.hpp:114
void resetNumberOfIterations() noexcept
Definition: Iteration.hpp:94
void incrementNumberOfIterations()
Definition: Iteration.hpp:103
Definition: Newton.hpp:49
~Newton() noexcept override=default
double solve(double x)
Definition: Newton.hpp:98
Newton(const double epsilon, std::function< double(double)> f, std::function< double(double)> fPrime) noexcept
Definition: Newton.hpp:59
Newton(const double epsilon, const uint32 maxNumIterations, std::function< double(double)> f, std::function< double(double)> fPrime) noexcept
Definition: Newton.hpp:75
dtype f(GeneratorType &generator, dtype inDofN, dtype inDofD)
Definition: f.hpp:56
Definition: Bisection.hpp:43
std::uint32_t uint32
Definition: Types.hpp:40