53 #ifndef ROL_FREUDENSTEINROTH_HPP
54 #define ROL_FREUDENSTEINROTH_HPP
70 Ptr<const std::vector<Real> > ex
73 Real f1 = -13.0 + (*ex)[0] + ((5.0-(*ex)[1])*(*ex)[1] - 2.0)*(*ex)[1];
74 Real f2 = -29.0 + (*ex)[0] + (((*ex)[1]+1.0)*(*ex)[1] - 14.0)*(*ex)[1];
80 Ptr<std::vector<Real> > eg
82 Ptr<const std::vector<Real> > ex
85 Real f1 = -13.0 + (*ex)[0] + ((5.0-(*ex)[1])*(*ex)[1] - 2.0)*(*ex)[1];
86 Real f2 = -29.0 + (*ex)[0] + (((*ex)[1]+1.0)*(*ex)[1] - 14.0)*(*ex)[1];
89 Real f12 = 10.0*(*ex)[1] - 3.0*(*ex)[1]*(*ex)[1] - 2.0;
91 Real f22 = 3.0*(*ex)[1]*(*ex)[1] + 2.0*(*ex)[1] - 14.0;
93 (*eg)[0] = 2.0*(f11*f1 + f21*f2);
94 (*eg)[1] = 2.0*(f12*f1 + f22*f2);
98 Ptr<std::vector<Real> > ehv
100 Ptr<const std::vector<Real> > ev
102 Ptr<const std::vector<Real> > ex
105 Real f1 = -13.0 + (*ex)[0] + ((5.0-(*ex)[1])*(*ex)[1] - 2.0)*(*ex)[1];
106 Real f2 = -29.0 + (*ex)[0] + (((*ex)[1]+1.0)*(*ex)[1] - 14.0)*(*ex)[1];
109 Real f12 = 10.0*(*ex)[1] - 3.0*(*ex)[1]*(*ex)[1] - 2.0;
111 Real f22 = 3.0*(*ex)[1]*(*ex)[1] + 2.0*(*ex)[1] - 14.0;
113 Real f122 = 10.0 - 6.0*(*ex)[1];
114 Real f222 = 6.0*(*ex)[1] + 2.0;
116 Real h11 = 2.0*(f11*f11) + 2.0*(f21*f21);
117 Real h12 = 2.0*(f12*f11) + 2.0*(f22*f21);
118 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
120 (*ehv)[0] = h11*(*ev)[0] + h12*(*ev)[1];
121 (*ehv)[1] = h12*(*ev)[0] + h22*(*ev)[1];
125 Ptr<std::vector<Real> > ehv
127 Ptr<const std::vector<Real> > ev
129 Ptr<const std::vector<Real> > ex
132 Real f1 = -13.0 + (*ex)[0] + ((5.0-(*ex)[1])*(*ex)[1] - 2.0)*(*ex)[1];
133 Real f2 = -29.0 + (*ex)[0] + (((*ex)[1]+1.0)*(*ex)[1] - 14.0)*(*ex)[1];
136 Real f12 = 10.0*(*ex)[1] - 3.0*(*ex)[1]*(*ex)[1] - 2.0;
138 Real f22 = 3.0*(*ex)[1]*(*ex)[1] + 2.0*(*ex)[1] - 14.0;
140 Real f122 = 10.0 - 6.0*(*ex)[1];
141 Real f222 = 6.0*(*ex)[1] + 2.0;
143 Real h11 = 2.0*(f11*f11) + 2.0*(f21*f21);
144 Real h12 = 2.0*(f12*f11) + 2.0*(f22*f21);
145 Real h22 = 2.0*(f122*f1 + f12*f12) + 2.0*(f222*f2 + f22*f22);
147 (*ehv)[0] = (1.0/(h11*h22-h12*h12))*( h22*(*ev)[0] - h12*(*ev)[1]);
148 (*ehv)[1] = (1.0/(h11*h22-h12*h12))*(-h12*(*ev)[0] + h11*(*ev)[1]);
159 return makePtr<Objective_FreudensteinRoth<Real>>();
166 Ptr<std::vector<Real> > x0p = makePtr<std::vector<Real>>(n,0.0);
167 (*x0p)[0] = 0.5; (*x0p)[1] = -2.0;
168 return makePtr<StdVector<Real>>(x0p);
175 Ptr<std::vector<Real> > xp = makePtr<std::vector<Real>>(n,0.0);
177 (*xp)[0] = 5.0; (*xp)[1] = 4.0;
180 (*xp)[0] = 11.412779; (*xp)[1] = -0.896805;
185 return makePtr<StdVector<Real>>(xp);
Provides the interface to evaluate objective functions.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
int getNumSolutions(void) const
Ptr< Vector< Real > > getInitialGuess(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Defines the linear algebra or vector space interface.
getFreudensteinRoth(void)
Objective_FreudensteinRoth()
Contains definitions of test objective functions.
Ptr< Objective< Real > > getObjective(void) const
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 gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.