75 Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
77 return rt3_*(*xp)[0]*std::pow((*xp)[1],3)*((*xp)[0]-6)/81.0;
82 Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
84 Ptr<vector> gp =
dynamic_cast<SV&
>(g).getVector();
86 (*gp)[0] = 2*
rt3_*std::pow((*xp)[1],3)*((*xp)[0]-3)/81.0;
87 (*gp)[1] =
rt3_*(*xp)[0]*std::pow((*xp)[1],2)*((*xp)[0]-6)/27.0;
94 Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
95 Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
96 Ptr<vector> hvp =
dynamic_cast<SV&
>(hv).getVector();
98 Real a00 = pow((*xp)[1],3)/81.0;
99 Real a01 = pow((*xp)[1],2)*((*xp)[0]-3)/27.0;
100 Real a11 = (*xp)[1]*(std::pow((*xp)[0]-3,2)-9)/27.0;
102 (*hvp)[0] = a00*(*vp)[0] + a01*(*vp)[1];
103 (*hvp)[1] = a01*(*vp)[0] + a11*(*vp)[1];
125 Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
126 Ptr<vector> cp =
dynamic_cast<SV&
>(c).getVector();
128 (*cp)[0] = (*xp)[0]/
rt3_ - (*xp)[1];
129 (*cp)[1] = (*xp)[0] +
rt3_*(*xp)[1];
130 (*cp)[2] = -(*xp)[0] -
rt3_*(*xp)[1] + 6;
137 Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
138 Ptr<vector> jvp =
dynamic_cast<SV&
>(jv).getVector();
140 (*jvp)[0] = (*vp)[0]/
rt3_ - (*vp)[1];
141 (*jvp)[1] = (*vp)[0] +
rt3_*(*vp)[1];
142 (*jvp)[2] = -(*vp)[0] -
rt3_*(*vp)[1];
150 Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
151 Ptr<vector> ajvp =
dynamic_cast<SV&
>(ajv).getVector();
153 (*ajvp)[0] =
rt3_*(*vp)[0]/3 + (*vp)[1] - (*vp)[2];
154 (*ajvp)[1] = -(*vp)[0] +
rt3_*(*vp)[1] -
rt3_*(*vp)[2];
174 return makePtr<Objective_HS24<Real>>();
178 return makePtr<Constraint_HS24<Real>>();
183 Ptr<std::vector<Real>> lp = makePtr<std::vector<Real>>(2,0.0);
186 Ptr<std::vector<Real>> up = makePtr<std::vector<Real>>(2,ROL_INF<Real>());
188 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(lp);
189 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(up);
191 return makePtr<Bounds<Real>>(l,u);
195 Ptr<std::vector<Real> > x0p = makePtr<std::vector<Real>>(2);
199 return makePtr<StdVector<Real>>(x0p);
203 Ptr<std::vector<Real> > xp = makePtr<std::vector<Real>>(2);
205 (*xp)[1] = std::sqrt(3.0);
207 return makePtr<StdVector<Real>>(xp);
211 Ptr<std::vector<Real> > lp = makePtr<std::vector<Real>>(3,0.0);
212 return makePtr<StdVector<Real>>(lp);
217 Ptr<std::vector<Real> > lp = makePtr<std::vector<Real>>(3,0.0);
220 Ptr<std::vector<Real> > up = makePtr<std::vector<Real>>(3,ROL_INF<Real>());
222 Ptr<Vector<Real> > l = makePtr<StdVector<Real>>(lp);
223 Ptr<Vector<Real> > u = makePtr<StdVector<Real>>(up);
225 return makePtr<Bounds<Real>>(l,u);
233 #endif // ROL_HS24_HPP
Provides the interface to evaluate objective functions.
Ptr< Vector< Real > > getInitialGuess(void) const
virtual void scale(const Real alpha)=0
Compute where .
Ptr< Constraint< Real > > getInequalityConstraint(void) const
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Ptr< Vector< Real > > getInequalityMultiplier(void) const
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Contains definitions of test objective functions.
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
std::vector< Real > vector
std::vector< Real > vector
Ptr< Objective< Real > > getObjective(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
Defines the general constraint operator interface.
Ptr< BoundConstraint< Real > > getSlackBoundConstraint(void) const