Skip to main content

proj_simplex

Function proj_simplex 

Source
pub fn proj_simplex(x: &[f64]) -> Vec<f64>
Expand description

Project x onto the probability simplex Δ = {z ≥ 0 : sum z = 1}.

Uses the O(n log n) algorithm by Duchi et al. (2008).