DiFfRG
Loading...
Searching...
No Matches
DiFfRG::BisectionRootFinder Class Reference

#include <root_finding.hh>

Inheritance diagram for DiFfRG::BisectionRootFinder:
DiFfRG::AbstractRootFinder< 1 >

Public Member Functions

 BisectionRootFinder (const FUN &f, const double abs_tol=1e-4, const int max_iter=1000)
 
void set_x_min (const double x_min)
 
void set_x_max (const double x_max)
 
void set_bounds (const double x_min, const double x_max)
 
void set_next_x (const std::function< double(double, double)> &next_x)
 
- Public Member Functions inherited from DiFfRG::AbstractRootFinder< 1 >
 AbstractRootFinder (const FUN &f, const double abs_tol=1e-4, const int max_iter=1000)
 
 AbstractRootFinder (const FUN_ARR &f, const double abs_tol=1e-4, const int max_iter=1000)
 
void set_abs_tol (const double abs_tol)
 
void set_max_iter (const uint max_iter)
 
uint get_iter () const
 
double search ()
 

Protected Member Functions

std::array< double, 1 > search_impl () override
 
- Protected Member Functions inherited from DiFfRG::AbstractRootFinder< 1 >

Protected Attributes

double x_min
 
double x_max
 
std::function< double(double, double)> next_x
 
- Protected Attributes inherited from DiFfRG::AbstractRootFinder< 1 >
FUN_ARR f
 
double abs_tol
 
uint max_iter
 
uint iter
 

Additional Inherited Members

- Protected Types inherited from DiFfRG::AbstractRootFinder< 1 >
using FUN = std::function<bool(const double)>
 
using FUN_ARR = std::function<bool(const std::array<double, 1> &)>
 

Constructor & Destructor Documentation

◆ BisectionRootFinder()

DiFfRG::BisectionRootFinder::BisectionRootFinder ( const FUN & f,
const double abs_tol = 1e-4,
const int max_iter = 1000 )
inline

Member Function Documentation

◆ search_impl()

std::array< double, 1 > DiFfRG::BisectionRootFinder::search_impl ( )
inlineoverrideprotectedvirtual

◆ set_bounds()

void DiFfRG::BisectionRootFinder::set_bounds ( const double x_min,
const double x_max )
inline

◆ set_next_x()

void DiFfRG::BisectionRootFinder::set_next_x ( const std::function< double(double, double)> & next_x)
inline

◆ set_x_max()

void DiFfRG::BisectionRootFinder::set_x_max ( const double x_max)
inline

◆ set_x_min()

void DiFfRG::BisectionRootFinder::set_x_min ( const double x_min)
inline

Member Data Documentation

◆ next_x

std::function<double(double, double)> DiFfRG::BisectionRootFinder::next_x
protected
Initial value:
= [](const double x_min, const double x_max) {
return (x_min + x_max) / 2.;
}
double x_max
Definition root_finding.hh:118
double x_min
Definition root_finding.hh:117

◆ x_max

double DiFfRG::BisectionRootFinder::x_max
protected

◆ x_min

double DiFfRG::BisectionRootFinder::x_min
protected

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