Mercurial > hg > svcore
diff base/LogRange.h @ 1392:667e369cfeab
LogRange tests
author | Chris Cannam |
---|---|
date | Tue, 28 Feb 2017 11:21:49 +0000 |
parents | 31f01931b781 |
children | ad5f892c0c4d |
line wrap: on
line diff
--- a/base/LogRange.h Mon Feb 27 16:52:47 2017 +0000 +++ b/base/LogRange.h Tue Feb 28 11:21:49 2017 +0000 @@ -23,14 +23,6 @@ { public: /** - * Map a linear range onto a logarithmic range. min and max are - * passed as the extents of the linear range and returned as the - * extents of the logarithmic range. thresh is the minimum value - * for the log range, to be used if the linear range spans zero. - */ - static void mapRange(double &min, double &max, double thresh = -10); - - /** * Map a value onto a logarithmic range. This just means taking * the base-10 log of the absolute value, or using the threshold * value if the absolute value is zero. @@ -44,11 +36,19 @@ static double unmap(double value); /** + * Map a linear range onto a logarithmic range. min and max are + * passed as the extents of the linear range and returned as the + * extents of the logarithmic range. thresh is the minimum value + * for the log range, to be used if the linear range spans zero. + */ + static void mapRange(double &min, double &max, double thresh = -10); + + /** * Estimate whether a set of values would be more properly shown * using a logarithmic than a linear scale. This is only ever * going to be a rough guess. */ - static bool useLogScale(std::vector<double> values); + static bool shouldUseLogScale(std::vector<double> values); };