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

Home » Public Forums » archive » Re: lower and upper triangular matrices
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: lower and upper triangular matrices [message #84366 is a reply to message #84365] Thu, 30 May 2013 03:51 Go to previous messageGo to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den torsdagen den 30:e maj 2013 kl. 12:05:16 UTC+2 skrev fd_...@mail.com:
> On Thursday, 30 May 2013 02:33:48 UTC+1, Craig Markwardt wrote:
>
>> What do you mean? Do you want to factor a matrix, such as with CHOLDC? Or do you just want to extract the upper and lower triangle elements from a matrix?
>
> I need the upper and lower triangle elements from a matrix. I am trying to use the Gauss-Seidel method.

Like this?

IDL> n=4
IDL> a=indgen(n,n)+1
IDL> ii=indgen(n) # replicate(1,n)
IDL> jj=indgen(n) ## replicate(1,n)
IDL> print,a
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
IDL> print,a*(ii lt jj)
0 0 0 0
5 0 0 0
9 10 0 0
13 14 15 0
IDL> print,a*(ii ge jj)
1 2 3 4
0 6 7 8
0 0 11 12
0 0 0 16
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Contour plot-Closed Polygon Intersection?
Next Topic: Widget_Base KBRD_Focus_Events not generated via Alt-Tab

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

Current Time: Wed Oct 08 17:39:04 PDT 2025

Total time taken to generate the page: 0.00423 seconds