Class 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 Algorithm

    Reference:

    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
    • Constructor Detail

      • LAESA

        public LAESA​(Relation<O> relation,
                     Distance<? super O> distance,
                     int m,
                     int k,
                     RandomFactory rng)
        Constructor.
        Parameters:
        distance - Distance function
        m - Number of reference points
        rng - Random generator
    • Method Detail

      • initialize

        public void initialize()
        Description copied from interface: Index
        Initialize the index. For static indexes, this is the moment the index is bulk loaded.
        Specified by:
        initialize in interface Index
      • kNNByObject

        public KNNSearcher<O> kNNByObject​(DistanceQuery<O> distanceQuery,
                                          int maxk,
                                          int flags)
        Description copied from interface: KNNIndex
        Get 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:
        kNNByObject in interface KNNIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxk - Maximum value of k
        flags - 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: KNNIndex
        Get 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:
        kNNByDBID in interface KNNIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxk - Maximum value of k
        flags - Hints for the optimizer
        Returns:
        KNN Query object or null
      • rangeByObject

        public RangeSearcher<O> rangeByObject​(DistanceQuery<O> distanceQuery,
                                              double maxrange,
                                              int flags)
        Description copied from interface: RangeIndex
        Get 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:
        rangeByObject in interface RangeIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxrange - Maximum range
        flags - 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: RangeIndex
        Get 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:
        rangeByDBID in interface RangeIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxrange - Maximum range
        flags - Hints for the optimizer
        Returns:
        KNN Query object or null