39 typedef typename vector::size_type
uint;
70 return 2.0 - prod/
fact_;
85 (*eg)[j] = -prod/
fact_;
103 if ( j != i && l != i ) {
107 (*ehv)[l] += -prod/
fact_*(*ev)[j];
125 return ROL::makePtr<Objective_HS45<Real>>(n);
132 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
133 for (
int i = 0; i < n; i++ ) {
136 return ROL::makePtr<StdVector<Real>>(x0p);
143 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
144 for (
int li = 0; li < n; li++ ) {
145 (*xp)[li] = (Real)(li+1);
147 return ROL::makePtr<StdVector<Real>>(xp);
154 ROL::Ptr<std::vector<Real> > lp = ROL::makePtr<std::vector<Real>>(n,0.0);
155 ROL::Ptr<std::vector<Real> > up = ROL::makePtr<std::vector<Real>>(n,0.0);
156 for (
int i = 0; i < n; i++ ) {
158 (*up)[i] =
static_cast<Real
>(i+1);
160 ROL::Ptr<Vector<Real> > l = ROL::makePtr<StdVector<Real>>(lp);
161 ROL::Ptr<Vector<Real> > u = ROL::makePtr<StdVector<Real>>(up);
162 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