33 std::vector<double>
x;
34 std::vector<double>
y;
39 double result[21] ={ 7.694599e-23, 1.027977e-18, 5.052271e-15, 9.134720e-12, 6.075883e-09,
40 1.486720e-06, 1.338302e-04, 4.431848e-03, 5.399097e-02, 2.419707e-01,
41 3.989423e-01, 2.419707e-01, 5.399097e-02, 4.431848e-03, 1.338302e-04,
42 1.486720e-06, 6.075883e-09, 9.134720e-12, 5.052271e-15, 1.027977e-18,
46 double sumfilter = std::accumulate(y.begin(),y.end(),0.);
47 std::pair<double,double> tmp;
49 std::transform(y.begin(),y.end(),y.begin(),std::bind2nd(std::plus<double>(),( 1./x.size() ) ) );
50 sumfilter = std::accumulate(y.begin(),y.end(),0.);
54 void testGauss_1deriv()
57 std::vector<double>
x;
58 std::vector<double>
y;
59 double epsilon = 5e-5;
63 double firstderiv[21] = {
64 7.694599e-22, 9.251796e-18, 4.041817e-14, 6.394304e-11, 3.645530e-08, 7.433598e-06, 5.353209e-04 , 1.329555e-02, 1.079819e-01, 2.419707e-01,
65 0.000000e+00, -2.419707e-01, -1.079819e-01, -1.329555e-02, -5.353209e-04, -7.433598e-06, -3.645530e-08, -6.394304e-11 -4.041817e-14 -9.251796e-18,
71 std::pair<double,double> tmp;
73 double sumfilter = std::accumulate(y.begin(),y.end(),0.0);
76 sumfilter = std::accumulate(x.begin(),x.end(),0.0);
80 void testGetGaussian()
82 std::vector<double> xx;
92 int main(
int argc,
char **argv) {
#define unit_assert_equal(x, y, epsilon)
void seq(TReal from, TReal to, std::vector< TReal > &result)
generates the sequence from, from+/-1, ..., to (identical to from:to).
TReal getGaussianFilterQuantile(std::vector< TReal > &gauss, TReal fwhm=20, TReal quantile=0.01)
generate the gauss filter function for filtering of peaks with fwhm (full width at half max) ...
int main(int argc, char **argv)
void scale(InputIterator begin, InputIterator end, std::pair< typename std::iterator_traits< InputIterator >::value_type, typename std::iterator_traits< InputIterator >::value_type > &scaled, bool center=true, bool scale=true)
scale centers and/or scales all values from begin in to end.
TReal getGaussianFilter(std::vector< TReal > &gauss, TReal fwhm=20)
generate the gauss filter function for filtering of peaks with fwhm (full width at half max) ...
KernelTraitsBase< Kernel >::space_type::abscissa_type x
TReal getGaussian1DerFilter(std::vector< TReal > &gauss1d, TReal fwhm=20)
generate first derivative Gauss
KernelTraitsBase< Kernel >::space_type::ordinate_type y
First derivative of Gaussian.
Da Comparator - constant mass error.