What I provided in my post is a model.  There is a better model
(diota) in *Hashing
for Tolerant Index-Of <http://www.jsoftware.com/papers/Hashing.htm>* .  It
is written in APL and is probably not directly usable if the tolerance is
large, but the idea and the code can be adapted for large tolerance.



On Mon, Jan 16, 2012 at 7:06 AM, Raul Miller <rauldmil...@gmail.com> 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,
>
> --
> Raul
>
> (P.S. I am also planning on responding to Linda Alvord's messages, but
> I do not fully understand them yet, and my responses probably belong
> in a different thread.)
>
> On Mon, Jan 16, 2012 at 9:21 AM, Devon McCormick <devon...@gmail.com>
> wrote:
> > Is there any reason you can't look at the differences directly and
> compare
> > those?  I.e.
> >
> >   2-/\PIs,{.PIs
> > _2.38419e_7 4.76837e_7 _2.38419e_7
> >
> > Here we see that the third one is the odd man out with twice the
> > difference.  For more than three items, you would probably want to sort
> > them first.
> >
> > On Mon, Jan 16, 2012 at 12:11 AM, Raul Miller <rauldmil...@gmail.com>
> wrote:
> >
> >> Let's suppose that I have some low precision floating point numbers:
> >>
> >>   require 'dll'
> >>   PIs=: _1 fc a.{~ 219 15 73 64 220 15 73 64 218 15 73 64
> >>   PIs
> >> 3.14159 3.14159 3.14159
> >>
> >> I would like to be able to recognize that some of these values are
> >> close to each other
> >>   i.!.3e_7~ PIs
> >> |domain error
> >>
> >> I can't use comparison tolerance on i. for this purpose, because i.
> >> throws a domain error when I try to specify the precision I want to
> >> use.
> >>
> >> I also can't use ": because I can't rely on the numbers not being "off
> >> by one" when formatted -- but I can rely on them being close enough
> >> that if they were slightly different they would format the same.
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to