37 Real
value(
const std::vector<Real> &x, Real &tol ) {
39 return std::pow(x[0]+x[1],two) + std::pow(x[1]+x[2],two);
42 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
44 g[0] = two*(x[0]+x[1]);
45 g[1] = two*(x[0]+x[1]) + two*(x[1]+x[2]);
46 g[2] = two*(x[1]+x[2]);
49 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
51 hv[0] = two*v[0] + two*v[1];
52 hv[1] = two*v[0] + two*two*v[1] + two*v[2];
53 hv[2] = two*v[1] + two*v[2];
62 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
63 const Real c1(1), c2(2), c3(3);
64 c[0] = c1*x[0]+c2*x[1]+c3*x[2]-c1;
68 const std::vector<Real> &x, Real &tol) {
69 const Real c1(1), c2(2), c3(3);
70 jv[0] = c1*v[0]+c2*v[1]+c3*v[2];
74 const std::vector<Real> &x, Real &tol ) {
75 const Real c1(1), c2(2), c3(3);
82 const std::vector<Real> &v,
const std::vector<Real> &x,
84 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
96 return ROL::makePtr<Objective_HS28<Real>>();
101 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,0.0);
102 (*xp)[0] =
static_cast<Real
>(-4);
103 (*xp)[1] =
static_cast<Real
>(1);
104 (*xp)[2] =
static_cast<Real
>(1);
105 return ROL::makePtr<StdVector<Real>>(xp);
110 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,0.0);
111 (*xp)[0] =
static_cast<Real
>(0.5);
112 (*xp)[1] =
static_cast<Real
>(-0.5);
113 (*xp)[2] =
static_cast<Real
>(0.5);
114 return ROL::makePtr<StdVector<Real>>(xp);
118 return ROL::makePtr<Constraint_HS28<Real>>();
123 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)