File: spart2.m

package info (click to toggle)
superlu 4.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,100 kB
  • ctags: 6,351
  • sloc: ansic: 61,952; makefile: 398; csh: 141; fortran: 108; sh: 14
file content (28 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [r,s] = spart2(A)
% SPART2 : supernode partition
%
% [r,x] = spart2(A) partitions the columns of A according to supernode 
% definition 2:
% A supernode in A = L+U is a sequence of adjacent columns in which
% the diagonal block of L is full,
% and below the diagonal all the columns (of L) have the same row structure.
% Output: row and column partitions r and s suitable for SPYPART(A,r,s)
%
% Copyright (c) 1995 by Xerox Corporation.  All rights reserved.
% HELP COPYRIGHT for complete copyright and licensing notice.


[nr,nc] = size(A);
A = spones(A);
A = tril(A) | speye(nr,nc);

A1 = tril([zeros(nr,1) A]);
A2 = [A ones(nr,1)];

signature = sum(xor(A1,A2));
r = find(signature);
r = r';
if nargout > 1,
    s = r;
    r = [1 nr+1];
end;