83 #ifndef ROL_ZAKHAROV_HPP
84 #define ROL_ZAKHAROV_HPP
97 Teuchos::RCP<Vector<Real> >
k_;
106 Real xdotx = x.
dot(x);
107 Real kdotx = x.
dot(*
k_);
109 Real val = xdotx + pow(kdotx,2)/4.0 + pow(kdotx,4)/16.0;
116 Real kdotx = x.
dot(*
k_);
117 Real coeff = 0.25*(2.0*kdotx+pow(kdotx,3.0));
127 Real kdotx = x.
dot(*
k_);
128 Real kdotv = v.
dot(*
k_);
129 Real coeff = 0.25*(2.0+3.0*pow(kdotx,2.0))*kdotv;
138 Real kdotv = v.
dot(*
k_);
139 Real kdotx = x.
dot(*
k_);
140 Real kdotk = (*k_).dot(*
k_);
141 Real coeff = -kdotv/(2.0*kdotk+16.0/(2.0+3.0*pow(kdotx,2.0)));
154 Teuchos::RCP<std::vector<Real> > x0p =
155 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x0)).getVector());
156 Teuchos::RCP<std::vector<Real> > xp =
157 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x)).getVector());
162 Teuchos::RCP<std::vector<Real> > k_rcp = Teuchos::rcp(
new std::vector<Real>(n,0));
163 for(
int i=0;i<n;++i) {
166 Teuchos::RCP<Vector<Real> > k = Teuchos::rcp(
new StdVector<Real>(k_rcp));
Provides the interface to evaluate objective functions.
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.
Objective_Zakharov(const Teuchos::RCP< Vector< Real > > k)
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
void getZakharov(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Teuchos::RCP< Vector< Real > > k_
Defines the linear algebra or vector space interface.
virtual Real dot(const Vector &x) const =0
Compute where .
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Provides the std::vector implementation of the ROL::Vector interface.
virtual void set(const Vector &x)
Set where .