mex file for approximate nearest neighbor seems to work with Matlab