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

Classes | |
| struct | SecondOrderInfo |
| Struct for zero, first and second order quantities (pointers) More... | |
Public Types | |
| typedef Teuchos::RCP< const Teuchos::AbstractFactory < MatrixSymOp > > | mat_sym_fcty_ptr_t |
| | |
Protected Member Functions | |
| const SecondOrderInfo | second_order_info () const |
| Return objective gradient and zero order information. | |
Constructors | |
| NLPSecondOrder () | |
| 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_sym_fcty_ptr_t | factory_HL () const =0 |
Return a matrix factory object for creating HL. | |
<<std aggr>> members for the Hessian of the Lagrangian HL | |
| virtual void | set_HL (MatrixSymOp *HL) |
Set a pointer to a matrix object to be updated when this->calc_HL() is called. | |
| virtual MatrixSymOp * | get_HL () |
Return pointer passed to this->set_HL(). | |
| virtual MatrixSymOp & | HL () |
Returns non-const *this->get_HL(). | |
| virtual const MatrixSymOp & | HL () const |
Returns const *this->get_HL(). | |
Unset calculation quantities | |
| void | unset_quantities () |
| Call to unset all storage quantities (both in this class and all subclasses). | |
Calculation Members | |
| virtual void | calc_HL (const Vector &x, const Vector *lambda, bool newpoint=true) const |
Update the matrix for HL at the point x, lambda, lambdaI and put it in the stored reference. | |
Number of function evaluations | |
| virtual size_type | num_HL_evals () const |
| Number of Hessian evaluations. | |
Protected methods to be overridden by subclasses | |
| virtual void | imp_calc_HL (const Vector &x, const Vector *lambda, bool newpoint, const SecondOrderInfo &second_order_info) const =0 |
Overridden to compute Gc(x) and perhaps Gf(x), f(x) and c(x). | |
NLP second order information interface class {abstract}.
Overview:
This class adds second order inforamtion to the first order information and basic information given in the NLPFirstOrder and base interfaces.
Specifically the Hesssian of the Lagrangian is defined as:
HL = Hf + sum( Hc(j) * lambda(j), j = 1...m )
Where:
Hf is the hessian of the objective function f(x) Hc(j) is the hessian of the jth equality constriant cj(x) lambda is the vector of lagrange multipliers for the equality constraints c(x) Client Usage:
ToDo: Finish Documentation!
Subclass developer's notes:
ToDo: Finish Documentation!
Definition at line 77 of file NLPInterfacePack_NLPSecondOrder.hpp.
| typedef Teuchos::RCP< const Teuchos::AbstractFactory<MatrixSymOp> > NLPInterfacePack::NLPSecondOrder::mat_sym_fcty_ptr_t |
Definition at line 82 of file NLPInterfacePack_NLPSecondOrder.hpp.
Initialize to no reference set to calculation quanities.
Definition at line 53 of file NLPInterfacePack_NLPSecondOrder.cpp.
| void NLPInterfacePack::NLPSecondOrder::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), Gh(x) and HL(x) evaluations. This implementation calls this->NLPFirstOrder::initialize()
Postconditions:
NLPFirstOrder::initialize() this->num_HL_evals() == 0 Reimplemented from NLPInterfacePack::NLPFirstOrder.
Definition at line 58 of file NLPInterfacePack_NLPSecondOrder.cpp.
| virtual const mat_sym_fcty_ptr_t NLPInterfacePack::NLPSecondOrder::factory_HL | ( | ) | const [pure virtual] |
Return a matrix factory object for creating HL.
The returned matrix object may not support the creation of any sub-matrix spaces (i.e. return->sub_space(rrng,crng).get() == NULL for all rrng and crng).
| void NLPInterfacePack::NLPSecondOrder::set_HL | ( | MatrixSymOp * | HL | ) | [virtual] |
Set a pointer to a matrix object to be updated when this->calc_HL() is called.
| HL | [in] Pointer to Hessian of the Lagrangian matrix. May be NULL. |
Preconditions:
this->is_initialized() == true (throw NotInitialized) Postconditions:
this->get_HL() == HL Definition at line 65 of file NLPInterfacePack_NLPSecondOrder.cpp.
| MatrixSymOp * NLPInterfacePack::NLPSecondOrder::get_HL | ( | ) | [virtual] |
Return pointer passed to this->set_HL().
Preconditions:
this->is_initialized() == true (throw NotInitialized) Definition at line 70 of file NLPInterfacePack_NLPSecondOrder.cpp.
| MatrixSymOp & NLPInterfacePack::NLPSecondOrder::HL | ( | ) | [virtual] |
Returns non-const *this->get_HL().
Preconditions:
this->is_initialized() == true (throw NotInitialized) this->get_HL() != NULL (throw NoRefSet) Definition at line 75 of file NLPInterfacePack_NLPSecondOrder.cpp.
| const MatrixSymOp & NLPInterfacePack::NLPSecondOrder::HL | ( | ) | const [virtual] |
Returns const *this->get_HL().
Preconditions:
this->is_initialized() == true (throw NotInitialized) this->get_HL() != NULL (throw NoRefSet) Definition at line 80 of file NLPInterfacePack_NLPSecondOrder.cpp.
| void NLPInterfacePack::NLPSecondOrder::unset_quantities | ( | ) | [virtual] |
Call to unset all storage quantities (both in this class and all subclasses).
Preconditions:
this->is_initialized() == true (throw NotInitialized) Postconditions:
NLPFirstOrder::unset_quantities() this->get_HL() == NULL This method must be called by all subclasses that override it.
Reimplemented from NLPInterfacePack::NLPFirstOrder.
Definition at line 85 of file NLPInterfacePack_NLPSecondOrder.cpp.
| void NLPInterfacePack::NLPSecondOrder::calc_HL | ( | const Vector & | x, |
| const Vector * | lambda, | ||
| bool | newpoint = true |
||
| ) | const [virtual] |
Update the matrix for HL at the point x, lambda, lambdaI and put it in the stored reference.
The referenced storage for f, c, Gf and Gc may also be changed but are not guarentied to be. But no other quanities from possible subclasses are allowed to be updated as a side effect.
| x | [in] Unknown primal variables |
| lambda | [in] Lagrange muitipliers for equality constriants. If m() == 0 then lambda must be NULL. However, if m() > 0 then lambda == NULL is still allowed and is treated as lambda = 0. |
| newpoint | [in] (default true) If false, the values in x, lambda and lambdaI are the same as the last call to this->calc_HL(). If true, then this is a new point. |
Preconditions:
this->is_initialized() == true (throw NotInitialized) x.space().is_compatible(*this->space_x()) == true (throw VectorSpace::IncompatibleVectorSpaces) this->get_HL() != NULL (throw NoRefSet) this->m() == 0] lambda == NULL (throw std::invalid_argument) this->m() != 0 && lambda != 0] lambda->space().is_compatible(*this->space_c()) == true) (throw std::invalid_argument) Postconditions:
this->HL() is updated to HL(x) Definition at line 93 of file NLPInterfacePack_NLPSecondOrder.cpp.
| size_type NLPInterfacePack::NLPSecondOrder::num_HL_evals | ( | ) | const [virtual] |
Number of Hessian evaluations.
This function can be called to find out how many evaluations the client requested since initialize() was called.
Definition at line 104 of file NLPInterfacePack_NLPSecondOrder.cpp.
| const NLPSecondOrder::SecondOrderInfo NLPInterfacePack::NLPSecondOrder::second_order_info | ( | ) | const [inline, protected] |
Return objective gradient and zero order information.
Definition at line 311 of file NLPInterfacePack_NLPSecondOrder.hpp.
| virtual void NLPInterfacePack::NLPSecondOrder::imp_calc_HL | ( | const Vector & | x, |
| const Vector * | lambda, | ||
| bool | newpoint, | ||
| const SecondOrderInfo & | second_order_info | ||
| ) | const [protected, pure virtual] |
Overridden to compute Gc(x) and perhaps Gf(x), f(x) and c(x).
| x | [in] Unknown vector (size n). |
| lambda | [in] Lagrange multipliers for equality constraints c(x). Must be NULL if m() == 0. If NULL, then treated as lambda = 0. |
| newpoint | [in] (default true) If false, the values in x, lambda and lambdaI are the same as the last call to this->calc_HL(). If true, then this is a new point. |
| second_order_info | [out] Pointers to HL, Gc, Gh, Gf, f, c and h On output *second_order_info.HL is updated to HL(x). Any of the other objects pointed to in second_order_info may also be updated but are not guaranteed to be. |
Preconditions:
x.space().is_compatible(*this->space_x()) (throw IncompatibleType) second_order_info.HL != NULL (throw std::invalid_argument) Postconditions:
*second_order_info.HL is updated to HL(x).
1.7.6.1