A class that implements the bisection method to find the root of a function, given an interval known to bracket it. Unlike NewtonRaphsonSolver, bisection only ever evaluates getValue() (never a derivative), so it cannot diverge - each iteration halves the bracket that is guaranteed to contain the root. This makes it a safe way to localize a root before handing off to NewtonRaphsonSolver for fast final convergence, mirroring DFT-FE's Fermi energy solver (src/dft/fermiEnergy.cc), which bisects before running Newton-Raphson.
More...
template<typename ValueType>
class dftefe::linearAlgebra::BisectionSolver< ValueType >
A class that implements the bisection method to find the root of a function, given an interval known to bracket it. Unlike NewtonRaphsonSolver, bisection only ever evaluates getValue() (never a derivative), so it cannot diverge - each iteration halves the bracket that is guaranteed to contain the root. This makes it a safe way to localize a root before handing off to NewtonRaphsonSolver for fast final convergence, mirroring DFT-FE's Fermi energy solver (src/dft/fermiEnergy.cc), which bisects before running Newton-Raphson.
This is a minimal, textbook bisection: it trusts getLowerBound()/getUpperBound() to already bracket a root and does not attempt to expand or otherwise fix a bad bracket. Both bisection itself and any bracket construction/expansion on top of it are only correct if getValue() is monotonic between the bracket ends - a property of the specific function being solved (e.g. an isolated Fermi-Dirac occupancy sum is provably monotonic; an arbitrary function need not be), not something this generic solver can verify. Any such domain-specific bracket handling belongs in the BisectionSolverFunction implementation, not here.
- Template Parameters
-
| ValueType | The datatype (float, double, etc.) |