Class Bucket
java.lang.Object
smile.neighbor.lsh.Bucket
- All Implemented Interfaces:
Serializable
A bucket is a container for points that all have the same value for hash
function g (function g is a vector of k LSH functions). A bucket is specified
by an integer vector of length k.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intThe bucket id is given by the universal bucket hashing.final IntArrayListThe indices of points that all have the same value for hash function g. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
bucket
public final int bucketThe bucket id is given by the universal bucket hashing. The id is used instead of the full k-vector (value of the hash function g) describing the bucket. With a high probability all buckets will have different pairs of id's. -
entry
The indices of points that all have the same value for hash function g.
-
-
Constructor Details
-
Bucket
public Bucket(int bucket) Constructor.- Parameters:
bucket- the bucket number given by universal hashing.
-
-
Method Details
-
points
-
add
public void add(int point) Adds a point to bucket.- Parameters:
point- the index of point.
-
remove
public boolean remove(int point) Removes a point from bucket.- Parameters:
point- the index of point.- Returns:
- true if the point was in the bucket.
-