Class Probe

java.lang.Object
smile.neighbor.lsh.Probe
All Implemented Interfaces:
Comparable<Probe>

public class Probe extends Object implements Comparable<Probe>
Probe to check for nearest neighbors.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Probe(int[] range)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Probe
     
    int
     
    This operation sets to one the component following the last nonzero component if it is not the last one.
    This operation adds one to the last nonzero component.
    int
    hash(Hash hash, PrZ[] pz)
    Returns the bucket number of the probe.
    boolean
    Returns true if the probe is expandable.
    boolean
    Returns true if the probe is extendable.
    boolean
    Returns true if the probe is shiftable.
    void
    setProb(PrZ[] pz)
    Calculate the probability of the probe.
    This operation shifts to the right the last nonzero component if it is equal to one and if it is not the last one.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Probe

      public Probe(int[] range)
      Constructor.
      Parameters:
      range - the valid range of buckets.
  • Method Details

    • clone

      protected Probe clone()
      Overrides:
      clone in class Object
    • isShiftable

      public boolean isShiftable()
      Returns true if the probe is shiftable.
      Returns:
      true if the probe is shiftable.
    • shift

      public Probe shift()
      This operation shifts to the right the last nonzero component if it is equal to one and if it is not the last one.
      Returns:
      the shifted probe.
    • isExpandable

      public boolean isExpandable()
      Returns true if the probe is expandable.
      Returns:
      true if the probe is expandable.
    • expand

      public Probe expand()
      This operation sets to one the component following the last nonzero component if it is not the last one.
      Returns:
      the expanded probe.
    • isExtendable

      public boolean isExtendable()
      Returns true if the probe is extendable.
      Returns:
      true if the probe is extendable.
    • extend

      public Probe extend()
      This operation adds one to the last nonzero component.
      Returns:
      the extended probe.
    • compareTo

      public int compareTo(Probe o)
      Specified by:
      compareTo in interface Comparable<Probe>
    • setProb

      public void setProb(PrZ[] pz)
      Calculate the probability of the probe.
      Parameters:
      pz - the probability of the probe.
    • hash

      public int hash(Hash hash, PrZ[] pz)
      Returns the bucket number of the probe.
      Parameters:
      hash - the hash function.
      pz - the probability list of all buckets for given query object.
      Returns:
      the hash code.