38 Real
value(
const std::vector<Real> &x, Real &tol ) {
39 const Real c2(2), c4(4);
40 return x[0] + c2*x[1] + c4*x[4] + std::exp(x[0]*x[3]);
43 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
44 const Real c0(0), c1(1), c2(2), c4(4);
45 Real exp03 = std::exp(x[0]*x[3]);
46 g[0] = c1 + x[3]*exp03;
54 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
55 const Real c0(0), c1(1);
56 Real exp03 = std::exp(x[0]*x[3]);
57 hv[0] = x[3]*x[3]*exp03*v[0] + (c1 + x[3]*x[0])*exp03*v[3];
60 hv[3] = (c1 + x[0]*x[3])*exp03*v[0] + x[0]*x[0]*exp03*v[3];
69 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
70 const Real c1(1), c2(2), c3(3), c5(5), c6(6);
71 c[0] = x[0] + c2*x[1] + c5*x[4] - c6;
72 c[1] = x[0] + x[1] + x[2] - c3;
73 c[2] = x[3] + x[4] + x[5] - c2;
74 c[3] = x[0] + x[3] - c1;
75 c[4] = x[1] + x[4] - c2;
76 c[5] = x[2] + x[5] - c2;
80 const std::vector<Real> &x, Real &tol) {
81 const Real c2(2), c5(5);
82 jv[0] = v[0] + c2*v[1] + c5*v[4];
83 jv[1] = v[0] + v[1] + v[2];
84 jv[2] = v[3] + v[4] + v[5];
91 const std::vector<Real> &x, Real &tol ) {
92 const Real c2(2), c5(5);
93 ajv[0] = v[0] + v[1] + v[3];
94 ajv[1] = c2*v[0] + v[1] + v[4];
97 ajv[4] = c5*v[0] + v[2] + v[4];
102 const std::vector<Real> &v,
const std::vector<Real> &x,
104 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
114 return ROL::makePtr<Objective_HS55<Real>>();
119 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n);
120 (*xp)[0] =
static_cast<Real
>(1.0);
121 (*xp)[1] =
static_cast<Real
>(2.0);
122 (*xp)[2] =
static_cast<Real
>(0.0);
123 (*xp)[3] =
static_cast<Real
>(0.0);
124 (*xp)[4] =
static_cast<Real
>(0.0);
125 (*xp)[5] =
static_cast<Real
>(2.0);
126 return ROL::makePtr<StdVector<Real>>(xp);
131 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n);
132 (*xp)[0] =
static_cast<Real
>(0.0);
133 (*xp)[1] =
static_cast<Real
>(4.0/3.0);
134 (*xp)[2] =
static_cast<Real
>(5.0/3.0);
135 (*xp)[3] =
static_cast<Real
>(1.0);
136 (*xp)[4] =
static_cast<Real
>(2.0/3.0);
137 (*xp)[5] =
static_cast<Real
>(1.0/3.0);
138 return ROL::makePtr<StdVector<Real>>(xp);
142 return ROL::makePtr<Constraint_HS55<Real>>();
147 return ROL::makePtr<StdVector<Real>>(n,0.0);
152 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(n,0.0);
153 ROL::Ptr<std::vector<Real>> up = ROL::makePtr<std::vector<Real>>(n,ROL_INF<Real>());
154 (*up)[0] =
static_cast<Real
>(1);
155 (*up)[3] =
static_cast<Real
>(1);
156 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(up);
157 return makePtr<Bounds<Real>>(l,u);
Contains definitions of custom data types in ROL.
Real value(const std::vector< Real > &x, Real &tol)
void applyAdjointJacobian(std::vector< Real > &ajv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Defines the equality constraint operator interface for StdVectors.
void applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
Ptr< Vector< Real > > getEqualityMultiplier(void) const
Ptr< Vector< Real > > getInitialGuess(void) const
Contains definitions of test objective functions.
W. Hock and K. Schittkowski 55th test function.
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
void applyAdjointHessian(std::vector< Real > &ahuv, const std::vector< Real > &u, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
void hessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
void value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< Objective< Real > > getObjective(void) const
Ptr< Constraint< Real > > getEqualityConstraint(void) const