16 m_firstDrawnBarAbscissa(0.0)
21 double data[2] = {m_barWidth, m_firstDrawnBarAbscissa};
22 size_t dataLengthInBytes = 2*
sizeof(double);
23 assert((dataLengthInBytes & 0x3) == 0);
41 return m_firstDrawnBarAbscissa;
45 m_firstDrawnBarAbscissa = firstBarAbscissa;
54 int barNumber =
std::floor((value - m_firstDrawnBarAbscissa)/width);
55 double lowerBound = m_firstDrawnBarAbscissa + barNumber*width;
56 double upperBound = m_firstDrawnBarAbscissa + (barNumber+1)*width;
57 return sumOfValuesBetween(lowerBound, upperBound);
61 double firstBarAbscissa = m_firstDrawnBarAbscissa + m_barWidth*
std::floor((
minValue()- m_firstDrawnBarAbscissa)/m_barWidth);
62 return firstBarAbscissa + index * m_barWidth;
70 double firstBarAbscissa = m_firstDrawnBarAbscissa + m_barWidth*
std::floor((
minValue()- m_firstDrawnBarAbscissa)/m_barWidth);
143 return sortedElementNumber(firstQuartileIndex);
148 return sortedElementNumber(thirdQuartileIndex);
157 int halfTotal = total/2;
158 int totalMod2 = total - 2*halfTotal;
159 if (totalMod2 == 0) {
160 double minusMedian = sortedElementNumber(halfTotal);
161 double maxMedian = sortedElementNumber(halfTotal+1);
162 return (minusMedian+maxMedian)/2.0;
164 return sortedElementNumber(halfTotal+1);
186 double Store::defaultValue(
int i,
int j) {
188 return FloatPairStore::defaultValue(i, j);
194 double Store::sumOfValuesBetween(
double x1,
double x2) {
204 double Store::sortedElementNumber(
int k) {
208 int sortedElementIndex = 0;
209 double cumulatedSize = 0.0;
210 while (cumulatedSize < k) {
212 bufferValues[sortedElementIndex] =
DBL_MAX;
213 cumulatedSize +=
m_data[1][sortedElementIndex];
215 return m_data[0][sortedElementIndex];
218 int Store::minIndex(
double * bufferValues,
int bufferLength) {
220 for (
int i = 1; i < bufferLength; i++) {
221 if (bufferValues[index] > bufferValues[i]) {
double sumOfOccurrences()
static constexpr float k_displayLeftMarginRatio
double heightOfBarAtValue(double value)
void setFirstDrawnBarAbscissa(double firstDrawnBarAbscissa)
static constexpr float k_displayRightMarginRatio
double sumOfColumn(int i)
double standardDeviation()
double heightOfBarAtIndex(int index)
double firstDrawnBarAbscissa()
double endOfBarAtIndex(int index)
void setBarWidth(double barWidth)
double sampleStandardDeviation()
double m_data[2][k_maxNumberOfPairs]
uint32_t crc32(const uint32_t *data, size_t length)
bool scrollToSelectedBarIndex(int index)
double startOfBarAtIndex(int index)
void * memcpy(void *dst, const void *src, size_t n)