Skip to main content

project_simplex

Function project_simplex 

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

Project a vector onto the probability simplex Δₙ = { x : x ≥ 0, Σxᵢ = 1 }.

Uses the O(n log n) sorting algorithm of Duchi et al. (2008) / Chen & Ye (2011).

§Arguments

  • x - Input vector to project