75 Teuchos::RCP<const vector>
getVector(
const V& x ) {
76 using Teuchos::dyn_cast;
81 using Teuchos::dyn_cast;
92 return std::sin((*ex)[0] + (*ex)[1]) + std::pow((*ex)[0]-(*ex)[1],2.0) - 1.5*(*ex)[0] + 2.5*(*ex)[1] + 1.0;
101 (*eg)[0] = std::cos((*ex)[0] + (*ex)[1]) + 2.0*((*ex)[0]-(*ex)[1]) - 1.5;
102 (*eg)[1] = std::cos((*ex)[0] + (*ex)[1]) - 2.0*((*ex)[0]-(*ex)[1]) + 2.5;;
112 Real h11 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
113 Real h22 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
114 Real h12 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
115 Real h21 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
117 (*ehv)[0] = h11 * (*ev)[0] + h12 * (*ev)[1];
118 (*ehv)[1] = h21 * (*ev)[0] + h22 * (*ev)[1];
128 Real h11 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
129 Real h22 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
130 Real h12 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
131 Real h21 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
133 (*ehv)[0] = 1.0/(h11*h22 - h12*h21) * (h22 * (*ev)[0] - h12 * (*ev)[1]);
134 (*ehv)[1] = 1.0/(h11*h22 - h12*h21) * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
142 typedef std::vector<Real>
vector;
147 using Teuchos::dyn_cast;
150 RCP<vector> x0p = dyn_cast<SV>(x0).
getVector();
151 RCP<vector> xp = dyn_cast<SV>(x).
getVector();
163 RCP<vector> l_rcp = rcp(
new vector(n,0.0) );
164 RCP<vector> u_rcp = rcp(
new vector(n,0.0) );
166 l_rcp->push_back(-1.5);
167 l_rcp->push_back(-3.0);
168 u_rcp->push_back(4.0);
169 u_rcp->push_back(3.0);
171 RCP<V> l = rcp(
new SV(l_rcp) );
172 RCP<V> u = rcp(
new SV(u_rcp) );
179 (*xp)[0] = -M_PI/3.0 + 1.0/2.0;
180 (*xp)[1] = -M_PI/3.0 - 1.0/2.0;
Provides the interface to evaluate objective functions.
Teuchos::RCP< vector > getVector(V &x)
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.
std::vector< Real > vector
Defines the linear algebra or vector space interface.
Provides the std::vector implementation of the ROL::Vector interface.
W. Hock and K. Schittkowski 5th test function.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Provides the interface to apply upper and lower bound constraints.
Teuchos::RCP< const vector > getVector(const V &x)
void getHS5(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Real value(const Vector< Real > &x, Real &tol)
Compute value.