44#ifndef ROL_MEANSEMIDEVIATIONFROMTARGET_HPP
45#define ROL_MEANSEMIDEVIATIONFROMTARGET_HPP
93 ROL_TEST_FOR_EXCEPTION((
coeff_ <
zero), std::invalid_argument,
94 ">>> ERROR (ROL::MeanPlusSemiDeviationFromTarget): Coefficient must be positive!");
95 ROL_TEST_FOR_EXCEPTION(
plusFunction_ == nullPtr, std::invalid_argument,
96 ">>> ERROR (ROL::MeanSemiDeviation): PlusFunction pointer is null!");
125 ROL::ParameterList &list
126 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"Mean Plus Semi-Deviation From Target");
128 coeff_ = list.get<Real>(
"Coefficient");
129 target_ = list.get<Real>(
"Target");
138 const std::vector<Real> &xstat,
140 Real val = computeValue(obj,x,tol);
142 val_ += weight_ * (val +
coeff_ * pf);
146 const std::vector<Real> &xstat,
149 sampler.
sumAll(&val_,&ev,1);
155 const std::vector<Real> &xstat,
158 Real val = computeValue(obj,x,tol);
160 computeGradient(*dualVector_,obj,x,tol);
161 g_->axpy(weight_ * (one +
coeff_ * pf), *dualVector_);
165 std::vector<Real> &gstat,
167 const std::vector<Real> &xstat,
174 const std::vector<Real> &vstat,
176 const std::vector<Real> &xstat,
179 Real val = computeValue(obj,x,tol);
182 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
183 hv_->axpy(weight_ *
coeff_ * pf2 * gv, *dualVector_);
184 computeHessVec(*dualVector_,obj,v,x,tol);
185 hv_->axpy(weight_ * (one +
coeff_ * pf1), *dualVector_);
189 std::vector<Real> &hvstat,
191 const std::vector<Real> &vstat,
193 const std::vector<Real> &xstat,
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
void updateGradient(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)
Real getValue(const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
void checkInputs(void) const
Ptr< PlusFunction< Real > > plusFunction_
MeanSemiDeviationFromTarget(const Real coeff, const Real target, const Ptr< PlusFunction< Real > > &pf)
Constructor.
MeanSemiDeviationFromTarget(ROL::ParameterList &parlist)
Constructor.
void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
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 getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
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.