 |
NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Go to the documentation of this file.
61 std::function<
double(
double)>
f,
62 std::function<
double(
double)> fPrime) noexcept :
65 fPrime_(std::move(fPrime))
78 const uint32 maxNumIterations,
79 std::function<
double(
double)>
f,
80 std::function<
double(
double)> fPrime) noexcept :
83 fPrime_(std::move(fPrime))
90 ~Newton()noexcept override = default;
104 double fxPrime = fPrime_(x);
108 x = calculateX(x, fx, fxPrime);
111 fxPrime = fPrime_(x);
121 const std::function<double(
double)> f_;
122 const std::function<double(
double)> fPrime_;
133 static double calculateX(
double x,
double fx,
double fxPrime) noexcept
135 return x - fx / fxPrime;
Iteration(double epsilon) noexcept
Definition: Iteration.hpp:55
Newton(const double epsilon, std::function< double(double)> f, std::function< double(double)> fPrime) noexcept
Definition: Newton.hpp:60
ABC for iteration classes to derive from.
Definition: Iteration.hpp:46
void incrementNumberOfIterations()
Definition: Iteration.hpp:104
std::uint32_t uint32
Definition: Types.hpp:40
const double epsilon_
Definition: Iteration.hpp:114
void resetNumberOfIterations() noexcept
Definition: Iteration.hpp:93
Definition: Coordinate.hpp:44
~Newton() noexcept override=default
Newton(const double epsilon, const uint32 maxNumIterations, std::function< double(double)> f, std::function< double(double)> fPrime) noexcept
Definition: Newton.hpp:77
dtype f(dtype inDofN, dtype inDofD)
Definition: f.hpp:56
double solve(double x)
Definition: Newton.hpp:99
Definition: Newton.hpp:49