Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
Minimizer Class Reference

Base class for the optimizer and least squares branches of the iterator hierarchy. More...

Inheritance diagram for Minimizer:
Iterator LeastSq Optimizer SurrBasedMinimizer NL2SOLLeastSq NLSSOLLeastSq SNLLLeastSq APPSOptimizer COLINOptimizer CONMINOptimizer DOTOptimizer JEGAOptimizer NCSUOptimizer NLPQLPOptimizer NPSOLOptimizer SNLLOptimizer EffGlobalMinimizer SurrBasedGlobalMinimizer SurrBasedLocalMinimizer

List of all members.

Protected Member Functions

 Minimizer ()
 default constructor
 Minimizer (Model &model)
 standard constructor
 Minimizer (NoDBBaseConstructor, Model &model)
 alternate constructor for "on the fly" instantiations
 Minimizer (NoDBBaseConstructor, 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 initialize_run ()
 utility function to perform common operations prior to pre_run(); typically memory initialization; setting of instance pointers
void finalize_run ()
 utility function to perform common operations following post_run(); deallocation and resetting of instance pointers
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
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_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:
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_n2s (const Variables &scaled_vars, const Response &native_response, Response &scaled_response, int native_offset, int recast_offset, int num_responses) const
 map reponses from native to scaled variable space
void response_modify_s2n (const Variables &native_vars, const Response &scaled_response, Response &native_response, int scaled_offset, int native_offset, int num_responses) const
 map responses from scaled to native 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
Real objective (const RealVector &fn_vals, const RealVector &primary_wts) const
 compute a composite objective value from one or more primary functions
void objective_gradient (const RealVector &fn_vals, const RealMatrix &fn_grads, 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 RealVector &primary_wts, RealSymMatrix &obj_hess) const
 compute the Hessian of the composite objective function

Static Protected Member Functions

static void variables_recast (const Variables &scaled_vars, Variables &native_vars)
 variables conversion map for RecastModel used in scaling: transform variables from scaled to native (user) space
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 secondary_resp_recast (const Variables &native_vars, const Variables &scaled_vars, const Response &native_response, Response &scaled_response)
 secondary response conversion map for RecastModel used in scaling: transform constraints (fns, grads, Hessians) from native (user) to

Protected Attributes

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
int numNonlinearConstraints
 total number of nonlinear constraints
int numLinearConstraints
 total number of linear constraints
int numConstraints
 total number of linear and nonlinear constraints
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 user's model
size_t numIterPrimaryFns
 number of objective functions or least squares terms in iterator's view
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 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
MinimizerprevMinInstance
 pointer containing previous value of minimizerInstance
bool vendorNumericalGradFlag
 convenience flag for gradType == numerical && methodSource == vendor

Static Protected Attributes

static MinimizerminimizerInstance
 pointer to Minimizer used in static member functions

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)

Detailed Description

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.


Constructor & Destructor Documentation

Minimizer ( Model model) [protected]

Member Function Documentation

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, SNLLLeastSq, NLPQLPOptimizer, CONMINOptimizer, DOTOptimizer, Optimizer, and LeastSq.

References Model::all_continuous_variables(), Model::all_discrete_int_variables(), Model::all_discrete_real_variables(), Iterator::bestVariablesArray, Iterator::iteratedModel, Minimizer::minimizerInstance, Minimizer::prevMinInstance, and Iterator::subIteratorFlag.

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.

void initialize_scaling ( ) [protected]

initialize scaling types, multipliers, and offsets; perform error checking

helper function used in constructors of derived classes to set up scaling types, multipliers and offsets when input scaling flag is enabled

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_dsa(), ProblemDescDB::get_rdv(), 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(), Iterator::numContinuousVars, Iterator::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 LeastSq::LeastSq(), and Optimizer::Optimizer().

void variables_recast ( const Variables scaled_vars,
Variables native_vars 
) [static, protected]

variables conversion map for RecastModel used in 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(), Iterator::outputLevel, and Dakota::write_data().

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::Optimizer(), and SurrBasedLocalMinimizer::SurrBasedLocalMinimizer().

void secondary_resp_recast ( const Variables native_vars,
const Variables scaled_vars,
const Response native_response,
Response iterator_response 
) [static, protected]

secondary response conversion map for RecastModel used in scaling: transform constraints (fns, grads, Hessians) from native (user) to

Constraint function map from user/native space to iterator/scaled/combined space using a RecastModel.

References Response::active_set_request_vector(), Minimizer::minimizerInstance, Minimizer::need_resp_trans_byvars(), Minimizer::numIterPrimaryFns, Minimizer::numNonlinearConstraints, Minimizer::numUserPrimaryFns, Minimizer::response_modify_n2s(), Minimizer::secondaryRespScaleFlag, and Response::update_partial().

Referenced by LeastSq::LeastSq(), and Optimizer::Optimizer().

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(), LeastSq::primary_resp_recast(), Optimizer::primary_resp_recast(), and Minimizer::secondary_resp_recast().

RealVector modify_n2s ( const RealVector &  native_vars,
const IntArray &  scale_types,
const RealVector &  multipliers,
const RealVector &  offsets 
) const [protected]

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().

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(), COLINOptimizer::post_run(), and Minimizer::variables_recast().

void response_modify_n2s ( const Variables native_vars,
const Response native_response,
Response recast_response,
int  native_offset,
int  recast_offset,
int  num_responses 
) const [protected]
void response_modify_s2n ( const Variables native_vars,
const Response scaled_response,
Response native_response,
int  scaled_offset,
int  native_offset,
int  num_responses 
) const [protected]
RealMatrix lin_coeffs_modify_n2s ( const RealMatrix &  src_coeffs,
const RealVector &  cv_multipliers,
const RealVector &  lin_multipliers 
) const [protected]

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().

Real objective ( const RealVector &  fn_vals,
const RealVector &  primary_wts 
) const [protected]
void objective_gradient ( const RealVector &  fn_vals,
const RealMatrix &  fn_grads,
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 Iterator::numContinuousVars, Minimizer::numUserPrimaryFns, and Minimizer::optimizationFlag.

Referenced by SurrBasedLocalMinimizer::approx_subprob_objective_eval(), SurrBasedMinimizer::augmented_lagrangian_gradient(), SurrBasedMinimizer::lagrangian_gradient(), Optimizer::objective_reduction(), SurrBasedMinimizer::penalty_gradient(), and SurrBasedMinimizer::update_lagrange_multipliers().

void objective_hessian ( const RealVector &  fn_vals,
const RealMatrix &  fn_grads,
const RealSymMatrixArray &  fn_hessians,
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(), Iterator::numContinuousVars, Minimizer::numUserPrimaryFns, and Minimizer::optimizationFlag.

Referenced by Optimizer::objective_reduction().


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