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

Home » Public Forums » archive » Getting array indices
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
Getting array indices [message #62703] Tue, 23 September 2008 13:23
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Sep 23, 12:53 pm, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
>> Here's a way to get verts:
>
>> sz = size(array)
>> nx = sz[0]
>> ny = sz[1]
>> nz = sz[2]
>> ns = sz[sz[0]+2]
>> verts = findgen(ns)
>
> Shouldn't it be indgen() ...
>
>> verts = transpose([ [verts mod nx], [verts/nx mod ny], [verts/nx/
>> ny] ])
>
>> BTW, I'd like to find a faster way, if there is one.
>
> what about this:
> print, array_indices(arr, indgen(ns))
>
> Jean

That takes about twice as long as the "MOD" method on my machine:
x86_64 Win32 Windows Microsoft Windows 7.0 Oct 25 2007 64 64
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL FOR Loop variable increments
Next Topic: Re: Getting array indices

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

Current Time: Wed Oct 08 11:36:26 PDT 2025

Total time taken to generate the page: 0.00497 seconds