Pivots (Gaussian reduction)
|
06-05-2015, 05:06 PM
(This post was last modified: 06-05-2015 10:47 PM by salvomic.)
Post: #2
|
|||
|
|||
RE: Pivots (Gaussian elimination)
A version a bit more "advanced". Now it can handle swapping for rows if there is problem in finding solution (*if* the solution there is, the matrix isn't singular, and so on...).
But I've still not found a real *general* formula: help very appreciated! When it runs well, the program now returns pivots(), LDU() and LDLt() factorization, and a routine to calculate permutation matrix also. In this version there isn't still a menu... The code (sorry for some //comments for debugging): Code:
The examples (see at the end of the program are): M2: [[2,1,1], [4,-6,0], [-2,7,2]] with pivots: {2,-8,1} -> U [[2,1,1], [0,-8,2], [0,0,1]] M3: [[1,1,1], [1,2,-2], [2,1,-3]] with pivots: {1,1,8} -> [[1,1,1], [0,1,-3], [0,0,-8]] M4: [[0,3,-1], [1,1,2], [1,4,1]] with pivots: {1,3,0} -> [[1,1,2], [0,3,-1], [0,0,0]] (this one will swap two times; try also another version: [[1,1,2], [0,3,-1], [1,4,1]]: swap two times, with inverted pivots: without the function for swap in the program it'll give "error: invalid input"...): it's a singular matrix (determinant 0, as the product of pivots) M6: [[2,-1,0], [-1,2,-1], [0,-1,2]] with pivots: {2, 3/2, 4/3} -> U [[2, -1, 0], [0, 3/3, -1], [0,0, 4/3]] M7: [[1,2,3], [2,4,3], [3,2,-1]] with pivots: {1, -4, -3} -> [[1,2,3], [0,-4,-10], [0, 0, -3]] M8: [[1,1,1], [1,1,3], [2,5,8]] with pivots: {1,3,2} -> U [[1,1,1], [0,3,6], [0,0,2]] (with swapping row 2 and 3) And now the problem of the "non general" formula (please, let me understand where I'm wrong): Code:
But I'm searching for *one* formula, not more ;-) Thank you for your patience and effort! Salvo EDIT: thanks Dale (DrD) and Claudio L. for some tips! ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Pivots (Gaussian reduction) - salvomic - 06-03-2015, 01:20 PM
RE: Pivots (Gaussian elimination) - salvomic - 06-05-2015 05:06 PM
RE: Pivots (Gaussian elimination) - DrD - 06-05-2015, 07:03 PM
RE: Pivots (Gaussian elimination) - salvomic - 06-05-2015, 07:29 PM
RE: Pivots (Gaussian reduction) - salvomic - 06-06-2015, 09:41 PM
RE: Pivots (Gaussian reduction) - DrD - 06-07-2015, 10:42 AM
RE: Pivots (Gaussian reduction) - salvomic - 06-07-2015, 11:28 AM
RE: Pivots (Gaussian reduction) - DrD - 06-07-2015, 12:13 PM
RE: Pivots (Gaussian reduction) - salvomic - 06-07-2015, 12:41 PM
RE: Pivots (Gaussian reduction) - salvomic - 06-08-2015, 04:02 PM
RE: Pivots (Gaussian reduction) - salvomic - 06-08-2015, 10:15 PM
RE: Pivots (Gaussian reduction) - DrD - 06-09-2015, 10:55 AM
RE: Pivots (Gaussian reduction) - salvomic - 06-09-2015, 12:50 PM
RE: Pivots (Gaussian reduction) - salvomic - 06-13-2015, 02:56 PM
|
User(s) browsing this thread: 1 Guest(s)