Mercurial > hg > qm-dsp
diff maths/MathUtilities.h @ 123:a37635bbb2c1
Some (but not all) MathUtilities unit tests, and accompanying fixes
author | Chris Cannam |
---|---|
date | Fri, 04 Oct 2013 18:34:30 +0100 |
parents | e5907ae6de17 |
children | 5351b5e9ad9f |
line wrap: on
line diff
--- a/maths/MathUtilities.h Fri Oct 04 16:43:44 2013 +0100 +++ b/maths/MathUtilities.h Fri Oct 04 18:34:30 2013 +0100 @@ -51,11 +51,11 @@ NormaliseUnitMax }; - static void normalise(double *data, int length, - NormaliseType n = NormaliseUnitMax); + static void normalise(double *data, int length, + NormaliseType n = NormaliseUnitMax); - static void normalise(std::vector<double> &data, - NormaliseType n = NormaliseUnitMax); + static void normalise(std::vector<double> &data, + NormaliseType n = NormaliseUnitMax); // moving mean threshholding: static void adaptiveThreshold(std::vector<double> &data); @@ -63,7 +63,9 @@ static bool isPowerOfTwo(int x); static int nextPowerOfTwo(int x); // e.g. 1300 -> 2048, 2048 -> 2048 static int previousPowerOfTwo(int x); // e.g. 1300 -> 1024, 2048 -> 2048 - static int nearestPowerOfTwo(int x); // e.g. 1300 -> 1024, 1700 -> 2048 + static int nearestPowerOfTwo(int x); // e.g. 1300 -> 1024, 12 -> 16 (not 8) + + static int factorial(int x); }; #endif