20 if (numBuckets <= 0 || numSamples <= 0 || !samples)
33 for (i = 0; i < numSamples; ++i)
38 if (value < numBuckets)
56 int minValue = samples[0], maxValue = minValue;
57 for (i = 1; i < numSamples; ++i)
64 else if (value > maxValue)
71 if (minValue < maxValue)
74 double numer =
static_cast<double>(numBuckets - 1);
75 double denom =
static_cast<double>(maxValue - minValue);
76 double mult = numer / denom;
77 for (i = 0; i < numSamples; ++i)
79 int index =
static_cast<int>(mult *
static_cast<double>(samples[i] - minValue));
97 if (numBuckets <= 0 || numSamples <= 0 || !samples)
106 float minValue = samples[0], maxValue = minValue;
107 for (
int i = 1; i < numSamples; ++i)
109 float value = samples[i];
110 if (value < minValue)
114 else if (value > maxValue)
121 if (minValue < maxValue)
124 double numer =
static_cast<double>(numBuckets - 1);
125 double denom =
static_cast<double>(maxValue - minValue);
126 double mult = numer / denom;
127 for (
int i = 0; i < numSamples; ++i)
129 int index =
static_cast<int>(mult *
static_cast<double>(samples[i] - minValue));
146 if (numBuckets <= 0 || numSamples <= 0 || !samples)
155 double minValue = samples[0], maxValue = minValue;
156 for (
int i = 1; i < numSamples; ++i)
158 double value = samples[i];
159 if (value < minValue)
163 else if (value > maxValue)
170 if (minValue < maxValue)
173 double numer =
static_cast<double>(numBuckets - 1);
174 double denom = maxValue - minValue;
175 double mult = numer/denom;
176 for (
int i = 0; i < numSamples; ++i)
178 int index =
static_cast<int>(mult * (samples[i] - minValue));
208 if (value < static_cast<int>(
mBuckets.size()))
225 int const numBuckets =
static_cast<int>(
mBuckets.size());
227 for (
int i = 0; i < numBuckets; ++i)
232 int hTailSum =
static_cast<int>(tailAmount * hSum);
235 for (lower = 0; lower < numBuckets; ++lower)
238 if (hLowerSum >= hTailSum)
248 int const numBuckets =
static_cast<int>(
mBuckets.size());
250 for (
int i = 0; i < numBuckets; ++i)
255 int hTailSum =
static_cast<int>(tailAmount * hSum);
258 for (upper = numBuckets - 1; upper >= 0; --upper)
261 if (hUpperSum >= hTailSum)
271 int const numBuckets =
static_cast<int>(
mBuckets.size());
273 for (
int i = 0; i < numBuckets; ++i)
278 int hTailSum =
static_cast<int>(0.5 * tailAmount * hSum);
280 for (lower = 0; lower < numBuckets; ++lower)
283 if (hLowerSum >= hTailSum)
290 for (upper = numBuckets - 1; upper >= 0; --upper)
293 if (hUpperSum >= hTailSum)
GLsizei const GLfloat * value
int GetUpperTail(double tailAmount)
int GetLowerTail(double tailAmount)
#define LogError(message)
void InsertCheck(int value)
void GetTails(double tailAmount, int &lower, int &upper)
Histogram(int numBuckets, int numSamples, int const *samples, bool noRescaling)
std::vector< int > mBuckets