matrix-decomposition

MATLAB LU Decomposition Partial pivoting

你。 提交于 2019-12-07 18:53:33
问题 I'm trying to work with my lu decomposition largely based on LU decomposition with partial pivoting Matlab function [L,U,P] = lup(A) n = length(A); L = eye(n); U = zeros(n); P = eye(n); for k=1:n-1 % find the entry in the left column with the largest abs value (pivot) [~,r] = max(abs(A(k:end,k))); r = n-(n-k+1)+r; A([k r],:) = A([r k],:); P([k r],:) = P([r k],:); L([k r],:) = L([r k],:); % from the pivot down divide by the pivot L(k+1:n,k) = A(k+1:n,k) / A(k,k); U(k,1:n) = A(k,1:n); A(k+1:n,1

MATLAB LU Decomposition Partial pivoting

大憨熊 提交于 2019-12-06 11:02:50
I'm trying to work with my lu decomposition largely based on LU decomposition with partial pivoting Matlab function [L,U,P] = lup(A) n = length(A); L = eye(n); U = zeros(n); P = eye(n); for k=1:n-1 % find the entry in the left column with the largest abs value (pivot) [~,r] = max(abs(A(k:end,k))); r = n-(n-k+1)+r; A([k r],:) = A([r k],:); P([k r],:) = P([r k],:); L([k r],:) = L([r k],:); % from the pivot down divide by the pivot L(k+1:n,k) = A(k+1:n,k) / A(k,k); U(k,1:n) = A(k,1:n); A(k+1:n,1:n) = A(k+1:n,1:n) - L(k+1:n,k)*A(k,1:n); end U(:,end) = A(:,end); end It seems to work for most

Correct use of pivot in Cholesky decomposition of positive semi-definite matrix

Deadly 提交于 2019-12-05 06:59:26
I don't understand how to use the chol function in R to factor a positive semi-definite matrix. (Or I do, and there's a bug.) The documentation states: If pivot = TRUE, then the Choleski decomposition of a positive semi-definite x can be computed. The rank of x is returned as attr(Q, "rank"), subject to numerical errors. The pivot is returned as attr(Q, "pivot"). It is no longer the case that t(Q) %*% Q equals x. However, setting pivot <- attr(Q, "pivot") and oo <- order(pivot), it is true that t(Q[, oo]) %*% Q[, oo] equals x ... The following example seems to belie this description. > x <-

CHOLMOD in Java

∥☆過路亽.° 提交于 2019-11-26 09:58:00
问题 I asked already something similar, but this time I will be more specific. I need to perform, within a for loop, the Cholesky factorization of a generally large positive definite symmetrix matrix (about 1000x1000 ). Now, to do this, I have been giving a try to: 1) Apache Math library 2) Parallel Colt library 3) JLapack library In any of the three above-mentioned cases, the time consumption is terribly long, if compared to MATLAB, for instance. Therefore I am wondering if there is any highly