91 BPOE(
const Real threshold,
const Real order=1)
97 ROL::ParameterList &list = parlist.sublist(
"SOL").sublist(
"Probability").sublist(
"bPOE");
99 order_ = list.get<Real>(
"Moment Order");
117 const std::vector<Real> &xstat,
119 const Real
zero(0), one(1);
120 Real val = computeValue(obj,x,tol);
123 val_ += weight_*((
order_==one) ? bp : std::pow(bp,
order_));
128 const std::vector<Real> &xstat,
132 sampler.
sumAll(&val_,&bpoe,1);
133 return ((
order_==one) ? bpoe : std::pow(bpoe,one/
order_));
138 const std::vector<Real> &xstat,
140 const Real
zero(0), one(1), two(2);
141 Real val = computeValue(obj,x,tol);
144 computeGradient(*dualVector_,obj,x,tol);
145 Real pvalp0 = ((
order_==one) ? bp : std::pow(bp,
order_));
147 val_ += weight_ * pvalp0;
149 g_->axpy(weight_ * pvalp1, *dualVector_);
154 std::vector<Real> &gstat,
156 const std::vector<Real> &xstat,
158 const Real
zero(0), one(1);
159 std::vector<Real> myvals(2), gvals(2);
160 myvals[0] = val_; myvals[1] = gv_;
161 sampler.
sumAll(&myvals[0],&gvals[0],2);
162 if ( gvals[0] >
zero) {
165 g.
scale(xstat[0]/norm);
166 gstat[0] = gvals[1]/norm;
176 const std::vector<Real> &vstat,
178 const std::vector<Real> &xstat,
180 const Real
zero(0), one(1), two(2), three(3);
181 Real val = computeValue(obj,x,tol);
185 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
186 Real pvalp0 = ((
order_==one) ? bp : std::pow(bp,
order_));
187 Real pvalp1 = ((
order_==one) ? one
192 hvec_[0] += weight_ * pvalp0;
195 hvec_[3] += weight_ * pvalp1 * gv;
197 g_->axpy(weight_ * pvalp1, *dualVector_);
199 dualVec2_->axpy(weight_ * pvalp2 * gv, *dualVector_);
201 computeHessVec(*dualVector_,obj,v,x,tol);
202 hv_->axpy(weight_ * pvalp1, *dualVector_);
207 std::vector<Real> &hvstat,
209 const std::vector<Real> &vstat,
211 const std::vector<Real> &xstat,
213 const Real
zero(0), one(1), two(2);
214 std::vector<Real> gvals(5);
217 if ( gvals[0] >
zero ) {
218 Real norm0 = ((
order_==one) ? one
219 : ((
order_==two) ? std::sqrt(gvals[0])
221 Real norm1 = ((
order_==one) ? gvals[0]
223 hvstat[0] = (
order_-one)*((gvals[2]/norm0 - gvals[1]*gvals[1]/norm1)*vstat[0]
224 +xstat[0]*(gvals[4]/norm0 - gvals[3]*gvals[1]/norm1))
228 hv.
scale(xstat[0]/norm0);
231 Real coeff = -(
order_-one)*xstat[0]*(xstat[0]*gvals[3]+vstat[0]*gvals[1])/norm1+vstat[0]/norm0;
235 hv.
axpy((
order_-one)*vstat[0]*xstat[0]/norm0,*hv_);
238 hv.
axpy((
order_-one)*xstat[0]*xstat[0]/norm0,*hv_);
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
ROL::Ptr< Vector< Real > > dualVec1_
std::vector< Real > hvec_
BPOE(ROL::ParameterList &parlist)
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)
BPOE(const Real threshold, const Real order=1)
void updateValue(Objective< Real > &obj, 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)
ROL::Ptr< Vector< Real > > dualVec2_
void getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Real getValue(const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
void initialize(const Vector< Real > &x)
void updateGradient(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
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
Defines the linear algebra or vector space interface.
virtual void scale(const Real alpha)=0
Compute where .
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
virtual void zero()
Set to zero vector.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .