OGS
|
Use the regula falsi method to find the root of some scalar function of one variable.
#include <Root1D.h>
Public Member Functions | |
RegulaFalsi (Function &&f, double a, double b) | |
void | step (const unsigned num_steps) |
Do num_steps iteration of regula falsi. | |
double | getResult () const |
Returns the current estimate of the root. | |
double | getRange () const |
Returns the size of the current search interval. | |
Private Attributes | |
Function | f_ |
double | a_ |
double | b_ |
double | fa_ |
double | fb_ |
|
inline |
Initializes finding a root of the Function
f
in the interval [a
, b
].
Definition at line 53 of file Root1D.h.
References MathLib::Nonlinear::RegulaFalsi< SubType, Function >::a_, MathLib::Nonlinear::detail::almost_zero(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::b_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::fa_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::fb_, OGS_FATAL, and MathLib::Nonlinear::detail::same_sign().
|
inline |
Returns the size of the current search interval.
Definition at line 123 of file Root1D.h.
References MathLib::Nonlinear::RegulaFalsi< SubType, Function >::a_, and MathLib::Nonlinear::RegulaFalsi< SubType, Function >::b_.
|
inline |
Returns the current estimate of the root.
Definition at line 109 of file Root1D.h.
References MathLib::Nonlinear::RegulaFalsi< SubType, Function >::a_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::b_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::fa_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::fb_, and MathLib::s.
|
inline |
Do num_steps
iteration of regula falsi.
Definition at line 76 of file Root1D.h.
References MathLib::Nonlinear::RegulaFalsi< SubType, Function >::a_, MathLib::Nonlinear::detail::almost_zero(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::b_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::f_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::fa_, MathLib::Nonlinear::RegulaFalsi< SubType, Function >::fb_, MathLib::s, and MathLib::Nonlinear::detail::same_sign().
|
private |
Definition at line 127 of file Root1D.h.
Referenced by MathLib::Nonlinear::RegulaFalsi< SubType, Function >::RegulaFalsi(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::getRange(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::getResult(), and MathLib::Nonlinear::RegulaFalsi< SubType, Function >::step().
|
private |
Definition at line 127 of file Root1D.h.
Referenced by MathLib::Nonlinear::RegulaFalsi< SubType, Function >::RegulaFalsi(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::getRange(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::getResult(), and MathLib::Nonlinear::RegulaFalsi< SubType, Function >::step().
|
private |
Definition at line 126 of file Root1D.h.
Referenced by MathLib::Nonlinear::RegulaFalsi< SubType, Function >::step().
|
private |
Definition at line 127 of file Root1D.h.
Referenced by MathLib::Nonlinear::RegulaFalsi< SubType, Function >::RegulaFalsi(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::getResult(), and MathLib::Nonlinear::RegulaFalsi< SubType, Function >::step().
|
private |
Definition at line 127 of file Root1D.h.
Referenced by MathLib::Nonlinear::RegulaFalsi< SubType, Function >::RegulaFalsi(), MathLib::Nonlinear::RegulaFalsi< SubType, Function >::getResult(), and MathLib::Nonlinear::RegulaFalsi< SubType, Function >::step().