Mercurial > hg > qm-dsp
diff maths/MathUtilities.h @ 348:50fae18236ee
Some (but not all) MathUtilities unit tests, and accompanying fixes
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 04 Oct 2013 18:34:30 +0100 |
parents | d5014ab8b0e5 |
children | a067c2eeb13c |
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