On 27 Jun 2008, at 11:36 am, Adam Langley wrote:
Specialised for 2d only, but:

http://www.imperialviolet.org/binary/NearestNeighbour2D.hs

In my C code for this, specialised to 3D,
 - dimension numbers were never stored
 - no arrays were used
 - the "search in x" function called
   the "search in y" function, which called
   the "search in z" function, which called
   the "search in x" function

Here's the relevant part of my kd3.h:

typedef struct KD3_Node *kd3ptr;
struct KD3_Node {
    double x, y, z;
    kd3ptr left, right;
    bool   present;
 << payload data goes here >>
};


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to