53 #ifndef ROL_POWELL_HPP
54 #define ROL_POWELL_HPP
72 Teuchos::RCP<const std::vector<Real> > xp = ex.
getVector();
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 Teuchos::RCP<const std::vector<Real> > xp =
83 Teuchos::RCP<std::vector<Real> > gp =
84 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(g)).getVector());
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 Teuchos::RCP<const std::vector<Real> > xp =
101 Teuchos::RCP<const std::vector<Real> > vp =
103 Teuchos::RCP<std::vector<Real> > hvp =
104 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
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 Teuchos::RCP<const std::vector<Real> > xp =
135 Teuchos::RCP<const std::vector<Real> > vp =
137 Teuchos::RCP<std::vector<Real> > hvp =
138 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
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]);
170 Teuchos::RCP<std::vector<Real> > x0p =
171 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x0)).getVector());
172 Teuchos::RCP<std::vector<Real> > xp =
173 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x)).getVector());
186 (*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)
Teuchos::RCP< const std::vector< Element > > getVector() const
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.
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.