53 #ifndef ROL_FREUDENSTEINROTH_HPP 54 #define ROL_FREUDENSTEINROTH_HPP 73 Teuchos::RCP<const vector>
getVector(
const V& x ) {
74 using Teuchos::dyn_cast;
79 using Teuchos::dyn_cast;
91 Real f1 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
92 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
103 Real f1 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
104 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
107 Real f12 = 10.0*(*xp)[1] - 3.0*(*xp)[1]*(*xp)[1] - 2.0;
109 Real f22 = 3.0*(*xp)[1]*(*xp)[1] + 2.0*(*xp)[1] - 14.0;
111 (*gp)[0] = 2.0*(f11*f1 + f21*f2);
112 (*gp)[1] = 2.0*(f12*f1 + f22*f2);
122 Real f1 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
123 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
126 Real f12 = 10.0*(*xp)[1] - 3.0*(*xp)[1]*(*xp)[1] - 2.0;
128 Real f22 = 3.0*(*xp)[1]*(*xp)[1] + 2.0*(*xp)[1] - 14.0;
130 Real f122 = 10.0 - 6.0*(*xp)[1];
131 Real f222 = 6.0*(*xp)[1] + 2.0;
133 Real h11 = 2.0*(f11*f11) + 2.0*(f21*f21);
134 Real h12 = 2.0*(f12*f11) + 2.0*(f22*f21);
135 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
137 (*hvp)[0] = h11*(*vp)[0] + h12*(*vp)[1];
138 (*hvp)[1] = h12*(*vp)[0] + h22*(*vp)[1];
148 Real f1 = -13.0 + (*xp)[0] + ((5.0-(*xp)[1])*(*xp)[1] - 2.0)*(*xp)[1];
149 Real f2 = -29.0 + (*xp)[0] + (((*xp)[1]+1.0)*(*xp)[1] - 14.0)*(*xp)[1];
152 Real f12 = 10.0*(*xp)[1] - 3.0*(*xp)[1]*(*xp)[1] - 2.0;
154 Real f22 = 3.0*(*xp)[1]*(*xp)[1] + 2.0*(*xp)[1] - 14.0;
156 Real f122 = 10.0 - 6.0*(*xp)[1];
157 Real f222 = 6.0*(*xp)[1] + 2.0;
159 Real h11 = 2.0*(f11*f11) + 2.0*(f21*f21);
160 Real h12 = 2.0*(f12*f11) + 2.0*(f22*f21);
161 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
163 (*hvp)[0] = (1.0/(h11*h22-h12*h12))*( h22*(*vp)[0] - h12*(*vp)[1]);
164 (*hvp)[1] = (1.0/(h11*h22-h12*h12))*(-h12*(*vp)[0] + h11*(*vp)[1]);
171 typedef std::vector<Real>
vector;
174 using Teuchos::dyn_cast;
177 RCP<vector> x0p = dyn_cast<SV>(x0).
getVector();
178 RCP<vector> xp = dyn_cast<SV>(x).
getVector();
Provides the interface to evaluate objective functions.
std::vector< Real > vector
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()
Teuchos::RCP< vector > getVector(V &x)
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.
Teuchos::RCP< const vector > getVector(const V &x)
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.