10#ifndef ROL_SMOOTHEDPOE_HPP
11#define ROL_SMOOTHEDPOE_HPP
52 const Real one(1), two(2);
55 Real ex = std::exp(-two*x/
eps_);
58 else if (deriv == 1) {
59 Real ex = std::exp(-two*x/
eps_);
60 val = (two/
eps_)*ex/std::pow(one+ex,2);
62 else if (deriv == 2) {
63 Real ex = std::exp(two*x/
eps_);
64 val = std::pow(two/
eps_,2)*ex*(one-ex)/std::pow(one+ex,3);
76 ROL::ParameterList &list = parlist.sublist(
"SOL").sublist(
"Probability").sublist(
"Smoothed POE");
78 eps_ = list.get<Real>(
"Smoothing Parameter");
83 const std::vector<Real> &xstat,
85 Real val = computeValue(obj,x,tol);
93 const std::vector<Real> &xstat,
96 sampler.
sumAll(&val_,&spoe,1);
102 const std::vector<Real> &xstat,
104 Real val = computeValue(obj,x,tol);
107 computeGradient(*dualVector_,obj,x,tol);
108 g_->axpy(weight_*sp,*dualVector_);
113 std::vector<Real> &gstat,
115 const std::vector<Real> &xstat,
122 const std::vector<Real> &vstat,
124 const std::vector<Real> &xstat,
126 Real val = computeValue(obj,x,tol);
131 computeHessVec(*dualVector_,obj,v,x,tol);
132 hv_->axpy(weight_*sp1,*dualVector_);
136 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
137 hv_->axpy(weight_*sp2*gv,*dualVector_);
142 std::vector<Real> &hvstat,
144 const std::vector<Real> &vstat,
146 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.