npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
continuousDegreeTaper.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_CONTINUOUSDEGREETAPER_HH_
2 #define NPSTAT_CONTINUOUSDEGREETAPER_HH_
3 
4 /*!
5 // \file continuousDegreeTaper.hh
6 //
7 // \brief A function that makes simple tapers for use with LocalPolyFilter1D
8 //
9 // Author: I. Volobouev
10 //
11 // September 2013
12 */
13 
14 #include <vector>
15 
16 namespace npstat {
17  /**
18  // The input argument "degree" must be non-negative (an exception
19  // will be thrown if a negative value is given).
20  //
21  // If "degree" is an exact integer, the resulting vector "vtaper"
22  // will have size degree + 1, with all elements set to 1.0.
23  //
24  // If "degree" is not an exact integer, the resulting vector "vtaper"
25  // will have size ceil(degree) + 1, with all elements except the last one
26  // set to 1.0. The last element will be set to sqrt(degree - floor(degree)).
27  // For a certain definition of the number of effective degrees of
28  // freedom, this results in a direct correspondence between the poly
29  // degree and the number of degrees of freedom at large bandwidth values.
30  //
31  // The resulting vector can be used as an argument of the LocalPolyFilter1D
32  // constructor, with constructor "taper" argument set to &vtaper[0] and
33  // "maxDegree" argument set to (vtaper.size() - 1).
34  */
35  void continuousDegreeTaper(double degree, std::vector<double>* vtaper);
36 
37 #ifdef SWIG
38  inline std::vector<double> contDegreeTaper(const double degree)
39  {
40  std::vector<double> tmp;
41  continuousDegreeTaper(degree, &tmp);
42  return tmp;
43  }
44 #endif // SWIG
45 }
46 
47 #endif // NPSTAT_CONTINUOUSDEGREETAPER_HH_
Definition: AbsArrayProjector.hh:14
void continuousDegreeTaper(double degree, std::vector< double > *vtaper)