13#ifndef OPTIMIST_ROOTFINDER_BRACKTING_HH
14#define OPTIMIST_ROOTFINDER_BRACKTING_HH
39 template <
typename Real,
typename DerivedSolver>
68 return static_cast<const DerivedSolver *
>(
this)->
name_impl();
86 template <
typename FunctionLambda>
87 bool solve_impl(FunctionLambda && function, Real , Real & x_sol)
89 #define CMD "Optimist::ScalarRootfinder::Bracketing::solve_impl(...): "
102 CMD "function evaluation failed at the lower bound.");
107 CMD "function evaluation failed at the upper bound.");
110 if (this->
m_fa*this->
m_fb > 0.0) {
return false;}
111 else {x_sol = this->
find_root(std::forward<FunctionLambda>(function));}
129 template <
typename FunctionLambda>
132 return static_cast<DerivedSolver *
>(
this)->find_root_impl(std::forward<FunctionLambda>(function));
#define OPTIMIST_ASSERT_WARNING(COND, MSG)
Definition Optimist.hh:61
#define OPTIMIST_BASIC_CONSTANTS(Real)
Definition Optimist.hh:71
Real m_b
Definition Bracketing.hh:51
Real m_e
Definition Bracketing.hh:54
Real m_fd
Definition Bracketing.hh:53
Real m_d
Definition Bracketing.hh:53
bool solve_impl(FunctionLambda &&function, Real, Real &x_sol)
Definition Bracketing.hh:87
std::string name_impl() const
Definition Bracketing.hh:66
Real m_a
Definition Bracketing.hh:50
Bracketing()
Definition Bracketing.hh:60
Real m_mu
Definition Bracketing.hh:47
Real m_fe
Definition Bracketing.hh:54
void tolerance_bracketing(Real t_tolerance)
Definition Bracketing.hh:76
Real m_interval_shink
Definition Bracketing.hh:48
Real m_fa
Definition Bracketing.hh:50
Real m_tolerance_bracketing
Definition Bracketing.hh:46
Real find_root(FunctionLambda &&function)
Definition Bracketing.hh:130
Real m_fc
Definition Bracketing.hh:52
Real m_fb
Definition Bracketing.hh:51
Real m_c
Definition Bracketing.hh:52
RootFinder()
Definition RootFinder.hh:259
void header()
Definition SolverBase.hh:870
void reset()
Definition SolverBase.hh:748
bool m_verbose
Definition SolverBase.hh:92
bool m_converged
Definition SolverBase.hh:98
InputType m_upper_bound
Definition SolverBase.hh:71
void bottom()
Definition SolverBase.hh:900
bool evaluate_function(FunctionLambda &&function, InputType const &x, OutputType &out)
Definition SolverBase.hh:768
InputType m_lower_bound
Definition SolverBase.hh:70
Namespace for the Optimist library.
Definition Optimist.hh:88