Post Reply 
About LU factorization
06-05-2015, 08:38 PM
Post: #23
RE: About LU factorization
(06-05-2015 08:15 PM)salvomic Wrote:  Given the permutation matrix (by LU), like [1,3,2] is there a way to obtain the actual permutation matrix (like P21 = [[0,1,0], [1,0,0], [0,0,1]] ?
I need to make a routine with that matrix for the program to calculate LDU factorization as, sometime, L*D*U returns the matrix A with some swap of rows (indicated by the permutation matrix by LU).

Salvo

To get the permutation matrix, simply create an NxN matrix with all zeros, and for each row, take a number off the list, and put a 1 in the corresponding column.
For example:
[ 1 , 3 , 2 ] --> Put a 1 in the 1st column on row 1, on row 2 put it in the 3rd column, and on the 3rd row put it in the 2nd column.
You'll get [[ 1 0 0 ] [0 0 1] [0 1 0]], which is what you are looking for.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
About LU factorization - salvomic - 06-04-2015, 09:10 AM
RE: About LU factorization - Paul Dale - 06-04-2015, 09:18 AM
RE: About LU factorization - salvomic - 06-04-2015, 09:52 AM
RE: About LU factorization - Tugdual - 06-04-2015, 10:15 AM
RE: About LU factorization - Paul Dale - 06-04-2015, 10:22 AM
RE: About LU factorization - Tugdual - 06-04-2015, 10:36 AM
RE: About LU factorization - DrD - 06-04-2015, 10:31 AM
RE: About LU factorization - DrD - 06-04-2015, 10:45 AM
RE: About LU factorization - salvomic - 06-04-2015, 11:06 AM
RE: About LU factorization - DrD - 06-04-2015, 11:30 AM
RE: About LU factorization - salvomic - 06-04-2015, 12:05 PM
RE: About LU factorization - salvomic - 06-04-2015, 12:48 PM
RE: About LU factorization - DrD - 06-04-2015, 01:31 PM
RE: About LU factorization - salvomic - 06-04-2015, 01:36 PM
RE: About LU factorization - DrD - 06-04-2015, 02:12 PM
RE: About LU factorization - salvomic - 06-04-2015, 02:19 PM
RE: About LU factorization - DrD - 06-04-2015, 02:19 PM
RE: About LU factorization - salvomic - 06-04-2015, 02:22 PM
RE: About LU factorization - Werner - 06-04-2015, 04:57 PM
RE: About LU factorization - Gerald H - 06-04-2015, 05:10 PM
RE: About LU factorization - salvomic - 06-04-2015, 05:10 PM
RE: About LU factorization - salvomic - 06-05-2015, 08:15 PM
RE: About LU factorization - Claudio L. - 06-05-2015 08:38 PM
RE: About LU factorization - salvomic - 06-05-2015, 09:00 PM
RE: About LU factorization - Claudio L. - 06-08-2015, 01:12 PM
RE: About LU factorization - salvomic - 06-08-2015, 01:15 PM
RE: About LU factorization - parisse - 06-07-2015, 06:42 PM
RE: About LU factorization - salvomic - 06-07-2015, 07:20 PM



User(s) browsing this thread: 1 Guest(s)