implement memory friendly fitting on the simplex in cython