30 Real
value(
const std::vector<Real> &x, Real &tol ) {
31 const Real c1(0.1), c2(100);
32 return c1*x[0]*x[0] + x[1]*x[1] - c2;
35 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
36 const Real two(2), c1(0.1);
41 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
42 const Real two(2), c1(0.1);
51 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
53 c[0] = c1*x[0] - x[1] - c1;
57 const std::vector<Real> &x, Real &tol ) {
59 jv[0] = c1*v[0] - v[1];
63 const std::vector<Real> &x, Real &tol ) {
70 const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
71 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
81 return makePtr<Objective_HS21<Real>>();
85 return makePtr<Constraint_HS21<Real>>();
89 Ptr<std::vector<Real>> lp = makePtr<std::vector<Real>>(2,2.0);
90 (*lp)[1] =
static_cast<Real
>(-50);
92 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(lp);
93 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(2,50.0);
95 return makePtr<Bounds<Real>>(l,u);
99 return makePtr<StdVector<Real>>(2,-1.0);
103 Ptr<std::vector<Real> > xp = makePtr<std::vector<Real>>(2,0.0);
104 (*xp)[0] =
static_cast<Real
>(2);
105 return makePtr<StdVector<Real>>(xp);
109 return makePtr<StdVector<Real>>(1,0.0);
113 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(1,0.0);
114 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(1,ROL_INF<Real>());
115 return makePtr<Bounds<Real>>(l,u);
122 #endif // ROL_HS21_HPP
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Ptr< Objective< Real > > getObjective(void) const
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.
Real value(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)
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
Ptr< Constraint< Real > > getInequalityConstraint(void) const
void applyAdjointJacobian(std::vector< Real > &ajv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Ptr< BoundConstraint< Real > > getSlackBoundConstraint(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Contains definitions of test objective functions.
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 value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)
Ptr< Vector< Real > > getInequalityMultiplier(void) const