40 Real
value(
const std::vector<Real> &x, Real &tol ) {
41 const Real c1(1), c2(2);
42 return std::pow(x[0]-c2,c2) + std::pow(x[1]-c1,c2);
45 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
46 const Real c1(1), c2(2);
51 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
63 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
64 const Real c1(1), c2(2);
65 c[0] = x[0] - c2*x[1] + c1;
69 const std::vector<Real> &x, Real &tol) {
71 jv[0] = v[0] - c2*v[1];
75 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));
93 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
94 const Real c0(0.25), c1(1), c2(2);
95 c[0] = -c0*std::pow(x[0],c2) - std::pow(x[1],c2) + c1;
99 const std::vector<Real> &x, Real &tol) {
100 const Real c0(0.25), c2(2);
101 jv[0] = -c0*c2*x[0]*v[0] - c2*x[1]*v[1];
105 const std::vector<Real> &x, Real &tol ) {
106 const Real c0(0.25), c2(2);
107 ajv[0] = -c0*c2*x[0]*v[0];
108 ajv[1] = -c2*x[1]*v[0];
112 const std::vector<Real> &v,
const std::vector<Real> &x,
114 const Real c0(0.25), c2(2);
115 ahuv[0] = -c0*c2*v[0]*u[0];
116 ahuv[1] = -c2*v[1]*u[0];
126 return ROL::makePtr<Objective_HS14<Real>>();
131 return ROL::makePtr<StdVector<Real>>(n,2.0);
136 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
137 (*xp)[0] =
static_cast<Real
>(0.5 *(std::sqrt(7)-1));
138 (*xp)[1] =
static_cast<Real
>(0.25*(std::sqrt(7)+1));
139 return ROL::makePtr<StdVector<Real>>(xp);
143 return makePtr<Constraint_HS14a<Real>>();
147 return makePtr<StdVector<Real>>(1,0.0);
151 return makePtr<Constraint_HS14b<Real>>();
155 return makePtr<StdVector<Real>>(1,0.0);
159 Ptr<Vector<Real>> lb = makePtr<StdVector<Real>>(1,0.0);
160 return makePtr<Bounds<Real>>(*lb,
true);
void applyAdjointHessian(std::vector< Real > &ahuv, const std::vector< Real > &u, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Real value(const std::vector< Real > &x, Real &tol)
Contains definitions of custom data types in ROL.
Ptr< Objective< Real > > getObjective(void) const
Defines the equality constraint operator interface for StdVectors.
void applyAdjointJacobian(std::vector< Real > &ajv, 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)
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
W. Hock and K. Schittkowski 14th test function.
Ptr< Vector< Real > > getEqualityMultiplier(void) const
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
void hessVec(std::vector< Real > &hv, 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)
void applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Contains definitions of test objective functions.
void applyAdjointJacobian(std::vector< Real > &ajv, const std::vector< Real > &v, 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)
Ptr< BoundConstraint< Real > > getSlackBoundConstraint(void) const
Ptr< Constraint< Real > > getEqualityConstraint(void) const
Ptr< Vector< Real > > getInequalityMultiplier(void) const
Ptr< Vector< Real > > getInitialGuess(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< Constraint< Real > > getInequalityConstraint(void) const
void value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)