Class AVLGroupTree
- All Implemented Interfaces:
Serializable, Iterable<Centroid>, Collection<Centroid>
A tree of t-digest centroids.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the provided centroid to the tree.boolean(package private) voidprivate voidcheckAggregates(int node) (package private) voidintcount(int node) Return the count for the provided node.data(int node) Return the data for the provided node.intfirst()Return the least node in the tree.intfloor(double centroid) Return the last node whose centroid is less thancentroid.intfloorSum(long sum) Return the last node so that the sum of counts of nodes that are before it is less than or equal tosum.longheadSum(int node) Compute the number of elements and sum of counts for every entry that is strictly beforenode.iterator()iterator(int startNode) doublemean(int node) Return the mean for the provided node.intnext(int node) Return the next node.intprev(int node) Return the previous node.intsize()Return the number of centroids in the tree.intsum()Return the total count of points that have been added to the tree.voidUpdate values associated with a node, readjusting the tree if necessary.Methods inherited from class AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
centroid
private double centroid -
count
private int count -
data
-
centroids
private double[] centroids -
counts
private int[] counts -
datas
-
aggregatedCounts
private int[] aggregatedCounts -
tree
-
-
Constructor Details
-
AVLGroupTree
AVLGroupTree() -
AVLGroupTree
AVLGroupTree(boolean record)
-
-
Method Details
-
size
public int size()Return the number of centroids in the tree.- Specified by:
sizein interfaceCollection<Centroid>- Specified by:
sizein classAbstractCollection<Centroid>
-
prev
public int prev(int node) Return the previous node. -
next
public int next(int node) Return the next node. -
mean
public double mean(int node) Return the mean for the provided node. -
count
public int count(int node) Return the count for the provided node. -
data
-
add
-
add
- Specified by:
addin interfaceCollection<Centroid>- Overrides:
addin classAbstractCollection<Centroid>
-
update
-
floor
public int floor(double centroid) Return the last node whose centroid is less thancentroid. -
floorSum
public int floorSum(long sum) Return the last node so that the sum of counts of nodes that are before it is less than or equal tosum. -
first
public int first()Return the least node in the tree. -
headSum
public long headSum(int node) Compute the number of elements and sum of counts for every entry that is strictly beforenode. -
iterator
-
iterator
-
sum
public int sum()Return the total count of points that have been added to the tree. -
checkBalance
void checkBalance() -
checkAggregates
void checkAggregates() -
checkAggregates
private void checkAggregates(int node)
-