83 #ifndef ROL_ZAKHAROV_HPP
84 #define ROL_ZAKHAROV_HPP
98 ROL::Ptr<Vector<Real> >
k_;
107 Real xdotx = x.
dot(x);
108 Real kdotx = x.
dot(*
k_);
110 Real val = xdotx + pow(kdotx,2)/4.0 + pow(kdotx,4)/16.0;
117 Real kdotx = x.
dot(*
k_);
118 Real coeff = 0.25*(2.0*kdotx+pow(kdotx,3.0));
127 Real kdotd = d.
dot(*
k_);
128 Real kdotx = x.
dot(*
k_);
129 Real xdotd = x.
dot(d);
131 Real coeff = 0.25*(2.0*kdotx+pow(kdotx,3.0));
133 Real deriv = 2*xdotd + coeff*kdotd;
142 Real kdotx = x.
dot(*
k_);
143 Real kdotv = v.
dot(*
k_);
144 Real coeff = 0.25*(2.0+3.0*pow(kdotx,2.0))*kdotv;
153 Real kdotv = v.
dot(*
k_);
154 Real kdotx = x.
dot(*
k_);
155 Real kdotk = (*k_).dot(*
k_);
156 Real coeff = -kdotv/(2.0*kdotk+16.0/(2.0+3.0*pow(kdotx,2.0)));
175 ROL::Ptr<std::vector<Real> > k_ptr = ROL::makePtr<std::vector<Real>>(n,0.0);
176 for (
int i = 0; i < n; i++ ) {
179 ROL::Ptr<Vector<Real> > k = ROL::makePtr<StdVector<Real>>(k_ptr);
180 return ROL::makePtr<Objective_Zakharov<Real>>(k);
187 ROL::Ptr<std::vector<Real> > x0p = ROL::makePtr<std::vector<Real>>(n,3.0);
188 return ROL::makePtr<StdVector<Real>>(x0p);
195 ROL::Ptr<std::vector<Real> > xp = ROL::makePtr<std::vector<Real>>(n,0.0);
196 return ROL::makePtr<StdVector<Real>>(xp);
Provides the interface to evaluate objective functions.
Objective_Zakharov(const ROL::Ptr< Vector< Real > > k)
virtual void scale(const Real alpha)=0
Compute where .
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
void invHessVec(Vector< Real > &ihv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Ptr< Vector< Real > > getSolution(const int i=0) 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.
ROL::Ptr< Vector< Real > > k_
virtual Real dot(const Vector &x) const =0
Compute where .
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Ptr< Objective< Real > > getObjective(void) const
Ptr< Vector< Real > > getInitialGuess(void) const
Contains definitions of test objective functions.
Real dirDeriv(const Vector< Real > &x, const Vector< Real > &d, Real &tol)
Compute directional derivative.
virtual void set(const Vector &x)
Set where .