
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.VAFileKNNQueryKNN query for this index. | 
| class  | VAFile.VAFileRangeQueryRange 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 | LOGLogging class. | 
| (package private) int | pageSizePage size, for estimating the VA file size. | 
| private int | partitionsNumber of partitions. | 
| (package private) int | scansNumber of scans we performed. | 
| private double[][] | splitPositionsQuantile grid we use. | 
| private List<VectorApproximation> | vectorApproxApproximation 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. | 
| String | getLongName()A "pretty" name for the result, for use in titles, captions and menus. | 
| long | getRandomReadOnly()Get the number of random read operations only. | 
| <D extends Distance<D>>  | getRangeQuery(DistanceQuery<V,D> distanceQuery,
             Object... hints)Get a range query object for the given distance query and k. | 
| long | getReadOperations()Returns the read I/O-Accesses of this file. | 
| long | getScannedPages()Get the number of scanned bytes. | 
| String | getShortName()A short name for the result, useful for file names. | 
| long | getWriteOperations()Returns the write I/O-Accesses of this file. | 
| protected void | initialize(Relation<V> relation,
          DBIDs ids)Initialize the index. | 
| void | resetPageAccess()Resets the counters for page accesses of this file and flushes the cache. | 
| void | setPartitions(Relation<V> relation)Initialize the data set grid by computing quantiles. | 
getInnerStatistics, getPageFileStatistics, insertAll, refinedelete, deleteAll, insertprivate static final Logging LOG
private List<VectorApproximation> vectorApprox
private int partitions
private double[][] splitPositions
int pageSize
int scans
protected void initialize(Relation<V> relation, DBIDs ids)
AbstractRefiningIndexinitialize in class AbstractRefiningIndex<V extends NumberVector<?>>relation - Relation to indexids - database idspublic void setPartitions(Relation<V> relation) throws IllegalArgumentException
relation - Data relationIllegalArgumentExceptionpublic VectorApproximation calculateApproximation(DBID id, V dv)
id - Object IDdv - Data vectorpublic long getReadOperations()
PageFileStatisticsgetReadOperations in interface PageFileStatisticsgetReadOperations in class AbstractRefiningIndex<V extends NumberVector<?>>public long getRandomReadOnly()
public long getScannedPages()
public long getWriteOperations()
PageFileStatisticsgetWriteOperations in interface PageFileStatisticsgetWriteOperations in class AbstractRefiningIndex<V extends NumberVector<?>>public void resetPageAccess()
PageFileStatisticsresetPageAccess in interface PageFileStatisticsresetPageAccess 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