public class PartialVAFile.PartialVAFileKNNQuery extends AbstractRefiningIndex.AbstractKNNQuery<DoubleDistance>
Modifier and Type | Field and Description |
---|---|
private double |
p
Lp-Norm p.
|
private BitSet |
subspace
Subspace.
|
distanceQuery
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
PartialVAFile.PartialVAFileKNNQuery(DistanceQuery<V,DoubleDistance> ddq,
double p,
BitSet subspace)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private LinkedList<PartialVAFile.PartialVACandidate> |
filter1(int k,
int reducedDims,
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.
|
DoubleDistanceKNNList |
getKNNForObject(V query,
int k)
Get the k nearest neighbors for a particular id.
|
List<DAFile> |
getWorstCaseDistOrder(VALPNormDistance dist,
BitSet subspace)
Order subspaces by their worst case distance.
|
protected DoubleDistanceKNNList |
retrieveAccurateDistances(List<PartialVAFile.PartialVACandidate> sortedCandidates,
int k,
BitSet subspace,
V query) |
incRefinements, refine
getKNNForBulkDBIDs, getKNNForDBID
getRelation
private double p
private BitSet subspace
public PartialVAFile.PartialVAFileKNNQuery(DistanceQuery<V,DoubleDistance> ddq, double p, BitSet subspace)
ddq
- Distance queryp
- LP-norm psubspace
- Subspace to querypublic DoubleDistanceKNNList getKNNForObject(V query, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<V extends NumberVector<?>,DoubleDistance>
getKNNForObject
in class AbstractDistanceKNNQuery<V extends NumberVector<?>,DoubleDistance>
query
- Query objectk
- Number of neighbors requestedprivate LinkedList<PartialVAFile.PartialVACandidate> filter1(int k, int reducedDims, 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 List<DAFile> getWorstCaseDistOrder(VALPNormDistance dist, BitSet subspace)
dist
- Distance functionsubspace
- Subspaceprotected DoubleDistanceKNNList retrieveAccurateDistances(List<PartialVAFile.PartialVACandidate> sortedCandidates, int k, BitSet subspace, V query)