nndistG function

Nearest neighbour distances as used by Ghat()