73 typedef typename vector::size_type
uint;
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);
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.
virtual void zero()
Set to zero vector.
W. Hock and K. Schittkowski 45th test function.
Objective_HS45(int dim=5)
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
ROL::Ptr< const vector > getVector(const V &x)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
std::vector< Real > vector
ROL::Ptr< vector > getVector(V &x)
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Ptr< Objective< Real > > getObjective(void) const
Ptr< Vector< Real > > getInitialGuess(void) const