55 template<
class ScalarT>
61 template <
class ScalarT>
64 ROL::Ptr<const std::vector<ScalarT> > xp =
67 ScalarT x1 = (*xp)[0];
68 ScalarT x2 = (*xp)[1];
69 ScalarT x3 = (*xp)[2];
70 ScalarT x4 = (*xp)[3];
71 ScalarT x5 = (*xp)[4];
73 ScalarT J = exp(x1*x2*x3*x4*x5) - 0.5 * pow( (pow(x1,3)+pow(x2,3)+1.0), 2);
85 class Example_Constraint {
89 template<
class ScalarT>
95 template<
class ScalarT>
98 typedef std::vector<ScalarT> vector;
103 ROL::Ptr<vector> cp =
dynamic_cast<SV&
>(c).getVector();
104 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
106 ScalarT x1 = (*xp)[0];
107 ScalarT x2 = (*xp)[1];
108 ScalarT x3 = (*xp)[2];
109 ScalarT x4 = (*xp)[3];
110 ScalarT x5 = (*xp)[4];
112 (*cp)[0] = x1*x1+x2*x2+x3*x3+x4*x4+x5*x5 - 10.0;
113 (*cp)[1] = x2*x3 - 5.0*x4*x5;
114 (*cp)[2] = x1*x1*x1 + x2*x2*x2 + 1.0;
ROL::Objective_SimOpt value
Defines the linear algebra or vector space interface.
Provides the ROL::Vector interface for scalar values, to be used, for example, with scalar constraint...
ScalarT value(const Vector< ScalarT > &x, Real &tol)
void value(ROL::Vector< Real > &c, const ROL::Vector< Real > &sol, const Real &mu)