57 BPOE(
const Real threshold,
const Real order=1)
63 ROL::ParameterList &list = parlist.sublist(
"SOL").sublist(
"Probability").sublist(
"bPOE");
65 order_ = list.get<Real>(
"Moment Order");
83 const std::vector<Real> &xstat,
85 const Real
zero(0), one(1);
86 Real val = computeValue(obj,x,tol);
89 val_ += weight_*((
order_==one) ? bp : std::pow(bp,
order_));
94 const std::vector<Real> &xstat,
98 sampler.
sumAll(&val_,&bpoe,1);
99 return ((
order_==one) ? bpoe : std::pow(bpoe,one/
order_));
104 const std::vector<Real> &xstat,
106 const Real
zero(0), one(1), two(2);
107 Real val = computeValue(obj,x,tol);
110 computeGradient(*dualVector_,obj,x,tol);
111 Real pvalp0 = ((
order_==one) ? bp : std::pow(bp,
order_));
113 val_ += weight_ * pvalp0;
115 g_->axpy(weight_ * pvalp1, *dualVector_);
120 std::vector<Real> &gstat,
122 const std::vector<Real> &xstat,
124 const Real
zero(0), one(1);
125 std::vector<Real> myvals(2), gvals(2);
126 myvals[0] = val_; myvals[1] = gv_;
127 sampler.
sumAll(&myvals[0],&gvals[0],2);
128 if ( gvals[0] >
zero) {
131 g.
scale(xstat[0]/norm);
132 gstat[0] = gvals[1]/norm;
142 const std::vector<Real> &vstat,
144 const std::vector<Real> &xstat,
146 const Real
zero(0), one(1), two(2), three(3);
147 Real val = computeValue(obj,x,tol);
151 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
152 Real pvalp0 = ((
order_==one) ? bp : std::pow(bp,
order_));
153 Real pvalp1 = ((
order_==one) ? one
158 hvec_[0] += weight_ * pvalp0;
161 hvec_[3] += weight_ * pvalp1 * gv;
163 g_->axpy(weight_ * pvalp1, *dualVector_);
165 dualVec2_->axpy(weight_ * pvalp2 * gv, *dualVector_);
167 computeHessVec(*dualVector_,obj,v,x,tol);
168 hv_->axpy(weight_ * pvalp1, *dualVector_);
173 std::vector<Real> &hvstat,
175 const std::vector<Real> &vstat,
177 const std::vector<Real> &xstat,
179 const Real
zero(0), one(1), two(2);
180 std::vector<Real> gvals(5);
183 if ( gvals[0] >
zero ) {
184 Real norm0 = ((
order_==one) ? one
185 : ((
order_==two) ? std::sqrt(gvals[0])
187 Real norm1 = ((
order_==one) ? gvals[0]
189 hvstat[0] = (
order_-one)*((gvals[2]/norm0 - gvals[1]*gvals[1]/norm1)*vstat[0]
190 +xstat[0]*(gvals[4]/norm0 - gvals[3]*gvals[1]/norm1))
194 hv.
scale(xstat[0]/norm0);
197 Real coeff = -(
order_-one)*xstat[0]*(xstat[0]*gvals[3]+vstat[0]*gvals[1])/norm1+vstat[0]/norm0;
201 hv.
axpy((
order_-one)*vstat[0]*xstat[0]/norm0,*hv_);
204 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 .