69 Real
value(
const std::vector<Real> &x, Real &tol ) {
70 return std::pow(x[0],3)+std::pow(x[1],3);
73 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
75 g[0] = three*std::pow(x[0],2);
76 g[1] = three*std::pow(x[1],2);
79 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
81 hv[0] = six*x[0]*v[0];
82 hv[1] = six*x[1]*v[1];
85 void invHessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
87 hv[0] = v[0]/(six*x[0]);
88 hv[1] = v[1]/(six*x[1]);
97 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
98 c[0] = std::pow(x[0],3) + x[1];
101 void applyJacobian( std::vector<Real> &jv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
103 jv[0] = three*std::pow(x[0],2)*v[0] + v[1];
106 void applyAdjointJacobian( std::vector<Real> &ajv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
108 ajv[0] = three*std::pow(x[0],2)*v[0];
112 void applyAdjointHessian( std::vector<Real> &ahuv,
const std::vector<Real> &u,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
113 const Real
zero(0), six(6);
114 ahuv[0] = six*x[0]*u[0]*v[0];
129 return makePtr<Objective_Cubic<Real>>();
134 Ptr<std::vector<Real>> scale = makePtr<std::vector<Real>>(n,
static_cast<Real
>( 1.0));
135 Ptr<std::vector<Real>> xp = makePtr<std::vector<Real>>(n,
static_cast<Real
>(-0.9));
136 return makePtr<PrimalScaledStdVector<Real>>(xp,scale);
141 Ptr<std::vector<Real>> scale = makePtr<std::vector<Real>>(n,
static_cast<Real
>( 1.0));
142 Ptr<std::vector<Real>> xp = makePtr<std::vector<Real>>(n,
static_cast<Real
>(-1.0));
144 const Real one(1), three(3), six(6);
145 Real x = -one/std::pow(three,one/six);
146 Real y = -std::pow(x,3);
152 (*xp)[0] =
static_cast<Real
>(-0.8374930678347255);
153 (*xp)[1] =
static_cast<Real
>( 0.5774131462277658);
155 return makePtr<PrimalScaledStdVector<Real>>(xp,scale);
160 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(n,-1.0);
161 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(n, 1.0);
162 return makePtr<Bounds<Real>>(l,u);
167 return makePtr<Constraint_Cubic<Real>>();
174 return makePtr<StdVector<Real>>(1,0.0);
181 return makePtr<Constraint_Cubic<Real>>();
188 return makePtr<StdVector<Real>>(1,0.0);
195 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(1,-0.01);
196 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(1, 0.01);
197 return makePtr<Bounds<Real>>(l,u);
Ptr< Vector< Real > > getInitialGuess(void) const
Ptr< Vector< Real > > getInequalityMultiplier(void) const
Ptr< Vector< Real > > getEqualityMultiplier(void) const
Ptr< Objective< Real > > getObjective(void) const
virtual void hessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
void applyJacobian(std::vector< Real > &jv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Defines the equality constraint operator interface for StdVectors.
Ptr< Constraint< Real > > getEqualityConstraint(void) const
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Ptr< BoundConstraint< Real > > getSlackBoundConstraint(void) const
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
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 value(std::vector< Real > &c, const std::vector< Real > &x, Real &tol)
Contains definitions of test objective functions.
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Ptr< Constraint< Real > > getInequalityConstraint(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Real value(const std::vector< Real > &x, Real &tol)
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
void invHessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
void applyAdjointJacobian(std::vector< Real > &ajv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)