76 using Teuchos::dyn_cast;
81 using Teuchos::dyn_cast;
92 return static_cast<Real
>(100) * std::pow((*ex)[1] - std::pow((*ex)[0],2),2)
93 + std::pow(static_cast<Real>(1)-(*ex)[0],2);
101 (*eg)[0] =
static_cast<Real
>(-400) * ((*ex)[1] - std::pow((*ex)[0],2))
102 * (*ex)[0] -
static_cast<Real
>(2) * (static_cast<Real>(1)-(*ex)[0]);
103 (*eg)[1] =
static_cast<Real
>(200) * ((*ex)[1] - std::pow((*ex)[0],2));
113 Real h11 =
static_cast<Real
>(-400) * (*ex)[1]
114 +
static_cast<Real
>(1200) * std::pow((*ex)[0],2)
115 + static_cast<Real>(2);
116 Real h22 =
static_cast<Real
>(200);
117 Real h12 =
static_cast<Real
>(-400) * (*ex)[0];
118 Real h21 =
static_cast<Real
>(-400) * (*ex)[0];
122 (*ehv)[0] = (h11+alpha) * (*ev)[0] + h12 * (*ev)[1];
123 (*ehv)[1] = h21 * (*ev)[0] + (h22+alpha) * (*ev)[1];
133 Real h11 =
static_cast<Real
>(-400) * (*ex)[1]
134 +
static_cast<Real
>(1200) * std::pow((*ex)[0],2)
135 + static_cast<Real>(2);
136 Real h22 =
static_cast<Real
>(200);
137 Real h12 =
static_cast<Real
>(-400) * (*ex)[0];
138 Real h21 =
static_cast<Real
>(-400) * (*ex)[0];
140 (*ehv)[0] =
static_cast<Real
>(1)/(h11*h22 - h12*h21)
141 * (h22 * (*ev)[0] - h12 * (*ev)[1]);
142 (*ehv)[1] =
static_cast<Real
>(1)/(h11*h22 - h12*h21)
143 * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
156 Teuchos::RCP<std::vector<Real> > x0p = Teuchos::rcp(
new std::vector<Real>(n,0.0));
157 (*x0p)[0] = -2.0; (*x0p)[1] = 1.0;
161 Teuchos::RCP<std::vector<Real> > xp = Teuchos::rcp(
new std::vector<Real>(n,0.0));
162 Real a = std::sqrt(598.0/1200.0);
163 Real b = 400.0 * std::pow(a,3.0);
164 (*xp)[0] = 2.0*a*std::cos(1.0/3.0 * std::acos(1.0/b));
172 Teuchos::RCP<std::vector<Real> > lp = Teuchos::rcp(
new std::vector<Real>(n,0.0));
173 (*lp)[0] = ROL_NINF<Real>(); (*lp)[1] = 1.5;
174 Teuchos::RCP<Vector<Real> > l = Teuchos::rcp(
new StdVector<Real>(lp) );
175 Teuchos::RCP<std::vector<Real> > up = Teuchos::rcp(
new std::vector<Real>(n,0.0));
176 (*up)[0] = ROL_INF<Real>(); (*up)[1] = ROL_INF<Real>();
177 Teuchos::RCP<Vector<Real> > u = Teuchos::rcp(
new StdVector<Real>(up) );
Provides the interface to evaluate objective functions.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Contains definitions of custom data types in ROL.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Defines the linear algebra or vector space interface.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
void getHS2(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
std::vector< Real > vector
Provides the interface to apply upper and lower bound constraints.
Teuchos::RCP< vector > getVector(V &x)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Teuchos::RCP< const vector > getVector(const V &x)
W. Hock and K. Schittkowski 2nd test function.