Dakota  Version 6.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
NPSOLOptimizer Class Reference

Wrapper class for the NPSOL optimization library. More...

Inheritance diagram for NPSOLOptimizer:
Optimizer SOLBase Minimizer Iterator

Public Member Functions

 NPSOLOptimizer (ProblemDescDB &problem_db, Model &model)
 standard constructor More...
 
 NPSOLOptimizer (Model &model)
 alternate constructor for Iterator instantiations by name More...
 
 NPSOLOptimizer (Model &model, const int &derivative_level, const Real &conv_tol)
 alternate constructor for instantiations "on the fly" More...
 
 NPSOLOptimizer (const RealVector &initial_point, const RealVector &var_lower_bnds, const RealVector &var_upper_bnds, const RealMatrix &lin_ineq_coeffs, const RealVector &lin_ineq_lower_bnds, const RealVector &lin_ineq_upper_bnds, const RealMatrix &lin_eq_coeffs, const RealVector &lin_eq_targets, const RealVector &nonlin_ineq_lower_bnds, const RealVector &nonlin_ineq_upper_bnds, const RealVector &nonlin_eq_targets, void(*user_obj_eval)(int &, int &, double *, double &, double *, int &), void(*user_con_eval)(int &, int &, int &, int &, int *, double *, double *, double *, int &), const int &derivative_level, const Real &conv_tol)
 alternate constructor for instantiations "on the fly" More...
 
 ~NPSOLOptimizer ()
 destructor
 
void core_run ()
 core portion of run; implemented by all derived classes and may include pre/post steps in lieu of separate pre/post More...
 
- Public Member Functions inherited from SOLBase
 SOLBase ()
 default constructor
 
 SOLBase (Model &model)
 standard constructor
 
 ~SOLBase ()
 destructor
 

Private Member Functions

void find_optimum_on_model ()
 called by core_run for setUpType == "model"
 
void find_optimum_on_user_functions ()
 called by core_run for setUpType == "user_functions"
 

Static Private Member Functions

static void objective_eval (int &mode, int &n, double *x, double &f, double *gradf, int &nstate)
 OBJFUN in NPSOL manual: computes the value and first derivatives of the objective function (passed by function pointer to NPSOL).
 

Private Attributes

String setUpType
 controls iteration mode: "model" (normal usage) or "user_functions" (user-supplied functions mode for "on the fly" instantiations). NonDReliability currently uses the user_functions mode.
 
RealVector initialPoint
 holds initial point passed in for "user_functions" mode.
 
RealVector lowerBounds
 holds variable lower bounds passed in for "user_functions" mode.
 
RealVector upperBounds
 holds variable upper bounds passed in for "user_functions" mode.
 
void(* userObjectiveEval )(int &, int &, double *, double &, double *, int &)
 holds function pointer for objective function evaluator passed in for "user_functions" mode.
 
void(* userConstraintEval )(int &, int &, int &, int &, int *, double *, double *, double *, int &)
 holds function pointer for constraint function evaluator passed in for "user_functions" mode.
 

Static Private Attributes

static NPSOLOptimizernpsolInstance
 pointer to the active object instance used within the static evaluator functions in order to avoid the need for static data
 

Additional Inherited Members

- Static Public Member Functions inherited from Optimizer
static void not_available (const std::string &package_name)
 Static helper function: third-party opt packages which are not available.
 
- Protected Member Functions inherited from Optimizer
 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 post_run (std::ostream &s)
 
void finalize_run ()
 utility function to perform common operations following post_run(); deallocation and resetting of instance pointers More...
 
void print_results (std::ostream &s)
 
- Protected Member Functions inherited from SOLBase
void allocate_arrays (int num_cv, size_t num_nln_con, const RealMatrix &lin_ineq_coeffs, const RealMatrix &lin_eq_coeffs)
 Allocates miscellaneous arrays for the SOL algorithms.
 
void deallocate_arrays ()
 Deallocates memory previously allocated by allocate_arrays().
 
void allocate_workspace (int num_cv, int num_nln_con, int num_lin_con, int num_lsq)
 Allocates real and integer workspaces for the SOL algorithms.
 
void set_options (bool speculative_flag, bool vendor_num_grad_flag, short output_lev, int verify_lev, Real fn_prec, Real linesrch_tol, int max_iter, Real constr_tol, Real conv_tol, const std::string &grad_type, const RealVector &fdss)
 Sets SOL method options using calls to npoptn2.
 
void augment_bounds (RealVector &augmented_l_bnds, RealVector &augmented_u_bnds, const RealVector &lin_ineq_l_bnds, const RealVector &lin_ineq_u_bnds, const RealVector &lin_eq_targets, const RealVector &nln_ineq_l_bnds, const RealVector &nln_ineq_u_bnds, const RealVector &nln_eq_targets)
 augments variable bounds with linear and nonlinear constraint bounds.
 
- Static Protected Member Functions inherited from Iterator
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 More...
 
- Static Protected Member Functions inherited from SOLBase
static void constraint_eval (int &mode, int &ncnln, int &n, int &nrowj, int *needc, double *x, double *c, double *cjac, int &nstate)
 CONFUN in NPSOL manual: computes the values and first derivatives of the nonlinear constraint functions.
 
- Protected Attributes inherited from Optimizer
size_t numObjectiveFns
 number of objective functions (iterator view)
 
bool localObjectiveRecast
 flag indicating whether local recasting to a single objective is used
 
OptimizerprevOptInstance
 pointer containing previous value of optimizerInstance
 
- Protected Attributes inherited from SOLBase
int realWorkSpaceSize
 size of realWorkSpace
 
int intWorkSpaceSize
 size of intWorkSpace
 
RealArray realWorkSpace
 real work space for NPSOL/NLSSOL
 
IntArray intWorkSpace
 int work space for NPSOL/NLSSOL
 
int nlnConstraintArraySize
 used for non-zero array sizing (nonlinear constraints)
 
int linConstraintArraySize
 used for non-zero array sizing (linear constraints)
 
RealArray cLambda
 CLAMBDA from NPSOL manual: Langrange multipliers.
 
IntArray constraintState
 ISTATE from NPSOL manual: constraint status.
 
int informResult
 INFORM from NPSOL manual: optimization status on exit.
 
int numberIterations
 ITER from NPSOL manual: number of (major) iterations performed.
 
int boundsArraySize
 length of augmented bounds arrays (variable bounds plus linear and nonlinear constraint bounds)
 
double * linConstraintMatrixF77
 [A] matrix from NPSOL manual: linear constraint coefficients
 
double * upperFactorHessianF77
 [R] matrix from NPSOL manual: upper Cholesky factor of the Hessian of the Lagrangian.
 
double * constraintJacMatrixF77
 [CJAC] matrix from NPSOL manual: nonlinear constraint Jacobian
 
int fnEvalCntr
 counter for testing against maxFunctionEvals
 
size_t constrOffset
 used in constraint_eval() to bridge NLSSOLLeastSq::numLeastSqTerms and NPSOLOptimizer::numObjectiveFns
 
- Static Protected Attributes inherited from Optimizer
static OptimizeroptimizerInstance
 pointer to Optimizer instance used in static member functions
 
- Static Protected Attributes inherited from SOLBase
static SOLBasesolInstance
 pointer to the active object instance used within the static evaluator functions in order to avoid the need for static data
 
static MinimizeroptLSqInstance
 pointer to the active base class object instance used within the static evaluator functions in order to avoid the need for static data
 

Detailed Description

Wrapper class for the NPSOL optimization library.

The NPSOLOptimizer class provides a wrapper for NPSOL, a Fortran 77 sequential quadratic programming library from Stanford University marketed by Stanford Business Associates. 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: max_function_evaluations is implemented directly in NPSOLOptimizer's evaluator functions since there is no NPSOL parameter equivalent, and max_iterations, convergence_tolerance, output verbosity, verify_level, function_precision, and linesearch_tolerance are mapped into NPSOL's "Major Iteration Limit", "Optimality Tolerance", "Major Print Level" (verbose: Major Print Level = 20; quiet: Major Print Level = 10), "Verify Level", "Function Precision", and "Linesearch Tolerance" parameters, respectively, using NPSOL's npoptn() subroutine (as wrapped by npoptn2() from the npoptn_wrapper.f file). Refer to [Gill, P.E., Murray, W., Saunders, M.A., and Wright, M.H., 1986] for information on NPSOL's optional input parameters and the npoptn() subroutine.

Constructor & Destructor Documentation

NPSOLOptimizer ( ProblemDescDB problem_db,
Model model 
)
NPSOLOptimizer ( Model model)

alternate constructor for Iterator instantiations by name

This is an alternate constructor which accepts a Model but does not have a supporting method specification from the ProblemDescDB.

References Minimizer::constraintTol, Iterator::convergenceTol, Model::fd_gradient_step_size(), Model::gradient_type(), Iterator::iteratedModel, Iterator::maxIterations, Iterator::outputLevel, SOLBase::set_options(), Minimizer::speculativeFlag, and Minimizer::vendorNumericalGradFlag.

NPSOLOptimizer ( Model model,
const int &  derivative_level,
const Real &  conv_tol 
)

alternate constructor for instantiations "on the fly"

This is an alternate constructor for instantiations on the fly using a Model but no ProblemDescDB.

NPSOLOptimizer ( const RealVector &  initial_point,
const RealVector &  var_lower_bnds,
const RealVector &  var_upper_bnds,
const RealMatrix &  lin_ineq_coeffs,
const RealVector &  lin_ineq_lower_bnds,
const RealVector &  lin_ineq_upper_bnds,
const RealMatrix &  lin_eq_coeffs,
const RealVector &  lin_eq_targets,
const RealVector &  nonlin_ineq_lower_bnds,
const RealVector &  nonlin_ineq_upper_bnds,
const RealVector &  nonlin_eq_targets,
void(*)(int &, int &, double *, double &, double *, int &)  user_obj_eval,
void(*)(int &, int &, int &, int &, int *, double *, double *, double *, int &)  user_con_eval,
const int &  derivative_level,
const Real &  conv_tol 
)

alternate constructor for instantiations "on the fly"

This is an alternate constructor for performing an optimization using the passed in objective function and constraint function pointers.

References SOLBase::allocate_arrays(), SOLBase::allocate_workspace(), SOLBase::augment_bounds(), NPSOLOptimizer::lowerBounds, Minimizer::numContinuousVars, Minimizer::numLinearConstraints, Minimizer::numNonlinearConstraints, and NPSOLOptimizer::upperBounds.

Member Function Documentation

void core_run ( )
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 Dakota::abort_handler(), NPSOLOptimizer::find_optimum_on_model(), NPSOLOptimizer::find_optimum_on_user_functions(), and NPSOLOptimizer::setUpType.


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