Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::RootFinder::Chandrupatla< Scalar > Class Template Reference

Class container for the Chandrupatla algorithm. More...

#include <Chandrupatla.hh>

Inherits Optimist::RootFinder::Bracketing< Scalar, Chandrupatla< Scalar > >.

Public Member Functions

 Chandrupatla ()
constexpr std::string name_impl () const
template<typename FunctionLambda>
Scalar find_root_impl (FunctionLambda &&function)
Public Member Functions inherited from Optimist::RootFinder::Bracketing< Scalar, Chandrupatla< Scalar > >
 Bracketing ()
constexpr std::string name_impl () const
void tolerance_bracketing (Scalar t_tolerance)
bool solve_impl (FunctionLambda &&function, Scalar, Scalar &x_sol)
Scalar find_root (FunctionLambda &&function)
Public Member Functions inherited from Optimist::RootFinder::RootFinder< Scalar, Chandrupatla< Scalar > >
 RootFinder ()
constexpr std::string name () const
Integer jacobian_evaluations () const
Integer max_jacobian_evaluations () const
Integer hessian_evaluations () const
Integer max_hessian_evaluations () const
bool solve (FunctionLambda &&function, const Input &x_ini, Output &x_sol)
Public Member Functions inherited from Optimist::SolverBase< Scalar, Scalar, Chandrupatla< Scalar > >
 SolverBase ()
void reset_bounds (const Integer n=InputTrait::IsDynamic ? 0 :InputTrait::Dimension)
const Scalarlower_bound () const
const Scalarupper_bound () const
void bounds (const Scalar &t_lower_bound, const Scalar &t_upper_bound)
constexpr Integer input_dimension () const
constexpr Integer output_dimension () const
Integer function_evaluations () const
void max_function_evaluations (const Integer t_max_function_evaluations)
Integer iterations () const
Integer max_iterations () const
Scalar alpha () const
Integer relaxations () const
Integer max_relaxations () const
Scalar tolerance () const
void verbose_mode (bool t_verbose)
void enable_verbose_mode ()
void disable_verbose_mode ()
void damped_mode (bool t_damped)
void enable_damped_mode ()
void disable_damped_mode ()
std::string task () const
bool converged () const
std::ostream & ostream () const
bool solve (FunctionLambda &&function, const Scalar &x_ini, Scalar &x_sol)
bool rootfind (const FunctionBase< FunctionInput, FunctionOutput, DerivedFunction > &function, const Scalar &x_ini, Scalar &x_sol)
bool optimize (const FunctionBase< FunctionInput, FunctionOutput, DerivedFunction > &function, const Scalar &x_ini, Scalar &x_sol)
constexpr std::string name () const

Static Public Attributes

static constexpr bool RequiresFunction {true}
static constexpr bool RequiresFirstDerivative {false}
static constexpr bool RequiresSecondDerivative {false}
Static Public Attributes inherited from Optimist::RootFinder::RootFinder< Scalar, Chandrupatla< Scalar > >
static constexpr bool IsRootFinder
static constexpr bool IsOptimizer

Additional Inherited Members

Public Types inherited from Optimist::RootFinder::RootFinder< Scalar, Chandrupatla< Scalar > >
using Scalar
using Input
using Output
Public Types inherited from Optimist::SolverBase< Scalar, Scalar, Chandrupatla< Scalar > >
using InputTrait
using OutputTrait
using Scalar
using FirstDerivative
using SecondDerivative
Protected Member Functions inherited from Optimist::RootFinder::RootFinder< Scalar, Chandrupatla< Scalar > >
bool evaluate_jacobian (JacobianLambda &&jacobian, const Input &x, FirstDerivative &out)
bool evaluate_hessian (HessianLambda &&hessian, const Input &x, SecondDerivative &out)
Protected Member Functions inherited from Optimist::SolverBase< Scalar, Scalar, Chandrupatla< Scalar > >
Integer first_derivative_evaluations () const
Integer max_first_derivative_evaluations () const
Integer second_derivative_evaluations () const
Integer max_second_derivative_evaluations () const
void reset_counters ()
bool evaluate_function (FunctionLambda &&function, const Scalar &x, Scalar &out)
bool evaluate_first_derivative (FirstDerivativeLambda &&function, const Scalar &x, FirstDerivative &out)
bool evaluate_second_derivative (SecondDerivativeLambda &&function, const Scalar &x, SecondDerivative &out)
bool damp (FunctionLambda &&function, const Scalar &x_old, const Scalar &function_old, const Scalar &step_old, Scalar &x_new, Scalar &function_new, Scalar &step_new)
void header ()
void bottom ()
void info (Scalar residuals, const std::string &notes="-")
Protected Attributes inherited from Optimist::RootFinder::Bracketing< Scalar, Chandrupatla< Scalar > >
Scalar m_tolerance_bracketing
Scalar m_mu
Scalar m_interval_shink
Scalar m_a
Scalar m_fa
Scalar m_b
Scalar m_fb
Scalar m_c
Scalar m_fc
Scalar m_d
Scalar m_fd
Scalar m_e
Scalar m_fe
Protected Attributes inherited from Optimist::SolverBase< Scalar, Scalar, Chandrupatla< Scalar > >
Scalar m_lower_bound
Scalar m_upper_bound
Integer m_function_evaluations
Integer m_first_derivative_evaluations
Integer m_second_derivative_evaluations
Integer m_max_function_evaluations
Integer m_max_first_derivative_evaluations
Integer m_max_second_derivative_evaluations
Integer m_iterations
Integer m_max_iterations
Scalar m_alpha
Integer m_relaxations
Integer m_max_relaxations
Scalar m_tolerance
bool m_verbose
bool m_damped
std::ostream * m_ostream
std::string m_task
bool m_converged

Detailed Description

template<typename Scalar>
class Optimist::RootFinder::Chandrupatla< Scalar >

The Chandrupatla algorithm allows to find the roots of a scalar function \(f(x)\) in a given interval \([a, b]\). The algorithm is based on the work of T. Chandrupatla, A new hybrid quadratic/bisection algorithm for finding the zero of a nonlinear function without using derivatives, Advances in Engineering Software, 28 (1997), pp. 145-149.

Template Parameters
ScalarFloating-point number type.

Constructor & Destructor Documentation

◆ Chandrupatla()

template<typename Scalar>
Optimist::RootFinder::Chandrupatla< Scalar >::Chandrupatla ( )
inline

Class constructor for the Chandrupatla solver.

Member Function Documentation

◆ find_root_impl()

template<typename Scalar>
template<typename FunctionLambda>
Scalar Optimist::RootFinder::Chandrupatla< Scalar >::find_root_impl ( FunctionLambda && function)
inline

Finds either an exact solution or an approximate solution of the equation \(f(x) = 0\) in the interval \([a, b]\).

Template Parameters
FunctionLambdaFunction lambda type.
Parameters
[in]functionFunction lambda.
Returns
The approximate root.

◆ name_impl()

template<typename Scalar>
std::string Optimist::RootFinder::Chandrupatla< Scalar >::name_impl ( ) const
inlineconstexpr

Get the Chandrupatla solver name.

Returns
The Chandrupatla solver name.

Member Data Documentation

◆ RequiresFirstDerivative

template<typename Scalar>
bool Optimist::RootFinder::Chandrupatla< Scalar >::RequiresFirstDerivative {false}
staticconstexpr

◆ RequiresFunction

template<typename Scalar>
bool Optimist::RootFinder::Chandrupatla< Scalar >::RequiresFunction {true}
staticconstexpr

◆ RequiresSecondDerivative

template<typename Scalar>
bool Optimist::RootFinder::Chandrupatla< Scalar >::RequiresSecondDerivative {false}
staticconstexpr

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