trait MedianModeCalculation extends AnyRef
- Alphabetic
- By Inheritance
- MedianModeCalculation
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
addValue(v: Int): Unit
Adds a value to the internal array, grouping values together but not ordering them.
Adds a value to the internal array, grouping values together but not ordering them. If you call this after calling addValueOrdered, you'll probably break the ordering, so use one or the other. This one is faster, according to timing data.
-
def
addValueOrdered(v: Int): Unit
Adds a value to the internal array, ordering the values.
Adds a value to the internal array, ordering the values. If you call addValue after calling this you'll probably break the ordering, so use one or the other. This one is slower, according to timing data.
- val arr: Array[Int]
- val currArrMax: Int
- val d2: Int
- def initArray(extent: Int): Unit
-
def
median: Int
Calculates the median.
Calculates the median. If you use this, make sure you've been only calling addValueOrdered
-
def
mode: Int
Calculates the mode.
Calculates the mode. Works with addValue or addValueOrdered
- val modeValue: Int
- def removeValue(v: Int): Unit
- def reset(): Unit