|
Re: lower and upper triangular matrices [message #84366 is a reply to message #84365] |
Thu, 30 May 2013 03:51  |
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
|
|
|
Re: lower and upper triangular matrices [message #84367 is a reply to message #84366] |
Thu, 30 May 2013 03:05  |
fd_luni
Messages: 66 Registered: January 2013
|
Member |
|
|
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.
|
|
|
Re: lower and upper triangular matrices [message #84370 is a reply to message #84367] |
Wed, 29 May 2013 18:33  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Wednesday, May 29, 2013 9:31:35 AM UTC-4, fd_...@mail.com wrote:
>
> Does anyone know how to create the lower and upper trianglular matrices of a given matrix A?
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?
CM
|
|
|
|