LshIndex class
Sign-projection LSH over dense vectors. See file header for
semantics. Codes are packed into (nbits + 7) ~/ 8 bytes each.
Properties
- codeSize → int
-
final
- dim → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
no setter
-
liveIds
→ Iterable<
Object?> -
V50: snapshot of ids in insertion order.
no setter
- nbits → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
Object? id, Vector v) → void -
Add
vunder keyid. Encodes on-the-fly; codes are stored contiguously in_codes. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeId(
Object? id) → bool -
Remove the first entry whose id equals
id. Swap-last, O(N) in the id lookup. -
search(
Vector query, int k, {VectorMetric? metric}) → List< VectorSearchHit> -
Top-
knearest neighbors ofqueryunder Hamming distance. Themetricargument is accepted for API symmetry with the other index kinds but ignored — LSH always ranks in Hamming space. -
toJson(
int seed) → Map< String, Object?> -
Serialize the built code table. Projectors are regenerated from
(seed, nbits, dim)on load — no need to persist them. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited