44 #ifndef ROL_CHI2DIVERGENCE_HPP
45 #define ROL_CHI2DIVERGENCE_HPP
93 Real
zero(0), one(1), half(0.5), val(0);
95 val = (x < zero) ? ROL_INF<Real>() : half*(x-one)*(x-one);
98 val = (x < zero) ? ROL_INF<Real>() : x-one;
101 val = (x < zero) ? ROL_INF<Real>() : one;
104 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
105 ">>> (ROL::Chi2Divergence): Derivative order must be 0, 1, or 2!");
111 Real
zero(0), one(1), half(0.5), val(0);
113 val = (x < -one) ? -half : (half*x + one)*x;
116 val = (x < -one) ?
zero : x + one;
119 val = (x < -one) ?
zero : one;
122 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
123 ">>> (ROL::Chi2Divergence): Derivative order must be 0, 1, or 2!");
Real Fprimal(Real x, int deriv=0)
Implementation of the scalar primal F function.
Real Fdual(Real x, int deriv=0)
Implementation of the scalar dual F function.
Provides an interface for the chi-squared-divergence distributionally robust expectation.
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Chi2Divergence(const Real thresh)
Constructor.
Provides a general interface for the F-divergence distributionally robust expectation.
Chi2Divergence(ROL::ParameterList &parlist)
Constructor.