forum.alglib.net
http://forum.alglib.net/

LU Factorization
http://forum.alglib.net/viewtopic.php?f=2&t=492
Page 1 of 1

Author:  rishka [ Fri Nov 25, 2011 6:39 pm ]
Post subject:  LU Factorization

How can I (succesfully) unpack the information module rmatrixlu returns me in the first argument? I.e. i need the matrices L and U explicitely.

Author:  Sergey.Bochkanov [ Mon Nov 28, 2011 7:20 am ]
Post subject:  Re: LU Factorization

Lower part of the result contains L, upper one contains U. They should be easy to unpack.

Author:  rishka [ Mon Nov 28, 2011 7:49 am ]
Post subject:  Re: LU Factorization

Sure, if this were it. What about the Permutation Matrix (Pivots) and the Decomposition A=P L U? I don't understand the function of the returned pivots in order to construct that Decomposition.

Author:  Sergey.Bochkanov [ Mon Nov 28, 2011 9:05 am ]
Post subject:  Re: LU Factorization

Here is extract from documentation:

Quote:
A is represented as A = P*L*U, where:
* L is lower unitriangular matrix
* U is upper triangular matrix
* P = P0*P1*...*PK, K=min(M,N)-1,
Pi - permutation matrix for I and Pivots[I]

Author:  rishka [ Mon Nov 28, 2011 9:51 am ]
Post subject:  Re: LU Factorization

It seems we are talking past each other. Please take a look at this example (mycode)

LU Decomposition A = L U.
A:
2,000000 -1,000000 0,000000
1,000000 0,000000 -1,000000
3,000000 7,000000 -1,000000

The Decomposition of A is
L:
0,666667 1,000000 0,000000
0,333333 0,411765 1,000000
1,000000 0,000000 0,000000
U:
3,000000 7,000000 -1,000000
0,000000 -5,666667 0,666667
0,000000 0,000000 -0,941176

Now please consider the output of alglib routine rmatrixlux

---> LUA:
3,0000 7,0000 -1,0000
0,6667 -5,6667 0,6667
0,3333 0,4118 -0,9412
---> PIVOTS:
2 2 2

Matrix U can easily be extracted. But the construction of L is what is making me a headache when using alglib's rmatrixlu.

Author:  Sergey.Bochkanov [ Mon Nov 28, 2011 11:16 am ]
Post subject:  Re: LU Factorization

L is unitriangular, which means that its diagonal elements are equal to 1.0. In your case L is equal to
1,0000 0,0000 0,0000
0,6667 1,0000 0,0000
0,3333 0,4118 1,0000

Author:  rishka [ Mon Nov 28, 2011 12:40 pm ]
Post subject:  Re: LU Factorization

Which in this case would mean, that LU != A. And, what about the Pivots? I know i am intrusive, and i am really sorry about that, but i hope to solve this (little) problem with your very appreciated help.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/