44#ifndef ROL_SMOOTHEDPOE_HPP
45#define ROL_SMOOTHEDPOE_HPP
86 const Real one(1), two(2);
89 Real ex = std::exp(-two*x/
eps_);
92 else if (deriv == 1) {
93 Real ex = std::exp(-two*x/
eps_);
94 val = (two/
eps_)*ex/std::pow(one+ex,2);
96 else if (deriv == 2) {
97 Real ex = std::exp(two*x/
eps_);
98 val = std::pow(two/
eps_,2)*ex*(one-ex)/std::pow(one+ex,3);
110 ROL::ParameterList &list = parlist.sublist(
"SOL").sublist(
"Probability").sublist(
"Smoothed POE");
112 eps_ = list.get<Real>(
"Smoothing Parameter");
117 const std::vector<Real> &xstat,
119 Real val = computeValue(obj,x,tol);
127 const std::vector<Real> &xstat,
130 sampler.
sumAll(&val_,&spoe,1);
136 const std::vector<Real> &xstat,
138 Real val = computeValue(obj,x,tol);
141 computeGradient(*dualVector_,obj,x,tol);
142 g_->axpy(weight_*sp,*dualVector_);
147 std::vector<Real> &gstat,
149 const std::vector<Real> &xstat,
156 const std::vector<Real> &vstat,
158 const std::vector<Real> &xstat,
160 Real val = computeValue(obj,x,tol);
165 computeHessVec(*dualVector_,obj,v,x,tol);
166 hv_->axpy(weight_*sp1,*dualVector_);
170 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
171 hv_->axpy(weight_*sp2*gv,*dualVector_);
176 std::vector<Real> &hvstat,
178 const std::vector<Real> &vstat,
180 const std::vector<Real> &xstat,
Provides the interface to evaluate objective functions.
Provides the interface to implement any functional that maps a random variable to a (extended) real n...
void sumAll(Real *input, Real *output, int dim) const
Real getValue(const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
void updateGradient(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
SmoothedPOE(const Real threshold, const Real eps)
SmoothedPOE(ROL::ParameterList &parlist)
void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
void getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Real smoothHeaviside(const Real x, const int deriv=0) const
void updateHessVec(Objective< Real > &obj, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
void getHessVec(Vector< Real > &hv, std::vector< Real > &hvstat, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Defines the linear algebra or vector space interface.
Real ROL_EPSILON(void)
Platform-dependent machine epsilon.