Modifier and Type | Field and Description |
---|---|
static boolean |
debug |
protected int |
dimension |
protected ArrayList<T> |
duplicates |
protected int |
medianLength |
protected Node<T> |
root |
Constructor and Description |
---|
KDTree(List<T> leaves)
Construct a KDTree from the elements in the given list.
|
KDTree(List<T> leaves,
int maxMedianLength) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allIdentical(List<T> list) |
int |
getDimension() |
ArrayList<T> |
getDuplicates() |
Node<T> |
getRoot() |
boolean |
hasDuplicates() |
protected Node<T> |
makeNode(List<T> leaves,
int depth) |
protected float |
median(List<T> leaves,
int k) |
String |
toString() |
String |
toString(Node<T> node,
String indent) |
protected final int medianLength
protected final int dimension
public static boolean debug
public KDTree(List<T> leaves)
The elements must implement the interface Leaf.
The parameter 'leaves' must be a list and cannot be an iterator, as the median needs to be calculated (or estimated, if the length is greater than medianLength).
leaves
- the list of leaves.Copyright © 2015–2021 Fiji. All rights reserved.