74 Real
value(
const std::vector<Real> &x, Real &tol ) {
75 const Real c1(1), c2(2);
76 return std::pow(x[0]-c2,c2) + std::pow(x[1]-c1,c2);
79 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
80 const Real c1(1), c2(2);
85 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
97 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
98 const Real c1(1), c2(2);
99 c[0] = x[0] - c2*x[1] + c1;
103 const std::vector<Real> &x, Real &tol) {
105 jv[0] = v[0] - c2*v[1];
109 const std::vector<Real> &x, Real &tol ) {
116 const std::vector<Real> &v,
const std::vector<Real> &x,
118 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
127 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
128 const Real c0(0.25), c1(1), c2(2);
129 c[0] = -c0*std::pow(x[0],c2) - std::pow(x[1],c2) + c1;
133 const std::vector<Real> &x, Real &tol) {
134 const Real c0(0.25), c2(2);
135 jv[0] = -c0*c2*x[0]*v[0] - c2*x[1]*v[1];
139 const std::vector<Real> &x, Real &tol ) {
140 const Real c0(0.25), c2(2);
141 ajv[0] = -c0*c2*x[0]*v[0];
142 ajv[1] = -c2*x[1]*v[0];
146 const std::vector<Real> &v,
const std::vector<Real> &x,
148 const Real c0(0.25), c2(2);
149 ahuv[0] = -c0*c2*v[0]*u[0];
150 ahuv[1] = -c2*v[1]*u[0];
160 return ROL::makePtr<Objective_HS14<Real>>();
165 return ROL::makePtr<StdVector<Real>>(n,2.0);
170 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
171 (*xp)[0] =
static_cast<Real
>(0.5 *(std::sqrt(7)-1));
172 (*xp)[1] =
static_cast<Real
>(0.25*(std::sqrt(7)+1));
173 return ROL::makePtr<StdVector<Real>>(xp);
177 return makePtr<Constraint_HS14a<Real>>();
181 return makePtr<StdVector<Real>>(1,0.0);
185 return makePtr<Constraint_HS14b<Real>>();
189 return makePtr<StdVector<Real>>(1,0.0);
193 Ptr<Vector<Real>> lb = makePtr<StdVector<Real>>(1,0.0);
194 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)