Skip to main content

diffuse_step

Function diffuse_step 

Source
pub fn diffuse_step(
    beliefs: &[f32],
    edges: &[(usize, usize)],
    rate: f32,
    out: &mut [f32],
) -> bool
Expand description

One CPU step of gradient-based belief diffusion (discrete graph Laplacian): each node’s belief moves toward its neighbours’ average by rate ∈ [0,1]. edges are undirected (i,j) index pairs. Writes the updated beliefs into out. Zero-heap (caller buffers, no allocation).