42 #include "NLPInterfacePack_NLPObjGrad.hpp"
43 #include "AbstractLinAlgPack_VectorMutable.hpp"
46 const char name_Gf[] =
"Gf";
49 namespace NLPInterfacePack {
83 return StandardCompositionRelationshipsPack::get_role_name(Gf_,
false, name_Gf);
88 return StandardCompositionRelationshipsPack::role_name(Gf_,
false, name_Gf);
93 return StandardCompositionRelationshipsPack::role_name(Gf_,
false, name_Gf);
106 StandardCompositionRelationshipsPack::assert_role_name_set(Gf_,
"NLP::calc_Gf()", name_Gf);
114 true,std::logic_error
115 ,
"Error, the function calc_Gf_prod(...) is not implemented for the class "
124 value_type* dummy = NULL;
130 return num_Gf_evals_;
void initialize(bool test_setup)
Initialize the NLP for its first use.
void unset_quantities()
Call to unset all storage quantities (both in this class and all subclasses).
virtual size_type num_Gf_evals() const
Objective gradient evaluations count.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const ObjGradInfo obj_grad_info() const
Return objective gradient and zero order information.
NLPObjGrad()
Initialize to no reference set to calculation quanities.
virtual VectorMutable * get_Gf()
Return pointer passed to this->set_Gf().
virtual void unset_quantities()
Call to unset all storage quantities (both in this class and all subclasses).
virtual bool supports_Gf_prod() const
Determine if the objective gradient product is supported or not.
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).
virtual VectorMutable & Gf()
Returns non-const *this->get_Gf().
virtual void initialize(bool test_setup=false)
Initialize the NLP before it is used.
virtual void set_Gf(VectorMutable *Gf)
Set a pointer to a vector to be updated when this->calc_Gf() is called.
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 bool supports_Gf() const
Determine if the objective gradient is supported or not.
std::string typeName(const T &t)
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.