1 #ifndef NPSTAT_RECTANGLEQUADRATURE1D_HH_
2 #define NPSTAT_RECTANGLEQUADRATURE1D_HH_
24 enum {interval_quadrature = 1};
30 inline unsigned npoints()
const {
return npoints_;}
31 void getAllAbscissae(
long double* abscissae,
unsigned len)
const;
32 void getAllWeights(
long double* weights,
unsigned len)
const;
35 template <
typename FcnResult,
typename FcnArg>
37 long double a,
long double b)
const;
41 mutable std::vector<std::pair<long double, long double> > buf_;
46 inline std::vector<double> allabscissae2()
const
48 std::vector<double> abscissae(npoints_);
49 const long double step = 2.0L/npoints_;
50 for (
unsigned i=0; i<npoints_; ++i)
51 abscissae[i] = -1.0L + step*(i + 0.5L);
55 inline std::vector<double> allweights2()
const
57 std::vector<double> weights(npoints_);
58 const long double w = 2.0L/npoints_;
59 for (
unsigned i=0; i<npoints_; ++i)
64 template <
typename FcnResult,
typename FcnArg>
65 inline double integrate2(
const Functor1<FcnResult,FcnArg>& fcn,
66 const double a,
const double b)
const
74 #include "npstat/nm/RectangleQuadrature1D.icc"
Base class for quadratures on the [-1, 1] interval.
Interface definitions and concrete simple functors for a variety of functor-based calculations.
Definition: AbsIntervalQuadrature1D.hh:19
Definition: RectangleQuadrature1D.hh:22
long double integrate(const Functor1< FcnResult, FcnArg > &fcn, long double a, long double b) const
Definition: AbsArrayProjector.hh:14
Definition: SimpleFunctors.hh:58