Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::RegulaFalsiRootFinder< F > Class Template Reference

Perform Regula Falsi iterations given a root function func and tolerance tol . More...

#include <RegulaFalsiRootFinder.hh>

Public Member Functions

CELER_FUNCTION RegulaFalsiRootFinder (F &&func, real_type tol)
 Construct from function.
 
CELER_FUNCTION real_type operator() (real_type left, real_type right)
 Solve for a root between the two points.
 

Detailed Description

template<class F>
class celeritas::RegulaFalsiRootFinder< F >

Perform Regula Falsi iterations given a root function func and tolerance tol .

Using a left and right bound a Regula Falsi approximates the root as:

\[ root = (left * func(right) - right * func(left)) / (func(right) - func(left)) \]

Then value of func at the root is calculated compared to values of func at the bounds. The root is then used update the bounds based on the sign of func(root) and whether it matches the sign of func(left) or func(right) . Performing this update of the bounds allows for the iteration on root, using the convergence criteria based on func(root) proximity to 0.


The documentation for this class was generated from the following file: