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

Home » Public Forums » archive » Index of a sector
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Was: Index... Now: Vectorize, huh? [message #24611 is a reply to message #24564] Thu, 05 April 2001 12:24 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Craig and Med,

I appreciate it! This is exactly what I needed. My problem is the lack
of matrix operations knowledge. Craig's generic solution is exactly what
I expected to see from Craig :-)

By the way. We all are big on vectorizing things in IDL. But look at this:

IDL> a = test(2000)
1.4968959
IDL> a = test(2000, /v)
3.2976190

where TEST is below. I don't even mention that /VEC causes extremely
high memory usage and gets totally out of hand on my system if S > 5000
or so.

;******************************
pro test, s, vec=vec
start = systime(1)
x = findgen(s)
a = fltarr(s, s)
if keyword_set(vec) then begin
a = sqrt(transpose(rebin(x, s, s))^2 + rebin(x, s, s)^2)
endif else begin
for i = 0, s-1 do begin
a[0, i] = sqrt(x^2 + i^2.)
endfor
endelse
print, systime(1) - start
;return, a
end
;******************************
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDLanROI Confusion
Next Topic: spherical gridding problem

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

Current Time: Thu Oct 09 19:53:22 PDT 2025

Total time taken to generate the page: 0.00517 seconds