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

« back to all changes in this revision

Viewing changes to BTF/MATLAB/drawbtf.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
1
function drawbtf (A, p, q, r)
2
 
% drawbtf (A, p, q, r)
 
2
%DRAWBTF plot the BTF form of a matrix
3
3
%
4
4
% A(p,q) is in BTF form, r the block boundaries
5
5
%
6
 
% [p,q,r] = dmperm (A) for example
 
6
% Example:
 
7
%   [p,q,r] = dmperm (A)
 
8
%   drawbtf (A, p, q, r)
 
9
%
 
10
% See also btf, maxtrans, strongcomp, dmperm.
 
11
 
 
12
% Copyright 2004-2007, Tim Davis, University of Florida
7
13
 
8
14
nblocks = length (r) - 1 ;
9
15
 
10
16
hold off
11
 
spy (A (p,q))
 
17
spy (A (p,abs(q)))
12
18
hold on
13
19
 
14
20
for k = 1:nblocks
16
22
    k2 = r (k+1) ;
17
23
    nk = k2 - k1 ;
18
24
    if (nk > 1)
19
 
        plot ([k1 k2 k2 k1 k1]-.5, [k1 k1 k2 k2 k1]-.5, 'g') ;
 
25
        plot ([k1 k2 k2 k1 k1]-.5, [k1 k1 k2 k2 k1]-.5, 'r') ;
20
26
    end
21
27
end