#include <NLPInterfacePack_NLPObjGrad.hpp>
Inheritance diagram for NLPInterfacePack::NLPObjGrad:
Constructors | |
| NLPObjGrad () | |
| Initialize to no reference set to calculation quanities. | |
NLP initialization | |
| void | initialize (bool test_setup) |
| Initialize the NLP for its first use. | |
Information | |
| virtual bool | supports_Gf () const |
| Determine if the objective gradient is supported or not. | |
| virtual bool | supports_Gf_prod () const |
| Determine if the objective gradient product is supported or not. | |
<<std aggr>> members for the gradient of the objective function Gf(x) | |
| virtual void | set_Gf (VectorMutable *Gf) |
Set a pointer to a vector to be updated when this->calc_Gf() is called. | |
| virtual VectorMutable * | get_Gf () |
Return pointer passed to this->set_Gf(). | |
| virtual VectorMutable & | Gf () |
Returns non-const *this->get_Gf(). | |
| virtual const Vector & | Gf () const |
Returns const *this->get_Gf(). | |
Unset calculation quantities | |
| void | unset_quantities () |
| Call to unset all storage quantities (both in this class and all subclasses). | |
Calculation Members | |
| 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. | |
| 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. | |
Function evaluation counts. | |
| virtual size_type | num_Gf_evals () const |
| Objective gradient evaluations count. | |
Protected methods to be overridden by subclasses | |
| virtual void | imp_calc_Gf (const Vector &x, bool newx, const ObjGradInfo &obj_grad_info) const =0 |
| Overridden to compute f(x) and perhaps c(x) (if multiple calculaiton = true). | |
Protected Member Functions | |
| const ObjGradInfo | obj_grad_info () const |
| Return objective gradient and zero order information. | |
Overview:
This class adds the ability to compute the gradient of the objective function Gf(x) to the basic information given in the NLP interface class. Note that Gf is in the vector space space_x().
Client Usage:
As with the NLP base interface, the initialize() method must be called before the NLP object can be used. The method set_Gf() is used to set a pointer to a vector to update when the gradient of the objective Gf is computed when calc_Gf() is called.
The number of evaluations of Gf using calc_Gf() is returned by num_Gf_evals().
Subclass developer's notes:
In addition to the methods that must be overridden by the NLP interface (see) the following methods must also be overridden: imp_calc_Gf().
In addition to the methods that should be overridden from NLP 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 strange situations: set_Gf(), get_Gf(), Gf(), num_Gf_evals().
Definition at line 66 of file NLPInterfacePack_NLPObjGrad.hpp.
|
|
Initialize to no reference set to calculation quanities.
Definition at line 40 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Initialize the NLP for its first use.
This function implementation should be called by subclass implementations in order to reset counts for Postconditions:
Reimplemented from NLPInterfacePack::NLP. Reimplemented in NLPInterfacePack::NLPDirect, NLPInterfacePack::NLPFirstOrder, NLPInterfacePack::NLPSecondOrder, NLPInterfacePack::NLPBarrier, NLPInterfacePack::NLPSerialPreprocess, and NLPInterfacePack::NLPSerialPreprocessExplJac. Definition at line 44 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Determine if the objective gradient is supported or not.
The default implementation returns Definition at line 51 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Determine if the objective gradient product is supported or not.
The default implementation returns Definition at line 56 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Set a pointer to a vector to be updated when
Postconditions:
Reimplemented in NLPInterfacePack::NLPBarrier. Definition at line 63 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Return pointer passed to Preconditions:
Reimplemented in NLPInterfacePack::NLPBarrier. Definition at line 68 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Returns non- Preconditions:
Reimplemented in NLPInterfacePack::NLPBarrier. Definition at line 73 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Returns Preconditions:
Reimplemented in NLPInterfacePack::NLPBarrier. Definition at line 78 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Call to unset all storage quantities (both in this class and all subclasses). Preconditions:
Postconditions:
This method must be called by all subclasses that override it. Reimplemented from NLPInterfacePack::NLP. Reimplemented in NLPInterfacePack::NLPFirstOrder, and NLPInterfacePack::NLPSecondOrder. Definition at line 83 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
||||||||||||
|
Update the vector for
Postconditions:
If Reimplemented in NLPInterfacePack::NLPBarrier. Definition at line 91 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
||||||||||||||||
|
Calculate the inner product
Postconditions:
If Definition at line 98 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Objective gradient evaluations count.
This function can be called to find out how many evaluations Reimplemented in NLPInterfacePack::NLPBarrier. Definition at line 107 of file NLPInterfacePack_NLPObjGrad.cpp. |
|
|
Return objective gradient and zero order information.
Definition at line 319 of file NLPInterfacePack_NLPObjGrad.hpp. |
|
||||||||||||||||
|
Overridden to compute f(x) and perhaps c(x) (if multiple calculaiton = true). Preconditions:
Postconditions:
Implemented in NLPInterfacePack::NLPBarrier, and NLPInterfacePack::NLPSerialPreprocess. |
1.3.9.1