Efficient data structure for lattice operations