$extrastylesheet
Dakota
Version 6.2
|
Base class for the optimizer and least squares branches of the iterator hierarchy. More...
Public Member Functions | |
void | constraint_tolerance (Real constr_tol) |
set the method constraint tolerance (constraintTol) | |
Real | constraint_tolerance () const |
return the method constraint tolerance (constraintTol) | |
Protected Member Functions | |
Minimizer () | |
default constructor | |
Minimizer (ProblemDescDB &problem_db, Model &model) | |
standard constructor | |
Minimizer (unsigned short method_name, Model &model) | |
alternate constructor for "on the fly" instantiations | |
Minimizer (unsigned short method_name, 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 | |
~Minimizer () | |
destructor | |
void | update_from_model (const Model &model) |
set inherited data attributes based on extractions from incoming model | |
void | initialize_run () |
utility function to perform common operations prior to pre_run(); typically memory initialization; setting of instance pointers | |
void | post_run (std::ostream &s) |
post-run portion of run (optional); verbose to print results; re-implemented by Iterators that can read all Variables/Responses and perform final analysis phase in a standalone way | |
void | finalize_run () |
utility function to perform common operations following post_run(); deallocation and resetting of instance pointers | |
const Model & | algorithm_space_model () const |
Model | original_model (unsigned short recasts_left=0) |
Return a shallow copy of the original model this Iterator was originally passed, optionally leaving recasts_left on top of it. | |
void | data_transform_model () |
Wrap iteratedModel in a RecastModel that subtracts provided observed data from the primary response functions (variables and secondary responses are unchanged) | |
void | gen_primary_resp_map (const SharedResponseData &srd, Sizet2DArray &primary_resp_map_indices, BoolDequeArray &nonlinear_resp_map) const |
compute the primary response map for a data transform RecastModel | |
template<typename T > | |
void | expand_array (const SharedResponseData &srd, const T &submodel_array, T &recast_array) const |
expand submodel_array by replicates to populate a pre-sized recast_array | |
void | scale_model () |
Wrap iteratedModel in a RecastModel that performs variable and/or response scaling. | |
bool | need_resp_trans_byvars (const ShortArray &asv, int start_index, int num_resp) |
determine if response transformation is needed due to variable transformations | |
RealVector | modify_s2n (const RealVector &scaled_vars, const IntArray &scale_types, const RealVector &multipliers, const RealVector &offsets) const |
general RealVector mapping from scaled to native variables (and values) | |
void | response_modify_s2n (const Variables &native_vars, const Response &scaled_response, Response &native_response, int start_offset, int num_responses) const |
map responses from scaled to native space | |
Real | objective (const RealVector &fn_vals, const BoolDeque &max_sense, const RealVector &primary_wts) const |
compute a composite objective value from one or more primary functions | |
Real | objective (const RealVector &fn_vals, size_t num_fns, const BoolDeque &max_sense, const RealVector &primary_wts) const |
compute a composite objective with specified number of source primary functions, instead of userPrimaryFns | |
void | objective_gradient (const RealVector &fn_vals, const RealMatrix &fn_grads, const BoolDeque &max_sense, const RealVector &primary_wts, RealVector &obj_grad) const |
compute the gradient of the composite objective function | |
void | objective_gradient (const RealVector &fn_vals, size_t num_fns, const RealMatrix &fn_grads, const BoolDeque &max_sense, const RealVector &primary_wts, RealVector &obj_grad) const |
compute the gradient of the composite objective function | |
void | objective_hessian (const RealVector &fn_vals, const RealMatrix &fn_grads, const RealSymMatrixArray &fn_hessians, const BoolDeque &max_sense, const RealVector &primary_wts, RealSymMatrix &obj_hess) const |
compute the Hessian of the composite objective function | |
void | objective_hessian (const RealVector &fn_vals, size_t num_fns, const RealMatrix &fn_grads, const RealSymMatrixArray &fn_hessians, const BoolDeque &max_sense, const RealVector &primary_wts, RealSymMatrix &obj_hess) const |
compute the Hessian of the composite objective function | |
void | archive_allocate_best (size_t num_points) |
allocate results arrays and labels for multipoint storage | |
void | archive_best (size_t index, const Variables &best_vars, const Response &best_resp) |
archive the best point into the results array | |
void | resize_best_vars_array (size_t newsize) |
Safely resize the best variables array to newsize taking into account the envelope-letter design pattern and any recasting. | |
void | resize_best_resp_array (size_t newsize) |
Safely resize the best response array to newsize taking into account the envelope-letter design pattern and any recasting. | |
Real | sum_squared_residuals (size_t num_pri_fns, const RealVector &residuals, const RealVector &weights) |
return weighted sum of squared residuals | |
void | print_residuals (size_t num_terms, const RealVector &best_terms, const RealVector &weights, size_t num_best, size_t best_index, std::ostream &s) |
print num_terms residuals and misfit for final results | |
void | print_model_resp (size_t num_pri_fns, const RealVector &best_fns, size_t num_best, size_t best_index, std::ostream &s) |
print the original user model resp in the case of data transformations | |
void | local_recast_retrieve (const Variables &vars, Response &response) const |
infers MOO/NLS solution from the solution of a single-objective optimizer | |
void | data_difference_core (const Response &raw_response, Response &residual_response) |
Core of data difference, which doesn't perform any output. | |
Static Protected Member Functions | |
static void | gnewton_set_recast (const Variables &recast_vars, const ActiveSet &recast_set, ActiveSet &sub_model_set) |
conversion of request vector values for the Gauss-Newton Hessian approximation | |
static void | replicate_set_recast (const Variables &recast_vars, const ActiveSet &recast_set, ActiveSet &sub_model_set) |
conversion of request vector values for Least Squares | |
static void | secondary_resp_copier (const Variables &input_vars, const Variables &output_vars, const Response &input_response, Response &output_response) |
copy the partial response for secondary functions when needed (data and reduction transforms) | |
Protected Attributes | |
size_t | numFunctions |
number of response functions | |
size_t | numContinuousVars |
number of active continuous vars | |
size_t | numDiscreteIntVars |
number of active discrete integer vars | |
size_t | numDiscreteStringVars |
number of active discrete string vars | |
size_t | numDiscreteRealVars |
number of active discrete real vars | |
Real | constraintTol |
optimizer/least squares constraint tolerance | |
Real | bigRealBoundSize |
cutoff value for inequality constraint and continuous variable bounds | |
int | bigIntBoundSize |
cutoff value for discrete variable bounds | |
size_t | numNonlinearIneqConstraints |
number of nonlinear inequality constraints | |
size_t | numNonlinearEqConstraints |
number of nonlinear equality constraints | |
size_t | numLinearIneqConstraints |
number of linear inequality constraints | |
size_t | numLinearEqConstraints |
number of linear equality constraints | |
size_t | numNonlinearConstraints |
total number of nonlinear constraints | |
size_t | numLinearConstraints |
total number of linear constraints | |
size_t | numConstraints |
total number of linear and nonlinear constraints | |
unsigned short | minimizerRecasts |
number of RecastModels locally (in Minimizer or derived classes) layered over the initially passed in Model | |
bool | optimizationFlag |
flag for use where optimization and NLS must be distinguished | |
size_t | numUserPrimaryFns |
number of objective functions or least squares terms in the inbound model; always initialize at Minimizer, even if overridden later | |
size_t | numIterPrimaryFns |
number of objective functions or least squares terms in iterator's view, after transformations; always initialize at Minimizer, even if overridden later | |
bool | boundConstraintFlag |
convenience flag for denoting the presence of user-specified bound constraints. Used for method selection and error checking. | |
bool | speculativeFlag |
flag for speculative gradient evaluations | |
bool | calibrationDataFlag |
flag indicating whether user-supplied calibration data is active | |
ExperimentData | expData |
Container for experimental data to which to calibrate model using least squares or other formulations which minimize SSE. | |
size_t | numExperiments |
number of experiments | |
size_t | numTotalCalibTerms |
number of total calibration terms (sum over experiments of number of experimental data per experiment, including field data) | |
bool | applyCovariance |
whether to scale residuals by covariance | |
bool | matrixCovarianceActive |
whether matrix-valued covariance is present | |
bool | scaleFlag |
flag for overall scaling status | |
bool | varsScaleFlag |
flag for variables scaling | |
bool | primaryRespScaleFlag |
flag for primary response scaling | |
bool | secondaryRespScaleFlag |
flag for secondary response scaling | |
IntArray | cvScaleTypes |
scale flags for continuous vars. | |
RealVector | cvScaleMultipliers |
scales for continuous variables | |
RealVector | cvScaleOffsets |
offsets for continuous variables | |
IntArray | responseScaleTypes |
scale flags for all responses | |
RealVector | responseScaleMultipliers |
scales for all responses | |
RealVector | responseScaleOffsets |
offsets for all responses (zero < for functions, not for nonlin con) | |
IntArray | linearIneqScaleTypes |
scale flags for linear ineq | |
RealVector | linearIneqScaleMultipliers |
scales for linear ineq constrs. | |
RealVector | linearIneqScaleOffsets |
offsets for linear ineq constrs. | |
IntArray | linearEqScaleTypes |
scale flags for linear eq. | |
RealVector | linearEqScaleMultipliers |
scales for linear constraints | |
RealVector | linearEqScaleOffsets |
offsets for linear constraints | |
Minimizer * | prevMinInstance |
pointer containing previous value of minimizerInstance | |
bool | vendorNumericalGradFlag |
convenience flag for gradient_type == numerical && method_source == vendor | |
Static Protected Attributes | |
static Minimizer * | minimizerInstance |
pointer to Minimizer used in static member functions | |
Private Member Functions | |
void | copy_residuals (const RealVector &fn_vals, RealMatrix &fn_grad, const RealSymMatrixArray &fn_hess, size_t offset, size_t num_fns, Response &residual_response) |
Convenience function to map data from passed fn, grad, hess, into subset of residual_response, based on ASV. | |
void | initialize_scaling () |
initialize scaling types, multipliers, and offsets; perform error checking | |
void | compute_scaling (int object_type, int auto_type, int num_vars, RealVector &lbs, RealVector &ubs, RealVector &targets, const StringArray &scale_strings, const RealVector &scales, IntArray &scale_types, RealVector &scale_mults, RealVector &scale_offsets) |
general helper function for initializing scaling types and factors on a vector of variables, functions, constraints, etc. | |
bool | compute_scale_factor (const Real lower_bound, const Real upper_bound, Real *multiplier, Real *offset) |
automatically compute a single scaling factor -- bounds case | |
bool | compute_scale_factor (const Real target, Real *multiplier) |
automatically compute a single scaling factor -- target case | |
void | response_scaler_core (const Variables &native_vars, const Variables &scaled_vars, const Response &native_response, Response &iterator_response, size_t start_offset, size_t num_responses) |
Core of response scaling, which doesn't perform any output. | |
RealVector | modify_n2s (const RealVector &native_vars, const IntArray &scale_types, const RealVector &multipliers, const RealVector &offsets) const |
general RealVector mapping from native to scaled variables vectors: | |
void | response_modify_n2s (const Variables &scaled_vars, const Response &native_response, Response &scaled_response, int start_offset, int num_responses) const |
map reponses from native to scaled variable space | |
RealMatrix | lin_coeffs_modify_n2s (const RealMatrix &native_coeffs, const RealVector &cv_multipliers, const RealVector &lin_multipliers) const |
general linear coefficients mapping from native to scaled space | |
void | print_scaling (const String &info, const IntArray &scale_types, const RealVector &scale_mults, const RealVector &scale_offsets, const StringArray &labels) |
print scaling information for a particular response type in tabular form | |
Static Private Member Functions | |
static void | primary_resp_differencer (const Variables &raw_vars, const Variables &residual_vars, const Response &raw_response, Response &residual_response) |
Recast callback function to difference residuals with observed data. | |
static void | variables_scaler (const Variables &scaled_vars, Variables &native_vars) |
RecastModel callback for variables scaling: transform variables from scaled to native (user) space. | |
static void | primary_resp_scaler (const Variables &native_vars, const Variables &scaled_vars, const Response &native_response, Response &iterator_response) |
RecastModel callback for primary response scaling: transform responses (grads, Hessians) from native (user) to scaled space. | |
static void | secondary_resp_scaler (const Variables &native_vars, const Variables &scaled_vars, const Response &native_response, Response &scaled_response) |
RecastModel callback for secondary response scaling: transform constraints (grads, Hessians) from native (user) to scaled space. | |
Friends | |
class | SOLBase |
the SOLBase class is not derived the iterator hierarchy but still needs access to iterator hierarchy data (to avoid attribute replication) | |
class | SNLLBase |
the SNLLBase class is not derived the iterator hierarchy but still needs access to iterator hierarchy data (to avoid attribute replication) |
Base class for the optimizer and least squares branches of the iterator hierarchy.
The Minimizer class provides common data and functionality for Optimizer and LeastSq.
Minimizer | ( | ProblemDescDB & | problem_db, |
Model & | model | ||
) | [protected] |
standard constructor
This constructor extracts inherited data for the optimizer and least squares branches and performs sanity checking on constraint settings.
References Iterator::iteratedModel, Iterator::maxIterations, Iterator::methodName, Iterator::numFinalSolutions, and Minimizer::update_from_model().
void initialize_run | ( | ) | [protected, virtual] |
utility function to perform common operations prior to pre_run(); typically memory initialization; setting of instance pointers
Perform initialization phases of run sequence, like allocating memory and setting 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 initialize_run(), typically _before_ performing its own implementation steps.
Reimplemented from Iterator.
Reimplemented in SNLLOptimizer, NLPQLPOptimizer, SNLLLeastSq, CONMINOptimizer, DOTOptimizer, Optimizer, and LeastSq.
References Model::all_continuous_variables(), Model::all_discrete_int_variables(), Model::all_discrete_real_variables(), Iterator::bestVariablesArray, Model::is_null(), Iterator::iteratedModel, Minimizer::minimizerInstance, Minimizer::minimizerRecasts, Minimizer::prevMinInstance, Model::set_evaluation_reference(), Iterator::subIteratorFlag, Model::subordinate_model(), and Iterator::summaryOutputFlag.
void post_run | ( | std::ostream & | s | ) | [protected, virtual] |
post-run portion of run (optional); verbose to print results; re-implemented by Iterators that can read all Variables/Responses and perform final analysis phase in a standalone way
Post-run phase, which a derived iterator may optionally reimplement; when not present, post-run is likely integrated into run. This is a virtual function; when re-implementing, a derived class must call its nearest parent's post_run(), typically _after_ performing its own implementation steps.
Reimplemented from Iterator.
Reimplemented in SNLLOptimizer, COLINOptimizer, SNLLLeastSq, Optimizer, and LeastSq.
References Model::is_null(), Iterator::iteratedModel, Model::print_evaluation_summary(), Iterator::print_results(), Iterator::resultsDB, Iterator::summaryOutputFlag, and ResultsManager::write_databases().
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 Iterator.
Reimplemented in SNLLOptimizer, SNLLLeastSq, Optimizer, and LeastSq.
References Minimizer::minimizerInstance, and Minimizer::prevMinInstance.
const Model & algorithm_space_model | ( | ) | const [inline, protected, virtual] |
default definition that gets redefined in selected derived Minimizers
Reimplemented from Iterator.
Reimplemented in EffGlobalMinimizer.
References Iterator::iteratedModel.
void data_transform_model | ( | ) | [protected] |
Wrap iteratedModel in a RecastModel that subtracts provided observed data from the primary response functions (variables and secondary responses are unchanged)
Reads observation data to compute least squares residuals. Does not change size of responses, and is the first wrapper, therefore sizes are based on iteratedModel.
References Dakota::abort_handler(), Iterator::activeSet, Minimizer::applyCovariance, Model::assign_rep(), Model::current_response(), Minimizer::expand_array(), Minimizer::expData, Minimizer::gen_primary_resp_map(), ProblemDescDB::get_sizet(), Iterator::iteratedModel, ExperimentData::load_data(), Minimizer::matrixCovarianceActive, Minimizer::minimizerRecasts, ExperimentData::num_total_exppoints(), Minimizer::numContinuousVars, Minimizer::numExperiments, Minimizer::numFunctions, Minimizer::numIterPrimaryFns, Minimizer::numNonlinearConstraints, Minimizer::numNonlinearIneqConstraints, Minimizer::numTotalCalibTerms, Minimizer::numUserPrimaryFns, Iterator::outputLevel, Minimizer::primary_resp_differencer(), Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), Iterator::probDescDB, ActiveSet::request_vector(), Minimizer::secondary_resp_copier(), Response::shared_data(), Model::subordinate_model(), and ExperimentData::variance_type_active().
Referenced by LeastSq::LeastSq(), and Optimizer::Optimizer().
void scale_model | ( | ) | [protected] |
Wrap iteratedModel in a RecastModel that performs variable and/or response scaling.
Wrap the iteratedModel in a scaling transformation, such that iteratedModel now contains a scaling recast model. Potentially affects variables, primary, and secondary responses
References Model::assign_rep(), Minimizer::cvScaleTypes, RecastModel::initialize(), Minimizer::initialize_scaling(), Iterator::iteratedModel, Minimizer::minimizerRecasts, Model::model_rep(), Minimizer::numContinuousVars, Minimizer::numNonlinearConstraints, Minimizer::numNonlinearIneqConstraints, Minimizer::numUserPrimaryFns, Iterator::outputLevel, Minimizer::primary_resp_scaler(), Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), Minimizer::primaryRespScaleFlag, Minimizer::responseScaleTypes, Minimizer::secondary_resp_scaler(), Minimizer::secondaryRespScaleFlag, Model::subordinate_model(), Minimizer::variables_scaler(), and Minimizer::varsScaleFlag.
Referenced by LeastSq::LeastSq(), and Optimizer::Optimizer().
void gnewton_set_recast | ( | const Variables & | recast_vars, |
const ActiveSet & | recast_set, | ||
ActiveSet & | sub_model_set | ||
) | [static, protected] |
conversion of request vector values for the Gauss-Newton Hessian approximation
For Gauss-Newton Hessian requests, activate the 2 bit and mask the 4 bit.
References ActiveSet::request_value(), and ActiveSet::request_vector().
Referenced by Optimizer::reduce_model(), and SurrBasedLocalMinimizer::SurrBasedLocalMinimizer().
void secondary_resp_copier | ( | const Variables & | input_vars, |
const Variables & | output_vars, | ||
const Response & | input_response, | ||
Response & | output_response | ||
) | [static, protected] |
copy the partial response for secondary functions when needed (data and reduction transforms)
Constraint function map from user/native space to iterator/scaled/combined space using a RecastModel.
References Minimizer::minimizerInstance, Minimizer::numIterPrimaryFns, Minimizer::numNonlinearConstraints, Minimizer::numUserPrimaryFns, and Response::update_partial().
Referenced by Minimizer::data_transform_model(), Optimizer::reduce_model(), and LeastSq::weight_model().
bool need_resp_trans_byvars | ( | const ShortArray & | asv, |
int | start_index, | ||
int | num_resp | ||
) | [protected] |
determine if response transformation is needed due to variable transformations
Determine if variable transformations present and derivatives requested, which implies a response transformation is necessay
References Minimizer::varsScaleFlag.
Referenced by LeastSq::post_run(), Optimizer::post_run(), SNLLLeastSq::post_run(), and Minimizer::response_scaler_core().
RealVector modify_s2n | ( | const RealVector & | scaled_vars, |
const IntArray & | scale_types, | ||
const RealVector & | multipliers, | ||
const RealVector & | offsets | ||
) | const [protected] |
general RealVector mapping from scaled to native variables (and values)
general RealVector mapping from scaled to native variables and/or vals; loosely, in greatest generality: scaled_var = (LOG_BASE^scaled_var) * multiplier + offset
Referenced by LeastSq::post_run(), Optimizer::post_run(), SNLLLeastSq::post_run(), and Minimizer::variables_scaler().
void response_modify_s2n | ( | const Variables & | native_vars, |
const Response & | scaled_response, | ||
Response & | native_response, | ||
int | start_offset, | ||
int | num_responses | ||
) | const [protected] |
map responses from scaled to native space
Unscaling response mapping: modifies response from scaled (iterator) to native (user) space. Maps num_responses starting at response_offset
References Response::active_set(), Variables::acv(), Variables::all_continuous_variable_ids(), Variables::all_continuous_variables(), Variables::continuous_variable_ids(), Variables::continuous_variables(), Dakota::copy_data(), Variables::cv(), Minimizer::cvScaleMultipliers, Minimizer::cvScaleOffsets, Minimizer::cvScaleTypes, Dakota::find_index(), Response::function_gradient_view(), Response::function_gradients(), Response::function_hessian_view(), Response::function_hessians(), Response::function_labels(), Response::function_value(), Response::function_values(), Variables::icv(), Variables::inactive_continuous_variable_ids(), Variables::inactive_continuous_variables(), Minimizer::numUserPrimaryFns, Iterator::outputLevel, ActiveSet::request_vector(), Minimizer::responseScaleMultipliers, Minimizer::responseScaleOffsets, Minimizer::responseScaleTypes, and Dakota::write_precision.
Referenced by LeastSq::post_run(), and Optimizer::post_run().
Real objective | ( | const RealVector & | fn_vals, |
const BoolDeque & | max_sense, | ||
const RealVector & | primary_wts | ||
) | const [protected] |
compute a composite objective value from one or more primary functions
The composite objective computation sums up the contributions from one of more primary functions using the primary response fn weights.
References Minimizer::numUserPrimaryFns.
Referenced by SurrBasedLocalMinimizer::approx_subprob_objective_eval(), SurrBasedMinimizer::augmented_lagrangian_merit(), EffGlobalMinimizer::expected_improvement(), SurrBasedMinimizer::lagrangian_merit(), Optimizer::objective_reduction(), SurrBasedMinimizer::penalty_merit(), COLINOptimizer::post_run(), SurrBasedMinimizer::update_filter(), and SurrBasedLocalMinimizer::update_penalty().
Real objective | ( | const RealVector & | fn_vals, |
size_t | num_fns, | ||
const BoolDeque & | max_sense, | ||
const RealVector & | primary_wts | ||
) | const [protected] |
compute a composite objective with specified number of source primary functions, instead of userPrimaryFns
This "composite" objective is a more general case of the previous objective(), but doesn't presume a reduction map from user to iterated space. Used to apply weights and sense in COLIN results sorting. Leaving as a duplicate implementation pending resolution of COLIN lookups.
References Minimizer::optimizationFlag.
void objective_gradient | ( | const RealVector & | fn_vals, |
size_t | num_fns, | ||
const RealMatrix & | fn_grads, | ||
const BoolDeque & | max_sense, | ||
const RealVector & | primary_wts, | ||
RealVector & | obj_grad | ||
) | const [protected] |
compute the gradient of the composite objective function
The composite objective gradient computation combines the contributions from one of more primary function gradients, including the effect of any primary function weights. In the case of a linear mapping (MOO), only the primary function gradients are required, but in the case of a nonlinear mapping (NLS), primary function values are also needed. Within RecastModel::set_mapping(), the active set requests are automatically augmented to make values available when needed, based on nonlinearRespMapping settings.
References Minimizer::numContinuousVars, and Minimizer::optimizationFlag.
void objective_hessian | ( | const RealVector & | fn_vals, |
size_t | num_fns, | ||
const RealMatrix & | fn_grads, | ||
const RealSymMatrixArray & | fn_hessians, | ||
const BoolDeque & | max_sense, | ||
const RealVector & | primary_wts, | ||
RealSymMatrix & | obj_hess | ||
) | const [protected] |
compute the Hessian of the composite objective function
The composite objective Hessian computation combines the contributions from one of more primary function Hessians, including the effect of any primary function weights. In the case of a linear mapping (MOO), only the primary function Hessians are required, but in the case of a nonlinear mapping (NLS), primary function values and gradients are also needed in general (gradients only in the case of a Gauss-Newton approximation). Within the default RecastModel::set_mapping(), the active set requests are automatically augmented to make values and gradients available when needed, based on nonlinearRespMapping settings.
References Dakota::abort_handler(), Minimizer::numContinuousVars, and Minimizer::optimizationFlag.
void resize_best_vars_array | ( | size_t | newsize | ) | [protected] |
Safely resize the best variables array to newsize taking into account the envelope-letter design pattern and any recasting.
Uses data from the innermost model, should any Minimizer recasts be active. Called by multipoint return solvers. Do not directly call resize on the bestVariablesArray object unless you intend to share the internal content (letter) with other objects after assignment.
References Iterator::bestVariablesArray, Variables::copy(), Model::current_variables(), and Minimizer::original_model().
Referenced by COLINOptimizer::post_run().
void resize_best_resp_array | ( | size_t | newsize | ) | [protected] |
Safely resize the best response array to newsize taking into account the envelope-letter design pattern and any recasting.
Uses data from the innermost model, should any Minimizer recasts be active. Called by multipoint return solvers. Do not directly call resize on the bestResponseArray object unless you intend to share the internal content (letter) with other objects after assignment.
References Iterator::bestResponseArray, Response::copy(), Model::current_response(), and Minimizer::original_model().
Referenced by COLINOptimizer::post_run().
void local_recast_retrieve | ( | const Variables & | vars, |
Response & | response | ||
) | const [protected] |
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. This may get called even for a single user-specified function, since we may be recasting a single NLS residual into a squared objective. Always returns best data in the space of the original inbound Model.
References Response::active_set(), Dakota::data_pairs, Model::interface_id(), Iterator::iteratedModel, Dakota::lookup_by_val(), and Response::update().
Referenced by LeastSq::post_run(), and Optimizer::post_run().
void primary_resp_differencer | ( | const Variables & | raw_vars, |
const Variables & | residual_vars, | ||
const Response & | raw_response, | ||
Response & | residual_response | ||
) | [static, private] |
Recast callback function to difference residuals with observed data.
Difference the primary responses with observed data
References Response::active_set_request_vector(), Minimizer::data_difference_core(), Minimizer::expData, Response::function_gradient_view(), Response::function_hessian(), Response::function_labels(), Response::function_value(), Response::function_values(), Minimizer::minimizerInstance, ExperimentData::num_total_exppoints(), Minimizer::numTotalCalibTerms, Minimizer::numUserPrimaryFns, and Iterator::outputLevel.
Referenced by Minimizer::data_transform_model().
void initialize_scaling | ( | ) | [private] |
initialize scaling types, multipliers, and offsets; perform error checking
Initialize scaling types, multipliers, and offsets. Update the iteratedModel appropriately
References Dakota::abort_handler(), Minimizer::compute_scaling(), Model::continuous_lower_bounds(), Model::continuous_upper_bounds(), Model::continuous_variable_labels(), Model::continuous_variables(), Dakota::copy_data(), Minimizer::cvScaleMultipliers, Minimizer::cvScaleOffsets, Minimizer::cvScaleTypes, ProblemDescDB::get_rv(), ProblemDescDB::get_sa(), Iterator::iteratedModel, Minimizer::lin_coeffs_modify_n2s(), Model::linear_eq_constraint_coeffs(), Model::linear_eq_constraint_targets(), Model::linear_ineq_constraint_coeffs(), Model::linear_ineq_constraint_lower_bounds(), Model::linear_ineq_constraint_upper_bounds(), Minimizer::linearEqScaleMultipliers, Minimizer::linearEqScaleOffsets, Minimizer::linearEqScaleTypes, Minimizer::linearIneqScaleMultipliers, Minimizer::linearIneqScaleOffsets, Minimizer::linearIneqScaleTypes, Model::model_rep(), Minimizer::modify_n2s(), Model::nonlinear_eq_constraint_targets(), Model::nonlinear_ineq_constraint_lower_bounds(), Model::nonlinear_ineq_constraint_upper_bounds(), Minimizer::numContinuousVars, Minimizer::numFunctions, Minimizer::numLinearEqConstraints, Minimizer::numLinearIneqConstraints, Minimizer::numNonlinearEqConstraints, Minimizer::numNonlinearIneqConstraints, Minimizer::numUserPrimaryFns, Iterator::outputLevel, Minimizer::primaryRespScaleFlag, Minimizer::print_scaling(), Iterator::probDescDB, Model::response_labels(), Minimizer::responseScaleMultipliers, Minimizer::responseScaleOffsets, Minimizer::responseScaleTypes, Minimizer::secondaryRespScaleFlag, RecastModel::submodel_supports_derivative_estimation(), Model::subordinate_model(), Model::supports_derivative_estimation(), and Minimizer::varsScaleFlag.
Referenced by Minimizer::scale_model().
void variables_scaler | ( | const Variables & | scaled_vars, |
Variables & | native_vars | ||
) | [static, private] |
RecastModel callback for variables scaling: transform variables from scaled to native (user) space.
Variables map from iterator/scaled space to user/native space using a RecastModel.
References Variables::continuous_variable_labels(), Variables::continuous_variables(), Minimizer::cvScaleMultipliers, Minimizer::cvScaleOffsets, Minimizer::cvScaleTypes, Minimizer::minimizerInstance, Minimizer::modify_s2n(), and Iterator::outputLevel.
Referenced by Minimizer::scale_model().
void secondary_resp_scaler | ( | const Variables & | native_vars, |
const Variables & | scaled_vars, | ||
const Response & | native_response, | ||
Response & | iterator_response | ||
) | [static, private] |
RecastModel callback for secondary response scaling: transform constraints (grads, Hessians) from native (user) to scaled space.
Constraint function map from user/native space to iterator/scaled/combined space using a RecastModel.
References Minimizer::minimizerInstance, Minimizer::numNonlinearConstraints, Minimizer::numUserPrimaryFns, and Minimizer::response_scaler_core().
Referenced by Minimizer::scale_model().
RealVector modify_n2s | ( | const RealVector & | native_vars, |
const IntArray & | scale_types, | ||
const RealVector & | multipliers, | ||
const RealVector & | offsets | ||
) | const [private] |
general RealVector mapping from native to scaled variables vectors:
general RealVector mapping from native to scaled variables; loosely, in greatest generality: scaled_var = log( (native_var - offset) / multiplier )
Referenced by Minimizer::initialize_scaling().
void response_modify_n2s | ( | const Variables & | native_vars, |
const Response & | native_response, | ||
Response & | recast_response, | ||
int | start_offset, | ||
int | num_responses | ||
) | const [private] |
map reponses from native to scaled variable space
Scaling response mapping: modifies response from a model (user/native) for use in iterators (scaled). Maps num_responses starting at response_offset
References Response::active_set(), Variables::acv(), Variables::all_continuous_variable_ids(), Variables::all_continuous_variables(), Variables::continuous_variable_ids(), Variables::continuous_variables(), Dakota::copy_data(), Variables::cv(), Minimizer::cvScaleMultipliers, Minimizer::cvScaleOffsets, Minimizer::cvScaleTypes, Dakota::find_index(), Response::function_gradient_view(), Response::function_gradients(), Response::function_hessian_view(), Response::function_hessians(), Response::function_labels(), Response::function_value(), Response::function_values(), Variables::icv(), Variables::inactive_continuous_variable_ids(), Variables::inactive_continuous_variables(), Minimizer::numUserPrimaryFns, Iterator::outputLevel, ActiveSet::request_vector(), Minimizer::responseScaleMultipliers, Minimizer::responseScaleOffsets, Minimizer::responseScaleTypes, and Dakota::write_precision.
Referenced by Minimizer::response_scaler_core().
RealMatrix lin_coeffs_modify_n2s | ( | const RealMatrix & | src_coeffs, |
const RealVector & | cv_multipliers, | ||
const RealVector & | lin_multipliers | ||
) | const [private] |
general linear coefficients mapping from native to scaled space
compute scaled linear constraint matrix given design variable multipliers and linear scaling multipliers. Only scales components corresponding to continuous variables so for src_coeffs of size MxN, lin_multipliers.size() <= M, cv_multipliers.size() <= N
Referenced by Minimizer::initialize_scaling().