10 #ifndef ROL_CHI2DIVERGENCE_HPP
11 #define ROL_CHI2DIVERGENCE_HPP
58 Real
Fprimal(Real x,
int deriv = 0)
const {
59 Real
zero(0), one(1), half(0.5), val(0);
61 val = (x < zero) ? ROL_INF<Real>() : half*(x-one)*(x-one);
64 val = (x < zero) ? ROL_INF<Real>() : x-one;
67 val = (x < zero) ? ROL_INF<Real>() : one;
70 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
71 ">>> (ROL::Chi2Divergence): Derivative order must be 0, 1, or 2!");
76 Real
Fdual(Real x,
int deriv = 0)
const {
77 Real
zero(0), one(1), half(0.5), val(0);
79 val = (x < -one) ? -half : (half*x + one)*x;
82 val = (x < -one) ?
zero : x + one;
85 val = (x < -one) ?
zero : one;
88 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
89 ">>> (ROL::Chi2Divergence): Derivative order must be 0, 1, or 2!");
Provides an interface for the chi-squared-divergence distributionally robust expectation.
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Real Fdual(Real x, int deriv=0) const
Implementation of the scalar dual F function.
Chi2Divergence(const Real thresh)
Constructor.
Provides a general interface for the F-divergence distributionally robust expectation.
Chi2Divergence(ROL::ParameterList &parlist)
Constructor.
Real Fprimal(Real x, int deriv=0) const
Implementation of the scalar primal F function.