35 Real
value(
const std::vector<Real> &x, Real &tol ) {
36 return std::pow(x[0],3)+std::pow(x[1],3);
39 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
41 g[0] = three*std::pow(x[0],2);
42 g[1] = three*std::pow(x[1],2);
45 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
47 hv[0] = six*x[0]*v[0];
48 hv[1] = six*x[1]*v[1];
51 void invHessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
53 hv[0] = v[0]/(six*x[0]);
54 hv[1] = v[1]/(six*x[1]);
63 void value( std::vector<Real> &c,
const std::vector<Real> &x, Real &tol ) {
64 c[0] = std::pow(x[0],3) + x[1];
67 void applyJacobian( std::vector<Real> &jv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
69 jv[0] = three*std::pow(x[0],2)*v[0] + v[1];
72 void applyAdjointJacobian( std::vector<Real> &ajv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
74 ajv[0] = three*std::pow(x[0],2)*v[0];
78 void applyAdjointHessian( std::vector<Real> &ahuv,
const std::vector<Real> &u,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
79 const Real
zero(0), six(6);
80 ahuv[0] = six*x[0]*u[0]*v[0];
95 return makePtr<Objective_Cubic<Real>>();
100 Ptr<std::vector<Real>> scale = makePtr<std::vector<Real>>(n,
static_cast<Real
>( 1.0));
101 Ptr<std::vector<Real>> xp = makePtr<std::vector<Real>>(n,
static_cast<Real
>(-0.9));
102 return makePtr<PrimalScaledStdVector<Real>>(xp,scale);
107 Ptr<std::vector<Real>> scale = makePtr<std::vector<Real>>(n,
static_cast<Real
>( 1.0));
108 Ptr<std::vector<Real>> xp = makePtr<std::vector<Real>>(n,
static_cast<Real
>(-1.0));
110 const Real one(1), three(3), six(6);
111 Real x = -one/std::pow(three,one/six);
112 Real y = -std::pow(x,3);
118 (*xp)[0] =
static_cast<Real
>(-0.8374930678347255);
119 (*xp)[1] =
static_cast<Real
>( 0.5774131462277658);
121 return makePtr<PrimalScaledStdVector<Real>>(xp,scale);
126 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(n,-1.0);
127 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(n, 1.0);
128 return makePtr<Bounds<Real>>(l,u);
133 return makePtr<Constraint_Cubic<Real>>();
140 return makePtr<StdVector<Real>>(1,0.0);
147 return makePtr<Constraint_Cubic<Real>>();
154 return makePtr<StdVector<Real>>(1,0.0);
161 Ptr<Vector<Real>> l = makePtr<StdVector<Real>>(1,-0.01);
162 Ptr<Vector<Real>> u = makePtr<StdVector<Real>>(1, 0.01);
163 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
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.
virtual void hessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
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 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 applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
void applyAdjointJacobian(std::vector< Real > &ajv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)