38 Real
value(
const std::vector<Real> &x, Real &tol ) {
40 return c2 - x[0]*x[1]*x[2];
43 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
47 g[3] =
static_cast<Real
>(0);
50 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
51 hv[0] = -x[2]*v[1] - x[1]*v[2];
52 hv[1] = -x[2]*v[0] - x[0]*v[2];
53 hv[2] = -x[1]*v[0] - x[0]*v[1];
54 hv[3] =
static_cast<Real
>(0);
61 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
63 c[0] = x[0] + c2*x[1] + c2*x[2] - x[3];
67 const std::vector<Real> &x, Real &tol) {
69 jv[0] = v[0] + c2*v[1] + c2*v[2] - v[3];
73 const std::vector<Real> &x, Real &tol ) {
82 const std::vector<Real> &v,
const std::vector<Real> &x,
84 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
94 return ROL::makePtr<Objective_HS41<Real>>();
99 return ROL::makePtr<StdVector<Real>>(n,2.0);
104 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,1.0/3.0);
105 (*xp)[0] =
static_cast<Real
>(2.0/3.0);
106 (*xp)[3] =
static_cast<Real
>(2.0);
107 return ROL::makePtr<StdVector<Real>>(xp);
111 return ROL::makePtr<Constraint_HS41<Real>>();
116 return ROL::makePtr<StdVector<Real>>(n,0.0);
121 Ptr<std::vector<Real>> up = makePtr<std::vector<Real>>(n,1.0);
122 (*up)[3] =
static_cast<Real
>(2.0);
123 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(n,0.0);
124 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(up);
125 return makePtr<Bounds<Real>>(l,u);
Ptr< Vector< Real > > getSolution(const int i=0) const
Contains definitions of custom data types in ROL.
Defines the equality constraint operator interface for StdVectors.
Ptr< Constraint< Real > > getEqualityConstraint(void) const
W. Hock and K. Schittkowski 41th test function.
Real value(const std::vector< Real > &x, Real &tol)
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
void applyAdjointJacobian(std::vector< Real > &ajv, 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)
Contains definitions of test objective functions.
void value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Ptr< Objective< Real > > getObjective(void) const
void applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Ptr< Vector< Real > > getInitialGuess(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 > > getEqualityMultiplier(void) const