1function [L,U,p,q] = cs_lu (A,tol) %#ok 2%CS_LU sparse LU factorization, with fill-reducing ordering. 3% [L,U,p] = cs_lu(A) factorizes A(p,:) into L*U using no fill-reducing 4% ordering. 5% 6% [L,U,p] = cs_lu(A,tol) factorizes A(p,:) into L*U using no fill-reducing 7% ordering. Entries on the diagonal are given preference in partial pivoting. 8% 9% [L,U,p,q] = cs_lu(A) factorizes A(p,q) into L*U using a fill-reducing 10% ordering q = cs_amd(A,2). Normal partial pivoting is used. 11% 12% [L,U,p,q] = cs_lu(A,tol) factorizes A(p,q) into L*U, using a fill-reducing 13% ordering q = cs_amd(A,1). Entries on the diagonal are given preference in 14% partial pivoting. With a pivot tolerance tol, the entries in L have 15% magnitude 1/tol or less. tol = 1 is normal partial pivoting (with 16% q = cs_amd(A)). tol = 0 ensures p = q. 0<tol<1 is relaxed partial 17% pivoting; the diagonal is selected if it is >= tol * max(abs(A(:,k))). 18% 19% Example: 20% Prob = ssget ('HB/arc130') ; A = Prob.A ; [L,U,p,q] = cs_lu (A) ; 21% cspy (A (p,q)) ; cspy (L+U) ; 22% norm (L*U - A(p,q), 1) 23% 24% See also CS_AMD, LU, UMFPACK, AMD, COLAMD. 25 26% Copyright 2006-2012, Timothy A. Davis, http://www.suitesparse.com 27 28error ('cs_lu mexFunction not found') ; 29