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

Home » Public Forums » archive » Re: The usual vectorising headache
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
Re: The usual vectorising headache [message #43787] Mon, 25 April 2005 07:16
Edd Edmondson is currently offline  Edd Edmondson
Messages: 50
Registered: January 2003
Member
Edd <eddedmondson@hotmail.com> wrote:
> I've ended up with a situation I'm having trouble vectorising effectively.
> The operation I want to do is a

> transpose(p)##q##p

> where p is Array[4] q is Array[4,4]

> Now I need to do this operation with a few tens of thousands of different
> p's, so I've got actually got a p which is Array[bignum,4].

> Obviously I want to vectorise it so I loop over 4s, rather than loop over
> bignums if I have to loop at all, but I don't want to have to completely
> specify the whole operation in individual 0,1,2,3 elements or the code
> looks pretty unreadable (but I'll do that if necessary).

> Anyone got any clever tricks I might use?

Hmm, well I think I've got something that makes sense, but can someone
take a peek and check this comes out right?

tot=0
for j=0,3 do tot+=p[*,j]*(q[0,j]*p[*,0]+q[1,j]*p[*,1]+q[2,j]*p[*,2]$
+q[3,j]*p[*,3])

Still a bit ugly though... hohum.

--
Edd
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: The usual vectorising headache
Next Topic: Itanium and IDL ?

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

Current Time: Wed Oct 08 19:59:11 PDT 2025

Total time taken to generate the page: 0.00498 seconds