Skip to content

Commit

Permalink
v3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Oct 19, 2019
1 parent ded2b32 commit 9b5800e
Show file tree
Hide file tree
Showing 693 changed files with 19,975 additions and 18,756 deletions.
12 changes: 8 additions & 4 deletions BTF/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Mar 24, 2009: version 1.1.0

* tabs expanded to 8 spaces; version number updated to stay in sync with KLU

Nov 1, 2007: version 1.0.1

* trivial change to BTF/MATLAB/btf.c mexFunction: unused variable removed.
Expand All @@ -15,13 +19,13 @@ May 31, 2007: version 1.0 released
* maxwork parameter added to btf_maxtrans and btf_order

* btf_maxtrans modified; now returns Q[i] = -1 if row i is unmatched;
code to complete the permutation moved to btf_order. This also
changes the maxtrans mexFunction.
code to complete the permutation moved to btf_order. This also
changes the maxtrans mexFunction.

* btf_install added for easy MATLAB installation

* illustrative recursive version of maxtrans removed (see the recursive
version of cs_maxtrans in CSparse instead)
version of cs_maxtrans in CSparse instead)

* MAXTRANS_* macros renamed BTF_*

Expand All @@ -34,5 +38,5 @@ Dec 12, 2006: version 0.11
Apr 30, 2006:

* minor editing of comments. dmperm.c moved to MATLAB directory, since
it requires MATLAB. Version number not changed.
it requires MATLAB. Version number not changed.

12 changes: 6 additions & 6 deletions BTF/Doc/lesser.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999

Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Expand All @@ -10,7 +10,7 @@
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]

Preamble
Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Expand Down Expand Up @@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.

GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License Agreement applies to any software library or other
Expand Down Expand Up @@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

NO WARRANTY
NO WARRANTY

15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
Expand All @@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Libraries

Expand Down
84 changes: 42 additions & 42 deletions BTF/Include/btf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* BTF_MAXTRANS: find a column permutation Q to give A*Q a zero-free diagonal
* BTF_STRONGCOMP: find a symmetric permutation P to put P*A*P' into block
* upper triangular form.
* upper triangular form.
* BTF_ORDER: do both of the above (btf_maxtrans then btf_strongcomp).
*
* Copyright (c) 2004-2007. Tim Davis, University of Florida,
Expand Down Expand Up @@ -36,8 +36,8 @@
* k of the original matrix becomes column Match[k] of the permuted matrix. In
* MATLAB, this can be expressed as (for non-structurally singular matrices):
*
* Match = maxtrans (A) ;
* B = A (:, Match) ;
* Match = maxtrans (A) ;
* B = A (:, Match) ;
*
* except of course here the A matrix and Match vector are all 0-based (rows
* and columns in the range 0 to n-1), not 1-based (rows/cols in range 1 to n).
Expand All @@ -51,19 +51,19 @@
* In the MATLAB mexFunction interface to btf_maxtrans, 1 is added to the Match
* array to obtain a 1-based permutation. Thus, in MATLAB where A is m-by-n:
*
* q = maxtrans (A) ; % has entries in the range 0:n
* q % a column permutation (only if sprank(A)==n)
* B = A (:, q) ; % permuted matrix (only if sprank(A)==n)
* sum (q > 0) ; % same as "sprank (A)"
* q = maxtrans (A) ; % has entries in the range 0:n
* q % a column permutation (only if sprank(A)==n)
* B = A (:, q) ; % permuted matrix (only if sprank(A)==n)
* sum (q > 0) ; % same as "sprank (A)"
*
* This behaviour differs from p = dmperm (A) in MATLAB, which returns the
* matching as p(j)=i if row i and column j are matched, and p(j)=0 if column j
* is unmatched.
*
* p = dmperm (A) ; % has entries in the range 0:m
* p % a row permutation (only if sprank(A)==m)
* B = A (p, :) ; % permuted matrix (only if sprank(A)==m)
* sum (p > 0) ; % definition of sprank (A)
* p = dmperm (A) ; % has entries in the range 0:m
* p % a row permutation (only if sprank(A)==m)
* B = A (p, :) ; % permuted matrix (only if sprank(A)==m)
* sum (p > 0) ; % definition of sprank (A)
*
* This algorithm is based on the paper "On Algorithms for obtaining a maximum
* transversal" by Iain Duff, ACM Trans. Mathematical Software, vol 7, no. 1,
Expand Down Expand Up @@ -98,20 +98,20 @@ extern "C" {
int btf_maxtrans /* returns # of columns matched */
(
/* --- input, not modified: --- */
int nrow, /* A is nrow-by-ncol in compressed column form */
int nrow, /* A is nrow-by-ncol in compressed column form */
int ncol,
int Ap [ ], /* size ncol+1 */
int Ai [ ], /* size nz = Ap [ncol] */
int Ap [ ], /* size ncol+1 */
int Ai [ ], /* size nz = Ap [ncol] */
double maxwork, /* maximum amount of work to do is maxwork*nnz(A); no limit
* if <= 0 */
* if <= 0 */

/* --- output, not defined on input --- */
double *work, /* work = -1 if maxwork > 0 and the total work performed
* reached the maximum of maxwork*nnz(A).
* Otherwise, work = the total work performed. */
* reached the maximum of maxwork*nnz(A).
* Otherwise, work = the total work performed. */

int Match [ ], /* size nrow. Match [i] = j if column j matched to row i
* (see above for the singular-matrix case) */
* (see above for the singular-matrix case) */

/* --- workspace, not defined on input or output --- */
int Work [ ] /* size 5*ncol */
Expand Down Expand Up @@ -147,18 +147,18 @@ UF_long btf_l_maxtrans (UF_long, UF_long, UF_long *, UF_long *, double,
int btf_strongcomp /* return # of strongly connected components */
(
/* input, not modified: */
int n, /* A is n-by-n in compressed column form */
int Ap [ ], /* size n+1 */
int Ai [ ], /* size nz = Ap [n] */
int n, /* A is n-by-n in compressed column form */
int Ap [ ], /* size n+1 */
int Ai [ ], /* size nz = Ap [n] */

/* optional input, modified (if present) on output: */
int Q [ ], /* size n, input column permutation */
int Q [ ], /* size n, input column permutation */

/* output, not defined on input */
int P [ ], /* size n. P [k] = j if row and column j are kth row/col
* in permuted matrix. */
int P [ ], /* size n. P [k] = j if row and column j are kth row/col
* in permuted matrix. */

int R [ ], /* size n+1. block b is in rows/cols R[b] ... R[b+1]-1 */
int R [ ], /* size n+1. block b is in rows/cols R[b] ... R[b+1]-1 */

/* workspace, not defined on input or output */
int Work [ ] /* size 4n */
Expand Down Expand Up @@ -191,20 +191,20 @@ UF_long btf_l_strongcomp (UF_long, UF_long *, UF_long *, UF_long *, UF_long *,
* number of strongly connected components found.
*/

int btf_order /* returns number of blocks found */
int btf_order /* returns number of blocks found */
(
/* --- input, not modified: --- */
int n, /* A is n-by-n in compressed column form */
int Ap [ ], /* size n+1 */
int Ai [ ], /* size nz = Ap [n] */
int n, /* A is n-by-n in compressed column form */
int Ap [ ], /* size n+1 */
int Ai [ ], /* size nz = Ap [n] */
double maxwork, /* do at most maxwork*nnz(A) work in the maximum
* transversal; no limit if <= 0 */
* transversal; no limit if <= 0 */

/* --- output, not defined on input --- */
double *work, /* return value from btf_maxtrans */
int P [ ], /* size n, row permutation */
int Q [ ], /* size n, column permutation */
int R [ ], /* size n+1. block b is in rows/cols R[b] ... R[b+1]-1 */
int P [ ], /* size n, row permutation */
int Q [ ], /* size n, column permutation */
int R [ ], /* size n+1. block b is in rows/cols R[b] ... R[b+1]-1 */
int *nmatch, /* # nonzeros on diagonal of P*A*Q */

/* --- workspace, not defined on input or output --- */
Expand Down Expand Up @@ -239,22 +239,22 @@ UF_long btf_l_order (UF_long, UF_long *, UF_long *, double , double *,
/* All versions of BTF include these definitions.
* As an example, to test if the version you are using is 1.2 or later:
*
* if (BTF_VERSION >= BTF_VERSION_CODE (1,2)) ...
* if (BTF_VERSION >= BTF_VERSION_CODE (1,2)) ...
*
* This also works during compile-time:
*
* #if (BTF >= BTF_VERSION_CODE (1,2))
* printf ("This is version 1.2 or later\n") ;
* #else
* printf ("This is an early version\n") ;
* #endif
* #if (BTF >= BTF_VERSION_CODE (1,2))
* printf ("This is version 1.2 or later\n") ;
* #else
* printf ("This is an early version\n") ;
* #endif
*/

#define BTF_DATE "Nov 1, 2007"
#define BTF_DATE "Mar 24, 2009"
#define BTF_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
#define BTF_MAIN_VERSION 1
#define BTF_SUB_VERSION 0
#define BTF_SUBSUB_VERSION 1
#define BTF_SUB_VERSION 1
#define BTF_SUBSUB_VERSION 0
#define BTF_VERSION BTF_VERSION_CODE(BTF_MAIN_VERSION,BTF_SUB_VERSION)

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions BTF/MATLAB/Test/checkbtf.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ function checkbtf (A, p, q, r)
error ('r(end) not n+1') ;
end

if (nblocks < 1 | nblocks > n) %#ok
if (nblocks < 1 | nblocks > n) %#ok
error ('nblocks wrong') ;
end

nblocks = length (r) - 1 ;
rdiff = r (2:(nblocks+1)) - r (1:nblocks) ;
if (any (rdiff < 1) | any (rdiff > n)) %#ok
if (any (rdiff < 1) | any (rdiff > n)) %#ok
error ('r bad')
end

8 changes: 4 additions & 4 deletions BTF/MATLAB/Test/test1.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function test1 (nmat)
Nzdiag = zeros (nmat,1) ;

% warmup
p = maxtrans (sparse (1)) ; %#ok
p = cs_dmperm (sparse (1)) ; %#ok
a = cs_transpose (sparse (1)) ; %#ok
p = maxtrans (sparse (1)) ; %#ok
p = cs_dmperm (sparse (1)) ; %#ok
a = cs_transpose (sparse (1)) ; %#ok

h = waitbar (0, 'BTF test 1 of 6') ;

Expand Down Expand Up @@ -91,7 +91,7 @@ function test1 (nmat)
error ('!') ;
end

if (s0 == n & m == n) %#ok
if (s0 == n & m == n) %#ok
B = A (:, q) ;
subplot (2,2,1) ;
cspy (B) ;
Expand Down
8 changes: 4 additions & 4 deletions BTF/MATLAB/Test/test2.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ function test2 (nmat)
Nzdiag = zeros (nmat,1) ;

% warmup
p = maxtrans (sparse (1)) ; %#ok
p = btf (sparse (1)) ; %#ok
p = cs_dmperm (sparse (1)) ; %#ok
a = cs_transpose (sparse (1)) ; %#ok
p = maxtrans (sparse (1)) ; %#ok
p = btf (sparse (1)) ; %#ok
p = cs_dmperm (sparse (1)) ; %#ok
a = cs_transpose (sparse (1)) ; %#ok

h = waitbar (0, 'BTF test 2 of 6') ;

Expand Down
16 changes: 8 additions & 8 deletions BTF/MATLAB/Test/test3.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function test3 (nmat)
-(1:8)' % generated matrices
904 % vanHeukelum/cage3 (5-by-5)
819 % Simon/raefsky6 (permuted triangular matrix)
%
%
% --- older seg faults:
264 % HB/west0156, causes older strongcomp_recursive to fail
824 % TOKAMAK/utm300 (300-by-300), causes older code to fail
Expand Down Expand Up @@ -76,7 +76,7 @@ function test3 (nmat)
851 % Chen/pkustk05
979 % Kamvar/Stanford
374 % Bova/rma10
%
%
% --- lots of time:
395 % DRIVCAV/cavity16
396 % DRIVCAV/cavity17
Expand Down Expand Up @@ -136,9 +136,9 @@ function test3 (nmat)
%
% --- lots of time, and seg faults:
285 % ATandT/pre2
% --- huge matrix, turn off plotting
% --- huge matrix, turn off plotting
940 % Shenk/af_shell1, memory leak in plot, after call to btf, once.
% ----
% ----
]' ;

% maxtrans_recursive causes a seg fault on these matrices, because of
Expand Down Expand Up @@ -217,13 +217,13 @@ function test3 (nmat)
% construct the jth test matrix
j = -j ;
if (j == 1 | j == 2) %#ok
B11 = UFget ('Grund/b1_ss') ; % 7-by-7 diagonal block
B11 = UFget ('Grund/b1_ss') ; % 7-by-7 diagonal block
B11 = B11.A ;
B12 = sparse (zeros (7,2)) ;
B12 (3,2) = 1 ;
B13 = sparse (ones (7,5)) ;
B21 = sparse (zeros (2,7)) ;
B22 = sparse (ones (2,2)) ; % 2-by-2 diagonal block
B22 = sparse (ones (2,2)) ; % 2-by-2 diagonal block
B23 = sparse (ones (2,5)) ;
B31 = sparse (zeros (5,7)) ;
B32 = sparse (zeros (5,2)) ;
Expand Down Expand Up @@ -427,7 +427,7 @@ function test3 (nmat)
if (any (c (kbad) ~= 0))
error ('kbad') ;
end
if (any (c (kgood) == 0)) %#ok
if (any (c (kgood) == 0)) %#ok
error ('kgood') ;
end

Expand Down Expand Up @@ -511,7 +511,7 @@ function test3 (nmat)
drawnow
end

if (matnum ~= nmat & dopause) %#ok
if (matnum ~= nmat & dopause) %#ok
input ('Hit enter: ') ;
end

Expand Down

0 comments on commit 9b5800e

Please sign in to comment.