/// <summary> /// Increments (increases by one) the bin count. /// </summary> public void Increment() { storage.Increment(index); }
// FindIndex is a simple binary search; we re-implement it here because Array.BinarySearch requires exact matching // A bin runs from [a,b), i.e. given value a, the count should fall into that bin; given value b, the count should // fall into the next bin. /// <summary> /// Adds a new value to the histogram. /// </summary> /// <param name="value">The value to add.</param> public void Add(double value) { storage.Increment(storage.FindIndex(value)); }