This maps a vector of 3d positions and map each index into an evenly spaced lattice of grid points (cells). The neighbors of a given index in the position vector can be used to quickly find all other index in the vicinity.
More inspiration: http://cacs.usc.edu/education/cs596/01-1LinkedListCell.pdf