Integer Optimization on Convex Semialgebraic Sets