 |
NumCpp
2.1.0
A C++ implementation of the Python Numpy library
|
Go to the documentation of this file.
62 std::function<
double(
double)>
f,
63 std::function<
double(
double)> fPrime) noexcept :
66 fPrime_(std::move(fPrime))
79 const uint32 maxNumIterations,
80 std::function<
double(
double)>
f,
81 std::function<
double(
double)> fPrime) noexcept :
84 fPrime_(std::move(fPrime))
91 ~Newton()noexcept override = default;
105 double fxPrime = fPrime_(x);
109 x = calculateX(x, fx, fxPrime);
112 fxPrime = fPrime_(x);
122 const std::function<double(
double)> f_;
123 const std::function<double(
double)> fPrime_;
134 static double calculateX(
double x,
double fx,
double fxPrime) noexcept
136 return x - fx / fxPrime;
Iteration(double epsilon) noexcept
Definition: Iteration.hpp:56
Newton(const double epsilon, std::function< double(double)> f, std::function< double(double)> fPrime) noexcept
Definition: Newton.hpp:61
ABC for iteration classes to derive from.
Definition: Iteration.hpp:47
void incrementNumberOfIterations()
Definition: Iteration.hpp:105
std::uint32_t uint32
Definition: Types.hpp:41
const double epsilon_
Definition: Iteration.hpp:115
void resetNumberOfIterations() noexcept
Definition: Iteration.hpp:94
Definition: Coordinate.hpp:45
~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:78
dtype f(dtype inDofN, dtype inDofD)
Definition: f.hpp:58
double solve(double x)
Definition: Newton.hpp:100
Definition: Newton.hpp:50