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

Function lcg_next

nodedb-vector/src/multivec/plaid.rs:41–46  ·  view source on GitHub ↗

Deterministic LCG step for reproducible randomness across train calls.

(s: &mut u64)

Source from the content-addressed store, hash-verified

39
40/// Deterministic LCG step for reproducible randomness across train calls.
41fn lcg_next(s: &mut u64) -> u64 {
42 *s = s
43 .wrapping_mul(6364136223846793005)
44 .wrapping_add(1442695040888963407);
45 *s
46}
47
48/// Distance from `v` to the nearest centroid in `centroids`.
49fn min_dist_to_centroids(v: &[f32], centroids: &[Vec<f32>]) -> f32 {

Callers 1

kmeans_plus_plus_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected