10 #ifndef ROL_CHEBYSHEVKUSUOKA_HPP
11 #define ROL_CHEBYSHEVKUSUOKA_HPP
14 #include "ROL_GaussChebyshev1Quadrature.hpp"
15 #include "ROL_GaussChebyshev2Quadrature.hpp"
16 #include "ROL_GaussChebyshev3Quadrature.hpp"
75 ROL_TEST_FOR_EXCEPTION(
lower_ >
upper_, std::invalid_argument,
76 ">>> ERROR (ROL::ChebyshevSpectral): Lower bound exceeds upper!");
77 ROL_TEST_FOR_EXCEPTION(
lower_ < static_cast<Real>(0), std::invalid_argument,
78 ">>> ERROR (ROL::ChebyshevSpectral): Lower bound is less than zero!");
79 ROL_TEST_FOR_EXCEPTION(static_cast<Real>(1) <
upper_, std::invalid_argument,
80 ">>> ERROR (ROL::ChebyshevSpectral): Upper bound is greater than one!");
81 ROL_TEST_FOR_EXCEPTION((wType_ < 1 || wType_ > 3), std::invalid_argument,
82 ">>> ERROR (ROL::ChebyshevSpectral): Weight must be 1, 2 or 3!");
83 ROL_TEST_FOR_EXCEPTION(
plusFunction_ == ROL::nullPtr, std::invalid_argument,
84 ">>> ERROR (ROL::ChebyshevSpectral): PlusFunction pointer is null!");
88 ROL::Ptr<Quadrature1D<Real> > quad;
90 quad = ROL::makePtr<GaussChebyshev1Quadrature<Real>>(
nQuad_);
93 quad = ROL::makePtr<GaussChebyshev2Quadrature<Real>>(
nQuad_);
96 quad = ROL::makePtr<GaussChebyshev3Quadrature<Real>>(
nQuad_);
100 Real sum(0), half(0.5), one(1);
101 for (
int i = 0; i <
nQuad_; ++i) {
104 for (
int i = 0; i <
nQuad_; ++i) {
126 ROL::ParameterList &list
127 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"Chebyshev Spectral Risk");
129 lower_ = list.get(
"Lower Bound",0.0);
130 upper_ = list.get(
"Upper Bound",1.0);
131 nQuad_ = list.get(
"Number of Quadrature Points",5);
132 wType_ = list.get(
"Weight Type",1);
148 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.