Mercurial > hg > qm-dsp
comparison maths/MathUtilities.h @ 414:7e8d1f26b098
Fix compiler warnings with -Wall -Wextra
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 28 Sep 2015 12:33:17 +0100 |
parents | 59b151f13b3e |
children | d583feeeed7a |
comparison
equal
deleted
inserted
replaced
413:ec7318974497 | 414:7e8d1f26b098 |
---|---|
33 | 33 |
34 /** | 34 /** |
35 * Return through min and max pointers the highest and lowest | 35 * Return through min and max pointers the highest and lowest |
36 * values in the given array of the given length. | 36 * values in the given array of the given length. |
37 */ | 37 */ |
38 static void getFrameMinMax( const double* data, unsigned int len, double* min, double* max ); | 38 static void getFrameMinMax( const double* data, int len, double* min, double* max ); |
39 | 39 |
40 /** | 40 /** |
41 * Return the mean of the given array of the given length. | 41 * Return the mean of the given array of the given length. |
42 */ | 42 */ |
43 static double mean( const double* src, unsigned int len ); | 43 static double mean( const double* src, int len ); |
44 | 44 |
45 /** | 45 /** |
46 * Return the mean of the subset of the given vector identified by | 46 * Return the mean of the subset of the given vector identified by |
47 * start and count. | 47 * start and count. |
48 */ | 48 */ |
49 static double mean( const std::vector<double> &data, | 49 static double mean( const std::vector<double> &data, |
50 unsigned int start, unsigned int count ); | 50 int start, int count ); |
51 | 51 |
52 /** | 52 /** |
53 * Return the sum of the values in the given array of the given | 53 * Return the sum of the values in the given array of the given |
54 * length. | 54 * length. |
55 */ | 55 */ |
56 static double sum( const double* src, unsigned int len ); | 56 static double sum( const double* src, int len ); |
57 | 57 |
58 /** | 58 /** |
59 * Return the median of the values in the given array of the given | 59 * Return the median of the values in the given array of the given |
60 * length. If the array is even in length, the returned value will | 60 * length. If the array is even in length, the returned value will |
61 * be half-way between the two values adjacent to median. | 61 * be half-way between the two values adjacent to median. |
62 */ | 62 */ |
63 static double median( const double* src, unsigned int len ); | 63 static double median( const double* src, int len ); |
64 | 64 |
65 /** | 65 /** |
66 * The principle argument function. Map the phase angle ang into | 66 * The principle argument function. Map the phase angle ang into |
67 * the range [-pi,pi). | 67 * the range [-pi,pi). |
68 */ | 68 */ |
71 /** | 71 /** |
72 * Floating-point division modulus: return x % y. | 72 * Floating-point division modulus: return x % y. |
73 */ | 73 */ |
74 static double mod( double x, double y); | 74 static double mod( double x, double y); |
75 | 75 |
76 static void getAlphaNorm(const double *data, unsigned int len, unsigned int alpha, double* ANorm); | 76 static void getAlphaNorm(const double *data, int len, int alpha, double* ANorm); |
77 static double getAlphaNorm(const std::vector <double> &data, unsigned int alpha ); | 77 static double getAlphaNorm(const std::vector <double> &data, int alpha ); |
78 | 78 |
79 static void circShift( double* data, int length, int shift); | 79 static void circShift( double* data, int length, int shift); |
80 | 80 |
81 static int getMax( double* data, unsigned int length, double* max = 0 ); | 81 static int getMax( double* data, int length, double* max = 0 ); |
82 static int getMax( const std::vector<double> &data, double* max = 0 ); | 82 static int getMax( const std::vector<double> &data, double* max = 0 ); |
83 static int compareInt(const void * a, const void * b); | 83 static int compareInt(const void * a, const void * b); |
84 | 84 |
85 enum NormaliseType { | 85 enum NormaliseType { |
86 NormaliseNone, | 86 NormaliseNone, |