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

Home » Public Forums » archive » Re: multiplication by a diagonal matrix
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: multiplication by a diagonal matrix [message #40809 is a reply to message #40807] Fri, 03 September 2004 07:42 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
lbusett@yahoo.it (Lorenzo Busetto) writes:


> Hi all,
>
> I have the following problem: given a matrix A(n,m) and a vector of
> weighting factors w(n), i need to multiply each row of the matrix
> A(i,*)by the corresponding weighting factor w(i).

It sounds like you want to use a FOR loop. When N is small, the
number of loop iterations is small, so it will be fast. When N is
large, the number of loop iterations is larger too, but you also get
more done per iteration (N multiplies per iteration), plus you save
N*(N-1) elements of memory compared to the full matrix approach.

Craig

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: event_pro for compound widgets
Next Topic: multiplication by a diagonal matrix

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

Current Time: Wed Oct 08 20:05:49 PDT 2025

Total time taken to generate the page: 0.79041 seconds