75 Teuchos::RCP<const vector>
getVector(
const V& x ) {
76 using Teuchos::dyn_cast;
81 using Teuchos::dyn_cast;
92 return 100.0 * std::pow((*ex)[1] - std::pow((*ex)[0],2.0),2.0) + std::pow(1.0-(*ex)[0],2.0);
100 (*eg)[0] = -4.0 * 100.0 * ((*ex)[1] - std::pow((*ex)[0],2.0)) * (*ex)[0] - 2.0 * (1.0-(*ex)[0]);
101 (*eg)[1] = 2.0 * 100.0 * ((*ex)[1] - std::pow((*ex)[0],2.0));
111 Real h11 = -4.0 * 100.0 * (*ex)[1] + 12.0 * 100.0 * std::pow((*ex)[0],2.0) + 2.0;
112 Real h22 = 2.0 * 100.0;
113 Real h12 = -4.0 * 100.0 * (*ex)[0];
114 Real h21 = -4.0 * 100.0 * (*ex)[0];
116 (*ehv)[0] = h11 * (*ev)[0] + h12 * (*ev)[1];
117 (*ehv)[1] = h21 * (*ev)[0] + h22 * (*ev)[1];
127 Real h11 = -4.0 * 100.0 * (*ex)[1] + 12.0 * 100.0 * std::pow((*ex)[0],2.0) + 2.0;
128 Real h22 = 2.0 * 100.0;
129 Real h12 = -4.0 * 100.0 * (*ex)[0];
130 Real h21 = -4.0 * 100.0 * (*ex)[0];
132 (*ehv)[0] = 1.0/(h11*h22 - h12*h21) * (h22 * (*ev)[0] - h12 * (*ev)[1]);
133 (*ehv)[1] = 1.0/(h11*h22 - h12*h21) * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
141 typedef std::vector<Real>
vector;
146 using Teuchos::dyn_cast;
149 RCP<vector> x0p = dyn_cast<SV>(x0).
getVector();
150 RCP<vector> xp = dyn_cast<SV>(x).
getVector();
162 RCP<vector> l_rcp = rcp(
new vector(n,0.0) );
167 RCP<vector> u_rcp = rcp(
new vector(n,0.0) );
172 RCP<V> l = rcp(
new SV(l_rcp) );
173 RCP<V> u = rcp(
new SV(u_rcp) );
Provides the interface to evaluate objective functions.
W. Hock and K. Schittkowski 1st test function.
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 getHS1(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Defines the linear algebra or vector space interface.
Teuchos::RCP< vector > getVector(V &x)
Provides the std::vector implementation of the ROL::Vector interface.
std::vector< Real > vector
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Provides the interface to apply upper and lower bound constraints.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
static const double ROL_OVERFLOW
Platform-dependent maximum double.
Teuchos::RCP< const vector > getVector(const V &x)