44 #ifndef ROL_CHEBYSHEVKUSUOKA_HPP
45 #define ROL_CHEBYSHEVKUSUOKA_HPP
48 #include "ROL_GaussChebyshev1Quadrature.hpp"
49 #include "ROL_GaussChebyshev2Quadrature.hpp"
50 #include "ROL_GaussChebyshev3Quadrature.hpp"
109 ROL_TEST_FOR_EXCEPTION(
lower_ >
upper_, std::invalid_argument,
110 ">>> ERROR (ROL::ChebyshevSpectral): Lower bound exceeds upper!");
111 ROL_TEST_FOR_EXCEPTION(
lower_ < static_cast<Real>(0), std::invalid_argument,
112 ">>> ERROR (ROL::ChebyshevSpectral): Lower bound is less than zero!");
113 ROL_TEST_FOR_EXCEPTION(static_cast<Real>(1) <
upper_, std::invalid_argument,
114 ">>> ERROR (ROL::ChebyshevSpectral): Upper bound is greater than one!");
115 ROL_TEST_FOR_EXCEPTION((wType_ < 1 || wType_ > 3), std::invalid_argument,
116 ">>> ERROR (ROL::ChebyshevSpectral): Weight must be 1, 2 or 3!");
117 ROL_TEST_FOR_EXCEPTION(
plusFunction_ == ROL::nullPtr, std::invalid_argument,
118 ">>> ERROR (ROL::ChebyshevSpectral): PlusFunction pointer is null!");
122 ROL::Ptr<Quadrature1D<Real> > quad;
124 quad = ROL::makePtr<GaussChebyshev1Quadrature<Real>>(
nQuad_);
127 quad = ROL::makePtr<GaussChebyshev2Quadrature<Real>>(
nQuad_);
130 quad = ROL::makePtr<GaussChebyshev3Quadrature<Real>>(
nQuad_);
134 Real sum(0), half(0.5), one(1);
135 for (
int i = 0; i <
nQuad_; ++i) {
138 for (
int i = 0; i <
nQuad_; ++i) {
160 ROL::ParameterList &list
161 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"Chebyshev Spectral Risk");
163 lower_ = list.get(
"Lower Bound",0.0);
164 upper_ = list.get(
"Upper Bound",1.0);
165 nQuad_ = list.get(
"Number of Quadrature Points",5);
166 wType_ = list.get(
"Weight Type",1);
182 const int nQuad,
const int wType,
Provides an interface for the Chebyshev-Spectral risk measure.
void buildMixedQuantile(const std::vector< Real > &pts, const std::vector< Real > &wts, const ROL::Ptr< PlusFunction< Real > > &pf)
ChebyshevSpectral(ROL::ParameterList &parlist)
Constructor.
void checkInputs(void) const
void initializeQuad(void)
Provides an interface for spectral risk measures.
ROL::Ptr< PlusFunction< Real > > plusFunction_
ChebyshevSpectral(const Real lower, const Real upper, const int nQuad, const int wType, const ROL::Ptr< PlusFunction< Real > > &pf)
Constructor.