MOOCHO (Single Doxygen Collection)
Version of the Day
|
Implements the base NLP interface using a Thyra::ModelEvaluator
object.
More...
#include <NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp>
Public Member Functions | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, showModelEvaluatorTrace) | |
Set if a trace of the model evaluations is shown or not. More... | |
Public Member Functions inherited from NLPInterfacePack::NLPObjGrad | |
NLPObjGrad () | |
Initialize to no reference set to calculation quanities. More... | |
virtual bool | supports_Gf () const |
Determine if the objective gradient is supported or not. More... | |
virtual bool | supports_Gf_prod () const |
Determine if the objective gradient product is supported or not. More... | |
virtual VectorMutable * | get_Gf () |
Return pointer passed to this->set_Gf() . More... | |
virtual VectorMutable & | Gf () |
Returns non-const *this->get_Gf() . More... | |
virtual const Vector & | Gf () const |
Returns const *this->get_Gf() . More... | |
virtual void | calc_Gf (const Vector &x, bool newx=true) const |
Update the vector for Gf at the point x and put it in the stored reference. More... | |
virtual value_type | calc_Gf_prod (const Vector &x, const Vector &d, bool newx=true) const |
Calculate the inner product Gf(x)'*d at the point x and put it in the stored reference. More... | |
virtual size_type | num_Gf_evals () const |
Objective gradient evaluations count. More... | |
Public Member Functions inherited from NLPInterfacePack::NLP | |
const ZeroOrderInfo | zero_order_info () const |
Return pointer to set quantities. More... | |
const ZeroOrderInfo | zero_order_info_breve () const |
Return pointer to set hat quantities. More... | |
NLP () | |
Initialize to no reference set to calculation quanities. More... | |
virtual | ~NLP () |
Destructor that cleans all the memory it owns. More... | |
virtual void | set_options (const options_ptr_t &options) |
Set the options that this NLP may be interested in. More... | |
virtual const options_ptr_t & | get_options () const |
Get the OptionsFromStream object being used to extract the options from. More... | |
virtual size_type | n () const |
Return the number of variables. More... | |
virtual size_type | m () const |
Return the number of general equality constraints. More... | |
virtual void | get_init_lagrange_mult (VectorMutable *lambda, VectorMutable *nu) const |
Get the initial value of the Lagrange multipliers lambda. More... | |
virtual value_type * | get_f () |
Return pointer passed to this->set_f() . More... | |
virtual value_type & | f () |
Returns non-const *this->get_f() . More... | |
virtual const value_type & | f () const |
Returns const *this->get_f() . More... | |
virtual VectorMutable * | get_c () |
Return pointer passed to this->set_c() . More... | |
virtual VectorMutable & | c () |
Returns non-const *this->get_c() . More... | |
virtual const Vector & | c () const |
Returns const *this->get_c() . More... | |
virtual void | calc_f (const Vector &x, bool newx=true) const |
Update the value for the objective f at the point x and put it in the stored reference. More... | |
virtual void | calc_c (const Vector &x, bool newx=true) const |
Update the constraint residual vector for c at the point x and put it in the stored reference. More... | |
virtual size_type | num_f_evals () const |
Gives the number of object function f(x) evaluations called by the solver since initialize() was called. More... | |
virtual size_type | num_c_evals () const |
Gives the number of constraint function c(x) evaluations called by the solver since initialize() was called. Throws exception if this->m() == 0 . More... | |
virtual size_type | ns () const |
Return the number of slack variables (i.e. number of general inequalities). More... | |
virtual vec_space_ptr_t | space_c_breve () const |
Vector space object for the original equalities c_breve(x_breve) More... | |
virtual vec_space_ptr_t | space_h_breve () const |
Vector space object for the original inequalities h_breve(x_breve) More... | |
virtual const Vector & | hl_breve () const |
Returns a reference to the vector of lower bounds on the general inequality constraints h_breve(x_breve) . More... | |
virtual const Vector & | hu_breve () const |
Returns a reference to the vector of upper bounds on the general inequality constraints h_breve(x_breve) . More... | |
virtual void | set_c_breve (VectorMutable *c_breve) |
Set a pointer to a vector to be updated when this->calc_c_breve() is called. More... | |
virtual VectorMutable * | get_c_breve () |
Return pointer passed to this->set_c_breve() . More... | |
virtual VectorMutable & | c_breve () |
Returns non-const *this->get_c_breve() . More... | |
virtual const Vector & | c_breve () const |
Returns const *this->get_c_breve() . More... | |
virtual void | set_h_breve (VectorMutable *h_breve) |
Set a pointer to a vector to be updated when this->calc_h_breve() is called. More... | |
virtual VectorMutable * | get_h_breve () |
Return pointer passed to this->set_h_breve() . More... | |
virtual VectorMutable & | h_breve () |
Returns non-const *this->get_h_breve() . More... | |
virtual const Vector & | h_breve () const |
Returns const *this->get_h_breve() . More... | |
virtual const Permutation & | P_var () const |
Return the permutation object for the variables. More... | |
virtual const Permutation & | P_equ () const |
Return the permutation object for the constraints. More... | |
virtual void | calc_c_breve (const Vector &x, bool newx=true) const |
Update the constraint residual vector for c_breve at the point x and put it in the stored reference. More... | |
virtual void | calc_h_breve (const Vector &x, bool newx=true) const |
Update the constraint residual vector for h_breve at the point x and put it in the stored reference. More... | |
Public Member Functions inherited from Teuchos::VerboseObject< NLP > | |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< const ParameterList > | getValidVerboseObjectSublist () |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setupVerboseObjectSublist (ParameterList *paramList) |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel) |
void | readVerboseObjectSublist (ParameterList *paramList, VerboseObject< NLP > *verboseObject) |
VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual void | initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) |
virtual const VerboseObject & | setVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setOverridingVerbLevel (const EVerbosityLevel verbLevel) const |
virtual EVerbosityLevel | getVerbLevel () const |
Protected Types | |
typedef Teuchos::RCP< const AbstractLinAlgPack::VectorSpaceThyra > | VectorSpaceThyra_ptr_t |
Protected Member Functions | |
void | evalModel (const Vector &x, bool newx, const ZeroOrderInfo *zero_order_info, const ObjGradInfo *obj_grad_info) const |
Protected Member Functions inherited from NLPInterfacePack::NLPObjGrad | |
const ObjGradInfo | obj_grad_info () const |
Return objective gradient and zero order information. More... | |
Protected Member Functions inherited from NLPInterfacePack::NLP | |
template<class T > | |
void | assert_ref_set (T *p, std::string info) const |
Assert referece has been set for a quanity. More... | |
virtual void | imp_calc_c_breve (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const |
Overridden to compute c_breve(x_breve) and perhaps f(x) and/or h_breve(x_breve) More... | |
virtual void | imp_calc_h_breve (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const |
Overridden to compute h_breve(x_breve) and perhaps f(x) and/or c_breve(x_breve). More... | |
Protected Attributes | |
bool | initialized_ |
value_type | obj_scale_ |
bool | has_bounds_ |
bool | force_xinit_in_bounds_ |
index_type | num_bounded_x_ |
Teuchos::RCP < Thyra::ModelEvaluator < value_type > > | model_ |
int | p_idx_ |
int | g_idx_ |
bool | DfDp_supports_op_ |
bool | DfDp_supports_mv_ |
VectorSpace::space_ptr_t | space_x_ |
VectorSpaceThyra_ptr_t | space_c_ |
NLPFirstOrder::mat_fcty_ptr_t | factory_Gc_ |
NLPFirstOrder::basis_sys_ptr_t | basis_sys_ |
bool | x_guess_bounds_updated_ |
VectorSpace::vec_mut_ptr_t | xinit_ |
VectorSpace::vec_mut_ptr_t | xl_ |
VectorSpace::vec_mut_ptr_t | xu_ |
Teuchos::RCP < Thyra::VectorBase < value_type > > | model_g_ |
bool | model_g_updated_ |
bool | model_Dg_updated_ |
bool | f_updated_ |
bool | c_updated_ |
bool | Gf_updated_ |
bool | Gc_updated_ |
Overridden public members from NLP | |
void | initialize (bool test_setup) |
bool | is_initialized () const |
vec_space_ptr_t | space_x () const |
vec_space_ptr_t | space_c () const |
size_type | num_bounded_x () const |
void | force_xinit_in_bounds (bool force_xinit_in_bounds) |
bool | force_xinit_in_bounds () const |
const Vector & | xinit () const |
const Vector & | xl () const |
const Vector & | xu () const |
value_type | max_var_bounds_viol () const |
void | set_f (value_type *f) |
void | set_c (VectorMutable *c) |
void | unset_quantities () |
void | scale_f (value_type scale_f) |
value_type | scale_f () const |
void | report_final_solution (const Vector &x, const Vector *lambda, const Vector *nu, bool optimal) |
Overridden public members from NLPObjGrad | |
void | set_Gf (VectorMutable *Gf) |
Overridden protected members from NLP | |
void | imp_calc_f (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const |
void | imp_calc_c (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const |
Overridden protected members from NLPObjGrad | |
void | imp_calc_Gf (const Vector &x, bool newx, const ObjGradInfo &obj_grad_info) const |
Protected functions to be used by subclasses | |
NLPThyraModelEvaluatorBase () | |
void | initializeBase (const Teuchos::RCP< Thyra::ModelEvaluator< value_type > > &model, const int p_idx, const int g_idx) |
Initialize given a Thyra::ModelEvaluator and a description of how to interpret it. More... | |
void | updateInitialGuessAndBounds () const |
Update the initial guess and bounds . More... | |
void | assert_is_initialized () const |
void | copy_from_model_x (const Thyra::VectorBase< value_type > *model_x, VectorMutable *x_D) const |
void | copy_from_model_p (const Thyra::VectorBase< value_type > *model_p, VectorMutable *x_I) const |
void | set_x (const Vector &x, Thyra::ModelEvaluatorBase::InArgs< value_type > *model_inArgs_inout) const |
void | preprocessBaseInOutArgs (const Vector &x, bool newx, const ZeroOrderInfo *zero_order_info, const ObjGradInfo *obj_grad_info, const NLPFirstOrder::FirstOrderInfo *first_order_info, Thyra::ModelEvaluatorBase::InArgs< value_type > *model_inArgs_inout, Thyra::ModelEvaluatorBase::OutArgs< value_type > *model_outArgs_inout, MatrixOp **Gc_out, VectorMutable **Gf_out, value_type **f_out, VectorMutable **c_out) const |
void | postprocessBaseOutArgs (Thyra::ModelEvaluatorBase::OutArgs< value_type > *model_outArgs_inout, VectorMutable *Gf, value_type *f, VectorMutable *c) const |
Additional Inherited Members | |
Public Types inherited from NLPInterfacePack::NLP | |
typedef AbstractLinAlgPack::Vector | Vector |
typedef AbstractLinAlgPack::VectorMutable | VectorMutable |
typedef Teuchos::RCP< const VectorSpace > | vec_space_ptr_t |
typedef Teuchos::RCP< const OptionsFromStreamPack::OptionsFromStream > | options_ptr_t |
Static Public Member Functions inherited from NLPInterfacePack::NLP | |
static value_type | infinite_bound () |
Value for an infinite bound. More... | |
Static Public Member Functions inherited from Teuchos::VerboseObject< NLP > | |
static void | setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel) |
static EVerbosityLevel | getDefaultVerbLevel () |
Implements the base NLP interface using a Thyra::ModelEvaluator
object.
The nonlinear program is mapped as follows:
min f(x) s.t. c(x) = 0 xL <= x <= xu where: x = [ model.x ] [ model.p(p_idx) ] f(x) = model.g(g_idx) c(x) = model.f()
where p_idx > 0
and g_idx > 0
are some indexes that specificy the indepenent variables and the objective function.
In addition, the client can also override the bounds on model.x
and model.p(p_idx)
defined in the object model
.
The current implementation of this class does not allow the use of any of the auxiliary functions model.g()
as undecomposed equality constraints or extra general inequality constraints. This type of functionality can be added when it is needed (just ask for it).
ToDo: Finish documentation!
Definition at line 92 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 254 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Initialize to uninitialized
Definition at line 233 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
NLPInterfacePack::NLPThyraModelEvaluatorBase::STANDARD_MEMBER_COMPOSITION_MEMBERS | ( | bool | , |
showModelEvaluatorTrace | |||
) |
Set if a trace of the model evaluations is shown or not.
|
virtual |
Reimplemented from NLPInterfacePack::NLPObjGrad.
Definition at line 68 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 82 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 88 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 94 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 99 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 104 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 109 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 114 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 120 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 126 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 132 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::NLP.
Definition at line 137 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::NLP.
Definition at line 143 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::NLPObjGrad.
Definition at line 149 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 154 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Implements NLPInterfacePack::NLP.
Definition at line 159 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::NLP.
Definition at line 164 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::NLPObjGrad.
Definition at line 197 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protectedvirtual |
Implements NLPInterfacePack::NLP.
Definition at line 205 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protectedvirtual |
Implements NLPInterfacePack::NLP.
Definition at line 213 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protectedvirtual |
Implements NLPInterfacePack::NLPObjGrad.
Definition at line 223 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Initialize given a Thyra::ModelEvaluator
and a description of how to interpret it.
model | [in] NonlinearProblem that defines all of the functions and variables. |
p_idx | [in] Index of the subset of parameter vectors to use as the independent variables. If p_idx < 0 , then no extra parameters are added. |
g_idx | [in] Index of the subset of auxiliary response functions to use as the objective function. Note, only the first element model.g(g_idx)(1) will be used as the objective function value. |
model_xL | [in] Pointer to upper bounds for the state variables model.x . If NULL then the default supplied in model->get_x_lower_bounds() will be used. |
model_xU | [in] Pointer to upper bounds for the state variables x . If NULL then the default supplied in model->get_x_upper_bounds() will be used. |
model_x0 | [in] Pointer to initial guess for the state variables x . If NULL the the default supplied in model->get_x_init() will be used. |
ToDo: Finish documentation!
Todo: Add arguments for auxiliary inequalites and equalities
Definition at line 240 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Update the initial guess and bounds .
Definition at line 357 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 408 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 417 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 423 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 429 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 460 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 562 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 608 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.
|
protected |
Definition at line 259 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 260 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 261 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 262 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 263 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 265 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 266 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 267 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 268 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 269 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 270 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 271 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 272 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 273 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 274 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 275 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 276 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 277 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
protected |
Definition at line 279 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 281 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 282 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 284 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 285 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 286 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.
|
mutableprotected |
Definition at line 287 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.