Naive brute force nearest neighbor finder
find_ordered_nn_brute(locs, m)
An matrix containing the indices of the neighbors. Row i
of the
returned matrix contains the indices of the nearest m
locations to the i
'th location. Indices are ordered within a
row to be increasing in distance. By convention, we consider a location
to neighbor itself, so the first entry of row i
is i
, the
second entry is the index of the nearest location, and so on. Because each
location neighbors itself, the returned matrix has m+1
columns.
matrix of locations
number of neighbors