Grid points in convex sets - geometry and optimization