lattice_point.cc: use some helper functions to simplify code