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

Home » Public Forums » archive » Randomize array order
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Randomize array order [message #55030] Wed, 25 July 2007 12:17
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
Hi everyone!

Anyone know an efficient way to randomize an array (I have a
sorted array that I want unsorted). Initially, I tried something like
this:

array = findgen(1000000)
unsort = array[sort(randomu(seed,1000000))]

It works, but sorting on a million elements is rather slow. Anyone
know a faster way?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: array subscript conversion
Next Topic: recommendations for curve fitting

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

Current Time: Sat Oct 11 14:01:18 PDT 2025

Total time taken to generate the page: 0.24198 seconds