35 Real
value(
const std::vector<Real> &x, Real &tol ) {
36 const Real c1(1000), c2(2);
37 return c1 - x[0]*x[0] - c2*x[1]*x[1] - x[2]*x[2] - x[0]*x[1] - x[0]*x[2];
40 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
42 g[0] = -c2*x[0]-x[1]-x[2];
43 g[1] = -c2*c2*x[1]-x[0];
47 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
49 hv[0] = -c2*v[0]-v[1]-v[2];
50 hv[1] = -c2*c2*v[1]-v[0];
51 hv[2] = -c2*v[2]-v[0];
58 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
59 const Real c1(8), c2(14), c3(7), c4(56);
60 c[0] = c1*x[0] + c2*x[1] + c3*x[2] - c4;
64 const std::vector<Real> &x, Real &tol) {
65 const Real c1(8), c2(14), c3(7);
66 jv[0] = c1*v[0] + c2*v[1] + c3*v[2];
70 const std::vector<Real> &x, Real &tol ) {
71 const Real c1(8), c2(14), c3(7);
78 const std::vector<Real> &v,
const std::vector<Real> &x,
80 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
87 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
89 c[0] = x[0]*x[0] + x[1]*x[1] + x[2]*x[2] - c1;
93 const std::vector<Real> &x, Real &tol) {
95 jv[0] = c1*(x[0]*v[0] + x[1]*v[1] + x[2]*v[2]);
99 const std::vector<Real> &x, Real &tol ) {
101 ajv[0] = c1*x[0]*v[0];
102 ajv[1] = c1*x[1]*v[0];
103 ajv[2] = c1*x[2]*v[0];
107 const std::vector<Real> &v,
const std::vector<Real> &x,
110 ahuv[0] = c1*v[0]*u[0];
111 ahuv[1] = c1*v[1]*u[0];
112 ahuv[2] = c1*v[2]*u[0];
122 return ROL::makePtr<Objective_HS63<Real>>();
127 return ROL::makePtr<StdVector<Real>>(n,
static_cast<Real
>(2));
132 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n);
133 (*xp)[0] =
static_cast<Real
>(3.512118414);
134 (*xp)[1] =
static_cast<Real
>(0.2169881741);
135 (*xp)[2] =
static_cast<Real
>(3.552174034);
136 return ROL::makePtr<StdVector<Real>>(xp);
140 std::vector<Ptr<Constraint<Real>>> cvec(2);
141 cvec[0] = makePtr<Constraint_HS63a<Real>>();
142 cvec[1] = makePtr<Constraint_HS63b<Real>>();
143 return ROL::makePtr<Constraint_Partitioned<Real>>(cvec);
147 std::vector<Ptr<Vector<Real>>> lvec(2);
148 lvec[0] = makePtr<StdVector<Real>>(1,
static_cast<Real
>(0));
149 lvec[1] = makePtr<StdVector<Real>>(1,
static_cast<Real
>(0));
150 return ROL::makePtr<PartitionedVector<Real>>(lvec);
155 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(n,
static_cast<Real
>(0.0));
156 return makePtr<Bounds<Real>>(*l,
true);
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< Vector< Real > > getEqualityMultiplier(void) const
Ptr< Objective< Real > > getObjective(void) const
Contains definitions of custom data types in ROL.
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)
void applyAdjointJacobian(std::vector< Real > &ajv, 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.
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Contains definitions of test objective functions.
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< BoundConstraint< Real > > getBoundConstraint(void) const
void applyAdjointHessian(std::vector< Real > &ahuv, const std::vector< Real > &u, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Ptr< Vector< Real > > getInitialGuess(void) const
W. Hock and K. Schittkowski 63rd test function.
void value(std::vector< Real > &c, 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< Constraint< Real > > getEqualityConstraint(void) const
Real value(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 applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)