You can sort the lists and then compare adjacent values; find 
superfluous ones; then i.!.0 to find them in the original list.

A tricky part is that proximity is not a transitive property.  If the 
tolerance is 2, and the data is

1 2 3 4 5 6 7

what should the result of the i.~ be?

Henry Rich

On 1/16/2012 10:06 AM, Raul Miller wrote:
> First:  I like Roger Hui's response.  And, in essence, it's doing
> exactly what you suggest.  However, this requires comparing every
> number in the left list with every number in the right list.  I am
> currently pondering algorithms which rely on I. so that when the lists
> are long computation times are still reasonable (perhaps with 100000
> members in each list).
>
> Second:  I would want the three PI values in my original message to be
> treated as equal.  I want to be able to specify a magnitude of
> acceptable difference which is greater than any of the differences in
> that data sample.
>
> FYI,
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to