yes, you are right, just saw the bug with si should be ii and jj will use sub as soon as I get 0.3.
Also, I did this little script to sort the xy array before hand. just need
ot figure out a smart way to constrain the loops to avoid calculating pairs
of block that can't have any distance below threshold.
n=5000
a=rand(3,n).*1000
b=zeros(Int64,4,n)
b[4,:]=1:n
b[1:3,:]=round(a/100)
bb=deepcopy(sortcols(b))
aa=deepcopy(a)
for i=1:n
a[:,i]=aa[:,bb[4,i]]
end
s=edist(a,10,100)
s[1000,:]
