83 #ifndef ROL_ZAKHAROV_HPP 84 #define ROL_ZAKHAROV_HPP 98 Teuchos::RCP<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 Teuchos::RCP<std::vector<Real> > x0p = Teuchos::rcp(
new std::vector<Real>(n,3.0));
179 Teuchos::RCP<std::vector<Real> > xp = Teuchos::rcp(
new std::vector<Real>(n,0.0));
183 Teuchos::RCP<std::vector<Real> > k_rcp = Teuchos::rcp(
new std::vector<Real>(n,0.0));
184 for (
int i = 0; i < n; i++ ) {
187 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.
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.
Real dirDeriv(const Vector< Real > &x, const Vector< Real > &d, Real &tol)
Compute directional derivative.
void getZakharov(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
virtual void set(const Vector &x)
Set where .