Good point. I didn't sort because that would in a biased way
move the indices away from the first occurrence, which is my
preferred (but not essential) choice. I see now I should take
your advice and use >./\x instead of x. I also see, looking back
at my work, that I had already taken care of that :) for routine
work and only missed it for some ad hoc cases. Thanks.

Roger Hui wrote:
The analysis of whether x I. y can give unreasonable results
when x is not sorted is not trivial.  For the small cost of
sorting x I wonder why you don't just go ahead and sort it.



----- Original Message -----
From: Cliff Reiter <[EMAIL PROTECTED]>
Date: Thursday, April 3, 2008 6:25
Subject: Interval Index: was Re: [Jgeneral] Transitive Closure and Line Wrap
To: General forum <[email protected]>

I have been fairly routinely using Interval Index x I. y with
"almost ordered" lists x. These are lists of a few thousand
scalars where 98% of the steps are increasing and the
deceases are tiny. I only need an index near the value y
and have no need of a particular choice of index. I
get visual feedback on all the results and have never
felt the need to chose anything other than x I. y.

Am I a foolish old man?

Roger Hui wrote:
Interval Index is just finding the index of an item in
a sorted list.  Not really all that novel (binary search,
etc.) In 1987 I did not have it as a primitive and solved the problem with one application of the monad /: .

...
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


--
Clifford A. Reiter
Mathematics Department, Lafayette College
Easton, PA 18042 USA,   610-330-5277
http://www.lafayette.edu/~reiterc
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to