1 #ifndef NPSTAT_GAUSSHERMITEQUADRATURE_HH_
2 #define NPSTAT_GAUSSHERMITEQUADRATURE_HH_
28 enum {interval_quadrature = 0};
45 inline unsigned npoints()
const {
return npoints_;}
60 void getWeights(
long double* weights,
unsigned len)
const;
66 template <
typename FcnResult,
typename FcnArg>
70 template <
typename FcnResult,
typename FcnArg>
90 const long double* a_;
91 const long double* w_;
92 mutable std::vector<std::pair<long double, long double> > buf_;
97 inline std::vector<double> abscissae2()
const
99 return std::vector<double>(a_, a_+npoints_/2U);
102 inline std::vector<double> weights2()
const
104 return std::vector<double>(w_, w_+npoints_/2U);
107 inline std::vector<double> allabscissae2()
const
110 std::vector<double> abscissae(npoints_);
111 const unsigned halfpoints = npoints_/2;
112 for (
unsigned i=0; i<halfpoints; ++i)
113 abscissae[i] = -a_[halfpoints - 1U - i];
114 for (
unsigned i=halfpoints; i<npoints_; ++i)
115 abscissae[i] = a_[i - halfpoints];
119 inline std::vector<double> allweights2()
const
122 std::vector<double> weights(npoints_);
123 const unsigned halfpoints = npoints_/2;
124 for (
unsigned i=0; i<halfpoints; ++i)
125 weights[i] = w_[halfpoints - 1U - i];
126 for (
unsigned i=halfpoints; i<npoints_; ++i)
127 weights[i] = w_[i - halfpoints];
131 template <
typename FcnResult,
typename FcnArg>
132 inline double integrate2(
const Functor1<FcnResult,FcnArg>& fcn)
const
137 template <
typename FcnResult,
typename FcnArg>
138 inline double integrateProb2(
const double mean,
const double sigma,
139 const Functor1<FcnResult,FcnArg>& fcn)
const
147 #include "npstat/nm/GaussHermiteQuadrature.icc"
Interface definitions and concrete simple functors for a variety of functor-based calculations.
Definition: GaussHermiteQuadrature.hh:26
void getAllWeights(long double *weights, unsigned len) const
void getAbscissae(long double *abscissae, unsigned len) const
static unsigned minimalExactRule(unsigned polyDegree)
long double integrate(const Functor1< FcnResult, FcnArg > &fcn) const
void getWeights(long double *weights, unsigned len) const
long double integrateProb(long double mean, long double sigma, const Functor1< FcnResult, FcnArg > &fcn) const
GaussHermiteQuadrature(unsigned npoints)
void getAllAbscissae(long double *abscissae, unsigned len) const
static bool isAllowed(unsigned npoints)
unsigned npoints() const
Definition: GaussHermiteQuadrature.hh:45
static std::vector< unsigned > allowedNPonts()
Definition: AbsArrayProjector.hh:14
Definition: SimpleFunctors.hh:58