Wrapper class for the NCSU DIRECT optimization library. More...
Public Member Functions | |
NCSUOptimizer (Model &model) | |
standard constructor | |
NCSUOptimizer (Model &model, const int &max_iter, const int &max_eval, double min_box_size=-1., double vol_box_size=-1., double solution_target=-DBL_MAX) | |
alternate constructor for instantiations "on the fly" | |
NCSUOptimizer (NoDBBaseConstructor, Model &model) | |
alternate constructor for Iterator instantiations by name | |
NCSUOptimizer (const RealVector &var_l_bnds, const RealVector &var_u_bnds, const int &max_iter, const int &max_eval, double(*user_obj_eval)(const RealVector &x), double min_box_size=-1., double vol_box_size=-1., double solution_target=-DBL_MAX) | |
alternate constructor for instantiations "on the fly" | |
~NCSUOptimizer () | |
destructor | |
void | find_optimum () |
Used within the optimizer branch for computing the optimal solution. Redefines the run virtual function for the optimizer branch. | |
Private Member Functions | |
void | initialize () |
shared code among model-based constructors | |
void | check_inputs () |
verify problem respects NCSU DIRECT Fortran limits | |
Static Private Member Functions | |
static int | objective_eval (int *n, double c[], double l[], double u[], int point[], int *maxI, int *start, int *maxfunc, double fvec[], int iidata[], int *iisize, double ddata[], int *idsize, char cdata[], int *icsize) |
'fep' in Griffin-modified NCSUDirect: computes the value of the objective function (potentially at multiple points, passed by function pointer to NCSUDirect). Include unscaling from DIRECT. | |
Private Attributes | |
short | setUpType |
controls iteration mode: SETUP_MODEL (normal usage) or SETUP_USERFUNC (user-supplied functions mode for "on the fly" instantiations). see enum in NCSUOptimizer.C NonDGlobalReliability currently uses the model mode. GaussProcApproximation currently uses the user_functions mode. | |
Real | minBoxSize |
holds the minimum boxsize | |
Real | volBoxSize |
hold the minimum volume boxsize | |
Real | solutionTarget |
holds the solution target minimum to drive towards | |
RealVector | lowerBounds |
holds variable lower bounds passed in for "user_functions" mode. | |
RealVector | upperBounds |
holds variable upper bounds passed in for "user_functions" mode. | |
double(* | userObjectiveEval )(const RealVector &x) |
holds function pointer for objective function evaluator passed in for "user_functions" mode. | |
Static Private Attributes | |
static NCSUOptimizer * | ncsudirectInstance |
pointer to the active object instance used within the static evaluator functions in order to avoid the need for static data |
Wrapper class for the NCSU DIRECT optimization library.
The NCSUOptimizer class provides a wrapper for a Fortran 77 implementation of the DIRECT algorithm developed at North Carolina State University. It uses a function pointer approach for which passed functions must be either global functions or static member functions. Any attribute used within static member functions must be either local to that function or accessed through a static pointer.
The user input mappings are as follows:
NCSUOptimizer | ( | Model & | model | ) |
standard constructor
This is the standard constructor with method specification support.
References NCSUOptimizer::check_inputs(), and NCSUOptimizer::initialize().
NCSUOptimizer | ( | Model & | model, |
const int & | max_iter, | ||
const int & | max_eval, | ||
double | min_box_size = -1. , |
||
double | vol_box_size = -1. , |
||
double | solution_target = -DBL_MAX |
||
) |
alternate constructor for instantiations "on the fly"
This is an alternate constructor for instantiations on the fly using a Model but no ProblemDescDB.
References NCSUOptimizer::check_inputs(), NCSUOptimizer::initialize(), Iterator::maxFunctionEvals, and Iterator::maxIterations.
NCSUOptimizer | ( | NoDBBaseConstructor | , |
Model & | model | ||
) |
alternate constructor for Iterator instantiations by name
This is an alternate constructor for Iterator instantiations by name using a Model but no ProblemDescDB.
References NCSUOptimizer::check_inputs(), and NCSUOptimizer::initialize().
NCSUOptimizer | ( | const RealVector & | var_l_bnds, |
const RealVector & | var_u_bnds, | ||
const int & | max_iter, | ||
const int & | max_eval, | ||
double(*)(const RealVector &x) | user_obj_eval, | ||
double | min_box_size = -1. , |
||
double | vol_box_size = -1. , |
||
double | solution_target = -DBL_MAX |
||
) |
alternate constructor for instantiations "on the fly"
This is an alternate constructor for performing an optimization using the passed in objective function pointer.
References NCSUOptimizer::check_inputs(), Iterator::maxFunctionEvals, and Iterator::maxIterations.
int objective_eval | ( | int * | n, |
double | c[], | ||
double | l[], | ||
double | u[], | ||
int | point[], | ||
int * | maxI, | ||
int * | start, | ||
int * | maxfunc, | ||
double | fvec[], | ||
int | iidata[], | ||
int * | iisize, | ||
double | ddata[], | ||
int * | idsize, | ||
char | cdata[], | ||
int * | icsize | ||
) | [static, private] |
'fep' in Griffin-modified NCSUDirect: computes the value of the objective function (potentially at multiple points, passed by function pointer to NCSUDirect). Include unscaling from DIRECT.
Modified batch evaluator that accepts multiple points and returns corresponding vector of functions in fvec. Must be used with modified DIRECT src (DIRbatch.f).
References Model::asynch_compute_response(), Model::asynch_flag(), Model::compute_response(), Model::continuous_variables(), Model::current_response(), Response::function_value(), Iterator::iteratedModel, NCSUOptimizer::ncsudirectInstance, NCSUOptimizer::setUpType, Model::synchronize(), and NCSUOptimizer::userObjectiveEval.
Referenced by NCSUOptimizer::find_optimum().