
V - Vector type@Title(value="An approximation based data structure for similarity search") @Reference(authors="Weber, R. and Blott, S.", title="An approximation based data structure for similarity search", booktitle="Report TR1997b, ETH Zentrum, Zurich, Switzerland", url="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.40.480&rep=rep1&type=pdf") public class VAFile<V extends NumberVector<?>> extends AbstractRefiningIndex<V> implements KNNIndex<V>, RangeIndex<V>
Weber, R. and Blott, S.
An approximation based data structure for similarity search
in: Report TR1997b, ETH Zentrum, Zurich, Switzerland
| Modifier and Type | Class and Description |
|---|---|
static class |
VAFile.Factory<V extends NumberVector<?>>
Index factory class.
|
class |
VAFile.VAFileKNNQuery
KNN query for this index.
|
class |
VAFile.VAFileRangeQuery
Range query for this index.
|
AbstractRefiningIndex.AbstractKNNQuery<D extends Distance<D>>, AbstractRefiningIndex.AbstractRangeQuery<D extends Distance<D>>| Modifier and Type | Field and Description |
|---|---|
private static Logging |
LOG
Logging class.
|
(package private) int |
pageSize
Page size, for estimating the VA file size.
|
private int |
partitions
Number of partitions.
|
(package private) int |
scans
Number of scans we performed.
|
private double[][] |
splitPositions
Quantile grid we use.
|
private List<VectorApproximation> |
vectorApprox
Approximation index.
|
relation| Constructor and Description |
|---|
VAFile(int pageSize,
Relation<V> relation,
int partitions)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
VectorApproximation |
calculateApproximation(DBID id,
V dv)
Calculate the VA file position given the existing borders.
|
<D extends Distance<D>> |
getKNNQuery(DistanceQuery<V,D> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query and k.
|
Logging |
getLogger()
Get the class logger.
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
<D extends Distance<D>> |
getRangeQuery(DistanceQuery<V,D> distanceQuery,
Object... hints)
Get a range query object for the given distance query and k.
|
long |
getScannedPages()
Get the number of scanned bytes.
|
String |
getShortName()
A short name for the result, useful for file names.
|
void |
initialize()
Initialize the index.
|
void |
logStatistics()
Send statistics to the logger, if enabled.
|
void |
setPartitions(Relation<V> relation)
Initialize the data set grid by computing quantiles.
|
countRefinements, refineprivate static final Logging LOG
private List<VectorApproximation> vectorApprox
private int partitions
private double[][] splitPositions
int pageSize
int scans
public void initialize()
Indexinitialize in interface Indexpublic void setPartitions(Relation<V> relation) throws IllegalArgumentException
relation - Data relationIllegalArgumentExceptionpublic VectorApproximation calculateApproximation(DBID id, V dv)
id - Object IDdv - Data vectorpublic long getScannedPages()
public Logging getLogger()
AbstractRefiningIndexgetLogger in class AbstractRefiningIndex<V extends NumberVector<?>>public void logStatistics()
IndexlogStatistics in interface IndexlogStatistics in class AbstractRefiningIndex<V extends NumberVector<?>>public String getLongName()
ResultgetLongName in interface ResultgetLongName in class AbstractIndex<V extends NumberVector<?>>public String getShortName()
ResultgetShortName in interface ResultgetShortName in class AbstractIndex<V extends NumberVector<?>>public <D extends Distance<D>> KNNQuery<V,D> getKNNQuery(DistanceQuery<V,D> distanceQuery, Object... hints)
KNNIndexgetKNNQuery in interface KNNIndex<V extends NumberVector<?>>D - Distance typedistanceQuery - Distance queryhints - Hints for the optimizernullpublic <D extends Distance<D>> RangeQuery<V,D> getRangeQuery(DistanceQuery<V,D> distanceQuery, Object... hints)
RangeIndexgetRangeQuery in interface RangeIndex<V extends NumberVector<?>>D - Distance typedistanceQuery - Distance queryhints - Hints for the optimizernull