BayesOpt
bayesopt::NLOPT_Optimization Class Reference
+ Collaboration diagram for bayesopt::NLOPT_Optimization:

Public Member Functions

 NLOPT_Optimization (RBOptimizable *rbo, size_t dim)
 
 NLOPT_Optimization (RGBOptimizable *rgbo, size_t dim)
 
void setAlgorithm (innerOptAlgorithms newAlg)
 Sets the optimization algorithm.
 
void setMaxEvals (size_t meval)
 Sets the maximum number of function evaluations. More...
 
void setLimits (const vectord &down, const vectord &up)
 Limits of the hypercube. More...
 
void setLimits (double down, double up)
 Limits of the hypercube assuming that all dimensions have the same limits. More...
 
double run (vectord &Xnext)
 Launch the inner optimization algorithm. More...
 
double localTrialAround (vectord &Xnext)
 Try some local optimization around a point. More...
 

Static Public Member Functions

static double evaluate_nlopt (unsigned int n, const double *x, double *grad, void *my_func_data)
 Wrapper of inner optimization to be evaluated by NLOPT. More...
 
static double evaluate_nlopt_grad (unsigned int n, const double *x, double *grad, void *my_func_data)
 Wrapper of inner optimization to be evaluated by NLOPT. More...
 

Private Member Functions

 NLOPT_Optimization (NLOPT_Optimization &copy)
 

Private Attributes

RBOptimizableWrapperrbobj
 
RGBOptimizableWrapperrgbobj
 
innerOptAlgorithms alg
 
std::vector< double > mDown
 
std::vector< double > mUp
 
size_t maxEvals
 

Detailed Description

Definition at line 44 of file inneroptimization.hpp.

Member Function Documentation

◆ evaluate_nlopt()

double bayesopt::NLOPT_Optimization::evaluate_nlopt ( unsigned int  n,
const double *  x,
double *  grad,
void *  my_func_data 
)
static

Wrapper of inner optimization to be evaluated by NLOPT.

Parameters
n# of dimensions
xinput point
grad(NOT USED. Only for compatibily with NLOPT template, see evaluate_nlopt_grad)
my_func_datapointer to the NLOPT_Optimization object
Returns
function evaluation

Definition at line 246 of file inneroptimization.cpp.

Referenced by run().

◆ evaluate_nlopt_grad()

double bayesopt::NLOPT_Optimization::evaluate_nlopt_grad ( unsigned int  n,
const double *  x,
double *  grad,
void *  my_func_data 
)
static

Wrapper of inner optimization to be evaluated by NLOPT.

Parameters
n# of dimensions
xinput point
gradreturns gradient evaluation
my_func_datapointer to the NLOPT_Optimization object
Returns
function evaluation

Definition at line 259 of file inneroptimization.cpp.

Referenced by run().

◆ localTrialAround()

double bayesopt::NLOPT_Optimization::localTrialAround ( vectord &  Xnext)

Try some local optimization around a point.

Parameters
Xnextinput: initial guess, output: result
Returns
minimum value

Definition at line 109 of file inneroptimization.cpp.

◆ run()

double bayesopt::NLOPT_Optimization::run ( vectord &  Xnext)

Launch the inner optimization algorithm.

Parameters
Xnextinput: initial guess, output: result
Returns
minimum value

Definition at line 150 of file inneroptimization.cpp.

References bayesopt::BOBYQA, bayesopt::COMBINED, bayesopt::DIRECT, evaluate_nlopt(), evaluate_nlopt_grad(), and bayesopt::LBFGS.

◆ setLimits() [1/2]

void bayesopt::NLOPT_Optimization::setLimits ( const vectord &  down,
const vectord &  up 
)
inline

Limits of the hypercube.

Definition at line 125 of file inneroptimization.hpp.

◆ setLimits() [2/2]

void bayesopt::NLOPT_Optimization::setLimits ( double  down,
double  up 
)
inline

Limits of the hypercube assuming that all dimensions have the same limits.

Definition at line 131 of file inneroptimization.hpp.

◆ setMaxEvals()

void bayesopt::NLOPT_Optimization::setMaxEvals ( size_t  meval)
inline

Sets the maximum number of function evaluations.

Depending on the algorithm, it might stops earlier if convergence is reached.

Definition at line 122 of file inneroptimization.hpp.


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