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

Home » Public Forums » archive » Re: efficient matrix multiplication
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: efficient matrix multiplication [message #3813] Sat, 18 March 1995 00:47 Go to previous message
goyette is currently offline  goyette
Messages: 2
Registered: March 1995
Junior Member
In article <D5LsIF.417@rockyd.rockefeller.edu>,
orbach@rockvax.rockefeller.edu (Darren Orbach) wrote:

> Here's the question: In order to extract the inner products from this
> big array, I've been looping over the z-variable and doing a "total()"
> operation: for i = 0, 99 do output(i)=total(productarray(*,*,i)).
> This process seems highly inefficient, and since I'm doing this
> hundreds of times every time I need the series of inner products,
> I'm looking for a better method. Is there a function analogous to
> total(), which can be directed to act over a specified dimension without
> looping over every element of that dimension? If it's at all relevant,
> I'm using PV-WAVE Advantage 5.0.

I think that the funtion, total, can do this. A second parameter in total
indicates a dimension to sum over --- i.e., total(z,1) sums over the first
dimension. So you could replace the loop with two lines:
output = total(productarray,1)
output = total(output,2)

or if you prefer 1 line, output = total(total(productarray,1),2)

Good luck!

-John G.
goyette@nwu.edu
[Message index]
 
Read Message
Read Message
Previous Topic: 3d histograms
Next Topic: CORTEX Framegrabber

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

Current Time: Fri Oct 10 15:33:13 PDT 2025

Total time taken to generate the page: 0.87980 seconds