71 Real
value(
const std::vector<Real> &x, Real &tol ) {
73 return std::pow(x[0]+x[1],two) + std::pow(x[1]+x[2],two);
76 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
78 g[0] = two*(x[0]+x[1]);
79 g[1] = two*(x[0]+x[1]) + two*(x[1]+x[2]);
80 g[2] = two*(x[1]+x[2]);
83 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
85 hv[0] = two*v[0] + two*v[1];
86 hv[1] = two*v[0] + two*two*v[1] + two*v[2];
87 hv[2] = two*v[1] + two*v[2];
96 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
97 const Real c1(1), c2(2), c3(3);
98 c[0] = c1*x[0]+c2*x[1]+c3*x[2]-c1;
102 const std::vector<Real> &x, Real &tol) {
103 const Real c1(1), c2(2), c3(3);
104 jv[0] = c1*v[0]+c2*v[1]+c3*v[2];
108 const std::vector<Real> &x, Real &tol ) {
109 const Real c1(1), c2(2), c3(3);
116 const std::vector<Real> &v,
const std::vector<Real> &x,
118 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
130 return ROL::makePtr<Objective_HS28<Real>>();
135 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,0.0);
136 (*xp)[0] =
static_cast<Real
>(-4);
137 (*xp)[1] =
static_cast<Real
>(1);
138 (*xp)[2] =
static_cast<Real
>(1);
139 return ROL::makePtr<StdVector<Real>>(xp);
144 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,0.0);
145 (*xp)[0] =
static_cast<Real
>(0.5);
146 (*xp)[1] =
static_cast<Real
>(-0.5);
147 (*xp)[2] =
static_cast<Real
>(0.5);
148 return ROL::makePtr<StdVector<Real>>(xp);
152 return ROL::makePtr<Constraint_HS28<Real>>();
157 return ROL::makePtr<StdVector<Real>>(n,0.0);
void applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Contains definitions of custom data types in ROL.
void hessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Defines the equality constraint operator interface for StdVectors.
void applyAdjointHessian(std::vector< Real > &ahuv, const std::vector< Real > &u, 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)
Ptr< Vector< Real > > getSolution(const int i=0) const
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
Contains definitions of test objective functions.
Ptr< Constraint< Real > > getEqualityConstraint(void) const
void value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)
Ptr< Vector< Real > > getInitialGuess(void) const
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
W. Hock and K. Schittkowski 28th test function.
Ptr< Objective< Real > > getObjective(void) const
Ptr< Vector< Real > > getEqualityMultiplier(void) const
Real value(const std::vector< Real > &x, Real &tol)