ancestor

function ancestor(w:Real[_]) -> Integer

Sample a single ancestor for a vector of log-weights. If the sum of weights is zero, returns zero.