Bisection
|
#include <functional>
Go to the source code of this file.
Functions | |
double | Bisect (const std::function< double(double)> &func, const double a, const double b, const double eps) |
Returns one solution for the equation \( func(x) = 0 \) with \( x \in [a,b] \). More... | |
double Bisect | ( | const std::function< double(double)> & | func, |
const double | a, | ||
const double | b, | ||
const double | eps | ||
) |
Returns one solution for the equation \( func(x) = 0 \) with \( x \in [a,b] \).
The requirement \( func(a) > 0 > func(b) \) has to be fulfilled.
The solution is determined by bisection.
The input function func
t has to be declared: double pp(double x); i.e., pp could be used as first argument in the parameter list when calling Bisect
.
[in] | func | function with one double input parameter that returns a double value |
[in] | a | interval begin |
[in] | b | interval end |
[in] | eps | accuracy \( \varepsilon \) |
Definition at line 6 of file bisect.cpp.