Re: What? You can't histogram a string array? [message #51689 is a reply to message #51545] |
Tue, 28 November 2006 11:23   |
Braedley
Messages: 57 Registered: September 2006
|
Member |
|
|
JD Smith wrote:
> On Tue, 28 Nov 2006 09:52:06 -0800, Braedley wrote:
>
>>
>> Braedley wrote:
>>> JD, a small nitpick: ind_int_sort will occasionally take the index from
>>> [a, b], and not from just a. This can quickly lead to out of bounds
>>> conditions if the user doesn't want to index [a, b], but just wants to
>>> index a. In my case, a is a column from a 2D string array, where b is
>>> just a 1D string array. I think a where statement is all that is
>>> needed to fix this (I know, it'll slow it down for large sets).
>>>
>>> Braedley
>>
>> Actually, the fix was much easier than previously thought. Instead of
>> return, srt[wh]
>> use
>> return, srt[wh]<srt[wh+1]
>>
>> I haven't done any tests, but it shouldn't take much longer for sparse
>> or small sets.
>
> That is a clever fix, but if the ordering of elements from a and b is
> random, and if you have a repeated set in a match a repeated set in b, and
> their interleaved sorted order is random, you'll get back a random number
> of the matching repeats (not 1, as was intended).
>
> See my other post though, and let me know your findings w.r.t. SORT.
>
> Thanks,
>
> JD
I hit an out of bounds on my first try. Running MacOSX, 10.4.8,
IDLv6.2. Unfortunately, I do need the indices, as I pointed out
earlier. Perhaps I'll use BSORT instead.
|
|
|