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 i = 0; i < n; i++ ) {
145 (*xp)[i] = (Real)(i+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);
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)