58 return (*ex)[1] + 1.e-5 * std::pow((*ex)[1] - (*ex)[0],2.0);
66 (*eg)[0] = -1.e-5 * 2.0 * ((*ex)[1] - (*ex)[0]);
67 (*eg)[1] = 1.0 + 1.e-5 * 2.0 * ((*ex)[1] - (*ex)[0]);
76 Real h11 = 1.e-5 * 2.0;
77 Real h22 = 1.e-5 * 2.0;
78 Real h12 = -1.e-5 * 2.0;
79 Real h21 = -1.e-5 * 2.0;
81 (*ehv)[0] = h11 * (*ev)[0] + h12 * (*ev)[1];
82 (*ehv)[1] = h21 * (*ev)[0] + h22 * (*ev)[1];
92 Real h11 = 1.e-5 * 2.0;
93 Real h22 = 1.e-5 * 2.0;
94 Real h12 = -1.e-5 * 2.0;
95 Real h21 = -1.e-5 * 2.0;
97 (*ehv)[0] = 1.0/(h11*h22 - h12*h21) * (h22 * (*ev)[0] - h12 * (*ev)[1]);
98 (*ehv)[1] = 1.0/(h11*h22 - h12*h21) * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
109 return ROL::makePtr<Objective_HS3<Real>>();
116 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
117 (*x0p)[0] = 10.0; (*x0p)[1] = 1.0;
118 return ROL::makePtr<StdVector<Real>>(x0p);
125 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
126 (*xp)[0] = 0.0; (*xp)[1] = 0.0;
127 return ROL::makePtr<StdVector<Real>>(xp);
134 ROL::Ptr<std::vector<Real> > lp = ROL::makePtr<std::vector<Real>>(n,0.0);
135 (*lp)[0] = ROL_NINF<Real>(); (*lp)[1] = 0.0;
136 ROL::Ptr<Vector<Real> > l = ROL::makePtr<StdVector<Real>>(lp);
137 ROL::Ptr<std::vector<Real> > up = ROL::makePtr<std::vector<Real>>(n,0.0);
138 (*up)[0] = ROL_INF<Real>(); (*up)[1] = ROL_INF<Real>();
139 ROL::Ptr<Vector<Real> > u = ROL::makePtr<StdVector<Real>>(up);
140 return ROL::makePtr<Bounds<Real>>(l,u);
Contains definitions of test objective functions.
Contains definitions of custom data types in ROL.
Provides the interface to evaluate objective functions.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Provides the ROL::Vector interface for scalar values, to be used, for example, with scalar constraint...
Defines the linear algebra or vector space interface.
W. Hock and K. Schittkowski 3rd test function.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::Ptr< vector > getVector(V &x)
ROL::Ptr< const vector > getVector(const V &x)
std::vector< Real > vector
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Ptr< Vector< Real > > getInitialGuess(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Ptr< Objective< Real > > getObjective(void) const