Package smile.neighbor.lsh
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
Modifier and TypeFieldDescriptionfinal int
The bucket id is given by the universal bucket hashing.final IntArrayList
The indices of points that all have the same value for hash function g. -
Constructor Summary
-
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
Returns the points in the bucket.- Returns:
- the points in the bucket.
-
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.
-