~logan/ubuntu/trusty/suitesparse/4.2.1-3ubuntu1

« back to all changes in this revision

Viewing changes to UMFPACK/MATLAB/umfpack2.m

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [out1, out2, out3, out4, out5] = umfpack2(in1, in2, in3, in4, in5) %#ok
 
2
%UMFPACK2 computes x=A\b, x=A/b, or lu (A) for a sparse matrix A
 
3
% It is also a built-in function in MATLAB, used in x=A\b.
 
4
%
 
5
% Example:
 
6
%
 
7
% UMFPACK:                            |  MATLAB approximate equivalent:
 
8
% ---------------------------------------------------------------------
 
9
% x = umfpack2 (A, '\', b) ;          |  x = A \ b
 
10
%                                     |
 
11
% x = umfpack2 (b, '/', A) ;          |  x = b / A
 
12
%                                     |
 
13
% [L,U,P,Q] = umfpack2 (A) ;          |  [m,n] = size (A) ;
 
14
%                                     |  I = speye (n) ;
 
15
%                                     |  Q = I (:, colamd (A)) ;
 
16
%                                     |  [L,U,P] = lu (A*Q) ;
 
17
%                                     |
 
18
% [L,U,P,Q,R] = umfpack2 (A) ;        |  [m,n] = size (A) ;
 
19
%                                     |  I = speye (n) ;
 
20
%                                     |  Q = I (:, colamd (A)) ;
 
21
%                                     |  r = full (sum (abs (A), 2)) ;
 
22
%                                     |  r (find (r == 0)) = 1 ;
 
23
%                                     |  R = spdiags (r, 0, m, m) ;
 
24
%                                     |  [L,U,P] = lu ((R\A)*Q) ;
 
25
%                                     |
 
26
% [P,Q,F,C] = umfpack2 (A, 'symbolic')|  [m,n] = size (A) ;
 
27
%                                     |  I = speye (n) ;
 
28
%                                     |  Q = I (:, colamd (A)) ;
 
29
%                                     |  [count,h,parent,post] = ...
 
30
%                                     |  symbfact (A*Q, 'col') ;
 
31
%
 
32
% A must be sparse.  It can be complex, singular, and/or rectangular.  A must be
 
33
% square for '/' or '\'.  b must be a full real or complex vector.  For
 
34
% [L,U,P,Q,R] = umfpack2 (A), the factorization is L*U = P*(R\A)*Q.  If A has a
 
35
% mostly symmetric nonzero pattern, then replace "colamd" with "amd" in the
 
36
% MATLAB-equivalent column in the table above.  Type umfpack_details for more
 
37
% information.
 
38
%
 
39
% See also: lu_normest, colamd, amd, umfpack.
 
40
% To use UMFPACK for an arbitrary b, see umfpack_solve.
 
41
 
 
42
% Copyright 1995-2007 by Timothy A. Davis.
 
43
 
 
44
help umfpack2
 
45
error ('umfpack2 mexFunction not found') ;
 
46