MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_minhash_jaccard

Function cbm_minhash_jaccard

src/simhash/minhash.c:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267/* ── Jaccard similarity ──────────────────────────────────────────── */
268
269double cbm_minhash_jaccard(const cbm_minhash_t *a, const cbm_minhash_t *b) {
270 if (!a || !b) {
271 return 0.0;
272 }
273 int matching = 0;
274 for (int i = 0; i < CBM_MINHASH_K; i++) {
275 if (a->values[i] == b->values[i]) {
276 matching++;
277 }
278 }
279 return (double)matching / (double)CBM_MINHASH_K;
280}
281
282/* ── Hex encoding/decoding ───────────────────────────────────────── */
283

Callers 3

cbm_sem_combined_scoreFunction · 0.85
sim_query_workerFunction · 0.85
test_simhash.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected