PqIndex class
Product-quantization search index. Requires train(...) before
add(...). Stores each vector as m bytes; search uses ADC and
ranks in approximate squared-L2 space.
Properties
- dim → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTrained → bool
-
no setter
- length → int
-
no setter
-
liveIds
→ Iterable<
Object?> -
V50: snapshot of ids in insertion order.
no setter
- m → 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 into the running code buffer. -
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
idvia swap-last. O(N). -
search(
Vector query, int k, {VectorMetric? metric}) → List< VectorSearchHit> -
Top-
knearest neighbors ofqueryunder ADC. Themetricarg is accepted for API symmetry but ignored — PQ ranks in approximate squared-L2 always. -
toJson(
) → Map< String, Object?> - Serialize the trained codebooks + code table.
-
toString(
) → String -
A string representation of this object.
inherited
-
train(
List< Vector> samples) → void - Fit codebooks on training vectors.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited