/** * @return A {@link RecordedValuesIterator}{@literal <}{@link HistogramIterationValue}{@literal >} */ public Iterator<HistogramIterationValue> iterator() { return new RecordedValuesIterator(histogram); } }
@Override public boolean hasNext() { return integerRecordedValuesIterator.hasNext(); }
@Override public DoubleHistogramIterationValue next() { integerRecordedValuesIterator.next(); return iterationValue; }
/** * Get the computed mean value of all recorded values in the histogram * * @return the mean value (in value units) of the histogram data */ public double getMean() { if (getTotalCount() == 0) { return 0.0; } recordedValuesIterator.reset(); double totalValue = 0; while (recordedValuesIterator.hasNext()) { HistogramIterationValue iterationValue = recordedValuesIterator.next(); totalValue += medianEquivalentValue(iterationValue.getValueIteratedTo()) * (double) iterationValue.getCountAtValueIteratedTo(); } return (totalValue * 1.0) / getTotalCount(); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. */ public void reset() { reset(histogram); }
@Override public void remove() { integerRecordedValuesIterator.remove(); } }
/** * Get the computed standard deviation of all recorded values in the histogram * * @return the standard deviation (in value units) of the histogram data */ public double getStdDeviation() { if (getTotalCount() == 0) { return 0.0; } final double mean = getMean(); double geometric_deviation_total = 0.0; recordedValuesIterator.reset(); while (recordedValuesIterator.hasNext()) { HistogramIterationValue iterationValue = recordedValuesIterator.next(); double deviation = (medianEquivalentValue(iterationValue.getValueIteratedTo()) * 1.0) - mean; geometric_deviation_total += (deviation * deviation) * iterationValue.getCountAddedInThisIterationStep(); } double std_deviation = Math.sqrt(geometric_deviation_total / getTotalCount()); return std_deviation; }
/** * @param histogram The histogram this iterator will operate on */ public RecordedValuesIterator(final AbstractHistogram histogram) { reset(histogram); }
@Override public void remove() { integerRecordedValuesIterator.remove(); } }
/** * Get the computed mean value of all recorded values in the histogram * * @return the mean value (in value units) of the histogram data */ public double getMean() { if (getTotalCount() == 0) { return 0.0; } recordedValuesIterator.reset(); double totalValue = 0; while (recordedValuesIterator.hasNext()) { HistogramIterationValue iterationValue = recordedValuesIterator.next(); totalValue += medianEquivalentValue(iterationValue.getValueIteratedTo()) * (double) iterationValue.getCountAtValueIteratedTo(); } return (totalValue * 1.0) / getTotalCount(); }
/** * @param histogram The histogram this iterator will operate on */ public DoubleRecordedValuesIterator(final DoubleHistogram histogram) { this.histogram = histogram; integerRecordedValuesIterator = new RecordedValuesIterator(histogram.integerValuesHistogram); iterationValue = new DoubleHistogramIterationValue(integerRecordedValuesIterator.currentIterationValue); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. */ public void reset() { integerRecordedValuesIterator.reset(); }
@Override public DoubleHistogramIterationValue next() { integerRecordedValuesIterator.next(); return iterationValue; }
@Override public boolean hasNext() { return integerRecordedValuesIterator.hasNext(); }
/** * Get the computed standard deviation of all recorded values in the histogram * * @return the standard deviation (in value units) of the histogram data */ public double getStdDeviation() { if (getTotalCount() == 0) { return 0.0; } final double mean = getMean(); double geometric_deviation_total = 0.0; recordedValuesIterator.reset(); while (recordedValuesIterator.hasNext()) { HistogramIterationValue iterationValue = recordedValuesIterator.next(); double deviation = (medianEquivalentValue(iterationValue.getValueIteratedTo()) * 1.0) - mean; geometric_deviation_total += (deviation * deviation) * iterationValue.getCountAddedInThisIterationStep(); } double std_deviation = Math.sqrt(geometric_deviation_total / getTotalCount()); return std_deviation; }
recordedValuesIterator = new RecordedValuesIterator(this);
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. */ public void reset() { reset(histogram); }
/** * @return A {@link RecordedValuesIterator}{@literal <}{@link HistogramIterationValue}{@literal >} */ public Iterator<HistogramIterationValue> iterator() { return new RecordedValuesIterator(histogram); } }
/** * @param histogram The histogram this iterator will operate on */ public RecordedValuesIterator(final AbstractHistogram histogram) { reset(histogram); }
/** * @param histogram The histogram this iterator will operate on */ public DoubleRecordedValuesIterator(final DoubleHistogram histogram) { this.histogram = histogram; integerRecordedValuesIterator = new RecordedValuesIterator(histogram.integerValuesHistogram); iterationValue = new DoubleHistogramIterationValue(integerRecordedValuesIterator.currentIterationValue); }