19 #ifndef ROL_POWELL_HPP
20 #define ROL_POWELL_HPP
37 ROL::Ptr<const std::vector<Real> > xp
40 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
41 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
47 ROL::Ptr<std::vector<Real> > gp
49 ROL::Ptr<const std::vector<Real> > xp
52 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
53 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
55 Real f11 = 1.e4*(*xp)[1];
56 Real f12 = 1.e4*(*xp)[0];
57 Real f21 = -std::exp(-(*xp)[0]);
58 Real f22 = -std::exp(-(*xp)[1]);
60 (*gp)[0] = 2.0*(f11*f1 + f21*f2);
61 (*gp)[1] = 2.0*(f12*f1 + f22*f2);
65 ROL::Ptr<std::vector<Real> > hvp
67 ROL::Ptr<const std::vector<Real> > vp
69 ROL::Ptr<const std::vector<Real> > xp
72 Real f1 = 1.e4*(*xp)[0]*(*xp)[1] - 1.0;
73 Real f2 = std::exp(-(*xp)[0]) + std::exp(-(*xp)[1]) - 1.0001;
75 Real f11 = 1.e4*(*xp)[1];
76 Real f12 = 1.e4*(*xp)[0];
77 Real f21 = -std::exp(-(*xp)[0]);
78 Real f22 = -std::exp(-(*xp)[1]);
84 Real f211 = std::exp(-(*xp)[0]);
87 Real f222 = std::exp(-(*xp)[1]);
89 Real h11 = 2.0*(f111*f1 + f11*f11) + 2.0*(f211*f2 + f21*f21);
90 Real h12 = 2.0*(f112*f1 + f11*f12) + 2.0*(f212*f2 + f21*f22);
91 Real h21 = 2.0*(f121*f1 + f12*f11) + 2.0*(f221*f2 + f22*f21);
92 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
94 (*hvp)[0] = h11*(*vp)[0] + h12*(*vp)[1];
95 (*hvp)[1] = h21*(*vp)[0] + h22*(*vp)[1];
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] = (1.0/(h11*h22-h12*h21))*( h22*(*vp)[0] - h21*(*vp)[1]);
129 (*hvp)[1] = (1.0/(h11*h22-h12*h21))*(-h12*(*vp)[0] + h11*(*vp)[1]);
141 scale_ = ROL::makePtr<std::vector<Real>>(2,0.0);
142 (*scale_)[0] = 1.e10; (*scale_)[1] = 1.e-2;
147 return ROL::makePtr<Objective_Powell<Real>>();
154 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,0.0);
155 (*x0p)[0] = 0.0; (*x0p)[1] = 1.0;
156 return ROL::makePtr<PrimalScaledStdVector<Real>>(x0p,
scale_);
163 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
164 (*xp)[0] = 1.098e-05; (*xp)[1] = 9.106;
165 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