Deterministic construction of an approximate M-ellipsoid and its applications to derandomizing lattice algorithms