Function logprob::log_sum_exp

source ·
pub fn log_sum_exp<T: Float + Sum + Ln2, L: Borrow<LogProb<T>> + Ord>(
    val: &[L]
) -> Result<LogProb<T>, ProbabilitiesSumToGreaterThanOne>
Expand description

Adds up a slice of LogProb (as raw probabilities) and returns a new Result<LogProb, ProbabilitiesSumToGreaterThanOne>. Will only return Ok if the sum could be a valid LogProb