53 #ifndef ROL_POWELL_HPP
54 #define ROL_POWELL_HPP
71 ROL::Ptr<const std::vector<Real> > xp
74 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
75 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
81 ROL::Ptr<std::vector<Real> > gp
83 ROL::Ptr<const std::vector<Real> > xp
86 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
87 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
89 Real f11 = 1.e4*(*xp)[1];
90 Real f12 = 1.e4*(*xp)[0];
91 Real f21 = -std::exp(-(*xp)[0]);
92 Real f22 = -std::exp(-(*xp)[1]);
94 (*gp)[0] = 2.0*(f11*f1 + f21*f2);
95 (*gp)[1] = 2.0*(f12*f1 + f22*f2);
99 ROL::Ptr<std::vector<Real> > hvp
101 ROL::Ptr<const std::vector<Real> > vp
103 ROL::Ptr<const std::vector<Real> > xp
106 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
107 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
109 Real f11 = 1.e4*(*xp)[1];
110 Real f12 = 1.e4*(*xp)[0];
111 Real f21 = -std::exp(-(*xp)[0]);
112 Real f22 = -std::exp(-(*xp)[1]);
118 Real f211 = std::exp(-(*xp)[0]);
121 Real f222 = std::exp(-(*xp)[1]);
123 Real h11 = 2.0*(f111*f1 + f11*f11) + 2.0*(f211*f2 + f21*f21);
124 Real h12 = 2.0*(f112*f1 + f11*f12) + 2.0*(f212*f2 + f21*f22);
125 Real h21 = 2.0*(f121*f1 + f21*f11) + 2.0*(f221*f2 + f22*f21);
126 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
128 (*hvp)[0] = h11*(*vp)[0] + h12*(*vp)[1];
129 (*hvp)[1] = h21*(*vp)[0] + h22*(*vp)[1];
133 ROL::Ptr<std::vector<Real> > hvp
135 ROL::Ptr<const std::vector<Real> > vp
137 ROL::Ptr<const std::vector<Real> > xp
140 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
141 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
143 Real f11 = 1.e4*(*xp)[1];
144 Real f12 = 1.e4*(*xp)[0];
145 Real f21 = -std::exp(-(*xp)[0]);
146 Real f22 = -std::exp(-(*xp)[1]);
152 Real f211 = std::exp(-(*xp)[0]);
155 Real f222 = std::exp(-(*xp)[1]);
157 Real h11 = 2.0*(f111*f1 + f11*f11) + 2.0*(f211*f2 + f21*f21);
158 Real h12 = 2.0*(f112*f1 + f11*f12) + 2.0*(f212*f2 + f21*f22);
159 Real h21 = 2.0*(f121*f1 + f21*f11) + 2.0*(f221*f2 + f22*f21);
160 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
162 (*hvp)[0] = (1.0/(h11*h22-h12*h21))*( h22*(*vp)[0] - h21*(*vp)[1]);
163 (*hvp)[1] = (1.0/(h11*h22-h12*h21))*(-h12*(*vp)[0] + h11*(*vp)[1]);
175 scale_ = ROL::makePtr<std::vector<Real>>(2,0.0);
176 (*scale_)[0] = 1.e10; (*scale_)[1] = 1.e-2;
181 return ROL::makePtr<Objective_Powell<Real>>();
188 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
189 (*x0p)[0] = 0.0; (*x0p)[1] = 1.0;
190 return ROL::makePtr<PrimalScaledStdVector<Real>>(x0p,
scale_);
197 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
198 (*xp)[0] = 1.098e-05; (*xp)[1] = 9.106;
199 return ROL::makePtr<PrimalScaledStdVector<Real>>(xp,
scale_);
Provides the interface to evaluate objective functions.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::Ptr< std::vector< Real > > scale_
Provides the std::vector implementation of the ROL::Vector interface that handles scalings in the inn...
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.
Ptr< Vector< Real > > getSolution(const int i=0) const
Defines the linear algebra or vector space interface.
Contains definitions of test objective functions.
Ptr< Vector< Real > > getInitialGuess(void) const
Provides the std::vector implementation of the ROL::Vector interface that handles scalings in the inn...
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.
Ptr< Objective< Real > > getObjective(void) const