21 template<
class ScalarT>
27 template <
class ScalarT>
30 ROL::Ptr<const std::vector<ScalarT> > xp =
33 ScalarT x1 = (*xp)[0];
34 ScalarT x2 = (*xp)[1];
35 ScalarT x3 = (*xp)[2];
36 ScalarT x4 = (*xp)[3];
37 ScalarT x5 = (*xp)[4];
39 ScalarT J = exp(x1*x2*x3*x4*x5) - 0.5 * pow( (pow(x1,3)+pow(x2,3)+1.0), 2);
51 class Example_Constraint {
55 template<
class ScalarT>
61 template<
class ScalarT>
64 typedef std::vector<ScalarT> vector;
69 ROL::Ptr<vector> cp =
dynamic_cast<SV&
>(c).getVector();
70 ROL::Ptr<const vector> xp =
dynamic_cast<const SV&
>(x).getVector();
72 ScalarT x1 = (*xp)[0];
73 ScalarT x2 = (*xp)[1];
74 ScalarT x3 = (*xp)[2];
75 ScalarT x4 = (*xp)[3];
76 ScalarT x5 = (*xp)[4];
78 (*cp)[0] = x1*x1+x2*x2+x3*x3+x4*x4+x5*x5 - 10.0;
79 (*cp)[1] = x2*x3 - 5.0*x4*x5;
80 (*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)