10#ifndef ROL_MEANSEMIDEVIATIONFROMTARGET_HPP
11#define ROL_MEANSEMIDEVIATIONFROMTARGET_HPP
58 ROL_TEST_FOR_EXCEPTION((
coeff_ <
zero), std::invalid_argument,
59 ">>> ERROR (ROL::MeanPlusSemiDeviationFromTarget): Coefficient must be positive!");
60 ROL_TEST_FOR_EXCEPTION(
plusFunction_ == nullPtr, std::invalid_argument,
61 ">>> ERROR (ROL::MeanSemiDeviation): PlusFunction pointer is null!");
90 ROL::ParameterList &list
91 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"Mean Plus Semi-Deviation From Target");
93 coeff_ = list.get<Real>(
"Coefficient");
94 target_ = list.get<Real>(
"Target");
103 const std::vector<Real> &xstat,
105 Real val = computeValue(obj,x,tol);
107 val_ += weight_ * (val +
coeff_ * pf);
111 const std::vector<Real> &xstat,
114 sampler.
sumAll(&val_,&ev,1);
120 const std::vector<Real> &xstat,
123 Real val = computeValue(obj,x,tol);
125 computeGradient(*dualVector_,obj,x,tol);
126 g_->axpy(weight_ * (one +
coeff_ * pf), *dualVector_);
130 std::vector<Real> &gstat,
132 const std::vector<Real> &xstat,
139 const std::vector<Real> &vstat,
141 const std::vector<Real> &xstat,
144 Real val = computeValue(obj,x,tol);
147 Real gv = computeGradVec(*dualVector_,obj,v,x,tol);
148 hv_->axpy(weight_ *
coeff_ * pf2 * gv, *dualVector_);
149 computeHessVec(*dualVector_,obj,v,x,tol);
150 hv_->axpy(weight_ * (one +
coeff_ * pf1), *dualVector_);
154 std::vector<Real> &hvstat,
156 const std::vector<Real> &vstat,
158 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.