MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / candidates_cover_input_range

Function candidates_cover_input_range

nodedb-vector/src/multivec/plaid.rs:368–382  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

366
367 #[test]
368 fn candidates_cover_input_range() {
369 // After training, the set of all-doc candidates (using multiple query
370 // vectors spanning the whole space) should cover all 9 documents.
371 let store = build_store();
372 let pruner = PlaidPruner::train(&store, 3, 15, 7);
373 let query = vec![
374 vec![0.0f32, 0.0f32],
375 vec![10.0f32, 0.0f32],
376 vec![0.0f32, 10.0f32],
377 ];
378 let mut cands = pruner.candidates(&query);
379 cands.sort_unstable();
380 cands.dedup();
381 assert_eq!(cands.len(), 9, "all docs should be candidates: {:?}", cands);
382 }
383}

Callers

nothing calls this directly

Calls 3

candidatesMethod · 0.80
dedupMethod · 0.80
build_storeFunction · 0.70

Tested by

no test coverage detected