jsat.linear.vectorcollection
Interface DualTree<V extends Vec>
-
- Type Parameters:
V-
- All Superinterfaces:
- java.lang.Cloneable, java.io.Serializable, VectorCollection<V>
public interface DualTree<V extends Vec> extends VectorCollection<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static classDualTree.DualTreeTraversalActionstatic classDualTree.SelfAsChildNode<N extends IndexNode<N>>This class is used as a helper class to deal with Dual Trees which may contain points in branching nodes.
-
Field Summary
Fields Modifier and Type Field and Description static doubleCOMP_SCORE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method and Description DualTree<V>clone()default doublecomputeKnnBound(IndexNode query, int numNeighbors, java.util.List<BoundedSortedList<IndexDistPair>> allPriorities, java.util.Map<IndexNode,java.lang.Double> query_B_cache)default doubledist(int self_index, int other_index, DualTree<V> other)static voiddual_depth_first(IndexNode n_r, IndexNode n_q, BaseCaseDT base, ScoreDT score, boolean improvedSearch)IndexNodegetRoot()voidsearch(Vec query, int numNeighbors, java.util.List<java.lang.Integer> neighbors, java.util.List<java.lang.Double> distances)Performs k-Nearest Neighbor search of the current collection.default voidsearch(VectorCollection<V> VC, double r_min, double r_max, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel)default voidsearch(VectorCollection<V> VC, int numNeighbors, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel)default voidtraverse(DualTree<V> Q, BaseCaseDT base, ScoreDT score, boolean improvedTraverse, boolean parallel)-
Methods inherited from interface jsat.linear.vectorcollection.VectorCollection
build, build, build, build, get, getAccelerationCache, getDistanceMetric, getVecs, search, search, search, search, search, setDistanceMetric, size
-
-
-
-
Field Detail
-
COMP_SCORE
static final double COMP_SCORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRoot
IndexNode getRoot()
-
search
void search(Vec query, int numNeighbors, java.util.List<java.lang.Integer> neighbors, java.util.List<java.lang.Double> distances)
Description copied from interface:VectorCollectionPerforms k-Nearest Neighbor search of the current collection. The index and distance of each found neighbor will be placed into the given Lists.- Specified by:
searchin interfaceVectorCollection<V extends Vec>- Parameters:
query- the point to search for the k-nearest neighbors ofnumNeighbors- the number of neighbors k to search for.neighbors- the list to store the index of the neighbors in. Will be sorted by distance to the query, and paired with the values in distances.distances- the list to store the distance of the neighbors to the query in. Will be sorted, and paired with the values in neighbors.
-
search
default void search(VectorCollection<V> VC, int numNeighbors, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel)
- Specified by:
searchin interfaceVectorCollection<V extends Vec>
-
computeKnnBound
default double computeKnnBound(IndexNode query, int numNeighbors, java.util.List<BoundedSortedList<IndexDistPair>> allPriorities, java.util.Map<IndexNode,java.lang.Double> query_B_cache)
-
search
default void search(VectorCollection<V> VC, double r_min, double r_max, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel)
- Specified by:
searchin interfaceVectorCollection<V extends Vec>
-
traverse
default void traverse(DualTree<V> Q, BaseCaseDT base, ScoreDT score, boolean improvedTraverse, boolean parallel)
-
dual_depth_first
static void dual_depth_first(IndexNode n_r, IndexNode n_q, BaseCaseDT base, ScoreDT score, boolean improvedSearch)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG