comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Would you consider this a bug?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Would you consider this a bug? [message #13061 is a reply to message #12982] Thu, 01 October 1998 00:00 Go to previous messageGo to previous message
David Kastrup is currently offline  David Kastrup
Messages: 33
Registered: February 1998
Member
Kevin Ivory <Kevin.Ivory@linmpi.mpg.de> writes:

> Leaving the bug topic - switching to algorithms
>
> David Kastrup wrote:
>> Unfortunately, translating something like
>>
>> a[[5,2,3,0,4,1]] = a
>> into the equivalent
>> a = a[[3,5,1,2,4,0]]
>> is not easy to do in the general case.
>
> Actually it is: you need a second call to sort. See example below.
>
>> some data that needed to be processed in sorted order, the results
>> needed to be rearranged in original order.
>>
>> Something like
>> s = sort(a)
>> a = a[s]
>> process(a)
> ; a[s] = a ; I still think this a dangerous thing to do.
> r = sort(s)
> a = a[r]

First, it is extremely impolite to send a copy of a followup in the
newsgroup to the original poster without marking it as such. Now I
have to type my reply all over again. Double work.

Second, I refuse to call a significantly time-consuming routine like
"sort" (O(n log n)) twice without good reason. Especially when a
simple workaround like writing
a[s] = a+0
will do the trick.


--
David Kastrup Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de Fax: +49-234-709-4209
Institut f�r Neuroinformatik, Universit�tsstr. 150, 44780 Bochum, Germany
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: CENTERING TEXT
Next Topic: what am I doing wrong?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 11:23:30 PST 2025

Total time taken to generate the page: 1.28212 seconds