Class PartialVAFile.PartialVAFileKNNQuery

    • Field Detail

      • p

        private double p
        Lp-Norm p.
      • subspace

        private long[] subspace
        Subspace.
    • Constructor Detail

      • PartialVAFileKNNQuery

        public PartialVAFileKNNQuery​(DistanceQuery<V> ddq,
                                     double p,
                                     long[] subspace)
        Constructor.
        Parameters:
        ddq - Distance query
        p - LP-norm p
        subspace - Subspace to query
    • Method Detail

      • getKNN

        public KNNList getKNN​(V query,
                              int k)
        Description copied from interface: KNNSearcher
        Get the k nearest neighbors for a particular object.
        Specified by:
        getKNN in interface KNNSearcher<V extends NumberVector>
        Parameters:
        query - query object
        k - Number of neighbors requested
        Returns:
        neighbors
      • getIOCosts

        private int getIOCosts​(int size,
                               int subspaceDims)
        Computes IO costs (in bytes) needed for refining the candidates.
        Parameters:
        size - The nuber of candidates
        subspaceDims - the required subspace dimensions
        Returns:
        the cost value (in bytes)
      • getIOCosts

        private int getIOCosts​(DAFile sample,
                               int numberOfDAFiles)
        Computes IO costs (in bytes) needed for reading several DA-files.
        Parameters:
        sample - the DA-file specific costs
        numberOfDAFiles - the number of DA-files that have to be read
        Returns:
        the cost value (in bytes)
      • getWorstCaseDistOrder

        public java.util.List<DAFile> getWorstCaseDistOrder​(VALPNormDistance dist,
                                                            long[] subspace)
        Order subspaces by their worst case distance.
        Parameters:
        dist - Distance function
        subspace - Subspace
        Returns:
        Ordered list of dimension files