#define XERR
#include "costs.ih"

size_t Costs::cost(double diameter) const
{
                    // reversed search: start at the max. diameter
    return find_if(d_treatmntPair.rbegin(), d_treatmntPair.rend(),
                [&](CostPair const &costPair)
                {
                    return diameter >= costPair.first;
                }
            )->second;
}

//    xerr("cost with diam. " << diameter << " = " << ret);
