ancestor function ancestor(w:Real[_]) -> Integer Sample a single ancestor for a log-weight vector. If the sum of weights is zero, returns zero.