53 #ifndef ROL_POWELL_HPP 54 #define ROL_POWELL_HPP 73 Teuchos::RCP<const vector>
getVector(
const V& x ) {
74 using Teuchos::dyn_cast;
79 using Teuchos::dyn_cast;
91 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
92 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
103 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
104 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
106 Real f11 = 1.e4*(*xp)[1];
107 Real f12 = 1.e4*(*xp)[0];
108 Real f21 = -std::exp(-(*xp)[0]);
109 Real f22 = -std::exp(-(*xp)[1]);
111 (*gp)[0] = 2.0*(f11*f1 + f21*f2);
112 (*gp)[1] = 2.0*(f12*f1 + f22*f2);
122 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
123 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
125 Real f11 = 1.e4*(*xp)[1];
126 Real f12 = 1.e4*(*xp)[0];
127 Real f21 = -std::exp(-(*xp)[0]);
128 Real f22 = -std::exp(-(*xp)[1]);
134 Real f211 = std::exp(-(*xp)[0]);
137 Real f222 = std::exp(-(*xp)[1]);
139 Real h11 = 2.0*(f111*f1 + f11*f11) + 2.0*(f211*f2 + f21*f21);
140 Real h12 = 2.0*(f112*f1 + f11*f12) + 2.0*(f212*f2 + f21*f22);
141 Real h21 = 2.0*(f121*f1 + f21*f11) + 2.0*(f221*f2 + f22*f21);
142 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
144 (*hvp)[0] = h11*(*vp)[0] + h12*(*vp)[1];
145 (*hvp)[1] = h21*(*vp)[0] + h22*(*vp)[1];
155 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
156 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
158 Real f11 = 1.e4*(*xp)[1];
159 Real f12 = 1.e4*(*xp)[0];
160 Real f21 = -std::exp(-(*xp)[0]);
161 Real f22 = -std::exp(-(*xp)[1]);
167 Real f211 = std::exp(-(*xp)[0]);
170 Real f222 = std::exp(-(*xp)[1]);
172 Real h11 = 2.0*(f111*f1 + f11*f11) + 2.0*(f211*f2 + f21*f21);
173 Real h12 = 2.0*(f112*f1 + f11*f12) + 2.0*(f212*f2 + f21*f22);
174 Real h21 = 2.0*(f121*f1 + f21*f11) + 2.0*(f221*f2 + f22*f21);
175 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
177 (*hvp)[0] = (1.0/(h11*h22-h12*h21))*( h22*(*vp)[0] - h21*(*vp)[1]);
178 (*hvp)[1] = (1.0/(h11*h22-h12*h21))*(-h12*(*vp)[0] + h11*(*vp)[1]);
185 typedef std::vector<Real>
vector;
188 typedef typename vector::size_type uint;
192 using Teuchos::dyn_cast;
195 RCP<vector> x0p = dyn_cast<SV>(x0).
getVector();
196 RCP<vector> xp = dyn_cast<SV>(x).
getVector();
210 (*xp)[0] = 1.098e-05;
Provides the interface to evaluate objective functions.
void getPowell(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Powell's badly scaled function.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Teuchos::RCP< vector > getVector(V &x)
Defines the linear algebra or vector space interface.
Provides the std::vector implementation of the ROL::Vector interface.
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.
Teuchos::RCP< const vector > getVector(const V &x)
std::vector< Real > vector