Projection onto a simplex
This function projects an input vector in any dimension onto the standard probability simplex.
This algorithm is developed in the short paper Y. Chen and X. Ye, Projection onto a simplex, arxiv 1101.6081, 2011. https://arxiv.org/abs/1101.6081