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

Home » Public Forums » archive » Matrix filling methods?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Matrix filling methods? [message #2691] Thu, 18 August 1994 06:32
nicholas is currently offline  nicholas
Messages: 22
Registered: January 1994
Junior Member
I'm trying to speed up some code and hence I am trying
to get rid of some FOR loops. I need to fill a 2-d square
matrix. The values above the diagonal are given by one
formula while those values below the diagonal are given
by another. this is how i currently fill the matrix:


for i=0,n-1 do begin
Matrix(i:*,i-1) = x(i-1)/x(k:*)
Matrix(i-1,i:*) = y(k:*)/y(k-1)
endfor
diag=findgen(n)
Matrix(diag,diag)=z(diag)

Does anyone know of a way to speed this up? Maybe a where to find the
matrix elements above the diagonal and one for below?
Any help is greatly appreciated,
Thanks,
Andy
nicholas.uap.nrl.navy.mil
[Message index]
 
Read Message
Previous Topic: dash sizes on contour
Next Topic: Re: Matrix filling methods?

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

Current Time: Fri Oct 10 13:13:53 PDT 2025

Total time taken to generate the page: 0.39997 seconds