Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::BisectionRootFinder< F > Class Template Reference

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

#include <BisectionRootFinder.hh>

Public Member Functions

CELER_FUNCTION BisectionRootFinder (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::BisectionRootFinder< F >

Perform Bisection iterations given a root function func and tolerance tol .

Using a left and right bound a Bisection approximates the root as:

\[ root = 0.5 * (left + right) \]

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: