Base class for the optimizer branch of the iterator hierarchy. More...
Static Public Member Functions | |
static void | not_available (const std::string &package_name) |
Static helper function: third-party opt packages which are not available. | |
Protected Member Functions | |
Optimizer () | |
default constructor | |
Optimizer (Model &model) | |
standard constructor | |
Optimizer (NoDBBaseConstructor, Model &model) | |
alternate constructor for "on the fly" instantiations | |
Optimizer (NoDBBaseConstructor, size_t num_cv, size_t num_div, size_t num_drv, size_t num_lin_ineq, size_t num_lin_eq, size_t num_nln_ineq, size_t num_nln_eq) | |
alternate constructor for "on the fly" instantiations | |
~Optimizer () | |
destructor | |
void | initialize_run () |
void | run () |
run portion of run_iterator; implemented by all derived classes and may include pre/post steps in lieu of separate pre/post | |
void | post_run (std::ostream &s) |
void | finalize_run () |
utility function to perform common operations following post_run(); deallocation and resetting of instance pointers | |
void | print_results (std::ostream &s) |
virtual void | find_optimum ()=0 |
Used within the optimizer branch for computing the optimal solution. Redefines the run virtual function for the optimizer branch. | |
Protected Attributes | |
size_t | numObjectiveFns |
number of objective functions (iterator view) | |
bool | localObjectiveRecast |
flag indicating whether local recasting to a single objective is used | |
Optimizer * | prevOptInstance |
pointer containing previous value of optimizerInstance | |
Static Protected Attributes | |
static Optimizer * | optimizerInstance |
pointer to Optimizer instance used in static member functions | |
Private Member Functions | |
void | objective_reduction (const Response &full_response, const RealVector &full_wts, Response &reduced_response) const |
forward mapping: maps multiple primary response functions to a single weighted objective for single-objective optimizers | |
void | local_objective_recast_retrieve (const Variables &vars, Response &response) const |
infers MOO/NLS solution from the solution of a single-objective optimizer | |
Static Private Member Functions | |
static void | primary_resp_recast (const Variables &native_vars, const Variables &scaled_vars, const Response &native_response, Response &scaled_response) |
primary response conversion map for RecastModel used in scaling and multiobjective: transform objectives (fns, grads, Hessians) from native (user) to iterator space |
Base class for the optimizer branch of the iterator hierarchy.
The Optimizer class provides common data and functionality for DOTOptimizer, CONMINOptimizer, NPSOLOptimizer, SNLLOptimizer, NLPQLPOptimizer, COLINOptimizer, and JEGAOptimizer.
standard constructor
This constructor extracts the inherited data for the optimizer branch and performs sanity checking on gradient and constraint settings.
References Dakota::abort_handler(), Iterator::activeSet, Model::assign_rep(), String::begins(), Iterator::bestVariablesArray, Minimizer::boundConstraintFlag, Variables::copy(), Model::current_response(), Model::current_variables(), Minimizer::cvScaleTypes, ProblemDescDB::get_sizet(), Minimizer::gnewton_set_recast(), Iterator::gradientType, Iterator::hessianType, Model::init_communicators(), RecastModel::initialize(), Minimizer::initialize_scaling(), Iterator::iteratedModel, Optimizer::localObjectiveRecast, Iterator::maxConcurrency, Iterator::methodName, Model::model_rep(), Model::model_type(), Iterator::numContinuousVars, Iterator::numFunctions, Minimizer::numIterPrimaryFns, Minimizer::numNonlinearConstraints, Minimizer::numNonlinearIneqConstraints, Optimizer::numObjectiveFns, Minimizer::numUserPrimaryFns, Minimizer::optimizationFlag, Optimizer::primary_resp_recast(), Minimizer::primaryRespScaleFlag, Iterator::probDescDB, ActiveSet::request_vector(), Response::reshape(), Minimizer::responseScaleTypes, Minimizer::scaleFlag, Minimizer::secondary_resp_recast(), Minimizer::secondaryRespScaleFlag, Minimizer::speculativeFlag, Minimizer::variables_recast(), and Minimizer::varsScaleFlag.
void initialize_run | ( | ) | [protected, virtual] |
Implements portions of initialize_run specific to Optimizers. This function should be invoked (or reimplemented) by any derived implementations of initialize_run() (which would otherwise hide it).
Reimplemented from Minimizer.
Reimplemented in SNLLOptimizer, NLPQLPOptimizer, CONMINOptimizer, and DOTOptimizer.
References Iterator::iteratedModel, Optimizer::localObjectiveRecast, Optimizer::optimizerInstance, Optimizer::prevOptInstance, Minimizer::scaleFlag, and Model::update_from_subordinate_model().
void run | ( | ) | [inline, protected, virtual] |
run portion of run_iterator; implemented by all derived classes and may include pre/post steps in lieu of separate pre/post
Virtual run function for the iterator class hierarchy. All derived classes need to redefine it.
Reimplemented from Iterator.
References Optimizer::find_optimum().
void post_run | ( | std::ostream & | s | ) | [protected, virtual] |
Implements portions of post_run specific to Optimizers. This function should be invoked (or reimplemented) by any derived implementations of post_run() (which would otherwise hide it).
Reimplemented from Iterator.
Reimplemented in SNLLOptimizer, and COLINOptimizer.
References Dakota::abort_handler(), Response::active_set_request_vector(), Iterator::bestResponseArray, Iterator::bestVariablesArray, Variables::continuous_variables(), Response::copy(), Minimizer::cvScaleMultipliers, Minimizer::cvScaleOffsets, Minimizer::cvScaleTypes, Optimizer::local_objective_recast_retrieve(), Optimizer::localObjectiveRecast, Minimizer::modify_s2n(), Minimizer::need_resp_trans_byvars(), Minimizer::numNonlinearConstraints, Minimizer::numUserPrimaryFns, Minimizer::primaryRespScaleFlag, Minimizer::response_modify_s2n(), Minimizer::secondaryRespScaleFlag, Response::update_partial(), and Minimizer::varsScaleFlag.
void finalize_run | ( | ) | [inline, protected, virtual] |
utility function to perform common operations following post_run(); deallocation and resetting of instance pointers
Optional: perform finalization phases of run sequence, like deallocating memory and resetting instance pointers. Commonly used in sub-iterator executions. This is a virtual function; when re-implementing, a derived class must call its nearest parent's finalize_run(), typically _after_ performing its own implementation steps.
Reimplemented from Minimizer.
Reimplemented in SNLLOptimizer.
References Optimizer::optimizerInstance, and Optimizer::prevOptInstance.
void print_results | ( | std::ostream & | s | ) | [protected, virtual] |
Redefines default iterator results printing to include optimization results (objective functions and constraints).
Reimplemented from Iterator.
References Dakota::abort_handler(), Iterator::bestResponseArray, Iterator::bestVariablesArray, Dakota::data_pairs, Model::interface_id(), Iterator::iteratedModel, Dakota::lookup_by_val(), Iterator::numContinuousVars, Iterator::numFunctions, Minimizer::numUserPrimaryFns, and Dakota::write_data_partial().
void primary_resp_recast | ( | const Variables & | native_vars, |
const Variables & | scaled_vars, | ||
const Response & | native_response, | ||
Response & | iterator_response | ||
) | [static, private] |
primary response conversion map for RecastModel used in scaling and multiobjective: transform objectives (fns, grads, Hessians) from native (user) to iterator space
Objective function map from user/native space to iterator/scaled/combined space using a RecastModel. If resizing the response, copies the constraint (secondary) data from native_response too
References Response::active_set_request_vector(), Response::copy(), Iterator::iteratedModel, Optimizer::localObjectiveRecast, Minimizer::need_resp_trans_byvars(), Minimizer::numUserPrimaryFns, Optimizer::objective_reduction(), Optimizer::optimizerInstance, Iterator::outputLevel, Model::primary_response_fn_weights(), Minimizer::primaryRespScaleFlag, Minimizer::response_modify_n2s(), Model::subordinate_model(), and Response::update_partial().
Referenced by Optimizer::Optimizer().
void objective_reduction | ( | const Response & | full_response, |
const RealVector & | full_wts, | ||
Response & | reduced_response | ||
) | const [private] |
forward mapping: maps multiple primary response functions to a single weighted objective for single-objective optimizers
This function is responsible for the mapping of multiple objective functions into a single objective for publishing to single-objective optimizers. Used in DOTOptimizer, NPSOLOptimizer, SNLLOptimizer, and SGOPTApplication on every function evaluation. The simple weighting approach (using primaryRespFnWts) is the only technique supported currently. The weightings are used to scale function values, gradients, and Hessians as needed.
References Dakota::abort_handler(), Response::active_set_request_vector(), Response::function_gradient_view(), Response::function_gradients(), Response::function_hessian_view(), Response::function_hessians(), Response::function_value(), Response::function_values(), Minimizer::numUserPrimaryFns, Minimizer::objective(), Minimizer::objective_gradient(), Minimizer::objective_hessian(), Iterator::outputLevel, Dakota::write_col_vector_trans(), Dakota::write_data(), and Dakota::write_precision.
Referenced by Optimizer::primary_resp_recast().
void local_objective_recast_retrieve | ( | const Variables & | vars, |
Response & | response | ||
) | const [private] |
infers MOO/NLS solution from the solution of a single-objective optimizer
Retrieve a MOO/NLS response based on the data returned by a single objective optimizer by performing a data_pairs search.
References Response::active_set(), Dakota::data_pairs, Model::interface_id(), Iterator::iteratedModel, Dakota::lookup_by_val(), Minimizer::numUserPrimaryFns, and Response::update().
Referenced by Optimizer::post_run().