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

Home » Public Forums » archive » Re: Help: how to do ?
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: Help: how to do ? [message #15278 is a reply to message #15269] Tue, 04 May 1999 00:00 Go to previous messageGo to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
Hi Tri,
Now I tested it better. Try the following:

pro test, N

start=systime(1)
a1=findgen(1,3)
a2=findgen(N, 3)
a3=a2
for i=0,N-1 do a3[i, *] = a2[i, *]+a1
print, systime(1) - start
print, a3

start=systime(1)
a1 = fix(findgen(N*3)/N)
a2 = findgen(N*3)
a3 = reform((a2+a1), N, 3)
print, systime(1) - start
print, a3
end

Still is faster by a factor of 10.
Cheers,
Pavel


Tri VU KHAC wrote:

> Having 2 arrays:
> + 3x1 : A1 = findgen(1, 3)
> + 3xN: A2= findgen(N, 3)
>
> No I need to do sth like:
>
> for i=1, N do A[i,*] = A2[i,*] + A1
>
> How to avoid FOR-DO here ?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Experimental FAQ
Next Topic: New procedure to plot great circles on a map

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

Current Time: Sat Oct 11 03:01:00 PDT 2025

Total time taken to generate the page: 2.95955 seconds