Package elki.index.laesa
Class LAESA<O>
- java.lang.Object
-
- elki.index.laesa.LAESA<O>
-
- Type Parameters:
O- Object type
- All Implemented Interfaces:
Index,KNNIndex<O>,RangeIndex<O>
@Reference(authors="L. Mic\u00f3, J. Oncina, E. Vidal", title="A new version of the nearest-neighbour approximating and eliminating search algorithm (AESA) with linear preprocessing time and memory requirements", booktitle="Pattern Recognit. Lett. 15(1)", url="https://doi.org/10.1016/0167-8655(94)90095-7", bibkey="DBLP:journals/prl/MicoOV94") public class LAESA<O> extends java.lang.Object implements RangeIndex<O>, KNNIndex<O>
Linear Approximating and Eliminating Search AlgorithmReference:
L. Micó, J. Oncina, E. Vidal
A new version of the nearest-neighbour approximating and eliminating search algorithm (AESA) with linear preprocessing time and memory requirements
Pattern Recognit. Lett. 15(1)- Since:
- 0.8.0
- Author:
- Erich Schubert, Robert Gehde
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLAESA.Factory<O>Index factory.classLAESA.LAESAKNNByDBIDSearcherKNN searcher by DBID classclassLAESA.LAESAKNNByObjectSearcherKNN searcher by object classclassLAESA.LAESAKNNSearcher<Q>KNN searcher classclassLAESA.LAESARangeByDBIDSearcherRange searcher by DBID classclassLAESA.LAESARangeByObjectSearcherRange searcher by object classclassLAESA.LAESARangeSearcher<Q>Range searcher class
-
Field Summary
Fields Modifier and Type Field Description (package private) HashSetDBIDschosenRefPfast lookup(package private) Distance<? super O>distanceDistance function(package private) DistanceQuery<? super O>distqDistance query, bound to the relation(package private) DoubleDataStore[]distsData storage for precomputed distances to reference points.(package private) intkCondition parameterprivate static LoggingLOGClass logger.(package private) intmNumber of reference points(package private) ArrayModifiableDBIDsrefpReference points(package private) Relation<O>relationRelation indexed.(package private) RandomFactoryrngRandom generator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize()Initialize the index.KNNSearcher<DBIDRef>kNNByDBID(DistanceQuery<O> distanceQuery, int maxk, int flags)Get a KNN query object for the given distance query and k.KNNSearcher<O>kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)Get a KNN query object for the given distance query and k.RangeSearcher<DBIDRef>rangeByDBID(DistanceQuery<O> distanceQuery, double maxrange, int flags)Get a range query object for the given distance query and k.RangeSearcher<O>rangeByObject(DistanceQuery<O> distanceQuery, double maxrange, int flags)Get a range query object for the given distance query and k.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.index.Index
logStatistics
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
distq
DistanceQuery<? super O> distq
Distance query, bound to the relation
-
m
int m
Number of reference points
-
k
int k
Condition parameter
-
rng
RandomFactory rng
Random generator
-
refp
ArrayModifiableDBIDs refp
Reference points
-
dists
DoubleDataStore[] dists
Data storage for precomputed distances to reference points.
-
chosenRefP
HashSetDBIDs chosenRefP
fast lookup
-
-
Constructor Detail
-
LAESA
public LAESA(Relation<O> relation, Distance<? super O> distance, int m, int k, RandomFactory rng)
Constructor.- Parameters:
distance- Distance functionm- Number of reference pointsrng- Random generator
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:IndexInitialize the index. For static indexes, this is the moment the index is bulk loaded.- Specified by:
initializein interfaceIndex
-
kNNByObject
public KNNSearcher<O> kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
Description copied from interface:KNNIndexGet a KNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
kNNByObjectin interfaceKNNIndex<O>- Parameters:
distanceQuery- Distance querymaxk- Maximum value of kflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
kNNByDBID
public KNNSearcher<DBIDRef> kNNByDBID(DistanceQuery<O> distanceQuery, int maxk, int flags)
Description copied from interface:KNNIndexGet a KNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
-
rangeByObject
public RangeSearcher<O> rangeByObject(DistanceQuery<O> distanceQuery, double maxrange, int flags)
Description copied from interface:RangeIndexGet a range query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
rangeByObjectin interfaceRangeIndex<O>- Parameters:
distanceQuery- Distance querymaxrange- Maximum rangeflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
rangeByDBID
public RangeSearcher<DBIDRef> rangeByDBID(DistanceQuery<O> distanceQuery, double maxrange, int flags)
Description copied from interface:RangeIndexGet a range query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
rangeByDBIDin interfaceRangeIndex<O>- Parameters:
distanceQuery- Distance querymaxrange- Maximum rangeflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
-