Mercurial > octave-nkf
view liboctave/UMFPACK/UMFPACK/MATLAB/umfpack_demo.m.out @ 5164:57077d0ddc8e
[project @ 2005-02-25 19:55:24 by jwe]
author | jwe |
---|---|
date | Fri, 25 Feb 2005 19:55:28 +0000 |
parents | |
children |
line wrap: on
line source
>> umfpack_demo Enter the printing level for UMFPACK's output statistics: 0: none, 1: errors only, 2: statistics, 4: print some of outputs 5: print all output [default is 1]: -------------------------------------------------------------- Factor and solve a small system, Ax=b, using default parameters Solving Ax=b via UMFPACK: Solving Ax=b via MATLAB: Difference between UMFPACK and MATLAB solution: 0 -------------------------------------------------------------- Factorizing [L, U, P, Q, R] = umfpack (A) P * (R\A) * Q - L*U should be zero: norm (P*(R\A)*Q - L*U, 1) = 6.80012e-16 (exact) 6.80012e-16 (estimated) Solution to Ax=b via UMFPACK factorization: x = Q * (U \ (L \ (P * (R \ b)))) UMFPACK flop count: 2354 Factorizing [L, U, P] = lu (A (:, q)) If you are using a version of MATLAB prior to V6.0, then the following statement (q = colamd (A)) may fail. Either download colamd from http://www.cise.ufl.edu/research/sparse, upgrade to MATLAB V6.0 or later, or replace the statement with q = colmmd (A) ; Solution to Ax=b via MATLAB factorization: x = U \ (L \ (P * b)) ; x (q) = x ; Difference between UMFPACK and MATLAB solution: 7.10543e-15 MATLAB LU flop count: 3164 -------------------------------------------------------------- Solve A'x=b: Solving A'x=b via UMFPACK: Solving A'x=b via MATLAB: Difference between UMFPACK and MATLAB solution: 2.66454e-15 -------------------------------------------------------------- Compute C = A', and compute the LU factorization of C. Factorizing A' can sometimes be better than factorizing A itself (less work and memory usage). Solve C'x=b; the solution is the same as the solution to Ax=b for the original A. P * (R\C) * Q - L*U should be zero: norm (P*(R\C)*Q - L*U, 1) = 1.94289e-16 (exact) 5.55112e-17 (estimated) Solution to Ax=b via UMFPACK, using the factors of C: x = R \ (P' * (L' \ (U' \ (Q' * b)))) ; Solution to Ax=b via MATLAB: Difference between UMFPACK and MATLAB solution: 7.10543e-15 -------------------------------------------------------------- Solve AX=B, where B is n-by-10, and sparse Difference between UMFPACK and MATLAB solution: 6.72949e-14 -------------------------------------------------------------- Solve AX=B, where B is n-by-10, and sparse, using umfpack_btf Difference between UMFPACK and MATLAB solution: 8.51541e-14 -------------------------------------------------------------- Solve A'X=B, where B is n-by-10, and sparse Difference between UMFPACK and MATLAB solution: 7.99291e-14 -------------------------------------------------------------- det(A): -4.07453e-05 UMFPACK determinant: -4.07453e-05 >> >> diary off