A kd-tree implementation in C++ (and Fortran) by Matthew B. Kennel