71 Real
value(
const std::vector<Real> &x, Real &tol ) {
72 const Real pi(M_PI), c12(12), c16(16);
73 return std::sin(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
76 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
77 const Real pi(M_PI), c12(12), c16(16);
78 g[0] = pi/c12*std::cos(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
79 g[1] = -pi/c16*std::sin(x[0]*pi/c12)*std::sin(x[1]*pi/c16);
82 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
83 const Real pi(M_PI), c12(12), c16(16);
84 Real h11 = -pi/c12*pi/c12*std::sin(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
85 Real h12 = -pi/c12*pi/c16*std::cos(x[0]*pi/c12)*std::sin(x[1]*pi/c16);
86 Real h22 = -pi/c16*pi/c16*std::sin(x[0]*pi/c12)*std::cos(x[1]*pi/c16);
87 hv[0] = h11*v[0] + h12*v[1];
88 hv[1] = h12*v[0] + h22*v[1];
97 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
98 const Real c3(3), c4(4);
99 c[0] = c4*x[0] - c3*x[1];
103 const std::vector<Real> &x, Real &tol) {
104 const Real c3(3), c4(4);
105 jv[0] = c4*v[0] - c3*v[1];
109 const std::vector<Real> &x, Real &tol ) {
110 const Real c3(3), c4(4);
116 const std::vector<Real> &v,
const std::vector<Real> &x,
118 ahuv.assign(ahuv.size(),
static_cast<Real
>(0));
131 return ROL::makePtr<Objective_HS9<Real>>();
137 return ROL::makePtr<StdVector<Real>>(n,0.0);
144 ROL::Ptr<std::vector<Real>> xp = ROL::makePtr<std::vector<Real>>(n,0.0);
145 (*xp)[0] =
static_cast<Real
>(-3);
146 (*xp)[1] =
static_cast<Real
>(-4);
147 return ROL::makePtr<StdVector<Real>>(xp);
151 return ROL::makePtr<Constraint_HS9<Real>>();
157 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)