92 return std::sin((*ex)[0] + (*ex)[1]) + std::pow((*ex)[0]-(*ex)[1],2.0) - 1.5*(*ex)[0] + 2.5*(*ex)[1] + 1.0;
101 (*eg)[0] = std::cos((*ex)[0] + (*ex)[1]) + 2.0*((*ex)[0]-(*ex)[1]) - 1.5;
102 (*eg)[1] = std::cos((*ex)[0] + (*ex)[1]) - 2.0*((*ex)[0]-(*ex)[1]) + 2.5;;
108 ROL::Ptr<const vector> ex =
getVector(x);
109 ROL::Ptr<const vector> ev =
getVector(v);
112 Real h11 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
113 Real h22 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
114 Real h12 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
115 Real h21 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
117 (*ehv)[0] = h11 * (*ev)[0] + h12 * (*ev)[1];
118 (*ehv)[1] = h21 * (*ev)[0] + h22 * (*ev)[1];
124 ROL::Ptr<const vector> ex =
getVector(x);
125 ROL::Ptr<const vector> ev =
getVector(v);
128 Real h11 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
129 Real h22 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
130 Real h12 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
131 Real h21 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
133 (*ehv)[0] = 1.0/(h11*h22 - h12*h21) * (h22 * (*ev)[0] - h12 * (*ev)[1]);
134 (*ehv)[1] = 1.0/(h11*h22 - h12*h21) * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
145 return ROL::makePtr<Objective_HS5<Real>>();
152 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
153 (*x0p)[0] = 0.0; (*x0p)[1] = 0.0;
154 return ROL::makePtr<StdVector<Real>>(x0p);
161 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
163 return ROL::makePtr<StdVector<Real>>(xp);
170 ROL::Ptr<std::vector<Real> > lp = ROL::makePtr<std::vector<Real>>(n,0.0);
171 (*lp)[0] = -1.5; (*lp)[1] = -3.0;
172 ROL::Ptr<Vector<Real> > l = ROL::makePtr<StdVector<Real>>(lp);
173 ROL::Ptr<std::vector<Real> > up = ROL::makePtr<std::vector<Real>>(n,0.0);
174 (*up)[0] = 4.0; (*up)[1] = 3.0;
175 ROL::Ptr<Vector<Real> > u = ROL::makePtr<StdVector<Real>>(up);
176 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 5th test function.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
std::vector< Real > vector
ROL::Ptr< const vector > getVector(const V &x)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::Ptr< vector > getVector(V &x)
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< Vector< Real > > getInitialGuess(void) const
Ptr< Objective< Real > > getObjective(void) const
static constexpr Real pi() noexcept