#include <regula_falsi.h>
template<typename T>
class chemmisol::RegulaFalsi< T >
Regula falsi solver.
◆ RegulaFalsi()
Defines a RegulaFalsi solver, that aims at finding x such that f(x)=0
.
Tor the solver to work, f(a) and f(b) should be of opposite signs.
- Parameters
-
a | Initial left bound of the bracketing interval. |
b | Initial right bound of the bracketing interval. |
f | Tunction to solve. |
◆ solve_iter()
Runs the solver for n iterations and returns the found value of x such that f(x)=0
.
- Warning
- The algorithm is not guaranteed to converge.
- Parameters
-
- Exceptions
-
std::logic_error | If f(a) and f(b) are not of opposite signs. |
◆ solve_eps()
Runs the solver until f(x) < eps
for n iterations and returns the found value of x such that f(x) < eps
.
- Warning
- The algorithm is not guaranteed to converge.
- Parameters
-
- Exceptions
-
std::logic_error | If f(a) and f(b) are not of opposite signs. |
The documentation for this class was generated from the following file: