92 return (*ex)[1] + 1.e-5 * std::pow((*ex)[1] - (*ex)[0],2.0);
100 (*eg)[0] = -1.e-5 * 2.0 * ((*ex)[1] - (*ex)[0]);
101 (*eg)[1] = 1.0 + 1.e-5 * 2.0 * ((*ex)[1] - (*ex)[0]);
107 ROL::Ptr<const vector> ex =
getVector(x);
108 ROL::Ptr<const vector> ev =
getVector(v);
110 Real h11 = 1.e-5 * 2.0;
111 Real h22 = 1.e-5 * 2.0;
112 Real h12 = -1.e-5 * 2.0;
113 Real h21 = -1.e-5 * 2.0;
115 (*ehv)[0] = h11 * (*ev)[0] + h12 * (*ev)[1];
116 (*ehv)[1] = h21 * (*ev)[0] + h22 * (*ev)[1];
122 ROL::Ptr<const vector> ex =
getVector(x);
123 ROL::Ptr<const vector> ev =
getVector(v);
126 Real h11 = 1.e-5 * 2.0;
127 Real h22 = 1.e-5 * 2.0;
128 Real h12 = -1.e-5 * 2.0;
129 Real h21 = -1.e-5 * 2.0;
131 (*ehv)[0] = 1.0/(h11*h22 - h12*h21) * (h22 * (*ev)[0] - h12 * (*ev)[1]);
132 (*ehv)[1] = 1.0/(h11*h22 - h12*h21) * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
143 return ROL::makePtr<Objective_HS3<Real>>();
150 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
151 (*x0p)[0] = 10.0; (*x0p)[1] = 1.0;
152 return ROL::makePtr<StdVector<Real>>(x0p);
159 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
160 (*xp)[0] = 0.0; (*xp)[1] = 0.0;
161 return ROL::makePtr<StdVector<Real>>(xp);
168 ROL::Ptr<std::vector<Real> > lp = ROL::makePtr<std::vector<Real>>(n,0.0);
169 (*lp)[0] = ROL_NINF<Real>(); (*lp)[1] = 0.0;
170 ROL::Ptr<Vector<Real> > l = ROL::makePtr<StdVector<Real>>(lp);
171 ROL::Ptr<std::vector<Real> > up = ROL::makePtr<std::vector<Real>>(n,0.0);
172 (*up)[0] = ROL_INF<Real>(); (*up)[1] = ROL_INF<Real>();
173 ROL::Ptr<Vector<Real> > u = ROL::makePtr<StdVector<Real>>(up);
174 return ROL::makePtr<Bounds<Real>>(l,u);
Provides the interface to evaluate objective functions.
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
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Ptr< Objective< Real > > getObjective(void) const
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Contains definitions of custom data types in ROL.
Defines the linear algebra or vector space interface.
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
ROL::Ptr< vector > getVector(V &x)
ROL::Ptr< const vector > getVector(const V &x)
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Contains definitions of test objective functions.
Ptr< Vector< Real > > getSolution(const int i=0) const
std::vector< Real > vector
W. Hock and K. Schittkowski 3rd test function.