46 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
51 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
52 ROL::Ptr<vector> gp =
dynamic_cast<SV&
>(g).getVector();
78 ROL::Ptr<vector> cp =
dynamic_cast<SV&
>(c).getVector();
79 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
81 (*cp)[0] = (*xp)[1]-std::pow((*xp)[0],3)-std::pow((*xp)[2],2);
87 ROL::Ptr<vector> jvp =
dynamic_cast<SV&
>(jv).getVector();
88 ROL::Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
89 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
91 (*jvp)[0] = (*vp)[1] - 3.0*(*xp)[0]*(*xp)[0]*(*vp)[0] - 2.0*(*xp)[2]*(*vp)[2];
98 ROL::Ptr<vector> ajvp =
dynamic_cast<SV&
>(ajv).getVector();
99 ROL::Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
100 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
102 (*ajvp)[0] = -3.0*(*xp)[0]*(*xp)[0]*(*vp)[0];
103 (*ajvp)[1] = (*vp)[0];
104 (*ajvp)[2] = -2.0*(*xp)[2]*(*vp)[0];
112 ROL::Ptr<vector> ahuvp =
dynamic_cast<SV&
>(ahuv).getVector();
113 ROL::Ptr<const vector> up =
dynamic_cast<const SV&
>(u).getVector();
114 ROL::Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
115 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
117 (*ahuvp)[0] = -6.0*(*up)[0]*(*xp)[0]*(*vp)[0];
119 (*ahuvp)[2] = -2.0*(*up)[0]*(*vp)[2];
138 ROL::Ptr<vector> cp =
dynamic_cast<SV&
>(c).getVector();
139 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
141 (*cp)[0] = std::pow((*xp)[0],2)-(*xp)[1]-std::pow((*xp)[3],2);
147 ROL::Ptr<vector> jvp =
dynamic_cast<SV&
>(jv).getVector();
148 ROL::Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
149 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
151 (*jvp)[0] = 2.0*(*xp)[0]*(*vp)[0] - (*vp)[1] - 2.0*(*xp)[3]*(*vp)[3];
158 ROL::Ptr<vector> ajvp =
dynamic_cast<SV&
>(ajv).getVector();
159 ROL::Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
160 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
162 (*ajvp)[0] = 2.0*(*xp)[0]*(*vp)[0];
163 (*ajvp)[1] = -(*vp)[0];
165 (*ajvp)[3] = -2.0*(*vp)[0]*(*xp)[3];
172 ROL::Ptr<vector> ahuvp =
dynamic_cast<SV&
>(ahuv).getVector();
173 ROL::Ptr<const vector> up =
dynamic_cast<const SV&
>(u).getVector();
174 ROL::Ptr<const vector> vp =
dynamic_cast<const SV&
>(v).getVector();
175 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
179 (*ahuvp)[0] = 2.0*(*up)[0]*(*vp)[0];
182 (*ahuvp)[3] = -2.0*(*up)[0]*(*vp)[3];
195 return ROL::makePtr<Objective_HS39<Real>>();
202 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,2.0);
203 return ROL::makePtr<StdVector<Real>>(x0p);
210 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
211 (*xp)[0] =
static_cast<Real
>(1);
212 (*xp)[1] =
static_cast<Real
>(1);
213 (*xp)[2] =
static_cast<Real
>(0);
214 (*xp)[3] =
static_cast<Real
>(0);
215 return ROL::makePtr<StdVector<Real>>(xp);
219 std::vector<Ptr<Constraint<Real>>> cvec(2);
220 cvec[0] = makePtr<Constraint_HS39a<Real>>();
221 cvec[1] = makePtr<Constraint_HS39b<Real>>();
222 return ROL::makePtr<Constraint_Partitioned<Real>>(cvec);
226 std::vector<Ptr<Vector<Real>>> lvec(2);
227 lvec[0] = makePtr<StdVector<Real>>(makePtr<std::vector<Real>>(1,0.0));
228 lvec[1] = makePtr<StdVector<Real>>(makePtr<std::vector<Real>>(1,0.0));
229 return ROL::makePtr<PartitionedVector<Real>>(lvec);
Provides the interface to evaluate objective functions.
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
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 hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
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 .
Ptr< Vector< Real > > getSolution(const int i=0) const
Contains definitions of custom data types in ROL.
Ptr< Objective< Real > > getObjective(void) const
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
std::vector< Real > vector
std::vector< Real > vector
std::vector< Real > vector
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Ptr< Vector< Real > > getInitialGuess(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 ...
Contains definitions of test objective functions.
Ptr< Vector< Real > > getEqualityMultiplier(void) const
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
Ptr< Constraint< Real > > getEqualityConstraint(void) const
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
Real value(const Vector< Real > &x, Real &tol)
Compute value.
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 .
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
Defines the general constraint operator interface.
W. Hock and K. Schittkowski 39th test function.