//#define XERR
#include "probgroup.ih"

    // 0 <= prob <= 1 and so indexOf always returns a column

uint16_t ProbGroup::indexOf(double prob) const
{
    return find_if(d_cumProbs.begin(), d_cumProbs.end(), 
                    [&](double cumProb)
                    {
                        return prob <= cumProb;
                    }
                ) - d_cumProbs.begin();
}
