94 TEUCHOS_TEST_FOR_EXCEPTION((
prob_ <= zero) || (
prob_ >= one), std::invalid_argument,
95 ">>> ERROR (ROL::CVaR): Confidence level must be between 0 and 1!");
96 TEUCHOS_TEST_FOR_EXCEPTION((
coeff_ < zero) || (
coeff_ > one), std::invalid_argument,
97 ">>> ERROR (ROL::CVaR): Convex combination parameter must be positive!");
98 TEUCHOS_TEST_FOR_EXCEPTION(
plusFunction_ == Teuchos::null, std::invalid_argument,
99 ">>> ERROR (ROL::CVaR): PlusFunction pointer is null!");
112 CVaR(
const Real prob,
const Real coeff,
129 CVaR( Teuchos::ParameterList &parlist )
131 Teuchos::ParameterList &list
132 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"CVaR");
134 prob_ = list.get<Real>(
"Confidence Level");
135 coeff_ = list.get<Real>(
"Convex Combination Parameter");
160 void update(
const Real val,
const Real weight) {
188 sampler.
sumAll(&val,&cvar,1);
196 sampler.
sumAll(&val,&var,1);
208 sampler.
sumAll(&val,&var,1);
Teuchos::RCP< Vector< Real > > dualVector_
Real getValue(SampleGenerator< Real > &sampler)
Return risk measure value.
void getGradient(Vector< Real > &g, SampleGenerator< Real > &sampler)
Return risk measure (sub)gradient.
void getHessVec(Vector< Real > &hv, SampleGenerator< Real > &sampler)
Return risk measure Hessian-times-a-vector.
Provides an interface for a convex combination of the expected value and the conditional value-at-ris...
void update(const Real val, const Real weight)
Update internal risk measure storage for value computation.
void sumAll(Real *input, Real *output, int dim) const
CVaR(const Real prob, const Real coeff, const Teuchos::RCP< PlusFunction< Real > > &pf)
Constructor.
void update(const Real val, const Vector< Real > &g, const Real weight)
Update internal risk measure storage for gradient computation.
Defines the linear algebra or vector space interface.
Teuchos::RCP< const Vector< Real > > getVector(void) const
void setVector(const Vector< Real > &vec)
void setStatistic(const Real stat)
Teuchos::RCP< PlusFunction< Real > > plusFunction_
void update(const Real val, const Vector< Real > &g, const Real gv, const Vector< Real > &hv, const Real weight)
Update internal risk measure storage for Hessian-time-a-vector computation.
void checkInputs(void) const
void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
Reset internal risk measure storage. Called for value and gradient computation.
void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x, Teuchos::RCP< Vector< Real > > &v0, const Vector< Real > &v)
Reset internal risk measure storage. Called for Hessian-times-a-vector computation.
Teuchos::RCP< const StdVector< Real > > getStatistic(void) const
virtual void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
Reset internal risk measure storage. Called for value and gradient computation.
Provides the interface to implement risk measures.
CVaR(Teuchos::ParameterList &parlist)
Constructor.