53 #ifndef ROL_FREUDENSTEINROTH_HPP
54 #define ROL_FREUDENSTEINROTH_HPP
72 Teuchos::RCP<const std::vector<Real> > xp = ex.
getVector();
74 Real f1 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
75 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
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 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
87 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
90 Real f12 = 10.0*(*xp)[1] - 3.0*(*xp)[1]*(*xp)[1] - 2.0;
92 Real f22 = 3.0*(*xp)[1]*(*xp)[1] + 2.0*(*xp)[1] - 14.0;
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 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
107 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
110 Real f12 = 10.0*(*xp)[1] - 3.0*(*xp)[1]*(*xp)[1] - 2.0;
112 Real f22 = 3.0*(*xp)[1]*(*xp)[1] + 2.0*(*xp)[1] - 14.0;
114 Real f122 = 10.0 - 6.0*(*xp)[1];
115 Real f222 = 6.0*(*xp)[1] + 2.0;
117 Real h11 = 2.0*(f11*f11) + 2.0*(f21*f21);
118 Real h12 = 2.0*(f12*f11) + 2.0*(f22*f21);
119 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
121 (*hvp)[0] = h11*(*vp)[0] + h12*(*vp)[1];
122 (*hvp)[1] = h12*(*vp)[0] + h22*(*vp)[1];
126 Teuchos::RCP<const std::vector<Real> > xp =
128 Teuchos::RCP<const std::vector<Real> > vp =
130 Teuchos::RCP<std::vector<Real> > hvp =
131 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
133 Real f1 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
134 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
137 Real f12 = 10.0*(*xp)[1] - 3.0*(*xp)[1]*(*xp)[1] - 2.0;
139 Real f22 = 3.0*(*xp)[1]*(*xp)[1] + 2.0*(*xp)[1] - 14.0;
141 Real f122 = 10.0 - 6.0*(*xp)[1];
142 Real f222 = 6.0*(*xp)[1] + 2.0;
144 Real h11 = 2.0*(f11*f11) + 2.0*(f21*f21);
145 Real h12 = 2.0*(f12*f11) + 2.0*(f22*f21);
146 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
148 (*hvp)[0] = (1.0/(h11*h22-h12*h12))*( h22*(*vp)[0] - h12*(*vp)[1]);
149 (*hvp)[1] = (1.0/(h11*h22-h12*h12))*(-h12*(*vp)[0] + h11*(*vp)[1]);
156 Teuchos::RCP<std::vector<Real> > x0p =
157 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x0)).getVector());
158 Teuchos::RCP<std::vector<Real> > xp =
159 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x)).getVector());
Provides the interface to evaluate objective functions.
Teuchos::RCP< const std::vector< Element > > getVector() const
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.
Objective_FreudensteinRoth()
Freudenstein and Roth's function.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
void getFreudensteinRoth(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.