59 Secant(
const double epsilon, std::function<
double(
double)>
f) noexcept :
73 Secant(
const double epsilon,
const uint32 maxNumIterations, std::function<
double(
double)>
f) noexcept :
93 double solve(
double a,
double b)
105 double lastFx = f_(a);
109 const double x_tmp = calculateX(x, lastX, fx, lastFx);
125 const std::function<double(
double)> f_;
137 static double calculateX(
double x,
double lastX,
double fx,
double lastFx)
noexcept
139 const double functionDifference = fx - lastFx;
140 return x - fx * (x - lastX) / functionDifference;
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: Secant.hpp:50
double solve(double a, double b)
Definition: Secant.hpp:93
~Secant() override=default
Secant(const double epsilon, const uint32 maxNumIterations, std::function< double(double)> f) noexcept
Definition: Secant.hpp:73
Secant(const double epsilon, std::function< double(double)> f) noexcept
Definition: Secant.hpp:59
dtype f(GeneratorType &generator, dtype inDofN, dtype inDofD)
Definition: f.hpp:56
Definition: Bisection.hpp:43
void swap(NdArray< dtype > &inArray1, NdArray< dtype > &inArray2) noexcept
Definition: swap.hpp:42
std::uint32_t uint32
Definition: Types.hpp:40