About LU factorization
|
06-04-2015, 05:10 PM
(This post was last modified: 06-05-2015 09:52 AM by salvomic.)
Post: #21
|
|||
|
|||
RE: About LU factorization
(06-04-2015 04:57 PM)Werner Wrote: ... hi Werner, both methods have goods and issues... Maybe Parisse and Tim could tell us more about the Prime and LU... However for matrices operations perhaps it could be better to have also some little commands or helps, like a command to extract pivots, to get cofactors, adjoint, minors, and also factorizations LDU (LDV) and LDLt. As they are missing, I'm trying to make some programs, but for pivots I'm getting these troubles... Some other calculators have those commands, if I well remember (i.e., TI 89/Voyage had adj / cofactor function)... For example I use a lot a little program to get minor of a matrix: Code:
I made a program to calculate Cofactor matrix and adjoint matrix (see here)... Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
06-05-2015, 08:15 PM
Post: #22
|
|||
|
|||
RE: About LU factorization
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 ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
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]] ? 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. |
|||
06-05-2015, 09:00 PM
Post: #24
|
|||
|
|||
RE: About LU factorization
(06-05-2015 08:38 PM)Claudio L. Wrote: 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. thank you Claudio! something like this? Code:
∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
06-07-2015, 06:42 PM
Post: #25
|
|||
|
|||
RE: About LU factorization | |||
06-07-2015, 07:20 PM
Post: #26
|
|||
|
|||
RE: About LU factorization
(06-07-2015 06:42 PM)parisse Wrote: permu2mat in Xcas, not available on the Prime. thank you, Parisse, I hope this command could be included in the Prime in a next firmware also Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
06-08-2015, 01:12 PM
(This post was last modified: 06-08-2015 01:16 PM by Claudio L..)
Post: #27
|
|||
|
|||
RE: About LU factorization
(06-05-2015 09:00 PM)salvomic Wrote: something like this? I don't have a Prime but looks correct to me, you can test easily that permMatrix(P)*A will swap the rows in any matrix A to the order you specified in the vector P. EDIT: I mean correct in the algorithm, I think your function is missing the size as argument?: permMatrix(P,3) EDIT AGAIN: Nevermind... I was misled by your comment in the code, but you fot the size automatically. |
|||
06-08-2015, 01:15 PM
Post: #28
|
|||
|
|||
RE: About LU factorization
(06-08-2015 01:12 PM)Claudio L. Wrote: I don't have a Prime but looks correct to me, you can test easily that permMatrix(P)*A will swap the rows in any matrix A to the order you specified in the vector P. it seems to be good, almost for the 10-20 matrices I tried thanks! Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)