public class PartialVAFile.PartialVAFileKNNQuery extends AbstractRefiningIndex.AbstractKNNQuery
Modifier and Type | Field and Description |
---|---|
private double |
p
Lp-Norm p.
|
private long[] |
subspace
Subspace.
|
distanceQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
PartialVAFileKNNQuery(DistanceQuery<V> ddq,
double p,
long[] subspace)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private java.util.LinkedList<PartialVAFile.PartialVACandidate> |
filter1(int k,
int reducedDims,
java.util.List<DAFile> daFiles,
VectorApproximation queryApprox,
int subspaceDims,
VALPNormDistance dist) |
private int |
getIOCosts(DAFile sample,
int numberOfDAFiles)
Computes IO costs (in bytes) needed for reading several DA-files.
|
private int |
getIOCosts(int size,
int subspaceDims)
Computes IO costs (in bytes) needed for refining the candidates.
|
KNNList |
getKNNForObject(V query,
int k)
Get the k nearest neighbors for a particular id.
|
java.util.List<DAFile> |
getWorstCaseDistOrder(VALPNormDistance dist,
long[] subspace)
Order subspaces by their worst case distance.
|
protected KNNList |
retrieveAccurateDistances(java.util.List<PartialVAFile.PartialVACandidate> sortedCandidates,
int k,
long[] subspace,
V query) |
incRefinements, refine
getKNNForBulkDBIDs, getKNNForDBID, getRelation
public PartialVAFileKNNQuery(DistanceQuery<V> ddq, double p, long[] subspace)
ddq
- Distance queryp
- LP-norm psubspace
- Subspace to querypublic KNNList getKNNForObject(V query, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<V extends NumberVector>
getKNNForObject
in class AbstractDistanceKNNQuery<V extends NumberVector>
query
- Query objectk
- Number of neighbors requestedprivate java.util.LinkedList<PartialVAFile.PartialVACandidate> filter1(int k, int reducedDims, java.util.List<DAFile> daFiles, VectorApproximation queryApprox, int subspaceDims, VALPNormDistance dist)
private int getIOCosts(int size, int subspaceDims)
size
- The nuber of candidatessubspaceDims
- the required subspace dimensionsprivate int getIOCosts(DAFile sample, int numberOfDAFiles)
sample
- the DA-file specific costsnumberOfDAFiles
- the number of DA-files that have to be readpublic java.util.List<DAFile> getWorstCaseDistOrder(VALPNormDistance dist, long[] subspace)
dist
- Distance functionsubspace
- Subspaceprotected KNNList retrieveAccurateDistances(java.util.List<PartialVAFile.PartialVACandidate> sortedCandidates, int k, long[] subspace, V query)
Copyright © 2019 ELKI Development Team. License information.