|
Sequence of Bisect implementations
|
#include <cmath>#include <functional>#include <iostream>
Go to the source code of this file.
Functions | |
| double | f (const double x) |
| Calculates function \( f(x) = \sin(x) - \frac{x}{2} \). | |
| double | g (const double x) |
| Calculates function \( f(x) = -(x-1.234567)*(x+0.987654) \). | |
| double | Bisect3 (const std::function< double(double)> &func, const double a, const double b, const double eps=1e-6) |
| Returns one solution for the equation \( func(x) = 0 \) with \( x \in [a,b] \). | |
| int | main () |
| double Bisect3 | ( | const std::function< double(double)> & | func, |
| const double | a, | ||
| const double | b, | ||
| const double | eps = 1e-6 |
||
| ) |
Returns one solution for the equation \( func(x) = 0 \) with \( x \in [a,b] \).
The solution is determined by bisection.
| [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 81 of file Bisect3.cpp.


| double f | ( | const double | x | ) |
Calculates function \( f(x) = \sin(x) - \frac{x}{2} \).
| [in] | x | position for funtion evaluation |
Definition at line 18 of file Bisect3.cpp.
| double g | ( | const double | x | ) |
Calculates function \( f(x) = -(x-1.234567)*(x+0.987654) \).
| [in] | x | position for funtion evaluation |
Definition at line 29 of file Bisect3.cpp.

| int main | ( | ) |