$extrastylesheet
Dakota
Version 6.2
|
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 (ProblemDescDB &problem_db, Model &model) | |
alternate constructor; accepts a model | |
Optimizer (unsigned short method_name, Model &model) | |
alternate constructor for "on the fly" instantiations | |
Optimizer (unsigned short method_name, size_t num_cv, size_t num_div, size_t num_dsv, 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 | core_run () |
core portion of run; 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 | reduce_model (bool local_nls_recast, bool require_hessians) |
Wrap iteratedModel in a RecastModel that performs (weighted) multi-objective or sum-of-squared residuals transformation. | |
void | objective_reduction (const Response &full_response, const BoolDeque &sense, const RealVector &full_wts, Response &reduced_response) const |
forward mapping: maps multiple primary response functions to a single weighted objective for single-objective optimizers | |
Static Private Member Functions | |
static void | primary_resp_reducer (const Variables &full_vars, const Variables &reduced_vars, const Response &full_response, Response &reduced_response) |
Recast callback to reduce multiple objectives or residuals to a single objective, with gradients and Hessians as needed. |
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.
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, Minimizer::minimizerRecasts, Optimizer::optimizerInstance, Optimizer::prevOptInstance, and Model::update_from_subordinate_model().
void core_run | ( | ) | [inline, protected, virtual] |
core portion of run; 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 Minimizer.
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, Minimizer::local_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(), Minimizer::archive_allocate_best(), Minimizer::archive_best(), Iterator::bestResponseArray, Iterator::bestVariablesArray, Minimizer::calibrationDataFlag, Model::current_response(), Minimizer::data_difference_core(), Dakota::data_pairs, Response::function_values(), Model::interface_id(), Dakota::lookup_by_val(), Model::num_functions(), Minimizer::numContinuousVars, Minimizer::numNonlinearConstraints, Minimizer::numTotalCalibTerms, Minimizer::numUserPrimaryFns, Minimizer::optimizationFlag, Minimizer::original_model(), Model::primary_response_fn_weights(), Minimizer::print_model_resp(), and Minimizer::print_residuals().
void reduce_model | ( | bool | local_nls_recast, |
bool | require_hessians | ||
) | [private] |
Wrap iteratedModel in a RecastModel that performs (weighted) multi-objective or sum-of-squared residuals transformation.
Reduce model for least-squares or multi-objective transformation. Doesn't map variables, or secondary responses. Maps active set for Gauss-Newton. Maps primary responses to single objective so user vs. iterated matters.
References Iterator::activeSet, Model::assign_rep(), Minimizer::calibrationDataFlag, Model::current_response(), Minimizer::gnewton_set_recast(), Model::hessian_type(), Iterator::iteratedModel, Minimizer::minimizerRecasts, Minimizer::numContinuousVars, Minimizer::numFunctions, Minimizer::numIterPrimaryFns, Minimizer::numNonlinearConstraints, Minimizer::numNonlinearIneqConstraints, Optimizer::numObjectiveFns, Minimizer::numTotalCalibTerms, Minimizer::numUserPrimaryFns, Iterator::outputLevel, Model::primary_fn_type(), Optimizer::primary_resp_reducer(), Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), ActiveSet::request_vector(), Response::reshape(), and Minimizer::secondary_resp_copier().
Referenced by Optimizer::Optimizer().
void primary_resp_reducer | ( | const Variables & | full_vars, |
const Variables & | reduced_vars, | ||
const Response & | full_response, | ||
Response & | reduced_response | ||
) | [static, private] |
Recast callback to reduce multiple objectives or residuals to a single objective, with gradients and Hessians as needed.
Objective function map from multiple primary responses (objective or residuals) to a single objective. Currently supports weighted sum; may later want more general transformations, e.g., goal-oriented
References Iterator::iteratedModel, Optimizer::objective_reduction(), Optimizer::optimizerInstance, Iterator::outputLevel, Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), and Model::subordinate_model().
Referenced by Optimizer::reduce_model().
void objective_reduction | ( | const Response & | full_response, |
const BoolDeque & | sense, | ||
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 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(), Response::num_functions(), Minimizer::numConstraints, Minimizer::objective(), Minimizer::objective_gradient(), Minimizer::objective_hessian(), Iterator::outputLevel, and Dakota::write_precision.
Referenced by Optimizer::primary_resp_reducer().