LDLt decomposition? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: LDLt decomposition? (/thread-2936.html) LDLt decomposition? - salvomic - 01-26-2015 12:30 PM hi all, in HP Prime we have for a matrix LU decomposition (it give P, L, U so PA=LU) and Cholesky decomposition (for that A=LLt, Lt is TRAN(L))... I can't find a factorization LDLt where D is a diagonal of pivot. Is there a way to get it? a program or something? Thank you! Salvo RE: LDLt decomposition? - salvomic - 06-01-2015 05:54 PM I wonder still for this question and another one, connected (in my case): With pivot(Mat, n,m) we get pivot for n,m: what's a simple way to get every pivots (Gauss' reduction); I forgot it thanks! Salvo RE: LDLt decomposition? - salvomic - 06-01-2015 10:51 PM ...to get Pivots I start with this code: Code: ``` EXPORT gaussJordan(m) // Gauss-Jordan elimination and pivots // Salvo MiccichÃ© 2015 BEGIN local temp, temp2, gj, r, c, j, piv; r:=rowDim(m); c:=colDim(m); temp:=MAKEMAT(0,r,c); gj:=MAKEMAT(0,r,c); piv:=MAKELIST(0,X,1,r); gj(1):= m(1); piv(1):=gj(1,1);     temp:= pivot(m,1,1); FOR j FROM 2 TO r DO     temp:=delrows(temp,1);     temp:=delcols(temp,1);     temp:=temp/piv(j-1);     temp:= pivot(temp,1,1);     piv(j):=temp(1,1);     gj(j):= temp(1); END; // for RETURN {gj, piv}; END;``` but I get wrong results (see image): I should get 0 below pivots at left, not ...at right; I'm trying SWAPROW() but it doesn't run... Any help? RE: LDLt decomposition? - DrD - 06-02-2015 11:26 AM Is diag() useful for you? Code: ``` EXPORT gjp() BEGIN    M5:=[[2,1,1,5],[-8,-2,-12,0],[1,2,0,0]];  // Your matrix   M6:=diag(M5);  //  Diagonal Matrix   return M6;   END;``` RE: LDLt decomposition? - salvomic - 06-02-2015 12:10 PM (06-02-2015 11:26 AM)DrD Wrote:  Is diag() useful for you? Code: ``` EXPORT gjp() BEGIN    M5:=[[2,1,1,5],[-8,-2,-12,0],[1,2,0,0]];  // Your matrix   M6:=diag(M5);  //  Diagonal Matrix   return M6;   END;``` hi Dale, diag() is also ok to get pivots, but after to have "pivot-ized" the original matrix: [[2,1,1,5],[4,-6,0,-2],[-2,7,2,9]] My goal is to return a transformed matrix and a list with pivots (and also diag() could be ok). EDIT: Something like that, Dale: Code: ``` EXPORT gaussJordan(m) // Gauss-Jordan elimination and pivots // Salvo MiccichÃ© 2015 BEGIN local temp, k, gj, r, c, j, piv; r:=rowDim(m); c:=colDim(m); temp:=MAKEMAT(0,r,c); gj:=MAKEMAT(0,r,c); piv:=MAKELIST(0,X,1,r); temp:= m; FOR j FROM 1 TO r DO       temp:=pivot(temp,1,1);       // gj(j):= temp(1);     FOR k FROM 1 TO colDim(temp) DO         gj(j, c-k+1):= temp(1, colDim(temp)-k+1);     END; // inner for       piv(j):=temp(1,1);     IF (j