104 return 2.0 - prod/
fact_;
109 ROL::Ptr<const vector> ex =
getVector(x);
119 (*eg)[j] = -prod/
fact_;
127 ROL::Ptr<const vector> ex =
getVector(x);
128 ROL::Ptr<const vector> ev =
getVector(v);
137 if ( j != i && l != i ) {
141 (*ehv)[l] += -prod/
fact_*(*ev)[j];
159 return ROL::makePtr<Objective_HS45<Real>>(n);
166 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
167 for (
int i = 0; i < n; i++ ) {
170 return ROL::makePtr<StdVector<Real>>(x0p);
177 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
178 for (
int i = 0; i < n; i++ ) {
179 (*xp)[i] = (Real)(i+1);
181 return ROL::makePtr<StdVector<Real>>(xp);
188 ROL::Ptr<std::vector<Real> > lp = ROL::makePtr<std::vector<Real>>(n,0.0);
189 ROL::Ptr<std::vector<Real> > up = ROL::makePtr<std::vector<Real>>(n,0.0);
190 for (
int i = 0; i < n; i++ ) {
192 (*up)[i] =
static_cast<Real
>(i+1);
194 ROL::Ptr<Vector<Real> > l = ROL::makePtr<StdVector<Real>>(lp);
195 ROL::Ptr<Vector<Real> > u = ROL::makePtr<StdVector<Real>>(up);
196 return ROL::makePtr<Bounds<Real>>(l,u);
Provides the interface to evaluate objective functions.
typename PV< Real >::size_type size_type
Ptr< Objective< Real > > getObjective(void) const
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
std::vector< Real > vector
Real value(const Vector< Real > &x, Real &tol)
Compute value.
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.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
ROL::Ptr< vector > getVector(V &x)
Contains definitions of test objective functions.
W. Hock and K. Schittkowski 45th test function.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Ptr< Vector< Real > > getInitialGuess(void) const
ROL::Ptr< const vector > getVector(const V &x)
Ptr< Vector< Real > > getSolution(const int i=0) const
Objective_HS45(int dim=5)