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

Home » Public Forums » archive » Re: vectorising versus loops
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: vectorising versus loops [message #38442 is a reply to message #38129] Sun, 07 March 2004 05:07 Go to previous message
nasalmon is currently offline  nasalmon
Messages: 33
Registered: August 2003
Member
David Fanning <david@dfanning.com> wrote in message news:<MPG.1aa3b24b992bd018989699@news.frii.com>...
> Edd Edmondson writes:
>
>> Funny, that. "I'm just an average astrophysicist" too, and last week I
>> took my IDL program that took a *fortnight* to run and got it down to 21
>> seconds. That's a speed up of 55,000 times.
>
> Well, there you go! I'll have a reporter out later
> this afternoon. :-)
>
> Cheers,
>
> David

Many thanks all for these very useful comments. My software is well on
the way to being vectorised, using all the stuff like WHERE statements
and matrix multiplications, mainly on inner most loops.

However, there is one small outstanding problem in the vectorisation,
and this involves vectorisation of a routine that uses the cross or
vector product, the IDL routine being CROSSP, generating a vector from
the cross product of two vectors.

Currently i am forced to use this in a loop, as my vectorising
attempts (see below) have failed. The loop statement below gives the
correct result (i being the counter of one of the outer loops):

for j = 0,jtot-1 do vec_pip[*,j] = crossp(pixpoly[*,j],normal[*,i])

Naively, putting this in the vector structure i have:

vec_pip[*,0:jtot-1] = crossp(pixpoly[*,0:jtot-1],normal[*,i])

which gives the IDL error message: "% Array subscript for VEC_PIP must
have same size as source expression." - well of course i know that!

Would anybody have any ideas as to how this might be resolved, without
having to resort to working out the cross product from first
principles using determinants and matrix multiplication. Is there any
way the IDL routine could be made to see this as a vectorising process
and compute it without making a fuss.

many thanks, Neil
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: creating own symbols for plot
Next Topic: Re: creating own symbols for plot

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

Current Time: Fri Oct 10 11:15:58 PDT 2025

Total time taken to generate the page: 0.64125 seconds