NLPInterfacePack::NLPThyraModelEvaluatorBase Class Reference

Implements the base NLP interface using a Thyra::ModelEvaluator object. More...

#include <NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp>

Inheritance diagram for NLPInterfacePack::NLPThyraModelEvaluatorBase:

[legend]
List of all members.

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 Vectorxinit () const
 
const Vectorxl () const
 
const Vectorxu () 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.
void updateInitialGuessAndBounds () const
 Update the initial guess and bounds .
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
 

Public Member Functions

 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, showModelEvaluatorTrace)
 Set if a trace of the model evaluations is shown or not.

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 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_

Detailed Description

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 79 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.


Member Typedef Documentation

typedef Teuchos::RCP<const AbstractLinAlgPack::VectorSpaceThyra> NLPInterfacePack::NLPThyraModelEvaluatorBase::VectorSpaceThyra_ptr_t [protected]

Definition at line 241 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.


Constructor & Destructor Documentation

NLPInterfacePack::NLPThyraModelEvaluatorBase::NLPThyraModelEvaluatorBase (  )  [protected]

Initialize to uninitialized

Definition at line 219 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.


Member Function Documentation

NLPInterfacePack::NLPThyraModelEvaluatorBase::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
showModelEvaluatorTrace   
)

Set if a trace of the model evaluations is shown or not.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::initialize ( bool  test_setup  )  [virtual]

Reimplemented from NLPInterfacePack::NLPObjGrad.

Reimplemented in NLPInterfacePack::NLPDirectThyraModelEvaluator, and NLPInterfacePack::NLPFirstOrderThyraModelEvaluator.

Definition at line 54 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::is_initialized (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 68 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

NLP::vec_space_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::space_x (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 74 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

NLP::vec_space_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::space_c (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 80 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

size_type NLPInterfacePack::NLPThyraModelEvaluatorBase::num_bounded_x (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 85 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::force_xinit_in_bounds ( bool  force_xinit_in_bounds  )  [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 90 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::force_xinit_in_bounds (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 95 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

const Vector & NLPInterfacePack::NLPThyraModelEvaluatorBase::xinit (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 100 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

const Vector & NLPInterfacePack::NLPThyraModelEvaluatorBase::xl (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 106 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

const Vector & NLPInterfacePack::NLPThyraModelEvaluatorBase::xu (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 112 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

value_type NLPInterfacePack::NLPThyraModelEvaluatorBase::max_var_bounds_viol (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 118 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::set_f ( value_type f  )  [virtual]

Reimplemented from NLPInterfacePack::NLP.

Definition at line 123 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::set_c ( VectorMutable c  ) 

Definition at line 129 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::unset_quantities (  )  [virtual]

Reimplemented from NLPInterfacePack::NLPObjGrad.

Reimplemented in NLPInterfacePack::NLPDirectThyraModelEvaluator, and NLPInterfacePack::NLPFirstOrderThyraModelEvaluator.

Definition at line 135 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::scale_f ( value_type  scale_f  )  [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 140 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

value_type NLPInterfacePack::NLPThyraModelEvaluatorBase::scale_f (  )  const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 145 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::report_final_solution ( const Vector x,
const Vector lambda,
const Vector nu,
bool  optimal 
)

Definition at line 150 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::set_Gf ( VectorMutable Gf  )  [virtual]

Reimplemented from NLPInterfacePack::NLPObjGrad.

Definition at line 183 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::imp_calc_f ( const Vector x,
bool  newx,
const ZeroOrderInfo &  zero_order_info 
) const [protected]

Definition at line 191 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::imp_calc_c ( const Vector x,
bool  newx,
const ZeroOrderInfo &  zero_order_info 
) const [protected]

Definition at line 199 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::imp_calc_Gf ( const Vector x,
bool  newx,
const ObjGradInfo &  obj_grad_info 
) const [protected]

Definition at line 209 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::initializeBase ( const Teuchos::RCP< Thyra::ModelEvaluator< value_type > > &  model,
const int  p_idx,
const int  g_idx 
) [protected]

Initialize given a Thyra::ModelEvaluator and a description of how to interpret it.

Parameters:
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 226 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::updateInitialGuessAndBounds (  )  const [protected]

Update the initial guess and bounds .

Definition at line 343 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::assert_is_initialized (  )  const [protected]

Definition at line 394 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::copy_from_model_x ( const Thyra::VectorBase< value_type > *  model_x,
VectorMutable x_D 
) const [protected]

Definition at line 403 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::copy_from_model_p ( const Thyra::VectorBase< value_type > *  model_p,
VectorMutable x_I 
) const [protected]

Definition at line 409 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::set_x ( const Vector x,
Thyra::ModelEvaluatorBase::InArgs< value_type > *  model_inArgs_inout 
) const [protected]

Definition at line 415 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::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 [protected]

Definition at line 446 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::postprocessBaseOutArgs ( Thyra::ModelEvaluatorBase::OutArgs< value_type > *  model_outArgs_inout,
VectorMutable Gf,
value_type f,
VectorMutable c 
) const [protected]

Definition at line 548 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.

void NLPInterfacePack::NLPThyraModelEvaluatorBase::evalModel ( const Vector x,
bool  newx,
const ZeroOrderInfo *  zero_order_info,
const ObjGradInfo *  obj_grad_info 
) const [protected]

Definition at line 594 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.cpp.


Member Data Documentation

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::initialized_ [protected]

Definition at line 246 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

value_type NLPInterfacePack::NLPThyraModelEvaluatorBase::obj_scale_ [protected]

Definition at line 247 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::has_bounds_ [protected]

Definition at line 248 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::force_xinit_in_bounds_ [protected]

Definition at line 249 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

index_type NLPInterfacePack::NLPThyraModelEvaluatorBase::num_bounded_x_ [protected]

Definition at line 250 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

Teuchos::RCP<Thyra::ModelEvaluator<value_type> > NLPInterfacePack::NLPThyraModelEvaluatorBase::model_ [protected]

Definition at line 252 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

int NLPInterfacePack::NLPThyraModelEvaluatorBase::p_idx_ [protected]

Definition at line 253 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

int NLPInterfacePack::NLPThyraModelEvaluatorBase::g_idx_ [protected]

Definition at line 254 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::DfDp_supports_op_ [protected]

Definition at line 255 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::DfDp_supports_mv_ [protected]

Definition at line 256 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

VectorSpace::space_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::space_x_ [protected]

Definition at line 257 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

VectorSpaceThyra_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::space_c_ [protected]

Definition at line 258 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

NLPFirstOrder::mat_fcty_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::factory_Gc_ [protected]

Definition at line 259 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

NLPFirstOrder::basis_sys_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::basis_sys_ [protected]

Definition at line 260 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::x_guess_bounds_updated_ [mutable, protected]

Definition at line 261 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

VectorSpace::vec_mut_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::xinit_ [protected]

Definition at line 262 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

VectorSpace::vec_mut_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::xl_ [protected]

Definition at line 263 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

VectorSpace::vec_mut_ptr_t NLPInterfacePack::NLPThyraModelEvaluatorBase::xu_ [protected]

Definition at line 264 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

Teuchos::RCP<Thyra::VectorBase<value_type> > NLPInterfacePack::NLPThyraModelEvaluatorBase::model_g_ [protected]

Definition at line 266 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::model_g_updated_ [mutable, protected]

Definition at line 268 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::model_Dg_updated_ [mutable, protected]

Definition at line 269 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::f_updated_ [mutable, protected]

Definition at line 271 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::c_updated_ [mutable, protected]

Definition at line 272 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::Gf_updated_ [mutable, protected]

Definition at line 273 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.

bool NLPInterfacePack::NLPThyraModelEvaluatorBase::Gc_updated_ [mutable, protected]

Definition at line 274 of file NLPInterfacePack_NLPThyraModelEvaluatorBase.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 20 12:54:21 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7