|
NLPInterfacePack: C++ Interfaces and Implementation for Non-Linear Programs
Version of the Day
|
NLP first order information interface class {abstract}. More...
#include <NLPInterfacePack_NLPFirstOrder.hpp>

Classes | |
| struct | FirstOrderInfo |
| Struct for zero and first order quantities (pointers) More... | |
Public Types | |
| typedef Teuchos::RCP< const Teuchos::AbstractFactory < MatrixOp > > | mat_fcty_ptr_t |
| | |
| typedef Teuchos::RCP< BasisSystem > | basis_sys_ptr_t |
| | |
Protected Member Functions | |
| const FirstOrderInfo | first_order_info () const |
| Return objective gradient and zero order information. | |
Constructors | |
| NLPFirstOrder () | |
| Initialize to no reference set to calculation quanities. | |
NLP initialization | |
| void | initialize (bool test_setup) |
| Initialize the NLP for its first use. | |
Matrix factory objects | |
| virtual const mat_fcty_ptr_t | factory_Gc () const =0 |
Return a matrix factory object for creating Gc. | |
BasisSystem | |
| virtual const basis_sys_ptr_t | basis_sys () const |
Return a BasisSystem object compatible with Gc and Gh. | |
<<std aggr>> members for the gradient of the objective function Gc(x) | |
| virtual void | set_Gc (MatrixOp *Gc) |
Set a pointer to a matrix object to be updated when this->calc_Gc() is called. | |
| virtual MatrixOp * | get_Gc () |
Return pointer passed to this->set_Gc(). | |
| virtual MatrixOp & | Gc () |
Returns non-const *this->get_Gc(). | |
| virtual const MatrixOp & | Gc () const |
Returns const *this->get_Gc(). | |
Unset calculation quantities | |
| void | unset_quantities () |
| Call to unset all storage quantities (both in this class and all subclasses). | |
Calculation Members | |
| virtual void | calc_Gc (const Vector &x, bool newx=true) const |
Update the matrix for Gc at the point x and put it in the stored reference. | |
Function evaluation counts | |
| virtual size_type | num_Gc_evals () const |
Gradient of constraints matrix Gc evaluations count. | |
Protected methods to be overridden by subclasses | |
| virtual void | imp_calc_Gc (const Vector &x, bool newx, const FirstOrderInfo &first_order_info) const =0 |
| Overridden to compute Gc(x) and perhaps Gf(x), f(x) and c(x). | |
NLP first order information interface class {abstract}.
Overview:
This class adds Jacobian information for the constraints. This augments the information provided by the NLP and NLPObjGrad interfaces. This interface includes access to matrix space objects which must be used by the client to create the matrix objects that are used with this interface. This totally decouples the client from the implementation of these matrix objects.
Client Usage:
As with the NLP base interface, the initialize() method must be called before the NLP object can be used.
The matrix space object returned from factory_Gc()must be used to create the matrix objects for Gc used with this interface. Note that the matrix objects returned from this matrix space object can not be expected to be usable until they are passed to the calculation routines.
The method set_Gc() si used to set a pointer to matrix object to be updated when Gc is computed using calc_Gc().
The number of evaluations of Gc using calc_Gc() and calc_Gh() is returned by num_Gc_evals().
Subclass developer's notes:
In addition to the methods that must be overridden by the NLPObjGrad interface (see) the following methods must also be overridden: factory_Gc(), imp_calc_Gc().
In addition to the methods that should be overridden from NLPObjGrad by most subclasses (see), the following additional methods should be overridden: initialize().
The following methods should never have to be overridden by most subclasses except in some very specialized situations: set_Gc(), get_Gc(), Gc(), num_Gc_evals().
Definition at line 89 of file NLPInterfacePack_NLPFirstOrder.hpp.
| typedef Teuchos::RCP< const Teuchos::AbstractFactory<MatrixOp> > NLPInterfacePack::NLPFirstOrder::mat_fcty_ptr_t |
Definition at line 94 of file NLPInterfacePack_NLPFirstOrder.hpp.
| typedef Teuchos::RCP<BasisSystem> NLPInterfacePack::NLPFirstOrder::basis_sys_ptr_t |
Definition at line 96 of file NLPInterfacePack_NLPFirstOrder.hpp.
Initialize to no reference set to calculation quanities.
Definition at line 54 of file NLPInterfacePack_NLPFirstOrder.cpp.
| void NLPInterfacePack::NLPFirstOrder::initialize | ( | bool | test_setup | ) | [virtual] |
Initialize the NLP for its first use.
This function implementation should be called by subclass implementations in order to reset counts for f(x), c(x), h(x), Gf(x), Gc(x) and Gh(x) evaluations. This implementation calls this->NLPObjGrad::initialize()
Postconditions:
NLPObjGrad::initialize() this->num_Gc_evals() == 0 this->num_Gh_evals() == 0 Reimplemented from NLPInterfacePack::NLPObjGrad.
Reimplemented in NLPInterfacePack::NLPSerialPreprocessExplJac, and NLPInterfacePack::NLPSecondOrder.
Definition at line 58 of file NLPInterfacePack_NLPFirstOrder.cpp.
| virtual const mat_fcty_ptr_t NLPInterfacePack::NLPFirstOrder::factory_Gc | ( | ) | const [pure virtual] |
Return a matrix factory object for creating Gc.
This method may return return.get() == NULL if m() == 0. Otherwise, it must must return a valid matrix factory object.
Implemented in NLPInterfacePack::NLPSerialPreprocessExplJac.
| virtual const basis_sys_ptr_t NLPInterfacePack::NLPFirstOrder::basis_sys | ( | ) | const [virtual] |
Return a BasisSystem object compatible with Gc and Gh.
Note that multiple calls to this method may return the same return.get() value so the client must not assume that they are unique.
The default implementation returns return.get() == NULL.
Reimplemented in NLPInterfacePack::NLPSerialPreprocessExplJac.
| void NLPInterfacePack::NLPFirstOrder::set_Gc | ( | MatrixOp * | Gc | ) | [virtual] |
Set a pointer to a matrix object to be updated when this->calc_Gc() is called.
| Gc | [in] Pointer to matrix of gradients. May be NULL. |
Preconditions:
this->is_initialized() == true (throw NotInitialized) Gc != NULL] Gc->space().is_compatible(*this->factory_Gc(),no_trans) == true (throw VectorSpace::IncompatibleVectorSpaces) Postconditions:
this->get_Gc() == Gc Reimplemented in NLPInterfacePack::NLPSerialPreprocessExplJac.
Definition at line 73 of file NLPInterfacePack_NLPFirstOrder.cpp.
| MatrixOp * NLPInterfacePack::NLPFirstOrder::get_Gc | ( | ) | [virtual] |
Return pointer passed to this->set_Gc().
Preconditions:
this->is_initialized() == true (throw NotInitialized) Definition at line 81 of file NLPInterfacePack_NLPFirstOrder.cpp.
| MatrixOp & NLPInterfacePack::NLPFirstOrder::Gc | ( | ) | [virtual] |
Returns non-const *this->get_Gc().
Preconditions:
this->is_initialized() == true (throw NotInitialized) this->get_Gc() != NULL (throw NoRefSet) Definition at line 89 of file NLPInterfacePack_NLPFirstOrder.cpp.
| const MatrixOp & NLPInterfacePack::NLPFirstOrder::Gc | ( | ) | const [virtual] |
Returns const *this->get_Gc().
Preconditions:
this->is_initialized() == true (throw NotInitialized) this->get_Gc() != NULL (throw NoRefSet) Definition at line 97 of file NLPInterfacePack_NLPFirstOrder.cpp.
| void NLPInterfacePack::NLPFirstOrder::unset_quantities | ( | ) | [virtual] |
Call to unset all storage quantities (both in this class and all subclasses).
Preconditions:
this->is_initialized() == true (throw NotInitialized) Postconditions:
NLPObjGrad::unset_quantities() this->get_Gc() == NULL This method must be called by all subclasses that override it.
Reimplemented from NLPInterfacePack::NLPObjGrad.
Reimplemented in NLPInterfacePack::NLPSecondOrder.
Definition at line 105 of file NLPInterfacePack_NLPFirstOrder.cpp.
| void NLPInterfacePack::NLPFirstOrder::calc_Gc | ( | const Vector & | x, |
| bool | newx = true |
||
| ) | const [virtual] |
Update the matrix for Gc at the point x and put it in the stored reference.
| x | [in] Point at which to calculate the matrix of gradients Gc(x). |
| newx | [in] (default true) If false, the values in x are assumed to be the same as the last call to a this->imp_calc_*(x,newx) member. If true, the values in x are assumed to not be the same as the last call to a this->imp_calc_*(x,newx) member. |
Preconditions:
this->is_initialized() == true (throw NotInitialized) x.space().is_compatible(*this->space_x()) == true (throw VectorSpace::IncompatibleVectorSpaces) this->get_Gc() != NULL (throw NoRefSet) Postconditions:
this->Gc() is updated to Gc(x) The storage reference for f and/or c may also be updated at this point (if get_f() != NULL and/or get_c() != NULL) but is not guarentied to be. But no other quanities from possible subclasses are allowed to be updated as a side effect.
Definition at line 113 of file NLPInterfacePack_NLPFirstOrder.cpp.
| size_type NLPInterfacePack::NLPFirstOrder::num_Gc_evals | ( | ) | const [virtual] |
Gradient of constraints matrix Gc evaluations count.
This function can be called to find out how many evaluations this->calc_Gc() the client requested since this->initialize() was called.
Definition at line 123 of file NLPInterfacePack_NLPFirstOrder.cpp.
| const NLPFirstOrder::FirstOrderInfo NLPInterfacePack::NLPFirstOrder::first_order_info | ( | ) | const [inline, protected] |
Return objective gradient and zero order information.
Definition at line 328 of file NLPInterfacePack_NLPFirstOrder.hpp.
| virtual void NLPInterfacePack::NLPFirstOrder::imp_calc_Gc | ( | const Vector & | x, |
| bool | newx, | ||
| const FirstOrderInfo & | first_order_info | ||
| ) | const [protected, pure virtual] |
Overridden to compute Gc(x) and perhaps Gf(x), f(x) and c(x).
Preconditions:
x.space().is_compatible(*this->space_x()) (throw IncompatibleType) obj_grad_info.Gc != NULL (throw std::invalid_argument) Postconditions:
*obj_grad_info.Gc is updated to Gc(x). | x | [in] Unknown vector (size n). |
| newx | [in] (default true) If false, the values in x are assumed to be the same as the last call to a this->imp_calc_*(x,newx) member. If true, the values in x are assumed to not be the same as the last call to a this->imp_calc_*(x,newx) member. |
| obj_grad_info | [out] Pointers to f, c, Gf and Gc On output *obj_grad_info.Gc is updated to Gc(x). Any of the other objects pointed to in obj_grad_info may also be set but are now guaranteed to be. |
Implemented in NLPInterfacePack::NLPSerialPreprocessExplJac.
1.7.6.1