|
Go to the documentation of this file. 1 #ifndef NPSTAT_MATHUTILS_HH_
2 #define NPSTAT_MATHUTILS_HH_
25 double *x1, double *x2);
36 unsigned solveCubic( double p, double q, double r, double v3[3]);
45 double x2, double y2, double* extremumCoordinate,
46 double* extremumValue);
68 template< typename Numeric>
70 unsigned degree, long double x);
76 template< typename Numeric>
78 long double x, long double *value, long double *deriv);
87 template< typename Numeric>
89 Numeric* integralCoeffs);
96 template< typename Numeric>
98 unsigned degree, long double x);
104 template< typename Numeric>
106 unsigned degree, long double x);
113 template< typename Numeric>
115 unsigned degree, long double x);
118 template< typename Numeric>
120 long double lambda, long double x);
126 template< typename Numeric>
135 template< typename Numeric1, typename Numeric2>
137 Numeric2* monoCoeffs);
143 template< typename Numeric>
145 long double xmin, long double xmax,
153 template< typename Functor, typename Numeric>
155 long double xmin, long double xmax,
156 unsigned degree, Numeric *coeffs);
166 template< typename Numeric>
168 long double xmin, long double xmax,
169 Numeric* integralCoeffs);
177 template< typename Numeric>
179 long double xmin, long double xmax,
180 Numeric* derivativeCoeffs);
183 inline double polySeriesSum2( const double *c, const unsigned degreep1,
190 inline std::pair<double,double> polyAndDeriv2(
191 const double *c, const unsigned degreep1,
197 return std::pair<double,double>(p, d);
200 inline std::vector<double> polyIntegralCoeffs2( const double *c, const unsigned degreep1)
203 std::vector<double> tmp(degreep1+1U);
208 inline double legendreSeriesSum2( const double *c, const unsigned degreep1,
215 inline double hermiteSeriesSumProb2( const double *c, const unsigned degreep1,
222 inline double hermiteSeriesSumPhys2( const double *c, const unsigned degreep1,
229 inline double gegenbauerSeriesSum2( const double *c, const unsigned degreep1,
230 const double lambda, const double x)
236 inline double chebyshevSeriesSum2( const double *c, const unsigned degreep1,
237 const double xmin, const double xmax,
244 inline std::vector<double> chebyshevIntegralCoeffs2( const double *c, const unsigned degreep1,
245 const double xmin, const double xmax)
248 std::vector<double> tmp(degreep1+1U);
253 inline std::vector<double> chebyshevDerivativeCoeffs2( const double *c, const unsigned degreep1,
254 const double xmin, const double xmax)
257 std::vector<double> tmp(degreep1-1U);
259 tmp.empty() ? ( double *)0 : &tmp[0]);
263 inline std::vector<double> chebyshevMonomialCoeffs2( const double *c, const unsigned degreep1)
266 std::vector<double> tmp(degreep1);
271 template< typename Functor>
272 inline std::vector<double> chebyshevSeriesCoeffs2( const Functor& f,
273 const double xmin, const double xmax, const unsigned degree)
275 std::vector<double> tmp(degree+1U);
280 inline std::vector<double> solveQuadratic2( const double b, const double c)
284 return std::vector<double>(x, x+nRoots);
287 inline std::vector<double> solveCubic2( const double p, const double q,
291 const unsigned nRoots = solveCubic(p, q, r, v3);
292 return std::vector<double>(v3, v3+nRoots);
297 #include "npstat/nm/MathUtils.icc"
Definition: AbsArrayProjector.hh:14
long double gegenbauerSeriesSum(const Numeric *coeffs, unsigned degree, long double lambda, long double x)
void chebyshevSeriesCoeffs(const Functor &f, long double xmin, long double xmax, unsigned degree, Numeric *coeffs)
long double chebyshevSeriesSum(const Numeric *coeffs, unsigned degree, long double x)
void polyAndDeriv(const Numeric *coeffs, unsigned degree, long double x, long double *value, long double *deriv)
long double hermiteSeriesSumProb(const Numeric *coeffs, unsigned degree, long double x)
void chebyshevDerivativeCoeffs(const Numeric *coeffs, unsigned degree, long double xmin, long double xmax, Numeric *derivativeCoeffs)
double ndUnitSphereArea(unsigned n)
long double hermiteSeriesSumPhys(const Numeric *coeffs, unsigned degree, long double x)
unsigned solveCubic(double p, double q, double r, double v3[3])
void chebyshevIntegralCoeffs(const Numeric *coeffs, unsigned degree, long double xmin, long double xmax, Numeric *integralCoeffs)
void chebyshevMonomialCoeffs(const Numeric1 *coeffs, unsigned degree, Numeric2 *monoCoeffs)
bool parabolicExtremum(double x0, double y0, double x1, double y1, double x2, double y2, double *extremumCoordinate, double *extremumValue)
void polyIntegralCoeffs(const Numeric *coeffs, unsigned degree, Numeric *integralCoeffs)
unsigned solveQuadratic(double b, double c, double *x1, double *x2)
long double legendreSeriesSum(const Numeric *coeffs, unsigned degree, long double x)
double ndUnitSphereVolume(unsigned n)
long double polySeriesSum(const Numeric *coeffs, unsigned degree, long double x)
|