44 #ifndef ROL_EXPUTILITY_HPP 45 #define ROL_EXPUTILITY_HPP 64 scaledGradient_ = (x.
dual()).clone();
65 dualVector_ = (x.
dual()).clone();
68 scaledGradient_->zero();
76 scaledGradient_ = (x.
dual()).clone();
77 dualVector_ = (x.
dual()).clone();
80 scaledGradient_->zero();
84 void update(
const Real val,
const Real weight) {
89 Real ev = std::exp(val);
96 Real ev = std::exp(val);
101 scaledGradient_->axpy(weight*ev*gv,g);
107 sampler.
sumAll(&val,&ev,1);
114 sampler.
sumAll(&val,&ev,1);
122 sampler.
sumAll(&val,&ev,1);
126 sampler.
sumAll(&gv,&egv,1);
130 sampler.
sumAll(*scaledGradient_,*dualVector_);
131 hv.
plus(*dualVector_);
136 dualVector_->scale(egv/(ev*ev));
137 hv.
plus(*dualVector_);
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual void scale(const Real alpha)=0
Compute where .
void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x, Teuchos::RCP< Vector< Real > > &v0, const Vector< Real > &v)
virtual void plus(const Vector &x)=0
Compute , where .
void update(const Real val, const Vector< Real > &g, const Real weight)
Teuchos::RCP< Vector< Real > > dualVector_
Defines the linear algebra or vector space interface.
void sumAll(Real *input, Real *output, int dim) const
void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
Teuchos::RCP< Vector< Real > > scaledGradient_
virtual void getHessVec(Vector< Real > &hv, SampleGenerator< Real > &sampler)
Real getValue(SampleGenerator< Real > &sampler)
void update(const Real val, const Real weight)
virtual void getGradient(Vector< Real > &g, SampleGenerator< Real > &sampler)
void update(const Real val, const Vector< Real > &g, const Real gv, const Vector< Real > &hv, const Real weight)
virtual void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)