Package com.tdunning.math.stats
Class GroupTree
java.lang.Object
com.tdunning.math.stats.GroupTree
A tree containing TDigest.Centroid. This adds to the normal NavigableSet the
ability to sum up the size of elements to the left of a particular group.
-
Constructor Details
-
GroupTree
public GroupTree() -
GroupTree
-
GroupTree
-
-
Method Details
-
add
-
move
Modify an existing value in the tree subject to the constraint that the change will not alter the ordering of the tree.- Parameters:
x
- New value to add to Centroidcount
- Weight of new valuev
- The value to modifydata
- The recorded data
-
size
public int size() -
headCount
- Returns:
- the number of items strictly before the current element
-
headSum
- Returns:
- the sum of the size() function for all elements strictly before the current element.
-
first
- Returns:
- the first Centroid in this set
-
iterator
Iteratres through all groups in the tree. -
remove
-
floor
- Returns:
- the largest element less than or equal to base
-
last
-
ceiling
- Returns:
- the smallest element greater than or equal to base.
-
tailSet
- Returns:
- the subset of elements equal to or greater than base.
-
sum
public long sum() -
checkBalance
public void checkBalance() -
print
public void print(int depth)
-