37 Real
value(
const std::vector<Real> &x, Real &tol ) {
38 const Real pi(M_PI), c12(12), c16(16);
39 return std::sin(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
42 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
43 const Real pi(M_PI), c12(12), c16(16);
44 g[0] = pi/c12*std::cos(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
45 g[1] = -pi/c16*std::sin(x[0]*pi/c12)*std::sin(x[1]*pi/c16);
48 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
49 const Real pi(M_PI), c12(12), c16(16);
50 Real h11 = -pi/c12*pi/c12*std::sin(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
51 Real h12 = -pi/c12*pi/c16*std::cos(x[0]*pi/c12)*std::sin(x[1]*pi/c16);
52 Real h22 = -pi/c16*pi/c16*std::sin(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
53 hv[0] = h11*v[0] + h12*v[1];
54 hv[1] = h12*v[0] + h22*v[1];
63 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
64 const Real c3(3), c4(4);
65 c[0] = c4*x[0] - c3*x[1];
69 const std::vector<Real> &x, Real &tol) {
70 const Real c3(3), c4(4);
71 jv[0] = c4*v[0] - c3*v[1];
75 const std::vector<Real> &x, Real &tol ) {
76 const Real c3(3), c4(4);
82 const std::vector<Real> &v,
const std::vector<Real> &x,
84 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
97 return ROL::makePtr<Objective_HS9<Real>>();
103 return ROL::makePtr<StdVector<Real>>(n,0.0);
110 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,0.0);
111 (*xp)[0] =
static_cast<Real
>(-3);
112 (*xp)[1] =
static_cast<Real
>(-4);
113 return ROL::makePtr<StdVector<Real>>(xp);
117 return ROL::makePtr<Constraint_HS9<Real>>();
123 return ROL::makePtr<StdVector<Real>>(n,0.0);
Ptr< Vector< Real > > getInitialGuess(void) const
Real value(const std::vector< Real > &x, Real &tol)
Ptr< Vector< Real > > getEqualityMultiplier(void) const
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Contains definitions of custom data types in ROL.
Defines the equality constraint operator interface for StdVectors.
Ptr< Vector< Real > > getSolution(const int i=0) const
void applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
W. Hock and K. Schittkowski 9th test function.
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)
Contains definitions of test objective functions.
void value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)
Ptr< Constraint< Real > > getEqualityConstraint(void) const
Ptr< Objective< Real > > getObjective(void) const
void hessVec(std::vector< Real > &hv, 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)