m.ensure(
        len(ydiff) == n + 1, "the vector y2-y1 should have a size equal to %d" % (n + 1)