MCPcopy Create free account

hub / github.com/Altor-lab/altor-vec / functions

Functions78 in github.com/Altor-lab/altor-vec

↓ 21 callersMethodinsert
Insert a vector into the index. The vector will be L2-normalized. Returns the assigned node ID.
src/hnsw/mod.rs:44
↓ 20 callersMethodsearch
Search for the `top_k` nearest neighbors of a query vector. Returns JSON: `[[node_id, distance], ...]`
wasm/src/lib.rs:50
↓ 12 callersFunctionnormalize
L2-normalize a vector in place. Returns the original norm.
src/distance.rs:10
↓ 9 callersMethodlen
Number of vectors in the index.
src/hnsw/mod.rs:61
↓ 7 callersFunctionrandom_vector
(dims: usize, rng: &mut impl Rng)
tests/edge_cases_test.rs:5
↓ 5 callersMethodpartial_cmp
(&self, other: &Self)
src/hnsw/search.rs:23
↓ 5 callersFunctionrandom_unit_vector
(dims: usize, rng: &mut impl Rng)
tests/recall_test.rs:5
↓ 5 callersFunctionsearch_layer
Search a single layer for the ef closest neighbors to the query. Returns a list of (node_id, distance) sorted by distance ascending.
src/hnsw/search.rs:73
↓ 5 callersMethodset_neighbors
Set neighbors for a node at a specific layer.
src/hnsw/graph.rs:73
↓ 4 callersFunctiondot_product
Compute dot product of two f32 slices. When vectors are L2-normalized, this equals cosine similarity. This will auto-vectorize with SIMD in release mo
src/distance.rs:4
↓ 4 callersMethodlen
Number of vectors in the index.
wasm/src/lib.rs:61
↓ 4 callersFunctionrandom_unit_vector
(dims: usize, rng: &mut impl Rng)
benches/search_bench.rs:6
↓ 3 callersMethodadd_node
Add a node with the given vector and layer assignment. Returns the new node's ID.
src/hnsw/graph.rs:52
↓ 3 callersFunctionbuild_test_index
(n: usize, dims: usize, ef_search: usize)
benches/search_bench.rs:12
↓ 3 callersFunctionknn_search
Top-level KNN search: traverse from top layer to layer 0.
src/hnsw/search.rs:154
↓ 3 callersMethodto_bytes
Export the index as bytes for later loading.
wasm/src/lib.rs:56
↓ 2 callersMethodcmp
(&self, other: &Self)
src/hnsw/search.rs:29
↓ 2 callersFunctiondist
(a: &[f32], b: &[f32])
src/hnsw/search.rs:67
↓ 2 callersMethodget_neighbors
Get neighbors for a node at a specific layer.
src/hnsw/graph.rs:78
↓ 2 callersFunctionmeasure_recall
( index: &HnswIndex, vectors: &[Vec<f32>], dims: usize, k: usize, num_queries: usize,
tests/recall_test.rs:21
↓ 2 callersFunctionrandomQuery
(dims)
wasm/test/node_test.mjs:20
↓ 2 callersFunctionrandom_layer
Select a random layer for a new node using the HNSW exponential distribution.
src/hnsw/construction.rs:14
↓ 2 callersFunctionrandom_vector
(dims: usize, rng: &mut impl Rng)
tests/serialization_test.rs:7
↓ 1 callersFunctionbrute_force_knn
(vectors: &[Vec<f32>], query: &[f32], k: usize)
tests/recall_test.rs:11
↓ 1 callersFunctiondist
(a: &[f32], b: &[f32])
src/hnsw/construction.rs:9
↓ 1 callersFunctionhandleInit
()
wasm/demo/worker.js:10
↓ 1 callersFunctionhandleSearch
(query, requestId)
wasm/demo/worker.js:44
↓ 1 callersFunctioninsert
Insert a new vector into the HNSW graph. The vector should already be L2-normalized.
src/hnsw/construction.rs:22
↓ 1 callersFunctionmain
()
scripts/download_msmarco.py:13
↓ 1 callersFunctionmain
()
scripts/embed.py:21
↓ 1 callersMethodmax_connections
Get the max number of connections for a given layer.
src/hnsw/graph.rs:64
↓ 1 callersFunctionsearch_layer_counted
Like search_layer but also returns the number of distance computations.
src/hnsw/search.rs:84
Methodadd_vectors
Add vectors to an existing index. `flat` is a contiguous array of vectors, each of length `dims`.
wasm/src/lib.rs:42
Functionbench_search_1k
(c: &mut Criterion)
benches/search_bench.rs:42
Functionbench_search_ef50
(c: &mut Criterion)
benches/search_bench.rs:22
Functionbench_search_ef500
(c: &mut Criterion)
benches/search_bench.rs:32
Methodeq
(&self, other: &Self)
src/hnsw/search.rs:14
Methodfrom_bytes
(bytes: &[u8])
src/hnsw/mod.rs:78
Methodfrom_vectors
Build a new index from a flat f32 array of vectors. `flat` is a contiguous array of vectors, each of length `dims`.
wasm/src/lib.rs:25
Methodis_empty
Whether the index is empty.
src/hnsw/mod.rs:66
Functionmain
()
examples/build_index.rs:6
Functionmain
()
examples/generate_fixture.rs:6
Methodnew
(bytes: &[u8])
wasm/src/lib.rs:16
Methodnew
(m: usize)
src/hnsw/graph.rs:40
Methodnew
Create a new HNSW index. - `dims`: vector dimensionality - `m`: max connections per node per layer (default: 16) - `ef_construction`: beam width durin
src/hnsw/mod.rs:33
Methodsearch
Search for the k nearest neighbors of a query vector. The query will be L2-normalized before search. Returns Vec<(node_id, distance)> sorted by ascend
src/hnsw/mod.rs:53
Functiontest_basic_search
()
tests/recall_test.rs:116
Functiontest_dist_identical
()
src/hnsw/search.rs:181
Functiontest_dist_orthogonal
()
src/hnsw/search.rs:187
Functiontest_dot_product_high_dimensions
()
src/distance.rs:61
Functiontest_dot_product_identical_vectors
()
src/distance.rs:54
Functiontest_dot_product_identity
()
src/distance.rs:25
Functiontest_dot_product_orthogonal
()
src/distance.rs:32
Functiontest_dot_product_zero_vector
()
src/distance.rs:47
Functiontest_duplicate_vectors
()
tests/edge_cases_test.rs:32
Functiontest_empty_index_search
()
tests/edge_cases_test.rs:10
Functiontest_high_dimensional_vectors
()
tests/edge_cases_test.rs:133
Functiontest_insert_dimension_mismatch
()
tests/edge_cases_test.rs:55
Functiontest_is_empty
()
tests/edge_cases_test.rs:123
Functiontest_knn_search_empty_graph
()
src/hnsw/search.rs:194
Functiontest_knn_search_single_node
()
src/hnsw/search.rs:202
Functiontest_nearest_neighbor_is_self
()
tests/edge_cases_test.rs:157
Functiontest_normalize
()
src/distance.rs:39
Functiontest_normalize_already_unit
()
src/distance.rs:82
Functiontest_normalize_returns_original_norm
()
src/distance.rs:90
Functiontest_normalize_zero_vector
()
src/distance.rs:71
Functiontest_random_layer_distribution
()
src/hnsw/construction.rs:108
Functiontest_recall_at_10
()
tests/recall_test.rs:52
Functiontest_recall_matches_reference
()
tests/recall_test.rs:87
Functiontest_search_dimension_mismatch
()
tests/edge_cases_test.rs:63
Functiontest_search_layer_returns_sorted
()
src/hnsw/search.rs:218
Functiontest_search_results_sorted_by_distance
()
tests/edge_cases_test.rs:102
Functiontest_search_with_k_zero
()
tests/edge_cases_test.rs:147
Functiontest_serialization_round_trip
()
tests/serialization_test.rs:12
Functiontest_single_vector_index
()
tests/edge_cases_test.rs:18
Functiontest_topk_greater_than_index_size
()
tests/edge_cases_test.rs:84
Functiontest_zero_vector_insert
()
tests/edge_cases_test.rs:71
Methodto_bytes
(&self)
src/hnsw/mod.rs:72