1 #ifndef NPSTAT_CONTORTHOPOLY1DQ_HH_
2 #define NPSTAT_CONTORTHOPOLY1DQ_HH_
19 #include "npstat/nm/RecurrenceQ.hh"
26 typedef std::pair<quad_float,quad_float> MeasurePoint;
36 template<
typename Numeric1,
typename Numeric2>
38 const std::vector<std::pair<Numeric1,Numeric2> >& measure,
40 bool shiftMeasureCoords =
true);
43 template<
typename Numeric>
45 const std::vector<Numeric>& coords,
47 bool shiftMeasureCoords =
true);
50 template<
typename Numeric1,
typename Numeric2,
class OrthoPoly>
52 const std::vector<std::pair<Numeric1,Numeric2> >& measure,
53 const OrthoPoly& ops,
bool shiftMeasureCoords =
false);
59 template<
typename Numeric,
class OrthoPoly>
61 const std::vector<Numeric>& coords,
62 const OrthoPoly& ops,
bool shiftMeasureCoords =
false);
73 inline bool areAllWeightsEqual()
const {
return allWeightsEqual_;}
74 inline quad_float measureShift()
const {
return shiftX_;}
75 inline quad_float meanCoordinate()
const {
return meanX_;}
76 inline quad_float location()
const {
return meanX_;}
77 inline quad_float scale()
const {
return 1.0;}
84 quad_float
poly(
unsigned deg, quad_float x)
const;
88 unsigned deg1,
unsigned deg2, quad_float x)
const;
95 template <
typename Numeric>
96 inline void allPolys(
const quad_float x,
const unsigned maxdeg,
97 Numeric* polyValues)
const
98 {getAllPolys(x - shiftX_, maxdeg, polyValues);}
104 inline void allpoly(
const long double x,
long double* values,
105 const unsigned maxdeg)
const
106 {getAllPolys(x - shiftX_, maxdeg, values);}
124 template<
typename Numeric1,
typename Numeric2>
125 void copyMeasure(
const std::vector<std::pair<Numeric1,Numeric2> >& inMeasure);
127 template<
typename Numeric>
128 void copyInputCoords(
const std::vector<Numeric>& inCoords);
130 void calcMeanXandWeightSums(
bool shiftTheMeasure);
132 template<
class OrthoPoly>
133 quad_float sigma(
const OrthoPoly& ops,
int k,
int l,
137 template<
class OrthoPoly>
138 void calculateMonicAverages(
const OrthoPoly& ops, quad_float* averages,
141 template<
class OrthoPoly>
142 void calcRecurrenceModifiedChebyshev(
const OrthoPoly& ops);
144 quad_float normpoly(
unsigned degree, quad_float x)
const;
146 std::pair<quad_float,quad_float> twonormpoly(
147 unsigned deg1,
unsigned deg2, quad_float x)
const;
149 template <
typename Numeric>
150 void getAllPolys(quad_float x,
unsigned maxdeg, Numeric *polyValues)
const;
152 std::vector<MeasurePoint> measure_;
153 std::vector<Private::RecurrenceQ> rCoeffs_;
161 bool allWeightsEqual_;
165 #include "npstat/nm/ContOrthoPoly1DQ.icc"
Enumeration of methods used to create orthogonal polynomials with discrete weights.
Definition: ContOrthoPoly1DQ.hh:24
void allPolys(const quad_float x, const unsigned maxdeg, Numeric *polyValues) const
Definition: ContOrthoPoly1DQ.hh:96
quad_float empiricalKroneckerDelta(unsigned deg1, unsigned deg2) const
void allpoly(const long double x, long double *values, const unsigned maxdeg) const
Definition: ContOrthoPoly1DQ.hh:104
quad_float effectiveSampleSize() const
ContOrthoPoly1DQ * clone() const
Definition: ContOrthoPoly1DQ.hh:68
std::pair< quad_float, quad_float > polyPair(unsigned deg1, unsigned deg2, quad_float x) const
ContOrthoPoly1DQ(unsigned maxDegree, const std::vector< Numeric > &coords, const OrthoPoly &ops, bool shiftMeasureCoords=false)
ContOrthoPoly1DQ(unsigned maxDegree, const std::vector< Numeric > &coords, OrthoPolyMethod m=OPOLY_STIELTJES, bool shiftMeasureCoords=true)
Matrix< quad_float > empiricalKroneckerMatrix(unsigned maxdeg) const
unsigned maxDegree() const
Definition: ContOrthoPoly1DQ.hh:72
ContOrthoPoly1DQ(unsigned maxDegree, const std::vector< std::pair< Numeric1, Numeric2 > > &measure, const OrthoPoly &ops, bool shiftMeasureCoords=false)
ContOrthoPoly1DQ(unsigned maxDegree, const std::vector< std::pair< Numeric1, Numeric2 > > &measure, OrthoPolyMethod m=OPOLY_STIELTJES, bool shiftMeasureCoords=true)
quad_float poly(unsigned deg, quad_float x) const
Definition: AbsArrayProjector.hh:14
OrthoPolyMethod
Definition: OrthoPolyMethod.hh:20