+++ /dev/null
-#------------------------------------------------------------------------------
-# compile the AMD demo (for both GNU make or original make)
-#-----------------------------------------------------------------------------
-
-all: amd_simple amd_demo amd_demo2
-
-include ../Make/Make.include
-
-C = $(CC) $(CFLAGS) $(CONFIG) -I../Include
-
-INC = ../Include/amd.h
-
-../Lib/libamd.a:
- ( cd ../Source ; make )
-
-../Lib/libamdf77.a:
- ( cd ../Source ; make fortran )
-
-#------------------------------------------------------------------------------
-# Create the demo program, run it, and compare the output
-#------------------------------------------------------------------------------
-
-dist:
-
-amd_demo: amd_demo.c ../Lib/libamd.a $(INC)
- $(C) -DDINT -o amd_demo amd_demo.c ../Lib/libamd.a $(LIB)
- ./amd_demo > my_amd_demo.out
- - diff amd_demo.out my_amd_demo.out
-
-amd_demo2: amd_demo2.c ../Lib/libamd.a $(INC)
- $(C) -DDINT -o amd_demo2 amd_demo2.c ../Lib/libamd.a $(LIB)
- ./amd_demo2 > my_amd_demo2.out
- - diff amd_demo2.out my_amd_demo2.out
-
-amd_simple: amd_simple.c ../Lib/libamd.a $(INC)
- $(C) -DDINT -o amd_simple amd_simple.c ../Lib/libamd.a $(LIB)
- ./amd_simple > my_amd_simple.out
- - diff amd_simple.out my_amd_simple.out
-
-#------------------------------------------------------------------------------
-# compile the Fortran demo
-#------------------------------------------------------------------------------
-
-fortran: amd_f77demo amd_f77simple
-
-cross: amd_f77cross
-
-amd_f77demo: amd_f77demo.f ../Lib/libamdf77.a
- $(F77) $(F77FLAGS) -o amd_f77demo amd_f77demo.f ../Lib/libamdf77.a \
- $(F77LIB)
- ./amd_f77demo > my_amd_f77demo.out
- - diff amd_f77demo.out my_amd_f77demo.out
-
-amd_f77simple: amd_f77simple.f ../Lib/libamdf77.a
- $(F77) $(F77FLAGS) -o amd_f77simple amd_f77simple.f \
- ../Lib/libamdf77.a $(F77LIB)
- ./amd_f77simple > my_amd_f77simple.out
- - diff amd_f77simple.out my_amd_f77simple.out
-
-amd_f77wrapper.o: amd_f77wrapper.c
- $(C) -DDINT -c amd_f77wrapper.c
-
-amd_f77cross: amd_f77cross.f amd_f77wrapper.o ../Lib/libamd.a
- $(F77) $(F77FLAGS) -o amd_f77cross amd_f77cross.f amd_f77wrapper.o \
- ../Lib/libamd.a $(F77LIB)
- ./amd_f77cross > my_amd_f77cross.out
- - diff amd_f77cross.out my_amd_f77cross.out
-
-#------------------------------------------------------------------------------
-# Remove all but the files in the original distribution
-#------------------------------------------------------------------------------
-
-purge: clean
- - $(RM) amd_demo my_amd_demo.out
- - $(RM) amd_demo2 my_amd_demo2.out
- - $(RM) amd_simple my_amd_simple.out
- - $(RM) amd_f77demo my_amd_f77demo.out
- - $(RM) amd_f77simple my_amd_f77simple.out
- - $(RM) amd_f77cross my_amd_f77cross.out
+++ /dev/null
-/* ========================================================================= */
-/* === AMD demo main program =============================================== */
-/* ========================================================================= */
-
-/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
-/* web: http://www.cise.ufl.edu/research/sparse/amd */
-/* ------------------------------------------------------------------------- */
-
-/* A simple C main program that illustrates the use of the ANSI C interface
- * to AMD.
- */
-
-#include "amd.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-int main (int argc, char **argv)
-{
- /* The symmetric can_24 Harwell/Boeing matrix, including upper and lower
- * triangular parts, and the diagonal entries. Note that this matrix is
- * 0-based, with row and column indices in the range 0 to n-1. */
- int n = 24, nz,
- Ap [ ] = { 0, 9, 15, 21, 27, 33, 39, 48, 57, 61, 70, 76, 82, 88, 94, 100,
- 106, 110, 119, 128, 137, 143, 152, 156, 160 },
- Ai [ ] = {
- /* column 0: */ 0, 5, 6, 12, 13, 17, 18, 19, 21,
- /* column 1: */ 1, 8, 9, 13, 14, 17,
- /* column 2: */ 2, 6, 11, 20, 21, 22,
- /* column 3: */ 3, 7, 10, 15, 18, 19,
- /* column 4: */ 4, 7, 9, 14, 15, 16,
- /* column 5: */ 0, 5, 6, 12, 13, 17,
- /* column 6: */ 0, 2, 5, 6, 11, 12, 19, 21, 23,
- /* column 7: */ 3, 4, 7, 9, 14, 15, 16, 17, 18,
- /* column 8: */ 1, 8, 9, 14,
- /* column 9: */ 1, 4, 7, 8, 9, 13, 14, 17, 18,
- /* column 10: */ 3, 10, 18, 19, 20, 21,
- /* column 11: */ 2, 6, 11, 12, 21, 23,
- /* column 12: */ 0, 5, 6, 11, 12, 23,
- /* column 13: */ 0, 1, 5, 9, 13, 17,
- /* column 14: */ 1, 4, 7, 8, 9, 14,
- /* column 15: */ 3, 4, 7, 15, 16, 18,
- /* column 16: */ 4, 7, 15, 16,
- /* column 17: */ 0, 1, 5, 7, 9, 13, 17, 18, 19,
- /* column 18: */ 0, 3, 7, 9, 10, 15, 17, 18, 19,
- /* column 19: */ 0, 3, 6, 10, 17, 18, 19, 20, 21,
- /* column 20: */ 2, 10, 19, 20, 21, 22,
- /* column 21: */ 0, 2, 6, 10, 11, 19, 20, 21, 22,
- /* column 22: */ 2, 20, 21, 22,
- /* column 23: */ 6, 11, 12, 23 } ;
-
- int P [24], Pinv [24], i, j, k, jnew, p, inew, result ;
- double Control [AMD_CONTROL], Info [AMD_INFO] ;
- char A [24][24] ;
-
- printf ("AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;
-
- /* get the default parameters, and print them */
- amd_defaults (Control) ;
- amd_control (Control) ;
-
- /* print the input matrix */
- nz = Ap [n] ;
- printf ("\nInput matrix: %d-by-%d, with %d entries.\n"
- " Note that for a symmetric matrix such as this one, only the\n"
- " strictly lower or upper triangular parts would need to be\n"
- " passed to AMD, since AMD computes the ordering of A+A'. The\n"
- " diagonal entries are also not needed, since AMD ignores them.\n"
- , n, n, nz) ;
- for (j = 0 ; j < n ; j++)
- {
- printf ("\nColumn: %d, number of entries: %d, with row indices in"
- " Ai [%d ... %d]:\n row indices:",
- j, Ap [j+1] - Ap [j], Ap [j], Ap [j+1]-1) ;
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
- {
- i = Ai [p] ;
- printf (" %d", i) ;
- }
- printf ("\n") ;
- }
-
- /* print a character plot of the input matrix. This is only reasonable
- * because the matrix is small. */
- printf ("\nPlot of input matrix pattern:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- for (i = 0 ; i < n ; i++) A [i][j] = '.' ;
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
- {
- i = Ai [p] ;
- A [i][j] = 'X' ;
- }
- }
- printf (" ") ;
- for (j = 0 ; j < n ; j++) printf (" %1d", j % 10) ;
- printf ("\n") ;
- for (i = 0 ; i < n ; i++)
- {
- printf ("%2d: ", i) ;
- for (j = 0 ; j < n ; j++)
- {
- printf (" %c", A [i][j]) ;
- }
- printf ("\n") ;
- }
-
- /* order the matrix */
- result = amd_order (n, Ap, Ai, P, Control, Info) ;
- printf ("return value from amd_order: %d (should be %d)\n",
- result, AMD_OK) ;
-
- /* print the statistics */
- amd_info (Info) ;
-
- if (result != AMD_OK)
- {
- printf ("AMD failed\n") ;
- exit (1) ;
- }
-
- /* print the permutation vector, P, and compute the inverse permutation */
- printf ("Permutation vector:\n") ;
- for (k = 0 ; k < n ; k++)
- {
- /* row/column j is the kth row/column in the permuted matrix */
- j = P [k] ;
- Pinv [j] = k ;
- printf (" %2d", j) ;
- }
- printf ("\n\n") ;
-
- printf ("Inverse permutation vector:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- k = Pinv [j] ;
- printf (" %2d", k) ;
- }
- printf ("\n\n") ;
-
- /* print a character plot of the permuted matrix. */
- printf ("\nPlot of permuted matrix pattern:\n") ;
- for (jnew = 0 ; jnew < n ; jnew++)
- {
- j = P [jnew] ;
- for (inew = 0 ; inew < n ; inew++) A [inew][jnew] = '.' ;
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
- {
- inew = Pinv [Ai [p]] ;
- A [inew][jnew] = 'X' ;
- }
- }
- printf (" ") ;
- for (j = 0 ; j < n ; j++) printf (" %1d", j % 10) ;
- printf ("\n") ;
- for (i = 0 ; i < n ; i++)
- {
- printf ("%2d: ", i) ;
- for (j = 0 ; j < n ; j++)
- {
- printf (" %c", A [i][j]) ;
- }
- printf ("\n") ;
- }
-
- return (0) ;
-}
+++ /dev/null
-AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:
-
-amd: approximate minimum degree ordering, parameters:
- dense row parameter: 10
- (rows with more than max (10 * sqrt (n), 16) entries are
- considered "dense", and placed last in output permutation)
- aggressive absorption: yes
-
-
-Input matrix: 24-by-24, with 160 entries.
- Note that for a symmetric matrix such as this one, only the
- strictly lower or upper triangular parts would need to be
- passed to AMD, since AMD computes the ordering of A+A'. The
- diagonal entries are also not needed, since AMD ignores them.
-
-Column: 0, number of entries: 9, with row indices in Ai [0 ... 8]:
- row indices: 0 5 6 12 13 17 18 19 21
-
-Column: 1, number of entries: 6, with row indices in Ai [9 ... 14]:
- row indices: 1 8 9 13 14 17
-
-Column: 2, number of entries: 6, with row indices in Ai [15 ... 20]:
- row indices: 2 6 11 20 21 22
-
-Column: 3, number of entries: 6, with row indices in Ai [21 ... 26]:
- row indices: 3 7 10 15 18 19
-
-Column: 4, number of entries: 6, with row indices in Ai [27 ... 32]:
- row indices: 4 7 9 14 15 16
-
-Column: 5, number of entries: 6, with row indices in Ai [33 ... 38]:
- row indices: 0 5 6 12 13 17
-
-Column: 6, number of entries: 9, with row indices in Ai [39 ... 47]:
- row indices: 0 2 5 6 11 12 19 21 23
-
-Column: 7, number of entries: 9, with row indices in Ai [48 ... 56]:
- row indices: 3 4 7 9 14 15 16 17 18
-
-Column: 8, number of entries: 4, with row indices in Ai [57 ... 60]:
- row indices: 1 8 9 14
-
-Column: 9, number of entries: 9, with row indices in Ai [61 ... 69]:
- row indices: 1 4 7 8 9 13 14 17 18
-
-Column: 10, number of entries: 6, with row indices in Ai [70 ... 75]:
- row indices: 3 10 18 19 20 21
-
-Column: 11, number of entries: 6, with row indices in Ai [76 ... 81]:
- row indices: 2 6 11 12 21 23
-
-Column: 12, number of entries: 6, with row indices in Ai [82 ... 87]:
- row indices: 0 5 6 11 12 23
-
-Column: 13, number of entries: 6, with row indices in Ai [88 ... 93]:
- row indices: 0 1 5 9 13 17
-
-Column: 14, number of entries: 6, with row indices in Ai [94 ... 99]:
- row indices: 1 4 7 8 9 14
-
-Column: 15, number of entries: 6, with row indices in Ai [100 ... 105]:
- row indices: 3 4 7 15 16 18
-
-Column: 16, number of entries: 4, with row indices in Ai [106 ... 109]:
- row indices: 4 7 15 16
-
-Column: 17, number of entries: 9, with row indices in Ai [110 ... 118]:
- row indices: 0 1 5 7 9 13 17 18 19
-
-Column: 18, number of entries: 9, with row indices in Ai [119 ... 127]:
- row indices: 0 3 7 9 10 15 17 18 19
-
-Column: 19, number of entries: 9, with row indices in Ai [128 ... 136]:
- row indices: 0 3 6 10 17 18 19 20 21
-
-Column: 20, number of entries: 6, with row indices in Ai [137 ... 142]:
- row indices: 2 10 19 20 21 22
-
-Column: 21, number of entries: 9, with row indices in Ai [143 ... 151]:
- row indices: 0 2 6 10 11 19 20 21 22
-
-Column: 22, number of entries: 4, with row indices in Ai [152 ... 155]:
- row indices: 2 20 21 22
-
-Column: 23, number of entries: 4, with row indices in Ai [156 ... 159]:
- row indices: 6 11 12 23
-
-Plot of input matrix pattern:
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- 0: X . . . . X X . . . . . X X . . . X X X . X . .
- 1: . X . . . . . . X X . . . X X . . X . . . . . .
- 2: . . X . . . X . . . . X . . . . . . . . X X X .
- 3: . . . X . . . X . . X . . . . X . . X X . . . .
- 4: . . . . X . . X . X . . . . X X X . . . . . . .
- 5: X . . . . X X . . . . . X X . . . X . . . . . .
- 6: X . X . . X X . . . . X X . . . . . . X . X . X
- 7: . . . X X . . X . X . . . . X X X X X . . . . .
- 8: . X . . . . . . X X . . . . X . . . . . . . . .
- 9: . X . . X . . X X X . . . X X . . X X . . . . .
-10: . . . X . . . . . . X . . . . . . . X X X X . .
-11: . . X . . . X . . . . X X . . . . . . . . X . X
-12: X . . . . X X . . . . X X . . . . . . . . . . X
-13: X X . . . X . . . X . . . X . . . X . . . . . .
-14: . X . . X . . X X X . . . . X . . . . . . . . .
-15: . . . X X . . X . . . . . . . X X . X . . . . .
-16: . . . . X . . X . . . . . . . X X . . . . . . .
-17: X X . . . X . X . X . . . X . . . X X X . . . .
-18: X . . X . . . X . X X . . . . X . X X X . . . .
-19: X . . X . . X . . . X . . . . . . X X X X X . .
-20: . . X . . . . . . . X . . . . . . . . X X X X .
-21: X . X . . . X . . . X X . . . . . . . X X X X .
-22: . . X . . . . . . . . . . . . . . . . . X X X .
-23: . . . . . . X . . . . X X . . . . . . . . . . X
-return value from amd_order: 0 (should be 0)
-
-amd: approximate minimum degree ordering, results:
- status: OK
- n, dimension of A: 24
- nz, number of nonzeros in A: 160
- symmetry of A: 1.0000
- number of nonzeros on diagonal: 24
- nonzeros in pattern of A+A' (excl. diagonal): 136
- # dense rows/columns of A+A': 0
- memory used, in bytes: 1516
- # of memory compactions: 0
-
- The following approximate statistics are for a subsequent
- factorization of A(P,P) + A(P,P)'. They are slight upper
- bounds if there are no dense rows/columns in A+A', and become
- looser if dense rows/columns exist.
-
- nonzeros in L (excluding diagonal): 97
- nonzeros in L (including diagonal): 121
- # divide operations for LDL' or LU: 97
- # multiply-subtract operations for LDL': 275
- # multiply-subtract operations for LU: 453
- max nz. in any column of L (incl. diagonal): 8
-
- chol flop count for real A, sqrt counted as 1 flop: 671
- LDL' flop count for real A: 647
- LDL' flop count for complex A: 3073
- LU flop count for real A (with no pivoting): 1003
- LU flop count for complex A (with no pivoting): 4497
-
-Permutation vector:
- 22 20 10 23 12 5 16 8 14 4 15 7 1 9 13 17 0 2 3 6 11 18 21 19
-
-Inverse permutation vector:
- 16 12 17 18 9 5 19 11 7 13 2 20 4 14 8 10 6 15 21 23 1 22 0 3
-
-
-Plot of permuted matrix pattern:
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- 0: X X . . . . . . . . . . . . . . . X . . . . X .
- 1: X X X . . . . . . . . . . . . . . X . . . . X X
- 2: . X X . . . . . . . . . . . . . . . X . . X X X
- 3: . . . X X . . . . . . . . . . . . . . X X . . .
- 4: . . . X X X . . . . . . . . . . X . . X X . . .
- 5: . . . . X X . . . . . . . . X X X . . X . . . .
- 6: . . . . . . X . . X X X . . . . . . . . . . . .
- 7: . . . . . . . X X . . . X X . . . . . . . . . .
- 8: . . . . . . . X X X . X X X . . . . . . . . . .
- 9: . . . . . . X . X X X X . X . . . . . . . . . .
-10: . . . . . . X . . X X X . . . . . . X . . X . .
-11: . . . . . . X . X X X X . X . X . . X . . X . .
-12: . . . . . . . X X . . . X X X X . . . . . . . .
-13: . . . . . . . X X X . X X X X X . . . . . X . .
-14: . . . . . X . . . . . . X X X X X . . . . . . .
-15: . . . . . X . . . . . X X X X X X . . . . X . X
-16: . . . . X X . . . . . . . . X X X . . X . X X X
-17: X X . . . . . . . . . . . . . . . X . X X . X .
-18: . . X . . . . . . . X X . . . . . . X . . X . X
-19: . . . X X X . . . . . . . . . . X X . X X . X X
-20: . . . X X . . . . . . . . . . . . X . X X . X .
-21: . . X . . . . . . . X X . X . X X . X . . X . X
-22: X X X . . . . . . . . . . . . . X X . X X . X X
-23: . X X . . . . . . . . . . . . X X . X X . X X X
+++ /dev/null
-/* ========================================================================= */
-/* === AMD demo main program (jumbled matrix version) ====================== */
-/* ========================================================================= */
-
-/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
-/* web: http://www.cise.ufl.edu/research/sparse/amd */
-/* ------------------------------------------------------------------------- */
-
-/* A simple C main program that illustrates the use of the ANSI C interface
- * to AMD.
- *
- * Identical to amd_demo.c, except that it operates on an input matrix that has
- * unsorted columns and duplicate entries.
- */
-
-#include "amd.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-int main (int argc, char **argv)
-{
- /* The symmetric can_24 Harwell/Boeing matrix (jumbled, and not symmetric).
- * Since AMD operates on A+A', only A(i,j) or A(j,i) need to be specified,
- * or both. The diagonal entries are optional (some are missing).
- * There are many duplicate entries, which must be removed. */
- int n = 24, nz,
- Ap [ ] = { 0, 9, 14, 20, 28, 33, 37, 44, 53, 58, 63, 63, 66, 69, 72, 75,
- 78, 82, 86, 91, 97, 101, 112, 112, 116 },
- Ai [ ] = {
- /* column 0: */ 0, 17, 18, 21, 5, 12, 5, 0, 13,
- /* column 1: */ 14, 1, 8, 13, 17,
- /* column 2: */ 2, 20, 11, 6, 11, 22,
- /* column 3: */ 3, 3, 10, 7, 18, 18, 15, 19,
- /* column 4: */ 7, 9, 15, 14, 16,
- /* column 5: */ 5, 13, 6, 17,
- /* column 6: */ 5, 0, 11, 6, 12, 6, 23,
- /* column 7: */ 3, 4, 9, 7, 14, 16, 15, 17, 18,
- /* column 8: */ 1, 9, 14, 14, 14,
- /* column 9: */ 7, 13, 8, 1, 17,
- /* column 10: */
- /* column 11: */ 2, 12, 23,
- /* column 12: */ 5, 11, 12,
- /* column 13: */ 0, 13, 17,
- /* column 14: */ 1, 9, 14,
- /* column 15: */ 3, 15, 16,
- /* column 16: */ 16, 4, 4, 15,
- /* column 17: */ 13, 17, 19, 17,
- /* column 18: */ 15, 17, 19, 9, 10,
- /* column 19: */ 17, 19, 20, 0, 6, 10,
- /* column 20: */ 22, 10, 20, 21,
- /* column 21: */ 6, 2, 10, 19, 20, 11, 21, 22, 22, 22, 22,
- /* column 22: */
- /* column 23: */ 12, 11, 12, 23 } ;
-
- int Rp [25], Ri [116] ;
- int P [24], Pinv [24], i, j, k, jnew, p, inew, result ;
- double Control [AMD_CONTROL], Info [AMD_INFO] ;
- char A [24][24] ;
-
- printf ("AMD demo, with a jumbled version of the 24-by-24\n") ;
- printf ("Harwell/Boeing matrix, can_24:\n") ;
-
- /* get the default parameters, and print them */
- amd_defaults (Control) ;
- amd_control (Control) ;
-
- /* print the input matrix */
- nz = Ap [n] ;
- printf ("\nJumbled input matrix: %d-by-%d, with %d entries.\n"
- " Note that for a symmetric matrix such as this one, only the\n"
- " strictly lower or upper triangular parts would need to be\n"
- " passed to AMD, since AMD computes the ordering of A+A'. The\n"
- " diagonal entries are also not needed, since AMD ignores them.\n"
- " This version of the matrix has jumbled columns and duplicate\n"
- " row indices, and must be fixed by amd_preprocess prior to\n"
- " ordering it with amd_order.\n" , n, n, nz) ;
- for (j = 0 ; j < n ; j++)
- {
- printf ("\nColumn: %d, number of entries: %d, with row indices in"
- " Ai [%d ... %d]:\n row indices:",
- j, Ap [j+1] - Ap [j], Ap [j], Ap [j+1]-1) ;
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
- {
- i = Ai [p] ;
- printf (" %d", i) ;
- }
- printf ("\n") ;
- }
-
- /* print a character plot of the input matrix. This is only reasonable
- * because the matrix is small. */
- printf ("\nPlot of (jumbled) input matrix pattern:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- for (i = 0 ; i < n ; i++) A [i][j] = '.' ;
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
- {
- i = Ai [p] ;
- A [i][j] = 'X' ;
- }
- }
- printf (" ") ;
- for (j = 0 ; j < n ; j++) printf (" %1d", j % 10) ;
- printf ("\n") ;
- for (i = 0 ; i < n ; i++)
- {
- printf ("%2d: ", i) ;
- for (j = 0 ; j < n ; j++)
- {
- printf (" %c", A [i][j]) ;
- }
- printf ("\n") ;
- }
-
- /* sort, remove duplicates, and transpose A to get R */
- result = amd_preprocess (n, Ap, Ai, Rp, Ri) ;
- printf ("return value from amd_preprocess: %d (should be %d)\n",
- result, AMD_OK) ;
-
- if (result != AMD_OK)
- {
- printf ("AMD failed\n") ;
- exit (1) ;
- }
-
- /* print the sorted/transposed matrix R */
- printf ("\nThe column-oriented form of the sorted/transposed matrix R:\n");
- for (j = 0 ; j < n ; j++)
- {
- printf ("\nColumn: %d, number of entries: %d, with row indices in"
- " Ri [%d ... %d]:\n row indices:",
- j, Rp [j+1] - Rp [j], Rp [j], Rp [j+1]-1) ;
- for (p = Rp [j] ; p < Rp [j+1] ; p++)
- {
- i = Ri [p] ;
- printf (" %d", i) ;
- }
- printf ("\n") ;
- }
-
- /* print a character plot of the matrix R. */
- printf ("\nPlot of the sorted/transposed matrix R:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- for (i = 0 ; i < n ; i++) A [i][j] = '.' ;
- for (p = Rp [j] ; p < Rp [j+1] ; p++)
- {
- i = Ri [p] ;
- A [i][j] = 'X' ;
- }
- }
- printf (" ") ;
- for (j = 0 ; j < n ; j++) printf (" %1d", j % 10) ;
- printf (" \n") ;
- for (i = 0 ; i < n ; i++)
- {
- printf ("%2d: ", i) ;
- for (j = 0 ; j < n ; j++)
- {
- printf (" %c", A [i][j]) ;
- }
- printf (" \n") ;
- }
-
- /* print a character plot of the matrix R+R'. */
- printf ("\nPlot of symmetric matrix to be ordered by amd_order:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- for (i = 0 ; i < n ; i++) A [i][j] = '.' ;
- }
- for (j = 0 ; j < n ; j++)
- {
- A [j][j] = 'X' ;
- for (p = Rp [j] ; p < Rp [j+1] ; p++)
- {
- i = Ri [p] ;
- A [i][j] = 'X' ;
- A [j][i] = 'X' ;
- }
- }
- printf (" ") ;
- for (j = 0 ; j < n ; j++) printf (" %1d", j % 10) ;
- printf ("\n") ;
- for (i = 0 ; i < n ; i++)
- {
- printf ("%2d: ", i) ;
- for (j = 0 ; j < n ; j++)
- {
- printf (" %c", A [i][j]) ;
- }
- printf ("\n") ;
- }
-
- /* order the matrix */
- result = amd_order (n, Rp, Ri, P, Control, Info) ;
- printf ("return value from amd_order: %d (should be %d)\n",
- result, AMD_OK) ;
-
- /* print the statistics */
- amd_info (Info) ;
-
- if (result != AMD_OK)
- {
- printf ("AMD failed\n") ;
- exit (1) ;
- }
-
- /* print the permutation vector, P, and compute the inverse permutation */
- printf ("Permutation vector:\n") ;
- for (k = 0 ; k < n ; k++)
- {
- /* row/column j is the kth row/column in the permuted matrix */
- j = P [k] ;
- Pinv [j] = k ;
- printf (" %2d", j) ;
- }
- printf ("\n\n") ;
-
- printf ("Inverse permutation vector:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- k = Pinv [j] ;
- printf (" %2d", k) ;
- }
- printf ("\n\n") ;
-
- /* print a character plot of the permuted matrix. */
- printf ("\nPlot of (symmetrized) permuted matrix pattern:\n") ;
- for (j = 0 ; j < n ; j++)
- {
- for (i = 0 ; i < n ; i++) A [i][j] = '.' ;
- }
- for (jnew = 0 ; jnew < n ; jnew++)
- {
- j = P [jnew] ;
- A [jnew][jnew] = 'X' ;
- for (p = Rp [j] ; p < Rp [j+1] ; p++)
- {
- inew = Pinv [Ri [p]] ;
- A [inew][jnew] = 'X' ;
- A [jnew][inew] = 'X' ;
- }
- }
- printf (" ") ;
- for (j = 0 ; j < n ; j++) printf (" %1d", j % 10) ;
- printf ("\n") ;
- for (i = 0 ; i < n ; i++)
- {
- printf ("%2d: ", i) ;
- for (j = 0 ; j < n ; j++)
- {
- printf (" %c", A [i][j]) ;
- }
- printf ("\n") ;
- }
-
- return (0) ;
-}
+++ /dev/null
-AMD demo, with a jumbled version of the 24-by-24
-Harwell/Boeing matrix, can_24:
-
-amd: approximate minimum degree ordering, parameters:
- dense row parameter: 10
- (rows with more than max (10 * sqrt (n), 16) entries are
- considered "dense", and placed last in output permutation)
- aggressive absorption: yes
-
-
-Jumbled input matrix: 24-by-24, with 116 entries.
- Note that for a symmetric matrix such as this one, only the
- strictly lower or upper triangular parts would need to be
- passed to AMD, since AMD computes the ordering of A+A'. The
- diagonal entries are also not needed, since AMD ignores them.
- This version of the matrix has jumbled columns and duplicate
- row indices, and must be fixed by amd_preprocess prior to
- ordering it with amd_order.
-
-Column: 0, number of entries: 9, with row indices in Ai [0 ... 8]:
- row indices: 0 17 18 21 5 12 5 0 13
-
-Column: 1, number of entries: 5, with row indices in Ai [9 ... 13]:
- row indices: 14 1 8 13 17
-
-Column: 2, number of entries: 6, with row indices in Ai [14 ... 19]:
- row indices: 2 20 11 6 11 22
-
-Column: 3, number of entries: 8, with row indices in Ai [20 ... 27]:
- row indices: 3 3 10 7 18 18 15 19
-
-Column: 4, number of entries: 5, with row indices in Ai [28 ... 32]:
- row indices: 7 9 15 14 16
-
-Column: 5, number of entries: 4, with row indices in Ai [33 ... 36]:
- row indices: 5 13 6 17
-
-Column: 6, number of entries: 7, with row indices in Ai [37 ... 43]:
- row indices: 5 0 11 6 12 6 23
-
-Column: 7, number of entries: 9, with row indices in Ai [44 ... 52]:
- row indices: 3 4 9 7 14 16 15 17 18
-
-Column: 8, number of entries: 5, with row indices in Ai [53 ... 57]:
- row indices: 1 9 14 14 14
-
-Column: 9, number of entries: 5, with row indices in Ai [58 ... 62]:
- row indices: 7 13 8 1 17
-
-Column: 10, number of entries: 0, with row indices in Ai [63 ... 62]:
- row indices:
-
-Column: 11, number of entries: 3, with row indices in Ai [63 ... 65]:
- row indices: 2 12 23
-
-Column: 12, number of entries: 3, with row indices in Ai [66 ... 68]:
- row indices: 5 11 12
-
-Column: 13, number of entries: 3, with row indices in Ai [69 ... 71]:
- row indices: 0 13 17
-
-Column: 14, number of entries: 3, with row indices in Ai [72 ... 74]:
- row indices: 1 9 14
-
-Column: 15, number of entries: 3, with row indices in Ai [75 ... 77]:
- row indices: 3 15 16
-
-Column: 16, number of entries: 4, with row indices in Ai [78 ... 81]:
- row indices: 16 4 4 15
-
-Column: 17, number of entries: 4, with row indices in Ai [82 ... 85]:
- row indices: 13 17 19 17
-
-Column: 18, number of entries: 5, with row indices in Ai [86 ... 90]:
- row indices: 15 17 19 9 10
-
-Column: 19, number of entries: 6, with row indices in Ai [91 ... 96]:
- row indices: 17 19 20 0 6 10
-
-Column: 20, number of entries: 4, with row indices in Ai [97 ... 100]:
- row indices: 22 10 20 21
-
-Column: 21, number of entries: 11, with row indices in Ai [101 ... 111]:
- row indices: 6 2 10 19 20 11 21 22 22 22 22
-
-Column: 22, number of entries: 0, with row indices in Ai [112 ... 111]:
- row indices:
-
-Column: 23, number of entries: 4, with row indices in Ai [112 ... 115]:
- row indices: 12 11 12 23
-
-Plot of (jumbled) input matrix pattern:
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- 0: X . . . . . X . . . . . . X . . . . . X . . . .
- 1: . X . . . . . . X X . . . . X . . . . . . . . .
- 2: . . X . . . . . . . . X . . . . . . . . . X . .
- 3: . . . X . . . X . . . . . . . X . . . . . . . .
- 4: . . . . . . . X . . . . . . . . X . . . . . . .
- 5: X . . . . X X . . . . . X . . . . . . . . . . .
- 6: . . X . . X X . . . . . . . . . . . . X . X . .
- 7: . . . X X . . X . X . . . . . . . . . . . . . .
- 8: . X . . . . . . . X . . . . . . . . . . . . . .
- 9: . . . . X . . X X . . . . . X . . . X . . . . .
-10: . . . X . . . . . . . . . . . . . . X X X X . .
-11: . . X . . . X . . . . . X . . . . . . . . X . X
-12: X . . . . . X . . . . X X . . . . . . . . . . X
-13: X X . . . X . . . X . . . X . . . X . . . . . .
-14: . X . . X . . X X . . . . . X . . . . . . . . .
-15: . . . X X . . X . . . . . . . X X . X . . . . .
-16: . . . . X . . X . . . . . . . X X . . . . . . .
-17: X X . . . X . X . X . . . X . . . X X X . . . .
-18: X . . X . . . X . . . . . . . . . . . . . . . .
-19: . . . X . . . . . . . . . . . . . X X X . X . .
-20: . . X . . . . . . . . . . . . . . . . X X X . .
-21: X . . . . . . . . . . . . . . . . . . . X X . .
-22: . . X . . . . . . . . . . . . . . . . . X X . .
-23: . . . . . . X . . . . X . . . . . . . . . . . X
-return value from amd_preprocess: 0 (should be 0)
-
-The column-oriented form of the sorted/transposed matrix R:
-
-Column: 0, number of entries: 4, with row indices in Ri [0 ... 3]:
- row indices: 0 6 13 19
-
-Column: 1, number of entries: 4, with row indices in Ri [4 ... 7]:
- row indices: 1 8 9 14
-
-Column: 2, number of entries: 3, with row indices in Ri [8 ... 10]:
- row indices: 2 11 21
-
-Column: 3, number of entries: 3, with row indices in Ri [11 ... 13]:
- row indices: 3 7 15
-
-Column: 4, number of entries: 2, with row indices in Ri [14 ... 15]:
- row indices: 7 16
-
-Column: 5, number of entries: 4, with row indices in Ri [16 ... 19]:
- row indices: 0 5 6 12
-
-Column: 6, number of entries: 5, with row indices in Ri [20 ... 24]:
- row indices: 2 5 6 19 21
-
-Column: 7, number of entries: 4, with row indices in Ri [25 ... 28]:
- row indices: 3 4 7 9
-
-Column: 8, number of entries: 2, with row indices in Ri [29 ... 30]:
- row indices: 1 9
-
-Column: 9, number of entries: 5, with row indices in Ri [31 ... 35]:
- row indices: 4 7 8 14 18
-
-Column: 10, number of entries: 5, with row indices in Ri [36 ... 40]:
- row indices: 3 18 19 20 21
-
-Column: 11, number of entries: 5, with row indices in Ri [41 ... 45]:
- row indices: 2 6 12 21 23
-
-Column: 12, number of entries: 5, with row indices in Ri [46 ... 50]:
- row indices: 0 6 11 12 23
-
-Column: 13, number of entries: 6, with row indices in Ri [51 ... 56]:
- row indices: 0 1 5 9 13 17
-
-Column: 14, number of entries: 5, with row indices in Ri [57 ... 61]:
- row indices: 1 4 7 8 14
-
-Column: 15, number of entries: 6, with row indices in Ri [62 ... 67]:
- row indices: 3 4 7 15 16 18
-
-Column: 16, number of entries: 4, with row indices in Ri [68 ... 71]:
- row indices: 4 7 15 16
-
-Column: 17, number of entries: 9, with row indices in Ri [72 ... 80]:
- row indices: 0 1 5 7 9 13 17 18 19
-
-Column: 18, number of entries: 3, with row indices in Ri [81 ... 83]:
- row indices: 0 3 7
-
-Column: 19, number of entries: 5, with row indices in Ri [84 ... 88]:
- row indices: 3 17 18 19 21
-
-Column: 20, number of entries: 4, with row indices in Ri [89 ... 92]:
- row indices: 2 19 20 21
-
-Column: 21, number of entries: 3, with row indices in Ri [93 ... 95]:
- row indices: 0 20 21
-
-Column: 22, number of entries: 3, with row indices in Ri [96 ... 98]:
- row indices: 2 20 21
-
-Column: 23, number of entries: 3, with row indices in Ri [99 ... 101]:
- row indices: 6 11 23
-
-Plot of the sorted/transposed matrix R:
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- 0: X . . . . X . . . . . . X X . . . X X . . X . .
- 1: . X . . . . . . X . . . . X X . . X . . . . . .
- 2: . . X . . . X . . . . X . . . . . . . . X . X .
- 3: . . . X . . . X . . X . . . . X . . X X . . . .
- 4: . . . . . . . X . X . . . . X X X . . . . . . .
- 5: . . . . . X X . . . . . . X . . . X . . . . . .
- 6: X . . . . X X . . . . X X . . . . . . . . . . X
- 7: . . . X X . . X . X . . . . X X X X X . . . . .
- 8: . X . . . . . . . X . . . . X . . . . . . . . .
- 9: . X . . . . . X X . . . . X . . . X . . . . . .
-10: . . . . . . . . . . . . . . . . . . . . . . . .
-11: . . X . . . . . . . . . X . . . . . . . . . . X
-12: . . . . . X . . . . . X X . . . . . . . . . . .
-13: X . . . . . . . . . . . . X . . . X . . . . . .
-14: . X . . . . . . . X . . . . X . . . . . . . . .
-15: . . . X . . . . . . . . . . . X X . . . . . . .
-16: . . . . X . . . . . . . . . . X X . . . . . . .
-17: . . . . . . . . . . . . . X . . . X . X . . . .
-18: . . . . . . . . . X X . . . . X . X . X . . . .
-19: X . . . . . X . . . X . . . . . . X . X X . . .
-20: . . . . . . . . . . X . . . . . . . . . X X X .
-21: . . X . . . X . . . X X . . . . . . . X X X X .
-22: . . . . . . . . . . . . . . . . . . . . . . . .
-23: . . . . . . . . . . . X X . . . . . . . . . . X
-
-Plot of symmetric matrix to be ordered by amd_order:
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- 0: X . . . . X X . . . . . X X . . . X X X . X . .
- 1: . X . . . . . . X X . . . X X . . X . . . . . .
- 2: . . X . . . X . . . . X . . . . . . . . X X X .
- 3: . . . X . . . X . . X . . . . X . . X X . . . .
- 4: . . . . X . . X . X . . . . X X X . . . . . . .
- 5: X . . . . X X . . . . . X X . . . X . . . . . .
- 6: X . X . . X X . . . . X X . . . . . . X . X . X
- 7: . . . X X . . X . X . . . . X X X X X . . . . .
- 8: . X . . . . . . X X . . . . X . . . . . . . . .
- 9: . X . . X . . X X X . . . X X . . X X . . . . .
-10: . . . X . . . . . . X . . . . . . . X X X X . .
-11: . . X . . . X . . . . X X . . . . . . . . X . X
-12: X . . . . X X . . . . X X . . . . . . . . . . X
-13: X X . . . X . . . X . . . X . . . X . . . . . .
-14: . X . . X . . X X X . . . . X . . . . . . . . .
-15: . . . X X . . X . . . . . . . X X . X . . . . .
-16: . . . . X . . X . . . . . . . X X . . . . . . .
-17: X X . . . X . X . X . . . X . . . X X X . . . .
-18: X . . X . . . X . X X . . . . X . X X X . . . .
-19: X . . X . . X . . . X . . . . . . X X X X X . .
-20: . . X . . . . . . . X . . . . . . . . X X X X .
-21: X . X . . . X . . . X X . . . . . . . X X X X .
-22: . . X . . . . . . . . . . . . . . . . . X X X .
-23: . . . . . . X . . . . X X . . . . . . . . . . X
-return value from amd_order: 0 (should be 0)
-
-amd: approximate minimum degree ordering, results:
- status: OK
- n, dimension of A: 24
- nz, number of nonzeros in A: 102
- symmetry of A: 0.4000
- number of nonzeros on diagonal: 17
- nonzeros in pattern of A+A' (excl. diagonal): 136
- # dense rows/columns of A+A': 0
- memory used, in bytes: 1516
- # of memory compactions: 0
-
- The following approximate statistics are for a subsequent
- factorization of A(P,P) + A(P,P)'. They are slight upper
- bounds if there are no dense rows/columns in A+A', and become
- looser if dense rows/columns exist.
-
- nonzeros in L (excluding diagonal): 97
- nonzeros in L (including diagonal): 121
- # divide operations for LDL' or LU: 97
- # multiply-subtract operations for LDL': 275
- # multiply-subtract operations for LU: 453
- max nz. in any column of L (incl. diagonal): 8
-
- chol flop count for real A, sqrt counted as 1 flop: 671
- LDL' flop count for real A: 647
- LDL' flop count for complex A: 3073
- LU flop count for real A (with no pivoting): 1003
- LU flop count for complex A (with no pivoting): 4497
-
-Permutation vector:
- 22 20 10 23 12 5 16 8 14 4 15 7 1 9 13 17 0 2 3 6 11 18 21 19
-
-Inverse permutation vector:
- 16 12 17 18 9 5 19 11 7 13 2 20 4 14 8 10 6 15 21 23 1 22 0 3
-
-
-Plot of (symmetrized) permuted matrix pattern:
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
- 0: X X . . . . . . . . . . . . . . . X . . . . X .
- 1: X X X . . . . . . . . . . . . . . X . . . . X X
- 2: . X X . . . . . . . . . . . . . . . X . . X X X
- 3: . . . X X . . . . . . . . . . . . . . X X . . .
- 4: . . . X X X . . . . . . . . . . X . . X X . . .
- 5: . . . . X X . . . . . . . . X X X . . X . . . .
- 6: . . . . . . X . . X X X . . . . . . . . . . . .
- 7: . . . . . . . X X . . . X X . . . . . . . . . .
- 8: . . . . . . . X X X . X X X . . . . . . . . . .
- 9: . . . . . . X . X X X X . X . . . . . . . . . .
-10: . . . . . . X . . X X X . . . . . . X . . X . .
-11: . . . . . . X . X X X X . X . X . . X . . X . .
-12: . . . . . . . X X . . . X X X X . . . . . . . .
-13: . . . . . . . X X X . X X X X X . . . . . X . .
-14: . . . . . X . . . . . . X X X X X . . . . . . .
-15: . . . . . X . . . . . X X X X X X . . . . X . X
-16: . . . . X X . . . . . . . . X X X . . X . X X X
-17: X X . . . . . . . . . . . . . . . X . X X . X .
-18: . . X . . . . . . . X X . . . . . . X . . X . X
-19: . . . X X X . . . . . . . . . . X X . X X . X X
-20: . . . X X . . . . . . . . . . . . X . X X . X .
-21: . . X . . . . . . . X X . X . X X . X . . X . X
-22: X X X . . . . . . . . . . . . . X X . X X . X X
-23: . X X . . . . . . . . . . . . X X . X X . X X X
+++ /dev/null
-C ======================================================================
-C === AMD_cross ========================================================
-C ======================================================================
-
-C ----------------------------------------------------------------------
-C AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A.
-C Davis, Patrick R. Amestoy, and Iain S. Duff. See ../README for
-C License. email: davis@cise.ufl.edu CISE Department, Univ. of
-C Florida. web: http://www.cise.ufl.edu/research/sparse/amd
-C ----------------------------------------------------------------------
-
-C This program provides an example of how to call the C version of AMD
-C from a Fortran program. It is HIGHLY non-portable.
-
-C The amd_order routine returns PERM (1) < 0 if an error occurs.
-C (-1: out of memory, -2: invalid matrix)
-
-C Note that the input matrix is 0-based. From Fortran, column j of the
-C matrix is in AI (AP (I)+1 ... AP (I+1)). The row indices in this
-C set are in the range 0 to N-1. To demonstrate this translation,
-C the input matrix is printed in 1-based form. This program uses
-C the same 5-by-5 test matrix as amd_simple.c.
-
- INTEGER N, NZ, K, P
- PARAMETER (N = 5, NZ = 14)
- INTEGER AP (N+1), AI (NZ), PERM (N)
- DATA AP / 0, 2, 6, 10, 12, 14 /
- DATA AI / 0,1, 0,1,2,4, 1,2,3,4, 2,3, 1,4 /
- DOUBLE PRECISION CONTROL (5), INFO (20)
-
-C print the input matrix
- PRINT 10, N, N, NZ
-10 FORMAT ('Input matrix:', I2, '-by-', I2, ' with',I3,' entries')
- DO 40 J = 1, N
- PRINT 20, J, AP (J+1) - AP (J), AP (J)+1, AP (J+1)
-20 FORMAT ( /, 'Column: ', I2, ' number of entries: ', I2,
- $ ' with row indices in AI (', I3, ' ... ', I3, ')')
- PRINT 30, ((AI (P) + 1), P = AP (J) + 1, AP (J+1))
-30 FORMAT (' row indices: ', 24I3)
-40 CONTINUE
-
- CALL AMDDEFAULTS (CONTROL)
- CALL AMDORDER (N, AP, AI, PERM, CONTROL, INFO)
- CALL AMDINFO (INFO)
-
- DO 60 K = 1, N
- PRINT 50, K, PERM (K) + 1
-50 FORMAT ('PERM (',I2,') = ', I2)
-60 CONTINUE
- END
-
+++ /dev/null
-Input matrix: 5-by- 5 with 14 entries
-
-Column: 1 number of entries: 2 with row indices in AI ( 1 ... 2)
- row indices: 1 2
-
-Column: 2 number of entries: 4 with row indices in AI ( 3 ... 6)
- row indices: 1 2 3 5
-
-Column: 3 number of entries: 4 with row indices in AI ( 7 ... 10)
- row indices: 2 3 4 5
-
-Column: 4 number of entries: 2 with row indices in AI ( 11 ... 12)
- row indices: 3 4
-
-Column: 5 number of entries: 2 with row indices in AI ( 13 ... 14)
- row indices: 2 5
-
-amd: approximate minimum degree ordering, results:
- status: OK
- n, dimension of A: 5
- nz, number of nonzeros in A: 14
- symmetry of A: 0.8889
- number of nonzeros on diagonal: 5
- nonzeros in pattern of A+A' (excl. diagonal): 10
- # dense rows/columns of A+A': 0
- memory used, in bytes: 228
- # of memory compactions: 0
-
- The following approximate statistics are for a subsequent
- factorization of A(P,P) + A(P,P)'. They are slight upper
- bounds if there are no dense rows/columns in A+A', and become
- looser if dense rows/columns exist.
-
- nonzeros in L (excluding diagonal): 5
- nonzeros in L (including diagonal): 10
- # divide operations for LDL' or LU: 5
- # multiply-subtract operations for LDL': 6
- # multiply-subtract operations for LU: 7
- max nz. in any column of L (incl. diagonal): 3
-
- chol flop count for real A, sqrt counted as 1 flop: 22
- LDL' flop count for real A: 17
- LDL' flop count for complex A: 93
- LU flop count for real A (with no pivoting): 19
- LU flop count for complex A (with no pivoting): 101
-
-PERM ( 1) = 1
-PERM ( 2) = 4
-PERM ( 3) = 3
-PERM ( 4) = 5
-PERM ( 5) = 2
+++ /dev/null
-C ======================================================================
-C === Fortran AMD demo main program ====================================
-C ======================================================================
-
-C ----------------------------------------------------------------------
-C AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A.
-C Davis, Patrick R. Amestoy, and Iain S. Duff. See ../README for
-C License. email: davis@cise.ufl.edu CISE Department, Univ. of
-C Florida. web: http://www.cise.ufl.edu/research/sparse/amd
-C ----------------------------------------------------------------------
-
-C A simple Fortran 77 main program that illustrates the use of the
-C Fortran version of AMD (both the AMD and AMDBAR routines). Note
-C that aggressive absorption has no effect on this particular matrix.
-
-C AP and AI contain the symmetric can_24 Harwell/Boeing matrix,
-C including upper and lower triangular parts, but excluding the
-C diagonal entries. Note that this matrix is 1-based, with row
-C and column indices in the range 1 to N.
-
- INTEGER N, NZ, IWLEN, PFREE, I, J, K, JNEW, P, INEW,
- $ METHOD, NCMPA
- PARAMETER (N = 24, NZ = 136, IWLEN = 200)
- INTEGER PE (N), DEGREE (N), NV (N), NEXT (N), PERM (N), W (N),
- $ HEAD (N), PINV (N), LEN (N), AP (N+1), AI (NZ), IW (IWLEN)
- CHARACTER A (24,24)
-
- DATA AP
- $ / 1, 9, 14, 19, 24, 29, 34, 42, 50, 53, 61, 66, 71,
- $ 76, 81, 86, 91, 94, 102, 110, 118, 123, 131, 134, 137 /
- DATA AI /
- $ 6, 7, 13, 14, 18, 19, 20, 22,
- $ 9, 10, 14, 15, 18,
- $ 7, 12, 21, 22, 23,
- $ 8, 11, 16, 19, 20,
- $ 8, 10, 15, 16, 17,
- $ 1, 7, 13, 14, 18,
- $ 1, 3, 6, 12, 13, 20, 22, 24,
- $ 4, 5, 10, 15, 16, 17, 18, 19,
- $ 2, 10, 15,
- $ 2, 5, 8, 9, 14, 15, 18, 19,
- $ 4, 19, 20, 21, 22,
- $ 3, 7, 13, 22, 24,
- $ 1, 6, 7, 12, 24,
- $ 1, 2, 6, 10, 18,
- $ 2, 5, 8, 9, 10,
- $ 4, 5, 8, 17, 19,
- $ 5, 8, 16,
- $ 1, 2, 6, 8, 10, 14, 19, 20,
- $ 1, 4, 8, 10, 11, 16, 18, 20,
- $ 1, 4, 7, 11, 18, 19, 21, 22,
- $ 3, 11, 20, 22, 23,
- $ 1, 3, 7, 11, 12, 20, 21, 23,
- $ 3, 21, 22,
- $ 7, 12, 13 /
-
-C print the input matrix
- PRINT 11, N, N, NZ
-11 FORMAT ('AMD Fortran 77 demo, with the 24-by-24',
- $ ' Harwell/Boeing matrix, can_24:'
- $ /, 'Input matrix: ', I2, '-by-', I2,' with ',I3,' entries',
- $ /, 'Note that the Fortran version of AMD requires that'
- $ /, 'no diagonal entries be present.')
- DO 20 J = 1, N
- PRINT 21, J, AP (J+1) - AP (J), AP (J), AP (J+1)-1
-21 FORMAT ( /, 'Column: ', I2, ' number of entries: ', I2,
- $ ' with row indices in AI (', I3, ' ... ', I3, ')')
- PRINT 10, ((AI (P)), P = AP (J), AP (J+1) - 1)
-10 FORMAT (' row indices: ', 24I3)
-20 CONTINUE
-
-C print a character plot of the input matrix. This is only
-C reasonable because the matrix is small.
- PRINT 31
-31 FORMAT ('Plot of input matrix pattern:')
- DO 50 J = 1,N
- DO 30 I = 1,N
- A (I, J) = '.'
-30 CONTINUE
-C add the diagonal entry to the plot
- A (J, J) = 'X'
- DO 40 P = AP (J), AP (J+1) - 1
- I = AI (P)
- A (I, J) = 'X'
-40 CONTINUE
-50 CONTINUE
- PRINT 60, ((MOD (J, 10)), J = 1,N)
-60 FORMAT (' ', 24I2)
- DO 80 I = 1,N
- PRINT 70, I, (A (I, J), J = 1,N)
-70 FORMAT (' ', I2, ': ', 24A2)
-80 CONTINUE
-
- DO 190 METHOD = 1,2
-
-C load the matrix into AMD's workspace
- DO 90 J = 1,N
- PE (J) = AP (J)
- LEN (J) = AP (J+1) - AP (J)
-90 CONTINUE
- DO 100 P = 1,NZ
- IW (P) = AI (P)
-100 CONTINUE
- PFREE = NZ + 1
-
-C order the matrix using AMD or AMDBAR
- IF (METHOD .EQ. 1) THEN
- PRINT 101
-101 FORMAT (/, '------------------------------------------',
- $ /, 'ordering the matrix with AMD',
- $ /, '------------------------------------------')
- CALL AMD (N, PE, IW, LEN, IWLEN, PFREE, NV, NEXT,
- $ PERM, HEAD, PINV, DEGREE, NCMPA, W)
- ELSE
- PRINT 102
-102 FORMAT (/, '------------------------------------------',
- $ /, 'ordering the matrix with AMDBAR',
- $ /, '------------------------------------------')
- CALL AMDBAR (N, PE, IW, LEN, IWLEN, PFREE, NV, NEXT,
- $ PERM, HEAD, PINV, DEGREE, NCMPA, W)
- ENDIF
-
-C print the permutation vector, PERM, and its inverse, PINV.
-C row/column J = PERM (K) is the Kth row/column in the
-C permuted matrix.
- PRINT 110, (PERM (K), K = 1,N)
-110 FORMAT (/, 'Permutation vector: ', /, 24I3)
- PRINT 120, (PINV (J), J = 1,N)
-120 FORMAT (/, 'Inverse permutation vector: ', /, 24I3)
-
-C print a character plot of the permuted matrix.
- PRINT 121
-121 FORMAT ('Plot of permuted matrix pattern:')
- DO 150 JNEW = 1,N
- J = PERM (JNEW)
- DO 130 INEW = 1,N
- A (INEW, JNEW) = '.'
-130 CONTINUE
-C add the diagonal entry to the plot
- A (JNEW, JNEW) = 'X'
- DO 140 P = AP (J), AP (J+1) - 1
- INEW = PINV (AI (P))
- A (INEW, JNEW) = 'X'
-140 CONTINUE
-150 CONTINUE
- PRINT 60, ((MOD (J, 10)), J = 1,N)
- DO 160 I = 1,N
- PRINT 70, I, (A (I, J), J = 1,N)
-160 CONTINUE
-
-C print the permuted matrix, PERM*A*PERM'
- DO 180 JNEW = 1,N
- J = PERM (JNEW)
- PRINT 171, JNEW, J, AP (J+1) - AP (J)
-171 FORMAT (/, 'New column: ', I2, ' old column: ', I2,
- $ ' number of entries: ', I2)
- PRINT 170, (PINV (AI (P)), P = AP (J), AP (J+1) - 1)
-170 FORMAT (' new row indices: ', 24I3)
-180 CONTINUE
-190 CONTINUE
- END
+++ /dev/null
-AMD Fortran 77 demo, with the 24-by-24 Harwell/Boeing matrix, can_24:
-Input matrix: 24-by-24 with 136 entries
-Note that the Fortran version of AMD requires that
-no diagonal entries be present.
-
-Column: 1 number of entries: 8 with row indices in AI ( 1 ... 8)
- row indices: 6 7 13 14 18 19 20 22
-
-Column: 2 number of entries: 5 with row indices in AI ( 9 ... 13)
- row indices: 9 10 14 15 18
-
-Column: 3 number of entries: 5 with row indices in AI ( 14 ... 18)
- row indices: 7 12 21 22 23
-
-Column: 4 number of entries: 5 with row indices in AI ( 19 ... 23)
- row indices: 8 11 16 19 20
-
-Column: 5 number of entries: 5 with row indices in AI ( 24 ... 28)
- row indices: 8 10 15 16 17
-
-Column: 6 number of entries: 5 with row indices in AI ( 29 ... 33)
- row indices: 1 7 13 14 18
-
-Column: 7 number of entries: 8 with row indices in AI ( 34 ... 41)
- row indices: 1 3 6 12 13 20 22 24
-
-Column: 8 number of entries: 8 with row indices in AI ( 42 ... 49)
- row indices: 4 5 10 15 16 17 18 19
-
-Column: 9 number of entries: 3 with row indices in AI ( 50 ... 52)
- row indices: 2 10 15
-
-Column: 10 number of entries: 8 with row indices in AI ( 53 ... 60)
- row indices: 2 5 8 9 14 15 18 19
-
-Column: 11 number of entries: 5 with row indices in AI ( 61 ... 65)
- row indices: 4 19 20 21 22
-
-Column: 12 number of entries: 5 with row indices in AI ( 66 ... 70)
- row indices: 3 7 13 22 24
-
-Column: 13 number of entries: 5 with row indices in AI ( 71 ... 75)
- row indices: 1 6 7 12 24
-
-Column: 14 number of entries: 5 with row indices in AI ( 76 ... 80)
- row indices: 1 2 6 10 18
-
-Column: 15 number of entries: 5 with row indices in AI ( 81 ... 85)
- row indices: 2 5 8 9 10
-
-Column: 16 number of entries: 5 with row indices in AI ( 86 ... 90)
- row indices: 4 5 8 17 19
-
-Column: 17 number of entries: 3 with row indices in AI ( 91 ... 93)
- row indices: 5 8 16
-
-Column: 18 number of entries: 8 with row indices in AI ( 94 ... 101)
- row indices: 1 2 6 8 10 14 19 20
-
-Column: 19 number of entries: 8 with row indices in AI (102 ... 109)
- row indices: 1 4 8 10 11 16 18 20
-
-Column: 20 number of entries: 8 with row indices in AI (110 ... 117)
- row indices: 1 4 7 11 18 19 21 22
-
-Column: 21 number of entries: 5 with row indices in AI (118 ... 122)
- row indices: 3 11 20 22 23
-
-Column: 22 number of entries: 8 with row indices in AI (123 ... 130)
- row indices: 1 3 7 11 12 20 21 23
-
-Column: 23 number of entries: 3 with row indices in AI (131 ... 133)
- row indices: 3 21 22
-
-Column: 24 number of entries: 3 with row indices in AI (134 ... 136)
- row indices: 7 12 13
-Plot of input matrix pattern:
- 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
- 1: X . . . . X X . . . . . X X . . . X X X . X . .
- 2: . X . . . . . . X X . . . X X . . X . . . . . .
- 3: . . X . . . X . . . . X . . . . . . . . X X X .
- 4: . . . X . . . X . . X . . . . X . . X X . . . .
- 5: . . . . X . . X . X . . . . X X X . . . . . . .
- 6: X . . . . X X . . . . . X X . . . X . . . . . .
- 7: X . X . . X X . . . . X X . . . . . . X . X . X
- 8: . . . X X . . X . X . . . . X X X X X . . . . .
- 9: . X . . . . . . X X . . . . X . . . . . . . . .
- 10: . X . . X . . X X X . . . X X . . X X . . . . .
- 11: . . . X . . . . . . X . . . . . . . X X X X . .
- 12: . . X . . . X . . . . X X . . . . . . . . X . X
- 13: X . . . . X X . . . . X X . . . . . . . . . . X
- 14: X X . . . X . . . X . . . X . . . X . . . . . .
- 15: . X . . X . . X X X . . . . X . . . . . . . . .
- 16: . . . X X . . X . . . . . . . X X . X . . . . .
- 17: . . . . X . . X . . . . . . . X X . . . . . . .
- 18: X X . . . X . X . X . . . X . . . X X X . . . .
- 19: X . . X . . . X . X X . . . . X . X X X . . . .
- 20: X . . X . . X . . . X . . . . . . X X X X X . .
- 21: . . X . . . . . . . X . . . . . . . . X X X X .
- 22: X . X . . . X . . . X X . . . . . . . X X X X .
- 23: . . X . . . . . . . . . . . . . . . . . X X X .
- 24: . . . . . . X . . . . X X . . . . . . . . . . X
-
-------------------------------------------
-ordering the matrix with AMD
-------------------------------------------
-
-Permutation vector:
- 24 23 17 9 15 5 21 13 6 11 16 8 2 10 14 18 1 3 4 19 7 12 22 20
-
-Inverse permutation vector:
- 17 13 18 19 6 9 21 12 4 14 10 22 8 15 5 11 3 16 20 24 7 23 2 1
-Plot of permuted matrix pattern:
- 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
- 1: X . . . . . . X . . . . . . . . . . . . X X . .
- 2: . X . . . . X . . . . . . . . . . X . . . . X .
- 3: . . X . . X . . . . X X . . . . . . . . . . . .
- 4: . . . X X . . . . . . . X X . . . . . . . . . .
- 5: . . . X X X . . . . . X X X . . . . . . . . . .
- 6: . . X . X X . . . . X X . X . . . . . . . . . .
- 7: . X . . . . X . . X . . . . . . . X . . . . X X
- 8: X . . . . . . X X . . . . . . . X . . . X X . .
- 9: . . . . . . . X X . . . . . X X X . . . X . . .
- 10: . . . . . . X . . X . . . . . . . . X X . . X X
- 11: . . X . . X . . . . X X . . . . . . X X . . . .
- 12: . . X . X X . . . . X X . X . X . . X X . . . .
- 13: . . . X X . . . . . . . X X X X . . . . . . . .
- 14: . . . X X X . . . . . X X X X X . . . X . . . .
- 15: . . . . . . . . X . . . X X X X X . . . . . . .
- 16: . . . . . . . . X . . X X X X X X . . X . . . X
- 17: . . . . . . . X X . . . . . X X X . . X X . X X
- 18: . X . . . . X . . . . . . . . . . X . . X X X .
- 19: . . . . . . . . . X X X . . . . . . X X . . . X
- 20: . . . . . . . . . X X X . X . X X . X X . . . X
- 21: X . . . . . . X X . . . . . . . X X . . X X X X
- 22: X . . . . . . X . . . . . . . . . X . . X X X .
- 23: . X . . . . X . . X . . . . . . X X . . X X X X
- 24: . . . . . . X . . X . . . . . X X . X X X . X X
-
-New column: 1 old column: 24 number of entries: 3
- new row indices: 21 22 8
-
-New column: 2 old column: 23 number of entries: 3
- new row indices: 18 7 23
-
-New column: 3 old column: 17 number of entries: 3
- new row indices: 6 12 11
-
-New column: 4 old column: 9 number of entries: 3
- new row indices: 13 14 5
-
-New column: 5 old column: 15 number of entries: 5
- new row indices: 13 6 12 4 14
-
-New column: 6 old column: 5 number of entries: 5
- new row indices: 12 14 5 11 3
-
-New column: 7 old column: 21 number of entries: 5
- new row indices: 18 10 24 23 2
-
-New column: 8 old column: 13 number of entries: 5
- new row indices: 17 9 21 22 1
-
-New column: 9 old column: 6 number of entries: 5
- new row indices: 17 21 8 15 16
-
-New column: 10 old column: 11 number of entries: 5
- new row indices: 19 20 24 7 23
-
-New column: 11 old column: 16 number of entries: 5
- new row indices: 19 6 12 3 20
-
-New column: 12 old column: 8 number of entries: 8
- new row indices: 19 6 14 5 11 3 16 20
-
-New column: 13 old column: 2 number of entries: 5
- new row indices: 4 14 15 5 16
-
-New column: 14 old column: 10 number of entries: 8
- new row indices: 13 6 12 4 15 5 16 20
-
-New column: 15 old column: 14 number of entries: 5
- new row indices: 17 13 9 14 16
-
-New column: 16 old column: 18 number of entries: 8
- new row indices: 17 13 9 12 14 15 20 24
-
-New column: 17 old column: 1 number of entries: 8
- new row indices: 9 21 8 15 16 20 24 23
-
-New column: 18 old column: 3 number of entries: 5
- new row indices: 21 22 7 23 2
-
-New column: 19 old column: 4 number of entries: 5
- new row indices: 12 10 11 20 24
-
-New column: 20 old column: 19 number of entries: 8
- new row indices: 17 19 12 14 10 11 16 24
-
-New column: 21 old column: 7 number of entries: 8
- new row indices: 17 18 9 22 8 24 23 1
-
-New column: 22 old column: 12 number of entries: 5
- new row indices: 18 21 8 23 1
-
-New column: 23 old column: 22 number of entries: 8
- new row indices: 17 18 21 10 22 24 7 2
-
-New column: 24 old column: 20 number of entries: 8
- new row indices: 17 19 21 10 16 20 7 23
-
-------------------------------------------
-ordering the matrix with AMDBAR
-------------------------------------------
-
-Permutation vector:
- 24 23 17 9 15 5 21 13 6 11 16 8 2 10 14 18 1 3 4 19 7 12 22 20
-
-Inverse permutation vector:
- 17 13 18 19 6 9 21 12 4 14 10 22 8 15 5 11 3 16 20 24 7 23 2 1
-Plot of permuted matrix pattern:
- 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
- 1: X . . . . . . X . . . . . . . . . . . . X X . .
- 2: . X . . . . X . . . . . . . . . . X . . . . X .
- 3: . . X . . X . . . . X X . . . . . . . . . . . .
- 4: . . . X X . . . . . . . X X . . . . . . . . . .
- 5: . . . X X X . . . . . X X X . . . . . . . . . .
- 6: . . X . X X . . . . X X . X . . . . . . . . . .
- 7: . X . . . . X . . X . . . . . . . X . . . . X X
- 8: X . . . . . . X X . . . . . . . X . . . X X . .
- 9: . . . . . . . X X . . . . . X X X . . . X . . .
- 10: . . . . . . X . . X . . . . . . . . X X . . X X
- 11: . . X . . X . . . . X X . . . . . . X X . . . .
- 12: . . X . X X . . . . X X . X . X . . X X . . . .
- 13: . . . X X . . . . . . . X X X X . . . . . . . .
- 14: . . . X X X . . . . . X X X X X . . . X . . . .
- 15: . . . . . . . . X . . . X X X X X . . . . . . .
- 16: . . . . . . . . X . . X X X X X X . . X . . . X
- 17: . . . . . . . X X . . . . . X X X . . X X . X X
- 18: . X . . . . X . . . . . . . . . . X . . X X X .
- 19: . . . . . . . . . X X X . . . . . . X X . . . X
- 20: . . . . . . . . . X X X . X . X X . X X . . . X
- 21: X . . . . . . X X . . . . . . . X X . . X X X X
- 22: X . . . . . . X . . . . . . . . . X . . X X X .
- 23: . X . . . . X . . X . . . . . . X X . . X X X X
- 24: . . . . . . X . . X . . . . . X X . X X X . X X
-
-New column: 1 old column: 24 number of entries: 3
- new row indices: 21 22 8
-
-New column: 2 old column: 23 number of entries: 3
- new row indices: 18 7 23
-
-New column: 3 old column: 17 number of entries: 3
- new row indices: 6 12 11
-
-New column: 4 old column: 9 number of entries: 3
- new row indices: 13 14 5
-
-New column: 5 old column: 15 number of entries: 5
- new row indices: 13 6 12 4 14
-
-New column: 6 old column: 5 number of entries: 5
- new row indices: 12 14 5 11 3
-
-New column: 7 old column: 21 number of entries: 5
- new row indices: 18 10 24 23 2
-
-New column: 8 old column: 13 number of entries: 5
- new row indices: 17 9 21 22 1
-
-New column: 9 old column: 6 number of entries: 5
- new row indices: 17 21 8 15 16
-
-New column: 10 old column: 11 number of entries: 5
- new row indices: 19 20 24 7 23
-
-New column: 11 old column: 16 number of entries: 5
- new row indices: 19 6 12 3 20
-
-New column: 12 old column: 8 number of entries: 8
- new row indices: 19 6 14 5 11 3 16 20
-
-New column: 13 old column: 2 number of entries: 5
- new row indices: 4 14 15 5 16
-
-New column: 14 old column: 10 number of entries: 8
- new row indices: 13 6 12 4 15 5 16 20
-
-New column: 15 old column: 14 number of entries: 5
- new row indices: 17 13 9 14 16
-
-New column: 16 old column: 18 number of entries: 8
- new row indices: 17 13 9 12 14 15 20 24
-
-New column: 17 old column: 1 number of entries: 8
- new row indices: 9 21 8 15 16 20 24 23
-
-New column: 18 old column: 3 number of entries: 5
- new row indices: 21 22 7 23 2
-
-New column: 19 old column: 4 number of entries: 5
- new row indices: 12 10 11 20 24
-
-New column: 20 old column: 19 number of entries: 8
- new row indices: 17 19 12 14 10 11 16 24
-
-New column: 21 old column: 7 number of entries: 8
- new row indices: 17 18 9 22 8 24 23 1
-
-New column: 22 old column: 12 number of entries: 5
- new row indices: 18 21 8 23 1
-
-New column: 23 old column: 22 number of entries: 8
- new row indices: 17 18 21 10 22 24 7 2
-
-New column: 24 old column: 20 number of entries: 8
- new row indices: 17 19 21 10 16 20 7 23
+++ /dev/null
-C ----------------------------------------------------------------------
-C AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A.
-C Davis, Patrick R. Amestoy, and Iain S. Duff. See ../README for
-C License. email: davis@cise.ufl.edu CISE Department, Univ. of
-C Florida. web: http://www.cise.ufl.edu/research/sparse/amd
-C ----------------------------------------------------------------------
-
-C This program provides an example of how to call the Fortran version
-C of AMD. It uses the same matrix as the amd_simple.c demo (in C).
-C Note that the diagonal entries are not present, and the matrix is
-C symmetric.
-
- INTEGER N, NZ, J, K, P, IWLEN, PFREE, NCMPA
- PARAMETER (N = 5, NZ = 10, IWLEN = 17)
- INTEGER AP (N+1), AI (NZ), LAST (N), PE (N), LEN (N), ELEN (N),
- $ IW (IWLEN), DEGREE (N), NV (N), NEXT (N), HEAD (N), W (N)
- DATA AP / 1, 2, 5, 8, 9, 11/
- DATA AI / 2, 1,3,5, 2,4,5, 3, 2,3 /
-
-C load the matrix into the AMD workspace
- DO 10 J = 1,N
- PE (J) = AP (J)
- LEN (J) = AP (J+1) - AP (J)
-10 CONTINUE
- DO 20 P = 1,NZ
- IW (P) = AI (P)
-20 CONTINUE
- PFREE = NZ + 1
-
-C order the matrix (destroys the copy of A in IW, PE, and LEN)
- CALL AMD (N, PE, IW, LEN, IWLEN, PFREE, NV, NEXT, LAST, HEAD,
- $ ELEN, DEGREE, NCMPA, W)
-
- DO 60 K = 1, N
- PRINT 50, K, LAST (K)
-50 FORMAT ('P (',I2,') = ', I2)
-60 CONTINUE
- END
+++ /dev/null
-P ( 1) = 4
-P ( 2) = 1
-P ( 3) = 3
-P ( 4) = 5
-P ( 5) = 2
+++ /dev/null
-/* ========================================================================= */
-/* === amd_f77wrapper ====================================================== */
-/* ========================================================================= */
-
-/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
-/* web: http://www.cise.ufl.edu/research/sparse/amd */
-/* ------------------------------------------------------------------------- */
-
-/* Fortran interface for the C-callable AMD library (int version only). This
- * is HIGHLY non-portable. You will need to modify this depending on how your
- * Fortran and C compilers behave. Two examples are provided.
- *
- * To avoid using I/O, and to avoid the extra porting step of a Fortran
- * function, the status code is returned as the first entry in P (P [0] in C
- * and P (1) in Fortran) if an error occurs. The error codes are negative
- * (-1: out of memory, -2: invalid matrix).
- *
- * For some C and Fortran compilers, the Fortran compiler appends a single "_"
- * after each routine name. C doesn't do this, so the translation is made
- * here. Some Fortran compilers don't append an underscore (xlf on IBM AIX,
- * for * example).
- *
- * Tested with the following compilers:
- * Solaris with cc and f77 from Sun WorkShop 6 update 1.
- * SGI Irix with MIPSpro cc and f77 compilers version 7.4
- * Linux with GNU gcc or Intel's icc, and GNU g77 Intel's ifc Fortran compiler.
- * (any combination). Note that with g77, a call to amd_order in Fortran
- * gets translated to a call to amd_order__, with two underscores ("_").
- * Thus, the Fortran names do not include an underscore.
- */
-
-#include "amd.h"
-#include <stdio.h>
-
-/* ------------------------------------------------------------------------- */
-/* Linux, Solaris, SGI */
-/* ------------------------------------------------------------------------- */
-
-void amdorder_ (int *n, const int *Ap, const int *Ai, int *P,
- double *Control, double *Info)
-{
- int result = amd_order (*n, Ap, Ai, P, Control, Info) ;
- if (result != AMD_OK && P) P [0] = result ;
-}
-
-void amddefaults_ (double *Control)
-{
- amd_defaults (Control) ;
-}
-
-void amdcontrol_ (double *Control)
-{
- fflush (stdout) ;
- amd_control (Control) ;
- fflush (stdout) ;
-}
-
-void amdinfo_ (double *Info)
-{
- fflush (stdout) ;
- amd_info (Info) ;
- fflush (stdout) ;
-}
-
-void amdpreproc_ (int *n, const int *Ap, const int *Ai, int *Rp, int *Ri)
-{
- int result = amd_preprocess (*n, Ap, Ai, Rp, Ri) ;
- if (result != AMD_OK && Rp) Rp [0] = result ;
-}
-
-/* ------------------------------------------------------------------------- */
-/* IBM AIX. Probably Windows, Compaq Alpha, and HP Unix as well. */
-/* ------------------------------------------------------------------------- */
-
-void amdorder (int *n, const int *Ap, const int *Ai, int *P,
- double *Control, double *Info)
-{
- int result = amd_order (*n, Ap, Ai, P, Control, Info) ;
- if (result != AMD_OK && P) P [0] = result ;
-}
-
-void amddefaults (double *Control)
-{
- amd_defaults (Control) ;
-}
-
-void amdcontrol (double *Control)
-{
- fflush (stdout) ;
- amd_control (Control) ;
- fflush (stdout) ;
-}
-
-void amdinfo (double *Info)
-{
- fflush (stdout) ;
- amd_info (Info) ;
- fflush (stdout) ;
-}
-
-void amdpreproc (int *n, const int *Ap, const int *Ai, int *Rp, int *Ri)
-{
- int result = amd_preprocess (*n, Ap, Ai, Rp, Ri) ;
- if (result != AMD_OK && Rp) Rp [0] = result ;
-}
+++ /dev/null
-/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
-/* web: http://www.cise.ufl.edu/research/sparse/amd */
-/* ------------------------------------------------------------------------- */
-
-#include <stdio.h>
-#include "amd.h"
-
-int n = 5 ;
-int Ap [ ] = { 0, 2, 6, 10, 12, 14} ;
-int Ai [ ] = { 0,1, 0,1,2,4, 1,2,3,4, 2,3, 1,4 } ;
-int P [5] ;
-
-int main (void)
-{
- int k ;
- (void) amd_order (n, Ap, Ai, P, (double *) NULL, (double *) NULL) ;
- for (k = 0 ; k < n ; k++) printf ("P [%d] = %d\n", k, P [k]) ;
- return (0) ;
-}
-
+++ /dev/null
-P [0] = 0
-P [1] = 3
-P [2] = 2
-P [3] = 4
-P [4] = 1
,pages={886-905}
}
+@article{AmestoyDavisDuff04,
+ author={Amestoy, P. R. and Davis, T. A. and Duff, I. S.},
+ title={Algorithm 837: An approximate minimum degree ordering algorithm},
+ journal=TOMS,
+ year={2004}
+ ,volume={30}
+ ,number={3}
+ ,pages={381-388}
+ }
+
@misc{hsl:2002,
author = {HSL},
title = "{HSL} 2002: {A} collection of {F}ortran codes for large
,pages={68-84}
}
-@article{DavisGilbertLarimoreNg00pending,
+@article{DavisGilbertLarimoreNg04,
author={Davis, T. A. and Gilbert, J. R. and Larimore, S. I. and Ng, E. G.},
title={A column approximate minimum degree ordering algorithm},
journal=TOMS,
- year={(to appear)}
+ year={2004}
+ ,volume={30}
+ ,pages={353-376}
}
\begin{document}
%------------------------------------------------------------------------------
-\title{AMD Version 1.1 User Guide}
+\title{AMD Version 2.2 User Guide}
\author{Patrick R. Amestoy\thanks{ENSEEIHT-IRIT,
2 rue Camichel 31017 Toulouse, France.
email: amestoy@enseeiht.fr. http://www.enseeiht.fr/$\sim$amestoy.}
This work was supported by the EPSRC under grant GR/R46441.
}}
-\date{January 29, 2004}
+\date{May 31, 2007}
\maketitle
%------------------------------------------------------------------------------
\end{abstract}
%------------------------------------------------------------------------------
-Technical report TR-04-002, CISE Department, University of Florida,
-Gainesville, FL, 2004.
+Technical report TR-04-002 (revised), CISE Department, University of Florida,
+Gainesville, FL, 2007.
-AMD Version 1.1 (Jan. 21, 2004), Copyright\copyright 2004 by Timothy A.
+AMD Version 2.2, Copyright\copyright 2007 by Timothy A.
Davis, Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved.
+AMD is available under alternate licences; contact T. Davis for details.
{\bf AMD License:}
Your use or distribution of AMD or any modified version of
AMD implies that you agree to this License.
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses AMD or any modified version of AMD code must cite the
- Copyright, this License, the Availability note, and ``Used by permission.''
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ Permission is hereby granted to use or copy this program under the
+ terms of the GNU LGPL, provided that the Copyright, this License,
+ and the Availability of the original version is retained on all copies.
+ User documentation of any code that uses this code or any modified
+ version of this code must cite the Copyright, this License, the
+ Availability note, and "Used by permission." Permission to modify
+ the code and to distribute modified code is granted, provided the
+ Copyright, this License, and the Availability note are retained,
+ and a notice that the code was modified is included.
{\bf Availability:}
http://www.cise.ufl.edu/research/sparse/amd
AMD is a set of routines for preordering a sparse matrix prior to
numerical factorization. It uses an approximate minimum degree ordering
-algorithm \cite{AmestoyDavisDuff96} to find a permutation matrix $\m{P}$
+algorithm \cite{AmestoyDavisDuff96,AmestoyDavisDuff04}
+to find a permutation matrix $\m{P}$
so that the Cholesky factorization $\m{PAP}\tr=\m{LL}\tr$ has fewer
(often much fewer) nonzero entries than the Cholesky factorization of $\m{A}$.
The algorithm is typically much faster than other ordering methods
\section{Availability}
%------------------------------------------------------------------------------
-In addition to appearing as a Collected Algorithm of the ACM,
-AMD Version 1.1 is available at http://www.cise.ufl.edu/research/sparse.
+In addition to appearing as a Collected Algorithm of the ACM, \newline
+AMD is available at http://www.cise.ufl.edu/research/sparse.
The Fortran version is available as the routine {\tt MC47} in HSL
(formerly the Harwell Subroutine Library) \cite{hsl:2002}.
\section{Using AMD in MATLAB}
%------------------------------------------------------------------------------
-To use AMD in MATLAB, you must first compile the AMD mexFunction.
-Just type {\tt make} in the Unix system shell, while in the {\tt AMD}
+The MATLAB function {\tt amd} is now a built-in function in MATLAB 7.3
+(R2006b). The built-in {\tt amd} and the {\tt amd2} function provided here
+differ in how the optional parameters are passed
+(the 2nd input parameter).
+
+To use AMD2 in MATLAB, you must first compile the AMD2 mexFunction.
+Just type {\tt make} in the Unix system shell, while in the {\tt AMD/MATLAB}
directory. You can also type {\tt amd\_make} in MATLAB, while in the
{\tt AMD/MATLAB} directory. Place the {\tt AMD/MATLAB} directory in your
MATLAB path. This can be done on any system with MATLAB, including Windows.
Type {\tt help lu} for more details.
The statement {\tt [L,U,P,Q] = lu (A (p,p))} in MATLAB 6.5 is
not suitable, however, because it uses UMFPACK Version 4.0 and thus
-does not attempt to select pivots from the diagonal. UMFPACK Version 4.1
+does not attempt to select pivots from the diagonal.
+UMFPACK Version 4.1 in MATLAB 7.0 and later
uses several strategies, including a symmetric pivoting strategy, and
will give you better results if you want to factorize an unsymmetric matrix
of this type. Refer to the UMFPACK User Guide for more details, at
The AMD mexFunction is much faster than the built-in MATLAB symmetric minimum
degree ordering methods, SYMAMD and SYMMMD. Its ordering quality is
comparable to SYMAMD, and better than SYMMMD
-\cite{DavisGilbertLarimoreNg00pending}.
+\cite{DavisGilbertLarimoreNg04}.
An optional input argument can be used to modify the control parameters for
AMD (aggressive absorption, dense row/column handling, and printing of
\label{Cversion}
%------------------------------------------------------------------------------
-The C-callable AMD library consists of five user-callable routines and one
+The C-callable AMD library consists of seven user-callable routines and one
include file. There are two versions of each of the routines, with
{\tt int} and {\tt long} integers.
The routines with prefix
and the number of floating-point operations required for Cholesky and LU
factorizations (which are returned in the {\tt Info} array).
The user's input matrix is not modified.
- It returns {\tt AMD\_OK} if successful, {\tt AMD\_INVALID} if
- the matrix is invalid, or {\tt AMD\_OUT\_OF\_MEMORY} if out of memory.
+ It returns {\tt AMD\_OK} if successful,
+ {\tt AMD\_OK\_BUT\_JUMBLED} if successful (but the matrix had unsorted
+ and/or duplicate row indices),
+ {\tt AMD\_INVALID} if the matrix is invalid,
+ {\tt AMD\_OUT\_OF\_MEMORY} if out of memory.
\item {\tt amd\_defaults}
({\tt long} version: {\tt amd\_l\_defaults})
}
Prints a description of the statistics computed by AMD, and their values.
-\item {\tt amd\_preprocess}
-({\tt long} version: {\tt amd\_l\_info})
+\item {\tt amd\_valid}
+({\tt long} version: {\tt amd\_valid})
{\footnotesize
\begin{verbatim}
#include "amd.h"
- int n, Ap [n+1], Ai [nz], Rp [n+1], Ri [nz] ;
- int result = amd_preprocess (n, Ap, Ai, Rp, Ri) ;
+ int n, Ap [n+1], Ai [nz] ;
+ int result = amd_valid (n, n, Ap, Ai) ;
\end{verbatim}
}
- Removes duplicate entries and sorts each column of its input $\m{A}$,
- and returns the nonzero pattern of the transpose, $\m{R}=\m{A}\tr$.
- It returns the transpose because this is the simplest way to sort
- a matrix and remove duplicate entries. Either $\m{A}$ or $\m{A}\tr$
- can be passed to {\tt amd\_order} with little effect on the
- ordering (except for minor tie-breaking changes).
+ Returns {\tt AMD\_OK} or {\tt AMD\_OK\_BUT\_JUMBLED}
+ if the matrix is valid as input to {\tt amd\_order};
+ the latter is returned if the matrix has unsorted and/or duplicate
+ row indices in one or more columns.
+ Returns {\tt AMD\_INVALID} if the matrix cannot be passed to
+ {\tt amd\_order}.
+ For {\tt amd\_order}, the matrix must
+ also be square. The first two arguments are the number of rows and the
+ number of columns of the matrix. For its use in AMD, these must both
+ equal {\tt n}.
+
+\item {\tt amd\_2}
+({\tt long} version: {\tt amd\_l2})
+ AMD ordering kernel. It is faster than {\tt amd\_order}, and
+ can be called by the user, but it is difficult to use.
+ It does not check its inputs for errors.
+ It does not require the columns of its input matrix to be sorted,
+ but it destroys the matrix on output. Additional workspace must be passed.
+ Refer to the source file {\tt AMD/Source/amd\_2.c} for a description.
\end{itemize}
of size {\tt nz}. The row indices of entries in column {\tt j} are stored in
{\tt Ai[Ap[j]} $\ldots$ {\tt Ap[j+1]-1]}.
For {\tt amd\_order},
-no duplicate row indices may be present, and the row indices in any given
-column must be sorted in ascending order.
+if duplicate row indices are present, or if the row indices in any given
+column are not sorted in ascending order, then {\tt amd\_order} creates
+an internal copy of the matrix with sorted rows and no duplicate entries,
+and orders the copy. This adds slightly to the time and memory usage of
+{\tt amd\_order}, but is not an error condition.
+
The matrix is 0-based, and thus
row indices must be in the range {\tt 0} to {\tt n-1}.
The first entry {\tt Ap[0]} must be zero.
The matrix must be square, but it does not need to be symmetric.
The {\tt amd\_order} routine constructs the nonzero pattern of
-$\m{B} = \m{A}+\m{A}\tr$ (without forming $\m{A}\tr$ explicitly),
+$\m{B} = \m{A}+\m{A}\tr$ (without forming $\m{A}\tr$ explicitly if
+$\m{A}$ has sorted columns and no duplicate entries),
and then orders the matrix $\m{B}$. Thus, either the
lower triangular part of $\m{A}$, the upper triangular part,
or any combination may be passed. The transpose $\m{A}\tr$ may also be
passed to {\tt amd\_order}.
The diagonal entries may be present, but are ignored.
-The input to {\tt amd\_order} must have sorted columns because it uses
-an in-place algorithm to construct $\m{A}+\m{A}\tr$ without first constructing
-$\m{A}\tr$. This saves memory, but places an additional restriction on
-the input. If the input matrix has columns with unsorted and/or duplicate
-row indices, it is not valid as input to {\tt amd\_order}. To handle this
-case, the {\tt amd\_preprocess} routine is provided. It sorts, transposes,
-and removes duplicate entries from its input matrix, returning its result
-as another compressed-column matrix $\m{R}$ which can then be passed to
-{\tt amd\_order}.
-
%------------------------------------------------------------------------------
\subsection{Control parameters}
\label{control_param}
%------------------------------------------------------------------------------
-Control parameters are set an optional {\tt Control} array.
+Control parameters are set in an optional {\tt Control} array.
It is optional in the sense that if
a {\tt NULL} pointer is passed for the {\tt Control} input argument,
then default control parameters are used.
controls whether or not to use
aggressive absorption, in which a prior element is absorbed into the current
element if it is a subset of the current element, even if it is not
-adjacent to the current pivot element (refer to \cite{AmestoyDavisDuff96}
+adjacent to the current pivot element (refer
+to \cite{AmestoyDavisDuff96,AmestoyDavisDuff04}
for more details). The default value is nonzero,
which means that aggressive absorption will be performed. This nearly always
leads to a better ordering (because the approximate degrees are more
{\footnotesize
\begin{verbatim}
#include "amd.h"
-int n, status, Ap [n+1], Ai [nz], P [n], Rp [n+1], Ri [nz] ;
+int n, status, Ap [n+1], Ai [nz], P [n] ;
double Control [AMD_CONTROL], Info [AMD_INFO] ;
amd_defaults (Control) ;
status = amd_order (n, Ap, Ai, P, Control, Info) ;
amd_control (Control) ;
amd_info (Info) ;
-amd_preprocess (n, Ap, Ai, Rp, Ri) ;
+status = amd_valid (n, n, Ap, Ai) ;
\end{verbatim}
}
{\footnotesize
\begin{verbatim}
#include "amd.h"
-long n, status, Ap [n+1], Ai [nz], P [n], Rp [n+1], Ri [nz] ;
+long n, status, Ap [n+1], Ai [nz], P [n] ;
double Control [AMD_CONTROL], Info [AMD_INFO] ;
amd_l_defaults (Control) ;
status = amd_l_order (n, Ap, Ai, P, Control, Info) ;
amd_l_control (Control) ;
amd_l_info (Info) ;
-amd_l_preprocess (n, Ap, Ai, Rp, Ri) ;
+status = amd_l_valid (n, n, Ap, Ai) ;
\end{verbatim}
}
The following discussion assumes you have the {\tt make} program, either in
Unix, or in Windows with Cygwin.
-System-dependent configurations are in the {\tt AMD/Make}
-directory. You can edit the {\tt Make.include}
-file in that directory to customize the compilation. The default
+System-dependent configurations are in the {\tt ../UFconfig/UFconfig.mk}
+file. You can edit that file to customize the compilation. The default
settings will work on most systems.
Sample configuration files are provided
for Linux, Sun Solaris, SGI IRIX, IBM AIX, and the DEC/Compaq Alpha.
To compile and install the C-callable AMD library,
go to the {\tt AMD} directory and type {\tt make}.
The library will be placed in {\tt AMD/Lib/libamd.a}.
-Two demo programs of the AMD ordering routine will be compiled and tested in
+Three demo programs of the AMD ordering routine will be compiled and tested in
the {\tt AMD/Demo} directory.
The outputs of these demo programs will then be compared with output
-files in the distribution. The AMD mexFunction for
-use in MATLAB will also be compiled. If you do not have MATLAB
-type {\tt make lib} instead.
+files in the distribution.
To compile and install the Fortran-callable AMD library,
go to the {\tt AMD} directory and type {\tt make fortran}.
The output will be compared with an output file in the distribution.
Typing {\tt make clean} will remove all but the final compiled libraries
-and demo programs. Typing {\tt make purge} removes all files not in the
-original distribution.
-If you compile AMD and then later change the {\tt Make.include}
-file or your system-specific configuration file such as {\tt Make.linux},
+and demo programs. Typing {\tt make purge} or {\tt make distclean}
+removes all files not in the original distribution.
+If you compile AMD and then later change the {\tt ../UFconfig/UFconfig.mk} file
then you should type {\tt make purge} and then {\tt make} to recompile.
-Here are the various parameters that you can control in your
-{\tt Make.include} file:
-
-\begin{itemize}
-\item {\tt CC = } your C compiler, such as {\tt cc}.
-\item {\tt RANLIB = } your system's {\tt ranlib} program, if needed.
-\item {\tt CFLAGS = } optimization flags, such as {\tt -O}.
-\item {\tt LIB = } your libraries, such as {\tt -lm} or {\tt -lblas}.
-\item {\tt RM =} the command to delete a file.
-\item {\tt MV =} the command to rename a file.
-\item {\tt MEX =} the command to compile a MATLAB mexFunction.
-\item {\tt F77 =} the command to compile a Fortran program (optional).
-\item {\tt F77FLAGS =} the Fortran compiler flags (optional).
-\item {\tt F77LIB =} the Fortran libraries (optional).
-\end{itemize}
-
-The {\tt Make.include} includes some definitions regarding the BLAS.
-This is so that AMD and UMFPACK (which requires AMD) can share
-the same configuration files. If you wish to use AMD only, then
-you can ignore any references to the BLAS (the -DNBLAS compile flag).
-
When you compile your program that uses the C-callable AMD library,
you need to add the {\tt AMD/Lib/libamd.a} library
and you need to tell your compiler to look in the
you need to add the {\tt AMD/Lib/libamdf77.a} library.
See {\tt AMD/Demo/Makefile} for an example.
-If all you want to use is the AMD mexFunction in MATLAB, you can skip
+If all you want to use is the AMD2 mexFunction in MATLAB, you can skip
the use of the {\tt make} command entirely. Simply type
{\tt amd\_make} in MATLAB while in the {\tt AMD/MATLAB} directory.
This works on any system with MATLAB, including Windows.
+Alternately, type {\tt make} in the {\tt AMD/MATLAB} directory,
+or just use the built-in {\tt amd} in MATLAB 7.3 or later.
+
+If you have MATLAB 7.2 or earlier, you must first edit UFconfig/UFconfig.h to
+remove the "-largeArrayDims" option from the MEX command, prior to
+{\tt make mex} or {\tt make} in the MATLAB directory
+(or just use {\tt amd\_make.m} inside MATLAB.
If you are including AMD as a subset of a larger library and do not want
to link the C standard I/O library, or if you simply do not need to use
them, you can safely remove the {\tt amd\_control.c} and {\tt amd\_info.c}
files. Similarly, if you use default parameters (or define your
own {\tt Control} array), then you can exclude the {\tt amd\_defaults.c}
-file. The {\tt amd\_preprocess.c} file is optional as well, if you
-can ensure that the input matrix to {\tt amd\_order} is always sorted
-and has no duplicate entries.
+file.
Each of these files contains the user-callable routines of the same
name. None of these auxiliary routines are directly called by
{\tt amd\_order}.
The {\tt amd\_dump.c} file contains debugging routines
that are neither used nor compiled unless debugging is enabled.
The {\tt amd\_internal.h} file must be edited to enable debugging;
-refer to the instructions in that file. Thus, it too can be excluded
-if compiled into a larger production program or library.
+refer to the instructions in that file.
The bare minimum files required to use just {\tt amd\_order} are
-{\tt amd.h} in the {\tt Include} directory,
+{\tt amd.h} and {\tt amd\_internal.h}
+in the {\tt Include} directory,
and
{\tt amd\_1.c},
{\tt amd\_2.c},
{\tt amd\_aat.c},
+{\tt amd\_global.c},
{\tt and\_order.c},
{\tt amd\_postorder.c},
{\tt amd\_post\_tree.c},
-{\tt amd\_valid.c},
+{\tt amd\_preprocess.c},
and
-{\tt amd\_internal.h},
+{\tt amd\_valid.c}
in the {\tt Source} directory.
%------------------------------------------------------------------------------
{\footnotesize
\begin{verbatim}
+
/* ========================================================================= */
/* === AMD: approximate minimum degree ordering =========================== */
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD Version 2.2, Copyright (c) 2007 by Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
* factorization of P*A*P' has fewer nonzeros and takes less work than the
* Cholesky factorization of A. If A is not symmetric, then it performs its
* ordering on the matrix A+A'. Two sets of user-callable routines are
- * provided, one for "int" integers and the other for "long" integers.
+ * provided, one for int integers and the other for UF_long integers.
*
* The method is based on the approximate minimum degree algorithm, discussed
* in Amestoy, Davis, and Duff, "An approximate degree ordering algorithm",
#ifndef AMD_H
#define AMD_H
-int amd_order ( /* returns 0 if OK, negative value if error */
+/* make it easy for C++ programs to include AMD */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* get the definition of size_t: */
+#include <stddef.h>
+
+/* define UF_long */
+#include "UFconfig.h"
+
+int amd_order /* returns AMD_OK, AMD_OK_BUT_JUMBLED,
+ * AMD_INVALID, or AMD_OUT_OF_MEMORY */
+(
int n, /* A is n-by-n. n must be >= 0. */
const int Ap [ ], /* column pointers for A, of size n+1 */
const int Ai [ ], /* row indices of A, of size nz = Ap [n] */
double Info [ ] /* output Info statistics, of size AMD_INFO */
) ;
-long amd_l_order ( /* see above for description of arguments */
- long n,
- const long Ap [ ],
- const long Ai [ ],
- long P [ ],
+UF_long amd_l_order /* see above for description of arguments */
+(
+ UF_long n,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
+ UF_long P [ ],
double Control [ ],
double Info [ ]
) ;
/* Input arguments (not modified):
*
* n: the matrix A is n-by-n.
- * Ap: an int/long array of size n+1, containing the column pointers of A.
- * Ai: an int/long array of size nz, containing the row indices of A,
+ * Ap: an int/UF_long array of size n+1, containing column pointers of A.
+ * Ai: an int/UF_long array of size nz, containing the row indices of A,
* where nz = Ap [n].
* Control: a double array of size AMD_CONTROL, containing control
* parameters. Defaults are used if Control is NULL.
*
* Output arguments (not defined on input):
*
- * P: an int/long array of size n, containing the output permutation. If
+ * P: an int/UF_long array of size n, containing the output permutation. If
* row i is the kth pivot row, then P [k] = i. In MATLAB notation,
* the reordered matrix is A (P,P).
* Info: a double array of size AMD_INFO, containing statistical
*
* On input, the matrix A is stored in column-oriented form. The row indices
* of nonzero entries in column j are stored in Ai [Ap [j] ... Ap [j+1]-1].
- * The row indices must appear in ascending order in each column, and there
- * must not be any duplicate entries. Row indices must be in the range 0 to
+ *
+ * If the row indices appear in ascending order in each column, and there
+ * are no duplicate entries, then amd_order is slightly more efficient in
+ * terms of time and memory usage. If this condition does not hold, a copy
+ * of the matrix is created (where these conditions do hold), and the copy is
+ * ordered. This feature is new to v2.0 (v1.2 and earlier required this
+ * condition to hold for the input matrix).
+ *
+ * Row indices must be in the range 0 to
* n-1. Ap [0] must be zero, and thus nz = Ap [n] is the number of nonzeros
* in A. The array Ap is of size n+1, and the array Ai is of size nz = Ap [n].
* The matrix does not need to be symmetric, and the diagonal does not need to
* pattern of the matrix A is the same as that used internally by MATLAB.
* If you wish to use a more flexible input structure, please see the
* umfpack_*_triplet_to_col routines in the UMFPACK package, at
- * http://www.cise.ufl.edu/research/sparse/umfpack, or use the amd_preprocess
- * routine discussed below.
+ * http://www.cise.ufl.edu/research/sparse/umfpack.
*
* Restrictions: n >= 0. Ap [0] = 0. Ap [j] <= Ap [j+1] for all j in the
- * range 0 to n-1. nz = Ap [n] >= 0. For all j in the range 0 to n-1,
- * and for all p in the range Ap [j] to Ap [j+1]-2, Ai [p] < Ai [p+1] must
- * hold. Ai [0..nz-1] must be in the range 0 to n-1. To avoid integer
- * overflow, (2.4*nz + 8*n) < INT_MAX / sizeof (int) for must hold for the
- * "int" version. (2.4*nz + 8*n) < LONG_MAX / sizeof (long) must hold
- * for the "long" version. Finally, Ai, Ap, and P must not be NULL. If
- * any of these restrictions are not met, AMD returns AMD_INVALID.
+ * range 0 to n-1. nz = Ap [n] >= 0. Ai [0..nz-1] must be in the range 0
+ * to n-1. Finally, Ai, Ap, and P must not be NULL. If any of these
+ * restrictions are not met, AMD returns AMD_INVALID.
*
* AMD returns:
*
* AMD_INVALID if the input arguments n, Ap, Ai are invalid, or if P is
* NULL.
*
+ * AMD_OK_BUT_JUMBLED if the matrix had unsorted columns, and/or duplicate
+ * entries, but was otherwise valid.
+ *
* The AMD routine first forms the pattern of the matrix A+A', and then
* computes a fill-reducing ordering, P. If P [k] = i, then row/column i of
* the original is the kth pivotal row. In MATLAB notation, the permuted
* condition.
*
* Info [AMD_STATUS]: the return value of AMD, either AMD_OK,
- * AMD_OUT_OF_MEMORY, or AMD_INVALID.
+ * AMD_OK_BUT_JUMBLED, AMD_OUT_OF_MEMORY, or AMD_INVALID.
*
* Info [AMD_N]: n, the size of the input matrix
*
*/
/* ------------------------------------------------------------------------- */
-/* AMD preprocess */
+/* direct interface to AMD */
/* ------------------------------------------------------------------------- */
-/* amd_preprocess: sorts, removes duplicate entries, and transposes the
- * nonzero pattern of a column-form matrix A, to obtain the matrix R.
- *
- * Alternatively, you can consider this routine as constructing a row-form
- * matrix from a column-form matrix. Duplicate entries are allowed in A (and
- * removed in R). The columns of R are sorted. Checks its input A for errors.
- *
- * On input, A can have unsorted columns, and can have duplicate entries.
- * Ap [0] must still be zero, and Ap must be monotonically nondecreasing.
- * Row indices must be in the range 0 to n-1.
- *
- * On output, if this routine returns AMD_OK, then the matrix R is a valid
- * input matrix for AMD_order. It has sorted columns, with no duplicate
- * entries in each column. Since AMD_order operates on the matrix A+A', it
- * can just as easily use A or A', so the transpose has no significant effect
- * (except for minor tie-breaking, which can lead to a minor effect in the
- * quality of the ordering). As an example, compare the output of amd_demo.c
- * and amd_demo2.c.
- *
- * This routine transposes A to get R because that's the simplest way to
- * sort and remove duplicate entries from a matrix.
- *
- * Allocates 2*n integer work arrays, and free's them when done.
- *
- * If you wish to call amd_order, but do not know if your matrix has unsorted
- * columns or duplicate entries, then you can use the following code, which is
- * fairly efficient. amd_order will not allocate any internal matrix until
- * it checks that the input matrix is valid, so the method below is memory-
- * efficient as well. This code snippet assumes that Rp and Ri are already
- * allocated, and are the same size as Ap and Ai respectively.
-
- result = amd_order (n, p, Ap, Ai, Control, Info) ;
- if (result == AMD_INVALID)
- {
- if (amd_preprocess (n, Ap, Ai, Rp, Ri) == AMD_OK)
- {
- result = amd_order (n, p, Rp, Ri, Control, Info) ;
- }
- }
-
- * amd_preprocess will still return AMD_INVALID if any row index in Ai is out
- * of range or if the Ap array is invalid. These errors are not corrected by
- * amd_preprocess since they represent a more serious error that should be
- * flagged with the AMD_INVALID error code.
- */
+/* amd_2 is the primary AMD ordering routine. It is not meant to be
+ * user-callable because of its restrictive inputs and because it destroys
+ * the user's input matrix. It does not check its inputs for errors, either.
+ * However, if you can work with these restrictions it can be faster than
+ * amd_order and use less memory (assuming that you can create your own copy
+ * of the matrix for AMD to destroy). Refer to AMD/Source/amd_2.c for a
+ * description of each parameter. */
-int amd_preprocess
+void amd_2
(
int n,
- const int Ap [ ],
- const int Ai [ ],
- int Rp [ ],
- int Ri [ ]
+ int Pe [ ],
+ int Iw [ ],
+ int Len [ ],
+ int iwlen,
+ int pfree,
+ int Nv [ ],
+ int Next [ ],
+ int Last [ ],
+ int Head [ ],
+ int Elen [ ],
+ int Degree [ ],
+ int W [ ],
+ double Control [ ],
+ double Info [ ]
) ;
-long amd_l_preprocess
+void amd_l2
(
- long n,
- const long Ap [ ],
- const long Ai [ ],
- long Rp [ ],
- long Ri [ ]
+ UF_long n,
+ UF_long Pe [ ],
+ UF_long Iw [ ],
+ UF_long Len [ ],
+ UF_long iwlen,
+ UF_long pfree,
+ UF_long Nv [ ],
+ UF_long Next [ ],
+ UF_long Last [ ],
+ UF_long Head [ ],
+ UF_long Elen [ ],
+ UF_long Degree [ ],
+ UF_long W [ ],
+ double Control [ ],
+ double Info [ ]
) ;
-/* Input arguments (not modified):
- *
- * n: the matrix A is n-by-n.
- * Ap: an int/long array of size n+1, containing the column pointers of A.
- * Ai: an int/long array of size nz, containing the row indices of A,
- * where nz = Ap [n].
- * The nonzero pattern of column j of A is in Ai [Ap [j] ... Ap [j+1]-1].
- * Ap [0] must be zero, and Ap [j] <= Ap [j+1] must hold for all j in the
- * range 0 to n-1. Row indices in Ai must be in the range 0 to n-1.
- * The row indices in any one column need not be sorted, and duplicates
- * may exist.
- *
- * Output arguments (not defined on input):
- *
- * Rp: an int/long array of size n+1, containing the column pointers of R.
- * Ri: an int/long array of size rnz, containing the row indices of R,
- * where rnz = Rp [n]. Note that Rp [n] will be less than Ap [n] if
- * duplicates appear in A. In general, Rp [n] <= Ap [n].
- * The data structure for R is the same as A, except that each column of
- * R contains sorted row indices, and no duplicates appear in any column.
- *
- * amd_preprocess returns:
- *
- * AMD_OK if the matrix A is valid and sufficient memory can be allocated
- * to perform the preprocessing.
- *
- * AMD_OUT_OF_MEMORY if not enough memory can be allocated.
+/* ------------------------------------------------------------------------- */
+/* amd_valid */
+/* ------------------------------------------------------------------------- */
+
+/* Returns AMD_OK or AMD_OK_BUT_JUMBLED if the matrix is valid as input to
+ * amd_order; the latter is returned if the matrix has unsorted and/or
+ * duplicate row indices in one or more columns. Returns AMD_INVALID if the
+ * matrix cannot be passed to amd_order. For amd_order, the matrix must also
+ * be square. The first two arguments are the number of rows and the number
+ * of columns of the matrix. For its use in AMD, these must both equal n.
*
- * AMD_INVALID if the input arguments n, Ap, Ai are invalid, or if Rp or
- * Ri are NULL.
+ * NOTE: this routine returned TRUE/FALSE in v1.2 and earlier.
*/
+int amd_valid
+(
+ int n_row, /* # of rows */
+ int n_col, /* # of columns */
+ const int Ap [ ], /* column pointers, of size n_col+1 */
+ const int Ai [ ] /* row indices, of size Ap [n_col] */
+) ;
+
+UF_long amd_l_valid
+(
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ]
+) ;
+
+/* ------------------------------------------------------------------------- */
+/* AMD memory manager and printf routines */
+/* ------------------------------------------------------------------------- */
+
+/* The user can redefine these to change the malloc, free, and printf routines
+ * that AMD uses. */
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
+EXTERN void *(*amd_malloc) (size_t) ; /* pointer to malloc */
+EXTERN void (*amd_free) (void *) ; /* pointer to free */
+EXTERN void *(*amd_realloc) (void *, size_t) ; /* pointer to realloc */
+EXTERN void *(*amd_calloc) (size_t, size_t) ; /* pointer to calloc */
+EXTERN int (*amd_printf) (const char *, ...) ; /* pointer to printf */
+
/* ------------------------------------------------------------------------- */
/* AMD Control and Info arrays */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
#define AMD_OK 0 /* success */
-#define AMD_OUT_OF_MEMORY -1 /* malloc failed */
+#define AMD_OUT_OF_MEMORY -1 /* malloc failed, or problem too large */
#define AMD_INVALID -2 /* input arguments are not valid */
+#define AMD_OK_BUT_JUMBLED 1 /* input matrix is OK for amd_order, but
+ * columns were not sorted, and/or duplicate entries were present. AMD had
+ * to do extra work before ordering the matrix. This is a warning, not an
+ * error. */
+
+/* ========================================================================== */
+/* === AMD version ========================================================== */
+/* ========================================================================== */
+
+/* AMD Version 1.2 and later include the following definitions.
+ * As an example, to test if the version you are using is 1.2 or later:
+ *
+ * #ifdef AMD_VERSION
+ * if (AMD_VERSION >= AMD_VERSION_CODE (1,2)) ...
+ * #endif
+ *
+ * This also works during compile-time:
+ *
+ * #if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE (1,2))
+ * printf ("This is version 1.2 or later\n") ;
+ * #else
+ * printf ("This is an early version\n") ;
+ * #endif
+ *
+ * Versions 1.1 and earlier of AMD do not include a #define'd version number.
+ */
+#define AMD_DATE "May 31, 2007"
+#define AMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
+#define AMD_MAIN_VERSION 2
+#define AMD_SUB_VERSION 2
+#define AMD_SUBSUB_VERSION 0
+#define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
#endif
\end{verbatim}
}
+
%------------------------------------------------------------------------------
\newpage
% References
+May 31, 2007: version 2.2.0
+
+ * port to 64-bit MATLAB
+
+ * Makefile moved from Source/ to Lib/
+
+ * minor changes to printing routines (amd_control.c, amd_info.c)
+
+Dec 12, 2006, version 2.0.4
+
+ * minor MATLAB code cleanup
+
+Nov 29, 2006, version 2.0.3
+
+ * changed MATLAB function name to amd2, so as not to conflict with
+ the now built-in version of AMD in MATLAB (which is the same thing
+ as the AMD here...).
+
+Sept 28, 2006, version 2.0.2
+
+ * #define SIZE_T_MAX not done if already defined (Mac OSX).
+
+Aug 31, 2006:
+
+ * trivial change to comments in amd.m
+
+Apr 30, 2006: AMD Version 2.0:
+
+ * long integer redefined as UF_long, controlled by UFconfig.h.
+
+ * amd_order no longer requires its input to have sorted columns. It can
+ also tolerate duplicate entries in each column. If these conditions
+ hold, but the matrix is otherwise valid, amd_order returns
+ AMD_OK_BUT_JUMBLED (a warning, not an error).
+
+ * amd_preprocess no longer deemed user-callable, since it is no longer
+ needed (it was used to ensure the input matrix had sorted columns with
+ no duplicate entries). It still exists, with additional parameters,
+ and is called by amd_order if necessary. amd_wpreprocess and
+ amd_preprocess_valid removed. Fortran interface routine amdpreproc
+ removed.
+
+ * Integer overflow computations modified, to extend the size of problem
+ that the "int" version can solve when used in an LP64 compilation.
+
+ * amd_demo2.c simplified (it tests AMD with a jumbled matrix).
+
+ * amd_valid returned TRUE/FALSE in v1.2. It now returns AMD_OK,
+ AMD_OK_BUT_JUMBLED, or AMD_INVALID. Only in the latter case is the
+ matrix unsuitable as input to amd_order.
+
+ * amd_internal.h include file moved from AMD/Source to AMD/Include.
+
+Nov 15, 2005:
+
+ * minor editting of comments; version number (1.2) unchanged.
+
+Aug. 30, 2005: AMD Version 1.2
+
+ * AMD v1.2 is upward compatible with v1.1 and v1.0, except that v1.2 no
+ longer includes the compile-time redefinition of malloc and free.
+
+ * Makefile modified to use UFconfig.mk. "Make" directory removed.
+
+ * License changed to GNU LGPL.
+
+ * Easier inclusion in C++ programs.
+
+ * option to allow compile-time redefinition of malloc and free
+ (added to v1.1) removed for v1.2. Replaced with a run-time
+ redefinition. AMD includes function pointers for malloc, free,
+ calloc, realloc, and printf, so that all those routines can be
+ redefined at compile time. These function pointers are global
+ variables, and so are not technically thread-safe, unless you
+ use defaults and don't need to change them (the common case)
+ or if you change them in one thread before using them in other
+ threads.
+
+ * added #define'd version number
+
+ * minor modification to AMD_2 to ensure all lines can be tested, without
+ conditional compilation.
+
+ * moved the prototype for AMD_2 from amd_internal.h to amd.h
+
+ * moved the prototype for AMD_valid from amd_internal.h to amd.h
+
+ * MATLAB mexFunction uses libamd.a (compiled with cc) instead of compiling
+ each AMD source file with the mex command
+
+ * long demo (amd_l_demo.c) added.
+
Jan. 21, 2004: AMD Version 1.1
* No bugs found or fixed - new features added, only
-AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A.
-Davis, Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved.
+AMD, Copyright (c) by Timothy A. Davis,
+Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved.
+AMD is available under alternate licenses, contact T. Davis for details.
AMD License:
Your use or distribution of AMD or any modified version of
AMD implies that you agree to this License.
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses AMD or any modified version of AMD code must cite the
- Copyright, this License, the Availability note, and "Used by permission."
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ Permission is hereby granted to use or copy this program under the
+ terms of the GNU LGPL, provided that the Copyright, this License,
+ and the Availability of the original version is retained on all copies.
+ User documentation of any code that uses this code or any modified
+ version of this code must cite the Copyright, this License, the
+ Availability note, and "Used by permission." Permission to modify
+ the code and to distribute modified code is granted, provided the
+ Copyright, this License, and the Availability note are retained,
+ and a notice that the code was modified is included.
Availability:
http://www.cise.ufl.edu/research/sparse/amd
+
+-------------------------------------------------------------------------------
# AMD Makefile for compiling on Unix systems (for GNU or original make)
#------------------------------------------------------------------------------
-all: dist
+default: dist
-include ../Make/Make.include
+include ../../UFconfig/UFconfig.mk
#------------------------------------------------------------------------------
# Remove all but the files in the original distribution
#------------------------------------------------------------------------------
-purge: clean
+clean:
+ - $(RM) $(CLEAN)
+
+purge: distclean
+
+distclean: clean
- $(RM) *.aux *.bbl *.blg *.log *.toc
#------------------------------------------------------------------------------
--- /dev/null
+ 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
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+\f
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+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
+\f
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
--- /dev/null
+/* ========================================================================== */
+/* === UFconfig.h =========================================================== */
+/* ========================================================================== */
+
+/* Configuration file for SuiteSparse: a Suite of Sparse matrix packages
+ * (AMD, COLAMD, CCOLAMD, CAMD, CHOLMOD, UMFPACK, CXSparse, and others).
+ *
+ * UFconfig.h provides the definition of the long integer. On most systems,
+ * a C program can be compiled in LP64 mode, in which long's and pointers are
+ * both 64-bits, and int's are 32-bits. Windows 64, however, uses the LLP64
+ * model, in which int's and long's are 32-bits, and long long's and pointers
+ * are 64-bits.
+ *
+ * SuiteSparse packages that include long integer versions are
+ * intended for the LP64 mode. However, as a workaround for Windows 64
+ * (and perhaps other systems), the long integer can be redefined.
+ *
+ * If _WIN64 is defined, then the __int64 type is used instead of long.
+ *
+ * The long integer can also be defined at compile time. For example, this
+ * could be added to UFconfig.mk:
+ *
+ * CFLAGS = -O -D'UF_long=long long' -D'UF_long_max=9223372036854775801' \
+ * -D'UF_long_id="%lld"'
+ *
+ * This file defines UF_long as either long (on all but _WIN64) or
+ * __int64 on Windows 64. The intent is that a UF_long is always a 64-bit
+ * integer in a 64-bit code. ptrdiff_t might be a better choice than long;
+ * it is always the same size as a pointer.
+ *
+ * This file also defines the SUITESPARSE_VERSION and related definitions.
+ *
+ * Copyright (c) 2007, University of Florida. No licensing restrictions
+ * apply to this file or to the UFconfig directory. Author: Timothy A. Davis.
+ */
+
+#ifndef _UFCONFIG_H
+#define _UFCONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <limits.h>
+
+/* ========================================================================== */
+/* === UF_long ============================================================== */
+/* ========================================================================== */
+
+#ifndef UF_long
+
+#ifdef _WIN64
+
+#define UF_long __int64
+#define UF_long_max _I64_MAX
+#define UF_long_id "%I64d"
+
+#else
+
+#define UF_long long
+#define UF_long_max LONG_MAX
+#define UF_long_id "%ld"
+
+#endif
+#endif
+
+/* ========================================================================== */
+/* === SuiteSparse version ================================================== */
+/* ========================================================================== */
+
+/* SuiteSparse is not a package itself, but a collection of packages, some of
+ * which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD,
+ * COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the
+ * collection itself. The versions of packages within each version of
+ * SuiteSparse are meant to work together. Combining one packge from one
+ * version of SuiteSparse, with another package from another version of
+ * SuiteSparse, may or may not work.
+ *
+ * SuiteSparse Version 3.0.0 contains the following packages:
+ *
+ * AMD version 2.2.0
+ * CAMD version 2.2.0
+ * COLAMD version 2.7.0
+ * CCOLAMD version 2.7.0
+ * CHOLMOD version 1.5.0
+ * CSparse version 2.2.0
+ * CXSparse version 2.2.0
+ * KLU version 1.0.0
+ * BTF version 1.0.0
+ * LDL version 2.0.0
+ * UFconfig version number is the same as SuiteSparse
+ * UMFPACK version 5.1.0
+ * RBio version 1.1.0
+ * UFcollection version 1.1.0
+ *
+ * Other package dependencies:
+ * BLAS required by CHOLMOD and UMFPACK
+ * LAPACK required by CHOLMOD
+ * METIS 4.0.1 required by CHOLMOD (optional) and KLU (optional)
+ */
+
+#define SUITESPARSE_DATE "May 31, 2007"
+#define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub))
+#define SUITESPARSE_MAIN_VERSION 3
+#define SUITESPARSE_SUB_VERSION 0
+#define SUITESPARSE_SUBSUB_VERSION 0
+#define SUITESPARSE_VERSION \
+ SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD Version 2.2, Copyright (c) 2007 by Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
* factorization of P*A*P' has fewer nonzeros and takes less work than the
* Cholesky factorization of A. If A is not symmetric, then it performs its
* ordering on the matrix A+A'. Two sets of user-callable routines are
- * provided, one for "int" integers and the other for "long" integers.
+ * provided, one for int integers and the other for UF_long integers.
*
* The method is based on the approximate minimum degree algorithm, discussed
* in Amestoy, Davis, and Duff, "An approximate degree ordering algorithm",
#ifndef AMD_H
#define AMD_H
-int amd_order ( /* returns 0 if OK, negative value if error */
+/* make it easy for C++ programs to include AMD */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* get the definition of size_t: */
+#include <stddef.h>
+
+/* define UF_long */
+#include "UFconfig.h"
+
+int amd_order /* returns AMD_OK, AMD_OK_BUT_JUMBLED,
+ * AMD_INVALID, or AMD_OUT_OF_MEMORY */
+(
int n, /* A is n-by-n. n must be >= 0. */
const int Ap [ ], /* column pointers for A, of size n+1 */
const int Ai [ ], /* row indices of A, of size nz = Ap [n] */
double Info [ ] /* output Info statistics, of size AMD_INFO */
) ;
-long amd_l_order ( /* see above for description of arguments */
- long n,
- const long Ap [ ],
- const long Ai [ ],
- long P [ ],
+UF_long amd_l_order /* see above for description of arguments */
+(
+ UF_long n,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
+ UF_long P [ ],
double Control [ ],
double Info [ ]
) ;
/* Input arguments (not modified):
*
* n: the matrix A is n-by-n.
- * Ap: an int/long array of size n+1, containing the column pointers of A.
- * Ai: an int/long array of size nz, containing the row indices of A,
+ * Ap: an int/UF_long array of size n+1, containing column pointers of A.
+ * Ai: an int/UF_long array of size nz, containing the row indices of A,
* where nz = Ap [n].
* Control: a double array of size AMD_CONTROL, containing control
* parameters. Defaults are used if Control is NULL.
*
* Output arguments (not defined on input):
*
- * P: an int/long array of size n, containing the output permutation. If
+ * P: an int/UF_long array of size n, containing the output permutation. If
* row i is the kth pivot row, then P [k] = i. In MATLAB notation,
* the reordered matrix is A (P,P).
* Info: a double array of size AMD_INFO, containing statistical
*
* On input, the matrix A is stored in column-oriented form. The row indices
* of nonzero entries in column j are stored in Ai [Ap [j] ... Ap [j+1]-1].
- * The row indices must appear in ascending order in each column, and there
- * must not be any duplicate entries. Row indices must be in the range 0 to
+ *
+ * If the row indices appear in ascending order in each column, and there
+ * are no duplicate entries, then amd_order is slightly more efficient in
+ * terms of time and memory usage. If this condition does not hold, a copy
+ * of the matrix is created (where these conditions do hold), and the copy is
+ * ordered. This feature is new to v2.0 (v1.2 and earlier required this
+ * condition to hold for the input matrix).
+ *
+ * Row indices must be in the range 0 to
* n-1. Ap [0] must be zero, and thus nz = Ap [n] is the number of nonzeros
* in A. The array Ap is of size n+1, and the array Ai is of size nz = Ap [n].
* The matrix does not need to be symmetric, and the diagonal does not need to
* pattern of the matrix A is the same as that used internally by MATLAB.
* If you wish to use a more flexible input structure, please see the
* umfpack_*_triplet_to_col routines in the UMFPACK package, at
- * http://www.cise.ufl.edu/research/sparse/umfpack, or use the amd_preprocess
- * routine discussed below.
+ * http://www.cise.ufl.edu/research/sparse/umfpack.
*
* Restrictions: n >= 0. Ap [0] = 0. Ap [j] <= Ap [j+1] for all j in the
- * range 0 to n-1. nz = Ap [n] >= 0. For all j in the range 0 to n-1,
- * and for all p in the range Ap [j] to Ap [j+1]-2, Ai [p] < Ai [p+1] must
- * hold. Ai [0..nz-1] must be in the range 0 to n-1. To avoid integer
- * overflow, (2.4*nz + 8*n) < INT_MAX / sizeof (int) for must hold for the
- * "int" version. (2.4*nz + 8*n) < LONG_MAX / sizeof (long) must hold
- * for the "long" version. Finally, Ai, Ap, and P must not be NULL. If
- * any of these restrictions are not met, AMD returns AMD_INVALID.
+ * range 0 to n-1. nz = Ap [n] >= 0. Ai [0..nz-1] must be in the range 0
+ * to n-1. Finally, Ai, Ap, and P must not be NULL. If any of these
+ * restrictions are not met, AMD returns AMD_INVALID.
*
* AMD returns:
*
* AMD_INVALID if the input arguments n, Ap, Ai are invalid, or if P is
* NULL.
*
+ * AMD_OK_BUT_JUMBLED if the matrix had unsorted columns, and/or duplicate
+ * entries, but was otherwise valid.
+ *
* The AMD routine first forms the pattern of the matrix A+A', and then
* computes a fill-reducing ordering, P. If P [k] = i, then row/column i of
* the original is the kth pivotal row. In MATLAB notation, the permuted
* condition.
*
* Info [AMD_STATUS]: the return value of AMD, either AMD_OK,
- * AMD_OUT_OF_MEMORY, or AMD_INVALID.
+ * AMD_OK_BUT_JUMBLED, AMD_OUT_OF_MEMORY, or AMD_INVALID.
*
* Info [AMD_N]: n, the size of the input matrix
*
*/
/* ------------------------------------------------------------------------- */
-/* AMD preprocess */
+/* direct interface to AMD */
/* ------------------------------------------------------------------------- */
-/* amd_preprocess: sorts, removes duplicate entries, and transposes the
- * nonzero pattern of a column-form matrix A, to obtain the matrix R.
- *
- * Alternatively, you can consider this routine as constructing a row-form
- * matrix from a column-form matrix. Duplicate entries are allowed in A (and
- * removed in R). The columns of R are sorted. Checks its input A for errors.
- *
- * On input, A can have unsorted columns, and can have duplicate entries.
- * Ap [0] must still be zero, and Ap must be monotonically nondecreasing.
- * Row indices must be in the range 0 to n-1.
- *
- * On output, if this routine returns AMD_OK, then the matrix R is a valid
- * input matrix for AMD_order. It has sorted columns, with no duplicate
- * entries in each column. Since AMD_order operates on the matrix A+A', it
- * can just as easily use A or A', so the transpose has no significant effect
- * (except for minor tie-breaking, which can lead to a minor effect in the
- * quality of the ordering). As an example, compare the output of amd_demo.c
- * and amd_demo2.c.
- *
- * This routine transposes A to get R because that's the simplest way to
- * sort and remove duplicate entries from a matrix.
- *
- * Allocates 2*n integer work arrays, and free's them when done.
- *
- * If you wish to call amd_order, but do not know if your matrix has unsorted
- * columns or duplicate entries, then you can use the following code, which is
- * fairly efficient. amd_order will not allocate any internal matrix until
- * it checks that the input matrix is valid, so the method below is memory-
- * efficient as well. This code snippet assumes that Rp and Ri are already
- * allocated, and are the same size as Ap and Ai respectively.
-
- result = amd_order (n, p, Ap, Ai, Control, Info) ;
- if (result == AMD_INVALID)
- {
- if (amd_preprocess (n, Ap, Ai, Rp, Ri) == AMD_OK)
- {
- result = amd_order (n, p, Rp, Ri, Control, Info) ;
- }
- }
-
- * amd_preprocess will still return AMD_INVALID if any row index in Ai is out
- * of range or if the Ap array is invalid. These errors are not corrected by
- * amd_preprocess since they represent a more serious error that should be
- * flagged with the AMD_INVALID error code.
- */
-
-int amd_preprocess
+/* amd_2 is the primary AMD ordering routine. It is not meant to be
+ * user-callable because of its restrictive inputs and because it destroys
+ * the user's input matrix. It does not check its inputs for errors, either.
+ * However, if you can work with these restrictions it can be faster than
+ * amd_order and use less memory (assuming that you can create your own copy
+ * of the matrix for AMD to destroy). Refer to AMD/Source/amd_2.c for a
+ * description of each parameter. */
+
+void amd_2
(
int n,
- const int Ap [ ],
- const int Ai [ ],
- int Rp [ ],
- int Ri [ ]
+ int Pe [ ],
+ int Iw [ ],
+ int Len [ ],
+ int iwlen,
+ int pfree,
+ int Nv [ ],
+ int Next [ ],
+ int Last [ ],
+ int Head [ ],
+ int Elen [ ],
+ int Degree [ ],
+ int W [ ],
+ double Control [ ],
+ double Info [ ]
) ;
-long amd_l_preprocess
+void amd_l2
(
- long n,
- const long Ap [ ],
- const long Ai [ ],
- long Rp [ ],
- long Ri [ ]
+ UF_long n,
+ UF_long Pe [ ],
+ UF_long Iw [ ],
+ UF_long Len [ ],
+ UF_long iwlen,
+ UF_long pfree,
+ UF_long Nv [ ],
+ UF_long Next [ ],
+ UF_long Last [ ],
+ UF_long Head [ ],
+ UF_long Elen [ ],
+ UF_long Degree [ ],
+ UF_long W [ ],
+ double Control [ ],
+ double Info [ ]
) ;
-/* Input arguments (not modified):
- *
- * n: the matrix A is n-by-n.
- * Ap: an int/long array of size n+1, containing the column pointers of A.
- * Ai: an int/long array of size nz, containing the row indices of A,
- * where nz = Ap [n].
- * The nonzero pattern of column j of A is in Ai [Ap [j] ... Ap [j+1]-1].
- * Ap [0] must be zero, and Ap [j] <= Ap [j+1] must hold for all j in the
- * range 0 to n-1. Row indices in Ai must be in the range 0 to n-1.
- * The row indices in any one column need not be sorted, and duplicates
- * may exist.
- *
- * Output arguments (not defined on input):
- *
- * Rp: an int/long array of size n+1, containing the column pointers of R.
- * Ri: an int/long array of size rnz, containing the row indices of R,
- * where rnz = Rp [n]. Note that Rp [n] will be less than Ap [n] if
- * duplicates appear in A. In general, Rp [n] <= Ap [n].
- * The data structure for R is the same as A, except that each column of
- * R contains sorted row indices, and no duplicates appear in any column.
- *
- * amd_preprocess returns:
- *
- * AMD_OK if the matrix A is valid and sufficient memory can be allocated
- * to perform the preprocessing.
- *
- * AMD_OUT_OF_MEMORY if not enough memory can be allocated.
- *
- * AMD_INVALID if the input arguments n, Ap, Ai are invalid, or if Rp or
- * Ri are NULL.
+/* ------------------------------------------------------------------------- */
+/* amd_valid */
+/* ------------------------------------------------------------------------- */
+
+/* Returns AMD_OK or AMD_OK_BUT_JUMBLED if the matrix is valid as input to
+ * amd_order; the latter is returned if the matrix has unsorted and/or
+ * duplicate row indices in one or more columns. Returns AMD_INVALID if the
+ * matrix cannot be passed to amd_order. For amd_order, the matrix must also
+ * be square. The first two arguments are the number of rows and the number
+ * of columns of the matrix. For its use in AMD, these must both equal n.
+ *
+ * NOTE: this routine returned TRUE/FALSE in v1.2 and earlier.
*/
+int amd_valid
+(
+ int n_row, /* # of rows */
+ int n_col, /* # of columns */
+ const int Ap [ ], /* column pointers, of size n_col+1 */
+ const int Ai [ ] /* row indices, of size Ap [n_col] */
+) ;
+
+UF_long amd_l_valid
+(
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ]
+) ;
+
+/* ------------------------------------------------------------------------- */
+/* AMD memory manager and printf routines */
+/* ------------------------------------------------------------------------- */
+
+/* The user can redefine these to change the malloc, free, and printf routines
+ * that AMD uses. */
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
+EXTERN void *(*amd_malloc) (size_t) ; /* pointer to malloc */
+EXTERN void (*amd_free) (void *) ; /* pointer to free */
+EXTERN void *(*amd_realloc) (void *, size_t) ; /* pointer to realloc */
+EXTERN void *(*amd_calloc) (size_t, size_t) ; /* pointer to calloc */
+EXTERN int (*amd_printf) (const char *, ...) ; /* pointer to printf */
+
/* ------------------------------------------------------------------------- */
/* AMD Control and Info arrays */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
#define AMD_OK 0 /* success */
-#define AMD_OUT_OF_MEMORY -1 /* malloc failed */
+#define AMD_OUT_OF_MEMORY -1 /* malloc failed, or problem too large */
#define AMD_INVALID -2 /* input arguments are not valid */
+#define AMD_OK_BUT_JUMBLED 1 /* input matrix is OK for amd_order, but
+ * columns were not sorted, and/or duplicate entries were present. AMD had
+ * to do extra work before ordering the matrix. This is a warning, not an
+ * error. */
+
+/* ========================================================================== */
+/* === AMD version ========================================================== */
+/* ========================================================================== */
+
+/* AMD Version 1.2 and later include the following definitions.
+ * As an example, to test if the version you are using is 1.2 or later:
+ *
+ * #ifdef AMD_VERSION
+ * if (AMD_VERSION >= AMD_VERSION_CODE (1,2)) ...
+ * #endif
+ *
+ * This also works during compile-time:
+ *
+ * #if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE (1,2))
+ * printf ("This is version 1.2 or later\n") ;
+ * #else
+ * printf ("This is an early version\n") ;
+ * #endif
+ *
+ * Versions 1.1 and earlier of AMD do not include a #define'd version number.
+ */
+
+#define AMD_DATE "May 31, 2007"
+#define AMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
+#define AMD_MAIN_VERSION 2
+#define AMD_SUB_VERSION 2
+#define AMD_SUBSUB_VERSION 0
+#define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION)
+
+#ifdef __cplusplus
+}
+#endif
#endif
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
/* This file is for internal use in AMD itself, and does not normally need to
- * be included in user code. Use amd.h instead.
+ * be included in user code (it is included in UMFPACK, however). All others
+ * should use amd.h instead.
*
* The following compile-time definitions affect how AMD is compiled.
*
- * -DMATLAB_MEX_FILE
+ * -DNPRINT
*
- * This flag is turned on when compiling the amd mexFunction for
- * use in MATLAB.
+ * Disable all printing. stdio.h will not be included. Printing can
+ * be re-enabled at run-time by setting the global pointer amd_printf
+ * to printf (or mexPrintf for a MATLAB mexFunction).
*
- * -DMATHWORKS
+ * -DNMALLOC
*
- * This flag is turned on when compiling amd as a built-in routine
- * in MATLAB. Internal routines utMalloc, utFree, utRealloc, and
- * utPrintf are used, and the MathWorks "util.h" file is included.
- * This option is intended for use by The MathWorks, Inc., only.
- *
- * -DNDEBUG
- *
- * Debugging mode (if NDEBUG is not defined). The default, of course,
- * is no debugging. Turning on debugging takes some work (see below).
- * If you do not edit this file, then debugging is turned off anyway,
- * regardless of whether or not -DNDEBUG is specified in your compiler
- * options.
- *
- * -DALLOCATE=allocation_routine
- * -DFREE=free_routine
- *
- * If you do not wish to use malloc or free, you can define the
- * routines to be used here. You must specify both of them, or
- * neither.
- *
- * -DPRINTF=printf_routine
- *
- * If you wish to use a routine other than printf, you can define it
- * with -DPRINTF= followed by the name of the printf replacement.
+ * No memory manager is defined at compile-time. You MUST define the
+ * function pointers amd_malloc, amd_free, amd_realloc, and
+ * amd_calloc at run-time for AMD to work properly.
*/
/* ========================================================================= */
/* === NDEBUG ============================================================== */
/* ========================================================================= */
+/*
+ * Turning on debugging takes some work (see below). If you do not edit this
+ * file, then debugging is always turned off, regardless of whether or not
+ * -DNDEBUG is specified in your compiler options.
+ *
+ * If AMD is being compiled as a mexFunction, then MATLAB_MEX_FILE is defined,
+ * and mxAssert is used instead of assert. If debugging is not enabled, no
+ * MATLAB include files or functions are used. Thus, the AMD library libamd.a
+ * can be safely used in either a stand-alone C program or in another
+ * mexFunction, without any change.
+ */
+
/*
AMD will be exceedingly slow when running in debug mode. The next three
lines ensure that debugging is turned off.
/* ANSI include files */
/* ------------------------------------------------------------------------- */
-/* from stdlib.h: malloc, free, realloc (when not compiling for MATLAB) */
+/* from stdlib.h: size_t, malloc, free, realloc, and calloc */
#include <stdlib.h>
-/* from stdio.h: printf. When in debug mode: fopen, fscanf */
+#if !defined(NPRINT) || !defined(NDEBUG)
+/* from stdio.h: printf. Not included if NPRINT is defined at compile time.
+ * fopen and fscanf are used when debugging. */
#include <stdio.h>
+#endif
/* from limits.h: INT_MAX and LONG_MAX */
#include <limits.h>
/* MATLAB include files (only if being used in or via MATLAB) */
/* ------------------------------------------------------------------------- */
-#ifdef MATHWORKS
-#include "util.h"
-#endif
-
#ifdef MATLAB_MEX_FILE
#include "matrix.h"
#include "mex.h"
#define NULL 0
+/* largest value of size_t */
+#ifndef SIZE_T_MAX
+#define SIZE_T_MAX ((size_t) (-1))
+#endif
+
/* ------------------------------------------------------------------------- */
-/* integer type for AMD: int or long */
+/* integer type for AMD: int or UF_long */
/* ------------------------------------------------------------------------- */
+/* define UF_long */
+#include "UFconfig.h"
+
#if defined (DLONG) || defined (ZLONG)
-#define Int long
-#define ID "%ld"
-#define Int_MAX LONG_MAX
-#define Int_MIN LONG_MIN
+#define Int UF_long
+#define ID UF_long_id
+#define Int_MAX UF_long_max
#define AMD_order amd_l_order
#define AMD_defaults amd_l_defaults
#define AMD_dump amd_l_dump
#define AMD_debug amd_l_debug
#define AMD_debug_init amd_l_debug_init
-#define AMD_wpreprocess amd_l_wpreprocess
#define AMD_preprocess amd_l_preprocess
-#define AMD_preprocess_valid amd_l_preprocess_valid
#else
#define Int int
#define ID "%d"
#define Int_MAX INT_MAX
-#define Int_MIN INT_MIN
#define AMD_order amd_order
#define AMD_defaults amd_defaults
#define AMD_dump amd_dump
#define AMD_debug amd_debug
#define AMD_debug_init amd_debug_init
-#define AMD_wpreprocess amd_wpreprocess
#define AMD_preprocess amd_preprocess
-#define AMD_preprocess_valid amd_preprocess_valid
#endif
-/* ========================================================================= */
-/* === Memory allocator ==================================================== */
-/* ========================================================================= */
-
-/* The MATLAB mexFunction uses MATLAB's memory manager, while the C-callable */
-/* AMD routine uses the ANSI C malloc, free, and realloc routines. */
-
-#ifndef ALLOCATE
-#ifdef MATLAB_MEX_FILE
-#define ALLOCATE mxMalloc
-#define FREE mxFree
-#else
-#ifdef MATHWORKS
-/* Compiling as a built-in routine. Since out-of-memory conditions are checked
- * after every allocation, we can use ut* routines here. */
-#define ALLOCATE utMalloc
-#define FREE utFree
-#else
-/* use the ANSI C memory allocation routines */
-#define ALLOCATE malloc
-#define FREE free
-#endif
-#endif
-#endif
-
-
/* ========================================================================= */
/* === PRINTF macro ======================================================== */
/* ========================================================================= */
/* All output goes through the PRINTF macro. */
-
-#ifndef PRINTF
-#ifdef MATLAB_MEX_FILE
-#define PRINTF(params) { (void) mexPrintf params ; }
-#else
-#ifdef MATHWORKS
-#define PRINTF(params) { (void) utPrintf params ; }
-#else
-#define PRINTF(params) { (void) printf params ; }
-#endif
-#endif
-#endif
+#define PRINTF(params) { if (amd_printf != NULL) (void) amd_printf params ; }
/* ------------------------------------------------------------------------- */
/* AMD routine definitions (user-callable) */
/* AMD routine definitions (not user-callable) */
/* ------------------------------------------------------------------------- */
-GLOBAL Int AMD_valid
-(
- Int n_row,
- Int n_col,
- const Int Ap [ ],
- const Int Ai [ ]
-) ;
-
-GLOBAL Int AMD_aat
+GLOBAL size_t AMD_aat
(
Int n,
const Int Ap [ ],
const Int Ai [ ],
Int Len [ ],
- Int Tp [ ],
+ Int Tp [ ],
double Info [ ]
) ;
double Info [ ]
) ;
-GLOBAL void AMD_2 (
- Int n,
- Int Pe [ ],
- Int Iw [ ],
- Int Len [ ],
- Int iwlen,
- Int pfree,
- Int Nv [ ],
- Int Next [ ],
- Int Last [ ],
- Int Head [ ],
- Int Elen [ ],
- Int Degree [ ],
- Int W [ ],
- double Control [ ],
- double Info [ ]
-) ;
-
GLOBAL void AMD_postorder
(
Int nn,
#endif
) ;
-GLOBAL void AMD_wpreprocess
+GLOBAL void AMD_preprocess
(
Int n,
const Int Ap [ ],
Int Flag [ ]
) ;
-GLOBAL Int AMD_preprocess_valid
-(
- Int n,
- const Int Ap [ ],
- const Int Ai [ ]
-) ;
-
/* ------------------------------------------------------------------------- */
/* debugging definitions */
/* ------------------------------------------------------------------------- */
+#ifndef NDEBUG
+
/* from assert.h: assert macro */
-#if !defined (MATHWORKS) && !defined (MATLAB_MEX_FILE)
#include <assert.h>
-#endif
-#ifndef NDEBUG
+#ifndef EXTERN
+#define EXTERN extern
+#endif
-GLOBAL Int AMD_debug ;
+EXTERN Int AMD_debug ;
GLOBAL void AMD_debug_init ( char *s ) ;
-GLOBAL void AMD_dump (
+GLOBAL void AMD_dump
+(
Int n,
Int Pe [ ],
Int Iw [ ],
#undef ASSERT
#endif
+/* Use mxAssert if AMD is compiled into a mexFunction */
#ifdef MATLAB_MEX_FILE
#define ASSERT(expression) (mxAssert ((expression), ""))
#else
-#ifdef MATHWORKS
-#define ASSERT(expression) (utAssert (expression))
-#else
#define ASSERT(expression) (assert (expression))
#endif
-#endif /* MATLAB_MEX_FILE */
#define AMD_DEBUG0(params) { PRINTF (params) ; }
#define AMD_DEBUG1(params) { if (AMD_debug >= 1) PRINTF (params) ; }
#else
+/* no debugging */
+#define ASSERT(expression)
#define AMD_DEBUG0(params)
#define AMD_DEBUG1(params)
#define AMD_DEBUG2(params)
#define AMD_DEBUG3(params)
#define AMD_DEBUG4(params)
-#define ASSERT(expression)
-
#endif
-AMD version 1.1: a set of routines for permuting sparse matrices prior to
+AMD Version 2.2, Copyright (c) 2007 by Timothy A.
+Davis, Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved.
+AMD is available under alternate licences; contact T. Davis for details.
+
+AMD: a set of routines for permuting sparse matrices prior to
factorization. Includes a version in C, a version in Fortran, and a MATLAB
mexFunction.
+Requires UFconfig, in the ../UFconfig directory relative to this directory.
+
Quick start (Unix, or Windows with Cygwin):
To compile, test, and install AMD, you may wish to first configure the
- installation by editting the AMD/Make/Make.include file. Next, cd to this
+ installation by editting the ../UFconfig/UFconfig.mk file. Next, cd to this
directory (AMD) and type "make" (or "make lib" if you do not have MATLAB).
To compile and run a demo program for the Fortran version, type
"make fortran". When done, type "make clean" to remove unused *.o files
(keeps the compiled libraries and demo programs). See the User Guide
- (Doc/AMD_UserGuide.pdf), or AMD/Make/Make.include, for more details.
+ (Doc/AMD_UserGuide.pdf), or ../UFconfig/UFconfig.mk for more details.
Quick start (for MATLAB users);
To compile, test, and install the AMD mexFunction, cd to the
AMD/MATLAB directory and type amd_make at the MATLAB prompt.
- This works on any system supported by MATLAB.
--------------------------------------------------------------------------------
+If you have MATLAB 7.2 or earlier and use "make mex", you must first edit
+UFconfig/UFconfig.h to remove the "-largeArrayDims" option from the MEX command
+(or just use amd_make.m inside MATLAB).
-AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A.
-Davis, Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved.
+-------------------------------------------------------------------------------
AMD License:
Your use or distribution of AMD or any modified version of
AMD implies that you agree to this License.
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses AMD or any modified version of AMD code must cite the
- Copyright, this License, the Availability note, and "Used by permission."
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ Permission is hereby granted to use or copy this program under the
+ terms of the GNU LGPL, provided that the Copyright, this License,
+ and the Availability of the original version is retained on all copies.
+ User documentation of any code that uses this code or any modified
+ version of this code must cite the Copyright, this License, the
+ Availability note, and "Used by permission." Permission to modify
+ the code and to distribute modified code is granted, provided the
+ Copyright, this License, and the Availability note are retained,
+ and a notice that the code was modified is included.
Availability:
-------------------------------------------------------------------------------
-This is the AMD Version 1.1 README file. It is a terse overview of AMD.
-Refer to the User Guide (Doc/AMD_UserGuide.pdf) for how to install and use AMD.
+This is the AMD README file. It is a terse overview of AMD.
+Refer to the User Guide (Doc/AMD_UserGuide.pdf) for how to install
+and use AMD.
Description:
Authors:
- Timothy A. Davis (davis@cise.ufl.edu), University of Florida.
+ Timothy A. Davis (davis at cise.ufl.edu), University of Florida.
Patrick R. Amestory, ENSEEIHT, Toulouse, France.
Iain S. Duff, Rutherford Appleton Laboratory, UK.
for making this sabbatical possible.
-------------------------------------------------------------------------------
-Files and directories in the AMD v1.0 distribution:
+Files and directories in the AMD distribution:
-------------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Doc documentation
- Make for compiling AMD
Source primary source code
Include include file for use in your code that calls AMD
Demo demo programs. also serves as test of the AMD installation.
Makefile top-level Makefile for GNU make or original make.
Windows users would require Cygwin to use "make"
- README this file
+ README.txt this file
---------------------------------------------------------------------------
Doc directory: documentation
Makefile for creating the documentation
AMD_UserGuide.bib AMD User Guide (references)
AMD_UserGuide.tex AMD User Guide (LaTeX)
- AMD_UserGuide.pdf AmD User Guide (PDF)
-
- ---------------------------------------------------------------------------
- Make directory: for compiling AMD (Lib/libamd.a and Lib/libamdf77.a)
- ---------------------------------------------------------------------------
-
- Make.include overall configurations. Can use one of:
- Make.alpha Makefile additions for Compaq Alpha
- Make.linux Makefile additions for Linux
- Make.rs6000 Makefile additions for RS 6000
- Make.sgi Makefile additions for SGI
- Make.solaris Makefile additions for Solaris
+ AMD_UserGuide.pdf AMD User Guide (PDF)
+ lesser.txt the GNU LGPL license
---------------------------------------------------------------------------
Source directory:
---------------------------------------------------------------------------
- GNUmakefile a nice Makefile, for GNU make
- Makefile an ugly Unix Makefile (for older make's)
-
amd_order.c user-callable, primary AMD ordering routine
amd_control.c user-callable, prints the control parameters
amd_defaults.c user-callable, sets default control parameters
amd_info.c user-callable, prints the statistics from AMD
amd_1.c non-user-callable, construct A+A'
- amd_2.c non-user-callable, primary ordering kernel
+ amd_2.c user-callable, primary ordering kernel
(a C version of amd.f and amdbar.f, with
post-ordering added)
amd_aat.c non-user-callable, computes nnz (A+A')
amd_dump.c non-user-callable, debugging routines
- amd_internal.h non-user-callable, include file for AMD
- amd_mex.c non-user-callable, MATLAB mexFunction
amd_postorder.c non-user-callable, postorder
amd_post_tree.c non-user-callable, postorder just one tree
amd_valid.c non-user-callable, verifies a matrix
+ amd_preprocess.c non-user-callable, computes A', removes duplic
amd.f user-callable Fortran 77 version
amdbar.f user-callable Fortran 77 version
---------------------------------------------------------------------------
amd.h include file for C programs that use AMD
+ amd_internal.h non-user-callable, include file for AMD
---------------------------------------------------------------------------
Demo directory:
amd_demo.c C demo program for AMD
amd_demo.out output of amd_demo.c
+ amd_demo2.c C demo program for AMD, jumbled matrix
+ amd_demo2.out output of amd_demo2.c
+
+ amd_l_demo.c C demo program for AMD (UF_long version)
+ amd_l_demo.out output of amd_l_demo.c
+
amd_simple.c simple C demo program for AMD
amd_simple.out output of amd_simple.c
GNUmakefile a nice Makefile, for GNU make
Makefile an ugly Unix Makefile (for older make's)
- Contents.m for "help amd" listing of toolbox contents
+ Contents.m for "help amd2" listing of toolbox contents
- amd.m MATLAB help file for AMD
+ amd2.m MATLAB help file for AMD
amd_make.m MATLAB m-file for compiling AMD mexFunction
+ amd_install.m compile and install the AMD mexFunction
amd_mex.c AMD mexFunction for MATLAB
Lib directory: libamd.a and libamdf77.a libraries placed here
---------------------------------------------------------------------------
+ GNUmakefile a nice Makefile, for GNU make
+ Makefile an ugly Unix Makefile (for older make's)
libamd.def AMD definitions for Windows
AMD = amd_aat amd_1 amd_2 amd_dump amd_postorder amd_post_tree amd_defaults \
amd_order amd_control amd_info amd_valid amd_preprocess
-INC = ../Include/amd.h amd_internal.h
+INC = ../Include/amd.h
#-------------------------------------------------------------------------------
# object files for each version
@echo =====umfpack==========optimized====== $(<F)
@$(CC) $(CFLAGS) -I../Include -DDLONG -c $< -o $@
-all: $(AMDI) $(AMDL)
+$D/lib/contrib/umfpack/amd_global.$(OBJEXT): amd_global.c $(INC)
+ @echo =====umfpack==========optimized====== $(<F)
+ @$(CC) $(CFLAGS) -I../Include -c $< -o $@
+
+
+all: $(AMDI) $(AMDL) $D/lib/contrib/umfpack/amd_global.$(OBJEXT)
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
* number of entries in each row/column in A+A', excluding the diagonal.
* Len [j], on input, is the number of entries in row/column j of A+A'. This
* routine constructs the matrix A+A' and then calls AMD_2. No error checking
- * is performed (this was done in AMD_aat).
+ * is performed (this was done in AMD_valid).
*/
#include "amd_internal.h"
W = s ; s += n ;
Iw = s ; s += iwlen ;
- ASSERT (AMD_valid (n, n, Ap, Ai)) ;
+ ASSERT (AMD_valid (n, n, Ap, Ai) == AMD_OK) ;
/* construct the pointers for A+A' */
Sp = Nv ; /* use Nv and W as workspace for Sp and Tp [ */
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
#include "amd_internal.h"
+/* ========================================================================= */
+/* === clear_flag ========================================================== */
+/* ========================================================================= */
+
+static Int clear_flag (Int wflg, Int wbig, Int W [ ], Int n)
+{
+ Int x ;
+ if (wflg < 2 || wflg >= wbig)
+ {
+ for (x = 0 ; x < n ; x++)
+ {
+ if (W [x] != 0) W [x] = 1 ;
+ }
+ wflg = 2 ;
+ }
+ /* at this point, W [0..n-1] < wflg holds */
+ return (wflg) ;
+}
+
+
+/* ========================================================================= */
+/* === AMD_2 =============================================================== */
+/* ========================================================================= */
+
GLOBAL void AMD_2
(
Int n, /* A is n-by-n, where n > 0 */
{
/*
- * Given a representation of the nonzero pattern of a symmetric matrix, A,
+ * Given a representation of the nonzero pattern of a symmetric matrix, A,
* (excluding the diagonal) perform an approximate minimum (UMFPACK/MA38-style)
* degree ordering to compute a pivot order such that the introduction of
* nonzeros (fill-in) in the Cholesky factors A = LL' is kept low. At each
* upper-bound on the external degree. This routine can optionally perform
* aggresive absorption (as done by MC47B in the Harwell Subroutine
* Library).
- *
+ *
* The approximate degree algorithm implemented here is the symmetric analog of
* the degree update algorithm in MA38 and UMFPACK (the Unsymmetric-pattern
* MultiFrontal PACKage, both by Davis and Duff). The routine is based on the
* MA27 minimum degree ordering algorithm by Iain Duff and John Reid.
- *
+ *
* This routine is a translation of the original AMDBAR and MC47B routines,
* in Fortran, with the following modifications:
- *
+ *
* (1) dense rows/columns are removed prior to ordering the matrix, and placed
* last in the output order. The presence of a dense row/column can
* increase the ordering time by up to O(n^2), unless they are removed
* ouput. Many of these functions are also provided by the Fortran
* Harwell Subroutine Library routine MC47A.
*
- * (6) both "int" and "long" versions are provided. In the descriptions below
- * and integer is and "int" or "long", depending on which version is
+ * (6) both int and UF_long versions are provided. In the descriptions below
+ * and integer is and int or UF_long depending on which version is
* being used.
**********************************************************************
* ----------------------------------------------------------------------------
* INPUT ARGUMENTS (unaltered):
* ----------------------------------------------------------------------------
-
+
* n: The matrix order. Restriction: n >= 1.
*
* iwlen: The size of the Iw array. On input, the matrix is stored in
Int deg, degme, dext, lemax, e, elenme, eln, i, ilast, inext, j,
jlast, jnext, k, knt1, knt2, knt3, lenj, ln, me, mindeg, nel, nleft,
- nvi, nvj, nvpiv, slenme, wbig, we, wflg, wnvi, x, ok, ndense, ncmpa,
+ nvi, nvj, nvpiv, slenme, wbig, we, wflg, wnvi, ok, ndense, ncmpa,
dense, aggressive ;
unsigned Int hash ; /* unsigned, so that hash % n is well defined.*/
* nvj: the number of variables in a supervariable j (= Nv [j])
* nvpiv: number of pivots in current element
* slenme: number of variables in variable list of pivotal variable
- * wbig: = INT_MAX - n for the "int" version, LONG_MAX - n for the
- * "long" version. wflg is not allowed to be >= wbig.
+ * wbig: = INT_MAX - n for the int version, UF_long_max - n for the
+ * UF_long version. wflg is not allowed to be >= wbig.
* we: W [e]
* wflg: used for flagging the W array. See description of Iw.
* wnvi: wflg - Nv [i]
dmax = 1 ;
me = EMPTY ;
- wflg = 2 ;
mindeg = 0 ;
ncmpa = 0 ;
nel = 0 ;
- lemax = 0 ; /* this is called dmax in the Fortran version */
-
-#ifdef TEST_FOR_INTEGER_OVERFLOW
- /* for testing only */
- wbig = 3*n ;
-#else
- /* normal operation */
- wbig = Int_MAX - n ;
-#endif
+ lemax = 0 ;
/* get control parameters */
if (Control != (double *) NULL)
alpha = AMD_DEFAULT_DENSE ;
aggressive = AMD_DEFAULT_AGGRESSIVE ;
}
+ /* Note: if alpha is NaN, this is undefined: */
if (alpha < 0)
{
- /* no dense rows/columns */
- dense = n ;
+ /* only remove completely dense rows/columns */
+ dense = n-2 ;
}
else
{
}
dense = MAX (16, dense) ;
dense = MIN (n, dense) ;
- AMD_DEBUG1 (("AMD (debug), alpha %g, aggr. "ID"\n", alpha, aggressive)) ;
+ AMD_DEBUG1 (("\n\nAMD (debug), alpha %g, aggr. "ID"\n",
+ alpha, aggressive)) ;
for (i = 0 ; i < n ; i++)
{
Last [i] = EMPTY ;
Head [i] = EMPTY ;
Next [i] = EMPTY ;
- /* if seperate Hhead array is used for hash buckets: *
+ /* if separate Hhead array is used for hash buckets: *
Hhead [i] = EMPTY ;
*/
Nv [i] = 1 ;
}
#ifndef NDEBUG
- AMD_DEBUG1 (("\n======Nel "ID"\n", nel)) ;
+ AMD_DEBUG1 (("\n======Nel "ID" initial\n", nel)) ;
AMD_dump (n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last,
Head, Elen, Degree, W, -1) ;
#endif
+ /* initialize wflg */
+ wbig = Int_MAX - n ;
+ wflg = clear_flag (0, wbig, W, n) ;
+
/* --------------------------------------------------------------------- */
/* initialize degree lists and eliminate dense and empty rows */
/* --------------------------------------------------------------------- */
ndense = 0 ;
- /* for (i = n-1 ; i >= 0 ; i--) */
for (i = 0 ; i < n ; i++)
{
deg = Degree [i] ;
#ifndef NDEBUG
AMD_DEBUG1 (("\n======Nel "ID"\n", nel)) ;
- if (AMD_debug >= 2) AMD_dump (n, Pe, Iw, Len, iwlen, pfree, Nv, Next,
- Last, Head, Elen, Degree, W, nel) ;
+ if (AMD_debug >= 2)
+ {
+ AMD_dump (n, Pe, Iw, Len, iwlen, pfree, Nv, Next,
+ Last, Head, Elen, Degree, W, nel) ;
+ }
#endif
/* ========================================================================= */
/* store i in new list */
/* ----------------------------------------------------- */
- /* flag i as being in Lme by negating Nv [i] */
+ /* flag i as being in Lme by negating Nv [i] */
degme += nvi ;
Nv [i] = -nvi ;
Iw [++pme2] = i ;
}
else
{
- /* i is at the head of the degree list */
+ /* i is at the head of the degree list */
ASSERT (Degree [i] >= 0 && Degree [i] < n) ;
Head [Degree [i]] = inext ;
}
}
else
{
- /* search the elements in me. */
+ /* search the elements in me. */
e = Iw [p++] ;
ASSERT (e >= 0 && e < n) ;
pj = Pe [e] ;
Pe [me] = p ;
Len [me] -= knt1 ;
- /* check if nothing left of supervariable me */
+ /* check if nothing left of supervariable me */
if (Len [me] == 0) Pe [me] = EMPTY ;
Pe [e] = pj ;
Len [e] = ln - knt2 ;
- /* nothing left of element e */
+ /* nothing left of element e */
if (Len [e] == 0) Pe [e] = EMPTY ;
ncmpa++ ; /* one more garbage collection */
- /* store first entry of each object in Pe */
- /* FLIP the first entry in each object */
+ /* store first entry of each object in Pe */
+ /* FLIP the first entry in each object */
for (j = 0 ; j < n ; j++)
{
pn = Pe [j] ;
}
}
- /* psrc/pdst point to source/destination */
+ /* psrc/pdst point to source/destination */
psrc = 0 ;
pdst = 0 ;
pend = pme1 - 1 ;
}
}
- /* move the new partially-constructed element */
+ /* move the new partially-constructed element */
p1 = pdst ;
for (psrc = pme1 ; psrc <= pfree-1 ; psrc++)
{
/* store i in new list */
/* ------------------------------------------------- */
- /* flag i as being in Lme by negating Nv [i] */
+ /* flag i as being in Lme by negating Nv [i] */
degme += nvi ;
Nv [i] = -nvi ;
Iw [pfree++] = i ;
}
else
{
- /* i is at the head of the degree list */
+ /* i is at the head of the degree list */
ASSERT (Degree [i] >= 0 && Degree [i] < n) ;
Head [Degree [i]] = inext ;
}
if (e != me)
{
- /* set tree pointer and flag to indicate element e is
- * absorbed into new element me (the parent of e is me) */
+ /* set tree pointer and flag to indicate element e is
+ * absorbed into new element me (the parent of e is me) */
AMD_DEBUG1 ((" Element "ID" => "ID"\n", e, me)) ;
Pe [e] = FLIP (me) ;
W [e] = 0 ;
/* me has now been converted into an element in Iw [pme1..pme2] */
/* ----------------------------------------------------------------- */
- /* degme holds the external degree of new element */
+ /* degme holds the external degree of new element */
Degree [me] = degme ;
Pe [me] = pme1 ;
Len [me] = pme2 - pme1 + 1 ;
ASSERT (Pe [me] >= 0 && Pe [me] < iwlen) ;
Elen [me] = FLIP (nvpiv + degme) ;
- /* FLIP (Elen (me)) is now the degree of pivot (including
+ /* FLIP (Elen (me)) is now the degree of pivot (including
* diagonal part). */
#ifndef NDEBUG
/* With the current value of wflg, wflg+n must not cause integer
* overflow */
- if (wflg >= wbig)
- {
- for (x = 0 ; x < n ; x++)
- {
- if (W [x] != 0) W [x] = 1 ;
- }
- wflg = 2 ;
- }
+ wflg = clear_flag (wflg, wbig, W, n) ;
/* ========================================================================= */
/* COMPUTE (W [e] - wflg) = |Le\Lme| FOR ALL ELEMENTS */
* for each element e that appears in any supervariable in Lme. The
* notation Le refers to the pattern (list of supervariables) of a
* previous element e, where e is not yet absorbed, stored in
- * Iw [Pe [e] + 1 ... Pe [e] + Iw [Pe [e]]]. The notation Lme
+ * Iw [Pe [e] + 1 ... Pe [e] + Len [e]]. The notation Lme
* refers to the pattern of the current element (stored in
* Iw [pme1..pme2]). If aggressive absorption is enabled, and
* (W [e] - wflg) becomes zero, then the element e will be absorbed
AMD_DEBUG3 ((""ID" Elen "ID": \n", i, eln)) ;
if (eln > 0)
{
- /* note that Nv [i] has been negated to denote i in Lme: */
+ /* note that Nv [i] has been negated to denote i in Lme: */
nvi = -Nv [i] ;
ASSERT (nvi > 0 && Pe [i] >= 0 && Pe [i] < iwlen) ;
wnvi = wflg - nvi ;
AMD_DEBUG4 ((" e "ID" we "ID" ", e, we)) ;
if (we >= wflg)
{
- /* unabsorbed element e has been seen in this loop */
+ /* unabsorbed element e has been seen in this loop */
AMD_DEBUG4 ((" unabsorbed, first time seen")) ;
we -= nvi ;
}
else if (we != 0)
{
- /* e is an unabsorbed element */
- /* this is the first we have seen e in all of Scan 1 */
+ /* e is an unabsorbed element */
+ /* this is the first we have seen e in all of Scan 1 */
AMD_DEBUG4 ((" unabsorbed")) ;
we = Degree [e] + wnvi ;
}
/* scan the element list associated with supervariable i */
/* ------------------------------------------------------------- */
- /* UMFPACK/MA38-style approximate degree: */
+ /* UMFPACK/MA38-style approximate degree: */
if (aggressive)
{
for (p = p1 ; p <= p2 ; p++)
}
}
- /* count the number of elements in i (including me): */
+ /* count the number of elements in i (including me): */
Elen [i] = pn - p1 + 1 ;
/* ------------------------------------------------------------- */
nvj = Nv [j] ;
if (nvj > 0)
{
- /* j is unabsorbed, and not in Lme. */
- /* add to degree and add to new list */
+ /* j is unabsorbed, and not in Lme. */
+ /* add to degree and add to new list */
deg += nvj ;
Iw [pn++] = j ;
hash += j ;
/* update the degree and check for mass elimination */
/* ------------------------------------------------------------- */
- /* with aggressive absorption, deg==0 is identical to the
+ /* with aggressive absorption, deg==0 is identical to the
* Elen [i] == 1 && p3 == pn test, below. */
ASSERT (IMPLIES (aggressive, (deg==0) == (Elen[i]==1 && p3==pn))) ;
{
/* --------------------------------------------------------- */
- /* mass elimination */
+ /* mass elimination */
/* --------------------------------------------------------- */
/* There is nothing left of this node except for an edge to
/* update the upper-bound degree of i */
/* --------------------------------------------------------- */
- /* the following degree does not yet include the size
- * of the current element, which is added later: */
+ /* the following degree does not yet include the size
+ * of the current element, which is added later: */
Degree [i] = MIN (Degree [i], deg) ;
/* add me to the list for i */
/* --------------------------------------------------------- */
- /* move first supervariable to end of list */
+ /* move first supervariable to end of list */
Iw [pn] = Iw [p3] ;
- /* move first element to end of element part of list */
+ /* move first element to end of element part of list */
Iw [p3] = Iw [p1] ;
- /* add new element, me, to front of list. */
+ /* add new element, me, to front of list. */
Iw [p1] = me ;
- /* store the new length of the list in Len [i] */
+ /* store the new length of the list in Len [i] */
Len [i] = pn - p1 + 1 ;
/* --------------------------------------------------------- */
Last [j] = i ;
}
- /* if a seperate Hhead array is used: *
+ /* if a separate Hhead array is used: *
Next [i] = Hhead [hash] ;
Hhead [hash] = i ;
*/
/* Clear the counter array, W [...], by incrementing wflg. */
/* ----------------------------------------------------------------- */
- /* make sure that wflg+n does not cause integer overflow */
+ /* make sure that wflg+n does not cause integer overflow */
lemax = MAX (lemax, degme) ;
wflg += lemax ;
- if (wflg >= wbig)
- {
- for (x = 0 ; x < n ; x++)
- {
- if (W [x] != 0) W [x] = 1 ;
- }
- wflg = 2 ;
- }
- /* at this point, W [0..n-1] < wflg holds */
+ wflg = clear_flag (wflg, wbig, W, n) ;
+ /* at this point, W [0..n-1] < wflg holds */
/* ========================================================================= */
/* SUPERVARIABLE DETECTION */
AMD_DEBUG2 (("Consider i "ID" nv "ID"\n", i, Nv [i])) ;
if (Nv [i] < 0)
{
- /* i is a principal variable in Lme */
+ /* i is a principal variable in Lme */
/* ---------------------------------------------------------
* examine all hash buckets with 2 or more variables. We do
* the pattern Lme of the current element, me
* --------------------------------------------------------- */
- /* let i = head of hash bucket, and empty the hash bucket */
+ /* let i = head of hash bucket, and empty the hash bucket */
ASSERT (Last [i] >= 0 && Last [i] < n) ;
hash = Last [i] ;
Last [j] = EMPTY ;
}
- /* if seperate Hhead array is used: *
+ /* if separate Hhead array is used: *
i = Hhead [hash] ;
Hhead [hash] = EMPTY ;
*/
eln = Elen [i] ;
ASSERT (ln >= 0 && eln >= 0) ;
ASSERT (Pe [i] >= 0 && Pe [i] < iwlen) ;
- /* do not flag the first element in the list (me) */
+ /* do not flag the first element in the list (me) */
for (p = Pe [i] + 1 ; p <= Pe [i] + ln - 1 ; p++)
{
ASSERT (Iw [p] >= 0 && Iw [p] < n) ;
ASSERT (Len [j] >= 0 && Elen [j] >= 0) ;
ASSERT (Pe [j] >= 0 && Pe [j] < iwlen) ;
ok = (Len [j] == ln) && (Elen [j] == eln) ;
- /* skop the first element in the list (me) */
+ /* skip the first element in the list (me) */
for (p = Pe [j] + 1 ; ok && p <= Pe [j] + ln - 1 ; p++)
{
ASSERT (Iw [p] >= 0 && Iw [p] < n) ;
AMD_DEBUG3 (("Restore i "ID" "ID"\n", i, nvi)) ;
if (nvi > 0)
{
- /* i is a principal variable in Lme */
- /* restore Nv [i] to signify that i is principal */
+ /* i is a principal variable in Lme */
+ /* restore Nv [i] to signify that i is principal */
Nv [i] = nvi ;
/* --------------------------------------------------------- */
AMD_DEBUG2 (("ME = "ID" DONE\n", me)) ;
Nv [me] = nvpiv ;
- /* save the length of the list for the new element me */
+ /* save the length of the list for the new element me */
Len [me] = p - pme1 ;
if (Len [me] == 0)
{
- /* there is nothing left of the current pivot element */
+ /* there is nothing left of the current pivot element */
/* it is a root of the assembly tree */
Pe [me] = EMPTY ;
W [me] = 0 ;
Info [AMD_STATUS] = AMD_OK ;
}
+/* ========================================================================= */
+/* POST-ORDERING */
+/* ========================================================================= */
+
/* -------------------------------------------------------------------------
* Variables at this point:
*
* No other scalars needed (pfree, iwlen, etc.)
* ------------------------------------------------------------------------- */
+ /* restore Pe */
for (i = 0 ; i < n ; i++)
{
Pe [i] = FLIP (Pe [i]) ;
+ }
+
+ /* restore Elen, for output information, and for postordering */
+ for (i = 0 ; i < n ; i++)
+ {
Elen [i] = FLIP (Elen [i]) ;
}
}
}
}
- ASSERT (nel == n) ;
+ ASSERT (nel == n) ;
AMD_DEBUG2 (("\n\nPerm:\n")) ;
for (i = 0 ; i < n ; i++)
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
/* AMD_aat: compute the symmetry of the pattern of A, and count the number of
- * nonzeros each column of A+A' (excluding the diagonal). Assume the input
- * matrix has no errors.
+ * nonzeros each column of A+A' (excluding the diagonal). Assumes the input
+ * matrix has no errors, with sorted columns and no duplicates
+ * (AMD_valid (n, n, Ap, Ai) must be AMD_OK, but this condition is not
+ * checked).
*/
#include "amd_internal.h"
-GLOBAL Int AMD_aat /* returns nz in A+A' */
+GLOBAL size_t AMD_aat /* returns nz in A+A' */
(
Int n,
const Int Ap [ ],
Int Len [ ], /* Len [j]: length of column j of A+A', excl diagonal*/
Int Tp [ ], /* workspace of size n */
double Info [ ]
-)
+)
{
- Int p1, p2, p, i, j, pj, pj2, k, nzdiag, nzboth, nz, nzaat ;
+ Int p1, p2, p, i, j, pj, pj2, k, nzdiag, nzboth, nz ;
double sym ;
+ size_t nzaat ;
#ifndef NDEBUG
AMD_debug_init ("AMD AAT") ;
for (k = 0 ; k < n ; k++) Tp [k] = EMPTY ;
- ASSERT (AMD_valid (n, n, Ap, Ai)) ;
+ ASSERT (AMD_valid (n, n, Ap, Ai) == AMD_OK) ;
#endif
if (Info != (double *) NULL)
}
else
{
- sym = ((double) (2 * nzboth)) / ((double) (nz - nzdiag)) ;
+ sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ;
}
nzaat = 0 ;
{
nzaat += Len [k] ;
}
- AMD_DEBUG1 (("AMD nz in A+A', excluding diagonal (nzaat) = "ID"\n",nzaat));
+
+ AMD_DEBUG1 (("AMD nz in A+A', excluding diagonal (nzaat) = %g\n",
+ (double) nzaat)) ;
AMD_DEBUG1 ((" nzboth: "ID" nz: "ID" nzdiag: "ID" symmetry: %g\n",
nzboth, nz, nzdiag, sym)) ;
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
aggressive = AMD_DEFAULT_AGGRESSIVE ;
}
- PRINTF (("\namd: approximate minimum degree ordering, parameters:\n"
- " dense row parameter: %g\n", alpha)) ;
+ PRINTF (("\nAMD version %d.%d.%d, %s: approximate minimum degree ordering\n"
+ " dense row parameter: %g\n", AMD_MAIN_VERSION, AMD_SUB_VERSION,
+ AMD_SUBSUB_VERSION, AMD_DATE, alpha)) ;
if (alpha < 0)
{
if (aggressive)
{
- PRINTF ((" aggressive absorption: yes\n\n")) ;
+ PRINTF ((" aggressive absorption: yes\n")) ;
}
else
{
- PRINTF ((" aggressive absorption: no\n\n")) ;
+ PRINTF ((" aggressive absorption: no\n")) ;
}
+
+ PRINTF ((" size of AMD integer: %d\n\n", sizeof (Int))) ;
}
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
#include "amd_internal.h"
+/* ========================================================================= */
+/* === AMD defaults ======================================================== */
+/* ========================================================================= */
+
GLOBAL void AMD_defaults
(
double Control [ ]
)
{
Int i ;
+
if (Control != (double *) NULL)
{
for (i = 0 ; i < AMD_CONTROL ; i++)
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
fscanf (f, ID, &AMD_debug) ;
fclose (f) ;
}
- if (AMD_debug >= 0) printf ("%s: AMD_debug_init, D= "ID"\n", s, AMD_debug);
+ if (AMD_debug >= 0)
+ {
+ printf ("%s: AMD_debug_init, D= "ID"\n", s, AMD_debug) ;
+ }
}
/* ========================================================================= */
if (AMD_debug < 0) return ;
ASSERT (pfree <= iwlen) ;
+ AMD_DEBUG3 (("\nAMD dump, pfree: "ID"\n", pfree)) ;
for (i = 0 ; i < n ; i++)
{
pe = Pe [i] ;
p = pe ;
AMD_DEBUG3 ((" e/s: ")) ;
if (elen == 0) AMD_DEBUG3 ((" : ")) ;
- ASSERT (pe < pfree) ;
+ ASSERT (pe + len <= pfree) ;
for (k = 0 ; k < len ; k++)
{
j = Iw [p] ;
ASSERT (nv > 0 && pe >= 0) ;
p = pe ;
AMD_DEBUG3 ((" : ")) ;
- ASSERT (pe < pfree) ;
+ ASSERT (pe + len <= pfree) ;
for (k = 0 ; k < len ; k++)
{
j = Iw [p] ;
{
if (Head [deg] == EMPTY) continue ;
ilast = EMPTY ;
- AMD_DEBUG3 ((ID": ", deg)) ;
+ AMD_DEBUG3 ((ID": \n", deg)) ;
for (i = Head [deg] ; i != EMPTY ; i = Next [i])
{
- AMD_DEBUG3 ((" "ID" : next "ID" last "ID" deg "ID"\n",
+ AMD_DEBUG3 ((" "ID" : next "ID" last "ID" deg "ID"\n",
i, Next [i], Last [i], Degree [i])) ;
ASSERT (i >= 0 && i < n && ilast == Last [i] &&
deg == Degree [i]) ;
--- /dev/null
+/* ========================================================================= */
+/* === amd_global ========================================================== */
+/* ========================================================================= */
+
+/* ------------------------------------------------------------------------- */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
+/* web: http://www.cise.ufl.edu/research/sparse/amd */
+/* ------------------------------------------------------------------------- */
+
+#include <stdlib.h>
+
+#ifdef MATLAB_MEX_FILE
+#include "mex.h"
+#include "matrix.h"
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* ========================================================================= */
+/* === Default AMD memory manager ========================================== */
+/* ========================================================================= */
+
+/* The user can redefine these global pointers at run-time to change the memory
+ * manager used by AMD. AMD only uses malloc and free; realloc and calloc are
+ * include for completeness, in case another package wants to use the same
+ * memory manager as AMD.
+ *
+ * If compiling as a MATLAB mexFunction, the default memory manager is mxMalloc.
+ * You can also compile AMD as a standard ANSI-C library and link a mexFunction
+ * against it, and then redefine these pointers at run-time, in your
+ * mexFunction.
+ *
+ * If -DNMALLOC is defined at compile-time, no memory manager is specified at
+ * compile-time. You must then define these functions at run-time, before
+ * calling AMD, for AMD to work properly.
+ */
+
+#ifndef NMALLOC
+#ifdef MATLAB_MEX_FILE
+/* MATLAB mexFunction: */
+void *(*amd_malloc) (size_t) = mxMalloc ;
+void (*amd_free) (void *) = mxFree ;
+void *(*amd_realloc) (void *, size_t) = mxRealloc ;
+void *(*amd_calloc) (size_t, size_t) = mxCalloc ;
+#else
+/* standard ANSI-C: */
+void *(*amd_malloc) (size_t) = malloc ;
+void (*amd_free) (void *) = free ;
+void *(*amd_realloc) (void *, size_t) = realloc ;
+void *(*amd_calloc) (size_t, size_t) = calloc ;
+#endif
+#else
+/* no memory manager defined at compile-time; you MUST define one at run-time */
+void *(*amd_malloc) (size_t) = NULL ;
+void (*amd_free) (void *) = NULL ;
+void *(*amd_realloc) (void *, size_t) = NULL ;
+void *(*amd_calloc) (size_t, size_t) = NULL ;
+#endif
+
+/* ========================================================================= */
+/* === Default AMD printf routine ========================================== */
+/* ========================================================================= */
+
+/* The user can redefine this global pointer at run-time to change the printf
+ * routine used by AMD. If NULL, no printing occurs.
+ *
+ * If -DNPRINT is defined at compile-time, stdio.h is not included. Printing
+ * can then be enabled at run-time by setting amd_printf to a non-NULL function.
+ */
+
+#ifndef NPRINT
+#ifdef MATLAB_MEX_FILE
+int (*amd_printf) (const char *, ...) = mexPrintf ;
+#else
+#include <stdio.h>
+int (*amd_printf) (const char *, ...) = printf ;
+#endif
+#else
+int (*amd_printf) (const char *, ...) = NULL ;
+#endif
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
{
double n, ndiv, nmultsubs_ldl, nmultsubs_lu, lnz, lnzd ;
+ PRINTF (("\nAMD version %d.%d.%d, %s, results:\n",
+ AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE)) ;
+
if (!Info)
{
return ;
lnzd = (n >= 0 && lnz >= 0) ? (n + lnz) : (-1) ;
/* AMD return status */
- PRINTF ((
- "\namd: approximate minimum degree ordering, results:\n"
- " status: ")) ;
+ PRINTF ((" status: ")) ;
if (Info [AMD_STATUS] == AMD_OK)
{
PRINTF (("OK\n")) ;
{
PRINTF (("invalid matrix\n")) ;
}
+ else if (Info [AMD_STATUS] == AMD_OK_BUT_JUMBLED)
+ {
+ PRINTF (("OK, but jumbled\n")) ;
+ }
else
{
PRINTF (("unknown\n")) ;
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
#include "amd_internal.h"
+/* ========================================================================= */
+/* === AMD_order =========================================================== */
+/* ========================================================================= */
+
GLOBAL Int AMD_order
(
Int n,
double Info [ ]
)
{
- Int slen, *Len, *S, nz, nzaat, i, *Pinv, info ;
+ Int *Len, *S, nz, i, *Pinv, info, status, *Rp, *Ri, *Cp, *Ci, ok ;
+ size_t nzaat, slen ;
+ double mem = 0 ;
#ifndef NDEBUG
AMD_debug_init ("amd") ;
return (AMD_INVALID) ;
}
- /* Avoid integer overflow in memory size calculations. The space required
- * by AMD is at most 2.4nz + 8n for S, and n for Len.
- * Note nz - n <= nzaat <= 2*nz, below. */
- if ((2.4 * (double) nz + 8 * (double) n) > (double) Int_MAX / sizeof (Int))
+ /* check if n or nz will cause size_t overflow */
+ if (((size_t) n) >= SIZE_T_MAX / sizeof (Int)
+ || ((size_t) nz) >= SIZE_T_MAX / sizeof (Int))
{
- /* :: int overflow :: */
if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ;
- return (AMD_OUT_OF_MEMORY) ;
+ return (AMD_OUT_OF_MEMORY) ; /* problem too large */
}
- if (!AMD_valid (n, n, Ap, Ai))
+ /* check the input matrix: AMD_OK, AMD_INVALID, or AMD_OK_BUT_JUMBLED */
+ status = AMD_valid (n, n, Ap, Ai) ;
+
+ if (status == AMD_INVALID)
{
if (info) Info [AMD_STATUS] = AMD_INVALID ;
return (AMD_INVALID) ; /* matrix is invalid */
}
- /* --------------------------------------------------------------------- */
- /* determine the symmetry and count off-diagonal nonzeros in A+A' */
- /* --------------------------------------------------------------------- */
-
- /* allocate size-n integer workspace */
- Len = (Int *) ALLOCATE (n * sizeof (Int)) ;
- if (!Len)
+ /* allocate two size-n integer workspaces */
+ Len = amd_malloc (n * sizeof (Int)) ;
+ Pinv = amd_malloc (n * sizeof (Int)) ;
+ mem += n ;
+ mem += n ;
+ if (!Len || !Pinv)
{
/* :: out of memory :: */
+ amd_free (Len) ;
+ amd_free (Pinv) ;
if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ;
return (AMD_OUT_OF_MEMORY) ;
}
- nzaat = AMD_aat (n, Ap, Ai, Len, P, Info) ;
- AMD_DEBUG1 (("nzaat: "ID"\n", nzaat)) ;
- ASSERT (nz-n <= nzaat && nzaat <= 2*nz) ;
+
+ if (status == AMD_OK_BUT_JUMBLED)
+ {
+ /* sort the input matrix and remove duplicate entries */
+ AMD_DEBUG1 (("Matrix is jumbled\n")) ;
+ Rp = amd_malloc ((n+1) * sizeof (Int)) ;
+ Ri = amd_malloc (MAX (nz,1) * sizeof (Int)) ;
+ mem += (n+1) ;
+ mem += MAX (nz,1) ;
+ if (!Rp || !Ri)
+ {
+ /* :: out of memory :: */
+ amd_free (Rp) ;
+ amd_free (Ri) ;
+ amd_free (Len) ;
+ amd_free (Pinv) ;
+ if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ;
+ return (AMD_OUT_OF_MEMORY) ;
+ }
+ /* use Len and Pinv as workspace to create R = A' */
+ AMD_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ;
+ Cp = Rp ;
+ Ci = Ri ;
+ }
+ else
+ {
+ /* order the input matrix as-is. No need to compute R = A' first */
+ Rp = NULL ;
+ Ri = NULL ;
+ Cp = (Int *) Ap ;
+ Ci = (Int *) Ai ;
+ }
/* --------------------------------------------------------------------- */
- /* allocate workspace for matrix, elbow room, and 7 size-n vectors */
+ /* determine the symmetry and count off-diagonal nonzeros in A+A' */
/* --------------------------------------------------------------------- */
- slen = (nzaat + nzaat/5 + n) + 7*n ;
- if (info)
+ nzaat = AMD_aat (n, Cp, Ci, Len, P, Info) ;
+ AMD_DEBUG1 (("nzaat: %g\n", (double) nzaat)) ;
+ ASSERT ((MAX (nz-n, 0) <= nzaat) && (nzaat <= 2 * (size_t) nz)) ;
+
+ /* --------------------------------------------------------------------- */
+ /* allocate workspace for matrix, elbow room, and 6 size-n vectors */
+ /* --------------------------------------------------------------------- */
+
+ S = NULL ;
+ slen = nzaat ; /* space for matrix */
+ ok = ((slen + nzaat/5) >= slen) ; /* check for size_t overflow */
+ slen += nzaat/5 ; /* add elbow room */
+ for (i = 0 ; ok && i < 7 ; i++)
{
- /* memory usage (Len and S), in bytes. */
- Info [AMD_MEMORY] = ((double) slen + n) * sizeof (Int) ;
+ ok = ((slen + n) > slen) ; /* check for size_t overflow */
+ slen += n ; /* size-n elbow room, 6 size-n work */
}
- S = (Int *) ALLOCATE (slen * sizeof (Int)) ;
- AMD_DEBUG1 ((" S "ID" Len "ID" n "ID" nzaat "ID" slen "ID"\n",
- (Int) S, (Int) Len, n, nzaat, slen)) ;
- if (S == (Int *) NULL)
+ mem += slen ;
+ ok = ok && (slen < SIZE_T_MAX / sizeof (Int)) ; /* check for overflow */
+ ok = ok && (slen < Int_MAX) ; /* S[i] for Int i must be OK */
+ if (ok)
{
- /* :: out of memory :: */
- FREE (Len) ;
- if (Info != (double *) NULL) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ;
+ S = amd_malloc (slen * sizeof (Int)) ;
+ }
+ AMD_DEBUG1 (("slen %g\n", (double) slen)) ;
+ if (!S)
+ {
+ /* :: out of memory :: (or problem too large) */
+ amd_free (Rp) ;
+ amd_free (Ri) ;
+ amd_free (Len) ;
+ amd_free (Pinv) ;
+ if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ;
return (AMD_OUT_OF_MEMORY) ;
}
-
- /* allocate space from S for Pinv */
- Pinv = S + slen - n ;
- slen -= n ;
+ if (info)
+ {
+ /* memory usage, in bytes. */
+ Info [AMD_MEMORY] = mem * sizeof (Int) ;
+ }
/* --------------------------------------------------------------------- */
/* order the matrix */
/* --------------------------------------------------------------------- */
- AMD_1 (n, Ap, Ai, P, Pinv, Len, slen, S, Control, Info) ;
+ AMD_1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info) ;
/* --------------------------------------------------------------------- */
/* free the workspace */
/* --------------------------------------------------------------------- */
- FREE (Len) ;
- FREE (S) ;
- return (AMD_OK) ; /* successful ordering */
+ amd_free (Rp) ;
+ amd_free (Ri) ;
+ amd_free (Len) ;
+ amd_free (Pinv) ;
+ amd_free (S) ;
+ if (info) Info [AMD_STATUS] = status ;
+ return (status) ; /* successful ordering */
}
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
/* Sorts, removes duplicate entries, and transposes from the nonzero pattern of
- * a column-form matrix A, to obtain the matrix R.
- * See amd.h for a complete description of AMD_preprocess
+ * a column-form matrix A, to obtain the matrix R. The input matrix can have
+ * duplicate entries and/or unsorted columns (AMD_valid (n,Ap,Ai) must not be
+ * AMD_INVALID).
+ *
+ * This input condition is NOT checked. This routine is not user-callable.
*/
#include "amd_internal.h"
-GLOBAL Int AMD_preprocess /* returns AMD_OK if input is OK, AMD_INVALID
- * if the matrix is invalid, or AMD_OUT_OF_MEMORY
- * if out of memory for the 2n workspace. */
-(
- Int n, /* input matrix: A is n-by-n */
- const Int Ap [ ], /* size n+1 */
- const Int Ai [ ], /* size nz = Ap [n] */
-
- /* output matrix R: */
- Int Rp [ ], /* size n+1 */
- Int Ri [ ] /* size nz (or less, if duplicates present) */
-)
-{
- /* --------------------------------------------------------------------- */
- /* local variables */
- /* --------------------------------------------------------------------- */
-
- Int *Flag, *W ;
-
- /* --------------------------------------------------------------------- */
- /* check inputs (note: fewer restrictions than AMD_order) */
- /* --------------------------------------------------------------------- */
-
- if (!AMD_preprocess_valid (n, Ap, Ai) || !Ri || !Rp)
- {
- return (AMD_INVALID) ;
- }
-
- /* --------------------------------------------------------------------- */
- /* allocate workspace */
- /* --------------------------------------------------------------------- */
-
- W = (Int *) ALLOCATE (MAX (n,1) * sizeof (Int)) ;
- if (!W)
- {
- return (AMD_OUT_OF_MEMORY) ;
- }
- Flag = (Int *) ALLOCATE (MAX (n,1) * sizeof (Int)) ;
- if (!Flag)
- {
- FREE (W) ;
- return (AMD_OUT_OF_MEMORY) ;
- }
-
- /* --------------------------------------------------------------------- */
- /* preprocess the matrix: sort, remove duplicates, and transpose */
- /* --------------------------------------------------------------------- */
-
- AMD_wpreprocess (n, Ap, Ai, Rp, Ri, W, Flag) ;
-
- /* --------------------------------------------------------------------- */
- /* free the workspace */
- /* --------------------------------------------------------------------- */
-
- FREE (W) ;
- FREE (Flag) ;
- return (AMD_OK) ;
-}
-
-
/* ========================================================================= */
-/* === AMD_wpreprocess ===================================================== */
+/* === AMD_preprocess ====================================================== */
/* ========================================================================= */
-/* The AMD_wpreprocess routine is not user-callable. It does not check its
- * input for errors or allocate workspace (that is done by the user-callable
- * AMD_preprocess routine). It does handle the n=0 case. */
+/* AMD_preprocess does not check its input for errors or allocate workspace.
+ * On input, the condition (AMD_valid (n,n,Ap,Ai) != AMD_INVALID) must hold.
+ */
-GLOBAL void AMD_wpreprocess
+GLOBAL void AMD_preprocess
(
Int n, /* input matrix: A is n-by-n */
const Int Ap [ ], /* size n+1 */
Int i, j, p, p2 ;
+ ASSERT (AMD_valid (n, n, Ap, Ai) != AMD_INVALID) ;
+
/* --------------------------------------------------------------------- */
/* count the entries in each row of A (excluding duplicates) */
/* --------------------------------------------------------------------- */
}
#ifndef NDEBUG
+ ASSERT (AMD_valid (n, n, Rp, Ri) == AMD_OK) ;
for (j = 0 ; j < n ; j++)
{
ASSERT (W [j] == Rp [j+1]) ;
}
- ASSERT (AMD_valid (n, n, Rp, Ri)) ;
#endif
}
-
-
-/* ========================================================================= */
-/* === AMD_preprocess_valid ================================================ */
-/* ========================================================================= */
-
-/* Not user-callable. Checks a matrix and returns TRUE if it is valid as input
- * to AMD_wpreprocess, FALSE otherwise. */
-
-GLOBAL Int AMD_preprocess_valid
-(
- Int n,
- const Int Ap [ ],
- const Int Ai [ ]
-)
-{
- Int i, j, p, nz ;
-
- if (n < 0 || !Ai || !Ap)
- {
- return (FALSE) ;
- }
- nz = Ap [n] ;
- if (Ap [0] != 0 || nz < 0)
- {
- /* column pointers must start at Ap [0] = 0, and Ap [n] must be >= 0 */
- AMD_DEBUG0 (("column 0 pointer bad or nz < 0\n")) ;
- return (FALSE) ;
- }
- for (j = 0 ; j < n ; j++)
- {
- if (Ap [j] > Ap [j+1])
- {
- /* column pointers must be ascending */
- AMD_DEBUG0 (("column "ID" pointer bad\n", j)) ;
- return (FALSE) ;
- }
- }
- for (p = 0 ; p < nz ; p++)
- {
- i = Ai [p] ;
- AMD_DEBUG3 (("row: "ID"\n", i)) ;
- if (i < 0 || i >= n)
- {
- /* row index out of range */
- AMD_DEBUG0 (("index out of range, col "ID" row "ID"\n", j, i)) ;
- return (FALSE) ;
- }
- }
- return (TRUE) ;
-}
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
-/* AMD Version 1.1 (Jan. 21, 2004), Copyright (c) 2004 by Timothy A. Davis, */
-/* Patrick R. Amestoy, and Iain S. Duff. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* AMD, Copyright (c) Timothy A. Davis, */
+/* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */
+/* email: davis at cise.ufl.edu CISE Department, Univ. of Florida. */
/* web: http://www.cise.ufl.edu/research/sparse/amd */
/* ------------------------------------------------------------------------- */
* nz = Ap [n_col] >= 0 number of entries in the matrix
* Ap [0] == 0
* Ap [j] <= Ap [j+1] for all j in the range 0 to n_col.
- * row indices in Ai [Ap [j] ... Ap [j+1]-1] must be sorted in ascending
- * order, must be in the range 0 to n_row-1, and no duplicate entries
- * can exist.
+ * Ai [0 ... nz-1] must be in the range 0 to n_row-1.
*
- * Not user-callable.
+ * If any of the above conditions hold, AMD_INVALID is returned. If the
+ * following condition holds, AMD_OK_BUT_JUMBLED is returned (a warning,
+ * not an error):
+ *
+ * row indices in Ai [Ap [j] ... Ap [j+1]-1] are not sorted in ascending
+ * order, and/or duplicate entries exist.
+ *
+ * Otherwise, AMD_OK is returned.
+ *
+ * In v1.2 and earlier, this function returned TRUE if the matrix was valid
+ * (now returns AMD_OK), or FALSE otherwise (now returns AMD_INVALID or
+ * AMD_OK_BUT_JUMBLED).
*/
#include "amd_internal.h"
const Int Ai [ ] /* row indices of A, of size nz = Ap [n_col] */
)
{
- Int nz, j, p1, p2, ilast, i, p ;
- if (n_row < 0 || n_col < 0)
+ Int nz, j, p1, p2, ilast, i, p, result = AMD_OK ;
+
+ if (n_row < 0 || n_col < 0 || Ap == NULL || Ai == NULL)
{
- AMD_DEBUG0 (("n must be >= 0: "ID" "ID"\n", n_row, n_col)) ;
- return (FALSE) ;
+ return (AMD_INVALID) ;
}
nz = Ap [n_col] ;
if (Ap [0] != 0 || nz < 0)
{
/* column pointers must start at Ap [0] = 0, and Ap [n] must be >= 0 */
AMD_DEBUG0 (("column 0 pointer bad or nz < 0\n")) ;
- return (FALSE) ;
+ return (AMD_INVALID) ;
}
for (j = 0 ; j < n_col ; j++)
{
{
/* column pointers must be ascending */
AMD_DEBUG0 (("column "ID" pointer bad\n", j)) ;
- return (FALSE) ;
+ return (AMD_INVALID) ;
}
ilast = EMPTY ;
for (p = p1 ; p < p2 ; p++)
{
i = Ai [p] ;
AMD_DEBUG3 (("row: "ID"\n", i)) ;
- if (i <= ilast || i >= n_row)
+ if (i < 0 || i >= n_row)
{
- /* row index out of range, or unsorted */
+ /* row index out of range */
AMD_DEBUG0 (("index out of range, col "ID" row "ID"\n", j, i));
- return (FALSE) ;
+ return (AMD_INVALID) ;
+ }
+ if (i <= ilast)
+ {
+ /* row index unsorted, or duplicate entry present */
+ AMD_DEBUG1 (("index unsorted/dupl col "ID" row "ID"\n", j, i));
+ result = AMD_OK_BUT_JUMBLED ;
}
ilast = i ;
}
}
- return (TRUE) ;
+ return (result) ;
}
-This directory is an almost identical copy of the UMFPACK 4.4
-release. The only things I have changed are the Makefiles: they build
-shared libraries instead of static ones if deal.II is so configured,
-and they put the object files somewhere else. This also allowed us to
-get rid of the AMD/Make and UMFPACK/Make subdirectories, since they
-did by hand what we do more elegantly using autoconf and friends.
-Finally, I removed the UMFPACK/Demo directory, since it is rather
-big. I assume that people using UMFPACK from inside deal.II are not
+This directory is an almost identical copy of the UMFPACK 5.1 release,
+together with the AMD 2.2 and UFconfig 3.0 packages. The only things I have
+changed are the Makefiles: they build shared libraries instead of static ones
+if deal.II is so configured, and they put the object files somewhere
+else. This also allowed us to get rid of the AMD/Make and UMFPACK/Make
+subdirectories, since they did by hand what we do more elegantly using
+autoconf and friends. Finally, I removed the UMFPACK/Demo directory, since it
+is rather big. I assume that people using UMFPACK from inside deal.II are not
interested in this, but they can of course download the full UMFPACK
distribution if they want these files.
+May 31, 2007, version 5.1.0
+
+ * port to 64-bit MATLAB
+
+ * Makefiles updated to reflect directory changes to AMD (UMFPACK v5.1.0
+ requires AMD v2.2.0)
+
+ * Source/Makefile and GNUMakefile moved to Lib/
+
+Dec 12, 2006: version 5.0.3
+
+ * minor MATLAB cleanup. Renamed umfpack mexFunction to umfpack2, to avoid
+ filename clash with the built-in version of umfpack.
+
+Dec 2, 2006, version 5.0.2
+
+ * minor change to umfpack_report_info: does not print timings less
+ than 0.001 seconds.
+
+ * bug fix for complex case when using a non-gcc compiler (simplified the
+ scaling of the pivot column). Does not affect the use of UMFPACK in
+ MATLAB.
+
+Aug 31, 2006, version 5.0.1
+
+ * Minor correction to comments in umfpack_get_numeric.h.
+
+May 5, 2006, version 5.0
+
+ * Tcov subdirectory added. This has existed since the first C version of
+ UMFPACK, but is only now included in the released version. It provides
+ a near 100% test coverage for UMFPACK. The code isn't pretty, but it
+ works.
+
+ * now uses CHOLMOD's method for interfacing to the BLAS, including the
+ BLAS_INT definition. This way, the UF_long version of UMFPACK can
+ call the int BLAS.
+
+ * revised to use AMD v2.0
+
+Apr 7, 2006
+
+ * Minor correction to UMFPACK/Source/Makefile, for those who
+ do not have GNU make. No change to version number, because
+ no code was modified.
+
+Oct 10, 2005, version 4.6
+
+ * umf_solve.c modified for the complex case. A, X, and b can be
+ split complex or unsplit. Prior version required the form of
+ A, X, and B to be identical (all split or all unsplit).
+ (Thanks to David Bateman).
+
+ * added Cygwin to architecture detection.
+
+ * added UMFPACK_SUBSUB_VERSION
+
+Aug. 30, 2005: v4.5 released
+
+ * License changed to GNU LGPL.
+
+ * The Make/ directory removed; configurations are now in ../UFconfig.
+
+ * requires AMD v1.2 or later
+
+ * added UMFPACK_MAIN_VERSION and UMFPACK_SUB_VERSION, defined as 4 and 5,
+ respectively, for version 4.5. These macros will be updated for all
+ future versions. See Include/umfpack.h for details.
+
+ * function pointers used for malloc, free, calloc, realloc, printf,
+ hypot, and complex divide. Defined in AMD/Source/amd_global.c,
+ AMD/Source/amd_internal.h, UMFPACK/Source/umfpack_global.c,
+ and UMFPACK/Include/umfpack_global.h.
+ Compile-time dependence on The MathWorks "util.h", ut* routines
+ and ut* macros removed.
+
Jan. 28, 2005: v4.4 released
* bug fix: when Qinit is provided to umfpack_*_qsymbolic,
ordering and can use all 4 strategies (auto, symmetric, unsymmetric,
and 2-by-2).
- * umfpack_get_determinant added.
+ * umfpack_get_determinant added. (Thanks to David Bateman).
* packed complex case added for all routines (previously only used in
umfpack_report_vector). This allows arrays of ANSI C/C++ complex
April 30, 2001: UMFPACK Version 3.0 released. Changes since 3.0Beta release:
- * Long integer version added (umfpack_l_* user-callable routines).
+ * long integer version added (umfpack_l_* user-callable routines).
* Peak memory usage in the numerical factorization reduced by a total of
12n integers (8n temporary workspace used during numerical factorization,
-UMFPACK Version 4.4 (Jan. 28, 2005), Copyright (c) 2005 by Timothy A.
-Davis. All Rights Reserved.
+UMFPACK Version 5.0, Copyright 1995-2006 by Timothy A. Davis.
+All Rights Reserved.
+UMFPACK is available under alternate licenses, contact T. Davis for details.
UMFPACK License:
Your use or distribution of UMFPACK or any modified version of
UMFPACK implies that you agree to this License.
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses UMFPACK or any modified version of UMFPACK code must cite the
- Copyright, this License, the Availability note, and "Used by permission."
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ Permission is hereby granted to use or copy this program under the
+ terms of the GNU LGPL, provided that the Copyright, this License,
+ and the Availability of the original version is retained on all copies.
+ User documentation of any code that uses this code or any modified
+ version of this code must cite the Copyright, this License, the
+ Availability note, and "Used by permission." Permission to modify
+ the code and to distribute modified code is granted, provided the
+ Copyright, this License, and the Availability note are retained,
+ and a notice that the code was modified is included.
Availability:
http://www.cise.ufl.edu/research/sparse/umfpack
---------------------------------------------------------------------------------
-
-AMD Version 1.1 (Jan. 10, 2004), Copyright (c) 2004 by Timothy A.
-Davis, Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved.
-
-AMD License:
-
- Your use or distribution of AMD or any modified version of
- AMD implies that you agree to this License.
-
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses AMD or any modified version of AMD code must cite the
- Copyright, this License, the Availability note, and "Used by permission."
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
-
-Availability:
-
- http://www.cise.ufl.edu/research/sparse/amd
# UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
# All Rights Reserved. See ../Doc/License for License.
-all: dist
+default: dist
-include ../Make/Make.include
+include ../../UFconfig/UFconfig.mk
#-------------------------------------------------------------------------------
# Remove all but the files in the original distribution
- $(RM) *.aux *.bbl *.blg *.log *.toc
- $(RM) UserGuide.tex
+clean:
+ - $(RM) $(CLEAN)
+
#-------------------------------------------------------------------------------
# Create the User Guide and Quick Start Guide
#-------------------------------------------------------------------------------
SRC = $(addprefix ../Include/, $(addsuffix .h,$(USER))) ../Demo/umfpack_simple.c
-UserGuide.pdf: UserGuide.stex UserGuide.sed1 UserGuide.sed2 $(SRC)
+UserGuide.pdf: UserGuide.stex UserGuide.sed1 UserGuide.sed2 $(SRC) UserGuide.bib
sed -f UserGuide.sed1 < UserGuide.stex | sed -f UserGuide.sed2 \
| expand -8 > UserGuide.tex
pdflatex UserGuide
\author{Timothy A. Davis \\
Dept. of Computer and Information Science and Engineering \\
Univ. of Florida, Gainesville, FL}
-\title{UMFPACK Version 4.4 Quick Start Guide}
-\date{Jan. 28, 2005}
+\title{UMFPACK Version 5.1 Quick Start Guide}
+\date{May 31, 2007}
\maketitle
%-------------------------------------------------------------------------------
\end{abstract}
%-------------------------------------------------------------------------------
-UMFPACK Version 4.4 (Jan. 28, 2005), Copyright\copyright 2005 by Timothy A.
-Davis. All Rights Reserved. Refer to the UMFPACK User Guide
+UMFPACK Version 5.1, Copyright\copyright 1995-2006 by Timothy A. Davis.
+All Rights Reserved. Refer to the UMFPACK User Guide
for the License. See \newline
http://www.cise.ufl.edu/research/sparse/umfpack
for the code and full documentation.
matrices $\m{A}$ can be used to solve $\m{Ax}=\m{b}$ or related systems.
Rectangular matrices can only be factorized.
-UMFPACK Version 4.3 is a built-in routine in MATLAB 7.1, used by the forward and
-backslash operator, and the {\tt lu} routine. MATLAB 6.5 used Version 4.0.
+UMFPACK is a built-in routine in MATLAB used by the forward and
+backslash operator, and the {\tt lu} routine.
The following is a short
introduction to Unix users of the C interface of UMFPACK.
\label{Install}
%-------------------------------------------------------------------------------
-You will need to install both UMFPACK v4.4 and AMD v1.1 (or AMD v1.0) to use UMFPACK.
+You will need to install both UMFPACK v5.1 and AMD v2.2 to use UMFPACK.
+Note that UMFPACK v5.1 cannot use AMD v1.2 or earlier.
The {\tt UMFPACK} and {\tt AMD} subdirectories must be placed side-by-side
within the same parent directory. AMD is a stand-alone package that
is required by UMFPACK. UMFPACK can be compiled without the
BLAS but your performance will be much less than what it should be.
-System-dependent configurations are in the {\tt AMD/Make}
-and {\tt UMFPACK/Make} directories
-(Note that {\tt UMFPACK/Make} is a symbolic link to {\tt AMD/Make}).
-You can edit the {\tt Make.include}
-file in those directories to customize the compilation. The default
-settings will work on most systems, except that UMFPACK will be compiled so
-that it does not use the BLAS. Sample configuration files are provided
+System-dependent configurations are in the {\tt UFconfig/UFconfig.mk}
+file. The default
+settings will work on most systems, except for the BLAS definition.
+Sample configurations are provided
for Linux, Sun Solaris, SGI IRIX, IBM AIX, and the DEC/Compaq Alpha.
To compile and install both packages,
The outputs of these demo programs will then be compared with output
files in the distribution. Expect to see a few differences, such as
residual norms, compile-time control settings, and perhaps memory usage
-differences. The AMD and MATLAB mexFunctions for
-use in MATLAB will also be compiled. If you do not have MATLAB,
-type {\tt make lib} instead.
-
-If you compile UMFPACK and AMD and then later change the {\tt Make.include}
-file or your system-specific configuration file such as {\tt Make.linux},
+differences.
+
+To use {\tt make} to compile the MATLAB mexFunctions for MATLAB
+and AMD, you can either type {\tt make mex} in the UMFPACK directory.
+You may first need to edit the {\tt UFconfig/UFconfig.mk} file to
+modify the definition of the {\tt MEX}, if you have a version of MATLAB
+older than Version 7.2. Remove the {\tt -largeArrayDims} definition.
+If you use the MATLAB command {\tt umfpack\_make} in the MATLAB directory,
+then this case is handled for you automatically.
+
+If you compile UMFPACK and AMD and then later change the
+{\tt UFconfig/UFconfig.mk} file
then you should type {\tt make purge} and then {\tt make} to recompile.
Here are the various parameters that you can control in your
-{\tt Make.include} file:
+{\tt UFconfig/UFconfig.mk} file:
\begin{itemize}
\item {\tt CC = } your C compiler, such as {\tt cc}.
\item {\tt RANLIB = } your system's {\tt ranlib} program, if needed.
\item {\tt CFLAGS = } optimization flags, such as {\tt -O}.
-\item {\tt CONFIG = } configuration settings, for the BLAS, memory allocation
- routines, and timing routines.
+\item {\tt UMFPACK\_CONFIG = } configuration settings, for the BLAS,
+ memory allocation routines, and timing routines.
\item {\tt LIB = } your libraries, such as {\tt -lm} or {\tt -lblas}.
\item {\tt RM =} the command to delete a file.
\item {\tt MV =} the command to rename a file.
\item {\tt F77LIB =} the Fortran libraries (optional).
\end{itemize}
-The {\tt CONFIG} string can include combinations of the following;
+The {\tt UMFPACK\_CONFIG} string can include combinations of the following;
most deal with how the BLAS are called:
\begin{itemize}
\item {\tt -DNBLAS} if you do not have any BLAS at all.
-\item {\tt -DCBLAS} if you have the C-BLAS.
\item {\tt -DNSUNPERF} if you are on Solaris but do not have the Sun
Performance Library.
-\item {\tt -DNSCSL} if you on SGI IRIX but do not have the SCSL BLAS library.
-\item {\tt -DLONGBLAS} if your BLAS can take {\tt long} integer input
- arguments.
-\item Options for controlling how C calls the Fortran BLAS:
- {\tt -DBLAS\_BY\_VALUE}, {\tt -DBLAS\_NO\_UNDERSCORE},
- and {\tt -DBLAS\_CHAR\_ARG}. These are set automatically for Windows,
+\item {\tt -DLONGBLAS} if your BLAS takes non-{\tt int} integer arguments.
+\item {\tt -DBLAS\_INT = } the integer used by the BLAS.
+
+\item {\tt -DBLAS\_NO\_UNDERSCORE}
+ for controlling how C calls the Fortran BLAS.
+ This is set automatically for Windows,
Sun Solaris, SGI Irix, Red Hat Linux, Compaq Alpha, and
AIX (the IBM RS 6000).
+
\item {\tt -DGETRUSAGE} if you have the {\tt getrusage} function.
-\item {\tt -DLP64} if you are compiling in the LP64 model (32 bit {\tt int}'s,
- 64 bit {\tt long}'s, and 64 bit pointers).
-\item {\tt -DNUTIL} if you wish to compile the MATLAB-callable
- UMFPACK mexFunction with the {\tt mxMalloc}, {\tt mxRealloc}
- and {\tt mxFree} routines, instead of the undocumented (but
- superior) {\tt utMalloc}, {\tt utRealloc}, and {\tt utFree}
- routines.
\item {\tt -DNPOSIX} if you do not have the POSIX-compliant
{\tt sysconf} and {\tt times} routines.
\item {\tt -DNRECIPROCAL} controls a trade-off between speed and accuracy.
Arguments:
- Int n_row ; Input argument, not modified.
- Int n_col ; Input argument, not modified.
+ int n_row ; Input argument, not modified.
+ int n_col ; Input argument, not modified.
A is an n_row-by-n_col matrix. Restriction: n_row > 0 and n_col > 0.
- Int Ap [n_col+1] ; Input argument, not modified.
+ int Ap [n_col+1] ; Input argument, not modified.
Ap is an integer array of size n_col+1. On input, it holds the
"pointers" for the column form of the sparse matrix A. Column j of
total number of entries in the pattern of the matrix A. nz must be
greater than or equal to zero.
- Int Ai [nz] ; Input argument, not modified, of size nz = Ap [n_col].
+ int Ai [nz] ; Input argument, not modified, of size nz = Ap [n_col].
The nonzero pattern (row indices) for column j is stored in
Ai [(Ap [j]) ... (Ap [j+1]-1)]. The row indices in a given column j
Arguments:
- Int Ap [n_col+1] ; Input argument, not modified.
+ int Ap [n_col+1] ; Input argument, not modified.
This must be identical to the Ap array passed to umfpack_di_symbolic.
The value of n_col is what was passed to umfpack_di_symbolic (this is
held in the Symbolic object).
- Int Ai [nz] ; Input argument, not modified, of size nz = Ap [n_col].
+ int Ai [nz] ; Input argument, not modified, of size nz = Ap [n_col].
This must be identical to the Ai array passed to umfpack_di_symbolic.
Arguments:
- Int sys ; Input argument, not modified.
+ int sys ; Input argument, not modified.
Defines which system to solve. (') is the linear algebraic transpose.
For the other values of the sys argument, iterative refinement is not
performed (Control [UMFPACK_IRSTEP], Ap, Ai, and Ax are ignored).
- Int Ap [n+1] ; Input argument, not modified.
- Int Ai [nz] ; Input argument, not modified.
+ int Ap [n+1] ; Input argument, not modified.
+ int Ai [nz] ; Input argument, not modified.
double Ax [nz] ; Input argument, not modified.
If iterative refinement is requested (Control [UMFPACK_IRSTEP] >= 1,
@techreport{Davis03_umf,
author={Davis, T. A.},
- title={{UMFPACK} Version 4.4 User Guide},
+ title={{UMFPACK} User Guide},
institution={Univ. of Florida, CISE Dept.},
- year={2004}
- ,number={TR-04-003}
+ year={2005}
+ ,number={TR-04-003 (revised)}
,address={Gainesville, FL}
,note={(www.cise.ufl.edu/tech-reports)}
}
@techreport{Davis03_umfquick,
author={Davis, T. A.},
- title={{UMFPACK} Version 4.4 Quick Start Guide},
+ title={{UMFPACK} Quick Start Guide},
institution={Univ. of Florida, CISE Dept.},
- year={2004}
- ,number={TR-04-005}
+ year={2005}
+ ,number={TR-04-005 (revised)}
,address={Gainesville, FL}
,note={(www.cise.ufl.edu/tech-reports)}
}
\author{Timothy A. Davis \\
Dept. of Computer and Information Science and Engineering \\
Univ. of Florida, Gainesville, FL}
-\title{UMFPACK Version 4.4 User Guide}
-\date{Jan. 28, 2005}
+\title{UMFPACK Version 5.1 User Guide}
+\date{May 31, 2007}
\maketitle
%-------------------------------------------------------------------------------
Technical Report TR-04-003 (revised)
-UMFPACK Version 4.4 (Jan. 28, 2005), Copyright\copyright 2005 by Timothy A.
-Davis. All Rights Reserved.
+UMFPACK Version 5.1, Copyright\copyright 1995-2006 by Timothy A. Davis.
+All Rights Reserved.
+UMFPACK is available under alternate licences; contact T. Davis for details.
{\bf UMFPACK License:}
Your use or distribution of UMFPACK or any modified version of
UMFPACK implies that you agree to this License.
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses UMFPACK or any modified version of UMFPACK code must cite the
- Copyright, this License, the Availability note, and ``Used by permission.''
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ Permission is hereby granted to use or copy this program under the
+ terms of the GNU LGPL, provided that the Copyright, this License,
+ and the Availability of the original version is retained on all copies.
+ User documentation of any code that uses this code or any modified
+ version of this code must cite the Copyright, this License, the
+ Availability note, and "Used by permission." Permission to modify
+ the code and to distribute modified code is granted, provided the
+ Copyright, this License, and the Availability note are retained,
+ and a notice that the code was modified is included.
{\bf Availability:}
http://www.cise.ufl.edu/research/sparse/umfpack
%-------------------------------------------------------------------------------
UMFPACK\footnote{Pronounced with two syllables: umph-pack}
-Version 4.4 is a set of routines for solving systems of linear
+Version 5.0 is a set of routines for solving systems of linear
equations, $\m{Ax}=\m{b}$, when $\m{A}$ is sparse and unsymmetric. It is based
on the Unsymmetric-pattern MultiFrontal method \cite{DavisDuff97,DavisDuff99}.
UMFPACK factorizes
%-------------------------------------------------------------------------------
In addition to appearing as a Collected Algorithm of the ACM,
-UMFPACK Version 4.4 is available at http://www.cise.ufl.edu/research/sparse.
-Version 4.3 is included as a built-in routine in MATLAB
-7.1. Version 4.0 (in MATLAB 6.5)
+UMFPACK is available at http://www.cise.ufl.edu/research/sparse.
+It is included as a built-in routine in MATLAB.
+Version 4.0 (in MATLAB 6.5)
does not have the symmetric or 2-by-2 strategies and it takes
less advantage of the level-3
BLAS \cite{DaydeDuff99,ACM679a,ATLAS,GotoVandeGeijn02}.
-Version 4.4 (and v4.3 through v4.1) tend to be much faster than Version 4.0,
+Versions 5.0 through v4.1 tend to be much faster than Version 4.0,
particularly on unsymmetric matrices with mostly symmetric
nonzero pattern (such as finite element and circuit simulation matrices).
Version 3.0 and following make
A detailed list of changes is in the {\tt ChangeLog} file.
+%-------------------------------------------------------------------------------
+\subsection{Version 5.1.0}
+%-------------------------------------------------------------------------------
+
+Port of MATLAB interface to 64-bit MATLAB.
+
+%-------------------------------------------------------------------------------
+\subsection{Version 5.0.3}
+%-------------------------------------------------------------------------------
+
+Renamed the MATLAB function to {\tt umfpack2}, so as not to confict with
+itself (the MATLAB built-in version of UMFPACK).
+
+%-------------------------------------------------------------------------------
+\subsection{Version 5.0}
+%-------------------------------------------------------------------------------
+
+Changed {\tt long} to {\tt UF\_long}, controlled by the {\tt UFconfig.h}
+file. A {\tt UF\_long} is normally just {\tt long}, except on the Windows 64
+(WIN64) platform. In that case, it becomes {\tt \_\_int64}.
+
+%-------------------------------------------------------------------------------
+\subsection{Version 4.6}
+%-------------------------------------------------------------------------------
+
+Added additional options to {\tt umf\_solve.c}.
+
+%-------------------------------------------------------------------------------
+\subsection{Version 4.5}
+%-------------------------------------------------------------------------------
+
+Added function pointers for malloc, calloc, realloc, free, printf, hypot,
+and complex divisiion, so that these functions can be redefined at run-time.
+Added a version number so you can determine the
+version of UMFPACK at run time or compile time. UMFPACK requires AMD v2.0
+or later.
+
%-------------------------------------------------------------------------------
\subsection{Version 4.4}
%-------------------------------------------------------------------------------
%-------------------------------------------------------------------------------
The easiest way to use UMFPACK is within MATLAB. Version 4.3 is a built-in
-routine in MATLAB 7.1, and is used in {\tt x = A}$\backslash${\tt b} when
+routine in MATLAB 7.0.4, and is used in {\tt x = A}$\backslash${\tt b} when
{\tt A} is sparse, square, unsymmetric (or symmetric but not positive definite),
and with nonzero entries that are not confined in a narrow band.
It is also used for the {\tt [L,U,P,Q] = lu (A)} usage of {\tt lu}.
it is increased via {\tt mxRealloc}.
However, {\tt mxMalloc} and {\tt mxRealloc} abort the {\tt umfpack} mexFunction
-if they fail, so this strategy does not work in MATLAB. The strategy works fine
-when {\tt malloc} or the internal memory allocator {\tt utMalloc} are used
-instead, since those routines return {\tt NULL} on failure, and do not terminate
-the mexFunction. The {\tt umfpack} mexFunction can be compiled to use
-{\tt utMalloc}, but this is an internal undocumented utility routine in MATLAB,
-and thus using {\tt utMalloc} might not always be successful.
-To use the documented {\tt mxMalloc} routine instead, compile the
-mexFunction with the {\tt -DNUTIL} flag enabled.
+if they fail, so this strategy does not work in MATLAB.
To compute the determinant with UMFPACK:
different sizes of integers and for real or complex floating-point numbers:
\begin{enumerate}
\item {\tt umfpack\_di\_*}: real double precision, {\tt int} integers.
-\item {\tt umfpack\_dl\_*}: real double precision, {\tt long} integers.
+\item {\tt umfpack\_dl\_*}: real double precision, {\tt UF\_long} integers.
\item {\tt umfpack\_zi\_*}: complex double precision, {\tt int} integers.
-\item {\tt umfpack\_zl\_*}: complex double precision, {\tt long} integers.
+\item {\tt umfpack\_zl\_*}: complex double precision, {\tt UF\_long} integers.
\end{enumerate}
where {\tt *} denotes the specific name of one of the routines.
Routine names beginning with {\tt umf\_} are internal to the package,
In addition, the C-callable AMD library distributed with UMFPACK
includes 4 user-callable routines (in two versions with {\tt int} and
-{\tt long} integers) and one include file. Refer to the AMD documentation
+{\tt UF\_long} integers) and one include file. Refer to the AMD documentation
for more details.
Use only one version for any one problem; do not attempt to use one version
The notation {\tt umfpack\_di\_*} refers to all user-callable routines
for the real double precision and {\tt int} integer case. The notation
{\tt umfpack\_*\_numeric}, for example, refers all four versions
-(real/complex, int/long) of a single operation
+(real/complex, int/UF\_long) of a single operation
(in this case numeric factorization).
%-------------------------------------------------------------------------------
The {\tt umfpack\_di\_*} and {\tt umfpack\_zi\_*} routines use {\tt int} integer
arguments; those starting with {\tt umfpack\_dl\_} or {\tt umfpack\_zl\_}
-use {\tt long} integer arguments. If you compile UMFPACK in the standard
+use {\tt UF\_long} integer arguments. If you compile UMFPACK in the standard
ILP32 mode (32-bit {\tt int}'s, {\tt long}'s, and pointers) then the versions
are essentially identical. You will be able to solve problems using up to 2GB
of memory. If you compile UMFPACK in the standard LP64 mode, the size of an
in the same mode.
If you compile UMFPACK and AMD in the LP64 mode,
be sure to add {\tt -DLP64} to the compilation command. See the examples in
-{\tt Make.alpha}, {\tt Make.sgi}, and {\tt Make.solaris}.
+the {\tt UFconfig/UFconfig.mk} file.
%-------------------------------------------------------------------------------
\subsection{Real and complex floating-point}
\end{verbatim}
}
-For the {\tt long} version of UMFPACK:
+For the {\tt UF\_long} version of UMFPACK:
{\footnotesize
\begin{verbatim}
- long Ap [n+1] ;
- long Ai [nz] ;
+ UF_long Ap [n+1] ;
+ UF_long Ai [nz] ;
double Ax [nz] ;
\end{verbatim}
}
\end{verbatim}
}
-For the {\tt long} version:
+For the {\tt UF\_long} version:
{\footnotesize
\begin{verbatim}
- long Ti [nz] ;
- long Tj [nz] ;
+ UF_long Ti [nz] ;
+ UF_long Tj [nz] ;
double Tx [nz] ;
\end{verbatim}
}
on how to compute these operations in your own code.
The only primary matrix operation not provided by UMFPACK is the
multiplication of two sparse matrices \cite{Gustavson78}.
-A future package under development (as of Jan. 2005), CHOLMOD,
-will provide many of these matrix operations, which
+The CHOLMOD provides many of these matrix operations, which
can then be used in conjunction with UMFPACK.
-Watch my web page for details.
+See my web page for details.
%-------------------------------------------------------------------------------
\subsection{Getting the contents of opaque objects}
{\tt sysconf} and {\tt times} routines to find both the CPU time
and wallclock time.
These three routines are the only user-callable
-routine that is identical in all four {\tt int}/{\tt long}, real/complex
+routine that is identical in all four {\tt int}/{\tt UF\_long}, real/complex
versions (there is no {\tt umfpack\_di\_timer} routine, for example).
%-------------------------------------------------------------------------------
\item {\tt UMFPACK\_ERROR\_internal\_error}, (-911):
An internal error has occurred, of unknown cause. This is either a bug
in UMFPACK, or the result of a memory overrun from your program.
- Try modifying the file {\tt AMD/Source/amd\_internal.h} and adding
+ Try modifying the file {\tt AMD/Include/amd\_internal.h} and adding
the statement {\tt \#undef NDEBUG}, to enable the debugging mode.
Recompile UMFPACK and rerun your program.
A failed assertion might occur which
the same name as those already listed in a prior category have the same size
and type.
-The real, {\tt long} integer {\tt umfpack\_dl\_*} routines are
+The real, {\tt UF\_long} integer {\tt umfpack\_dl\_*} routines are
identical to the real, {\tt int} routines, except that {\tt \_di\_} is replaced
-with {\tt \_dl\_} in the name, and all {\tt int} arguments become {\tt long}.
-Similarly, the complex, {\tt long} integer {\tt umfpack\_zl\_*} routines are
+with {\tt \_dl\_} in the name, and all {\tt int} arguments become
+{\tt UF\_long}.
+Similarly, the complex, {\tt UF\_long} integer {\tt umfpack\_zl\_*} routines are
identical to the complex, {\tt int} routines, except that {\tt \_zi\_} is
replaced
-with {\tt \_zl\_} in the name, and all {\tt int} arguments become {\tt long}.
+with {\tt \_zl\_} in the name, and all {\tt int} arguments become
+{\tt UF\_long}.
Only the real and complex {\tt int} versions are listed in the synopsis below.
The matrix $\m{A}$ is {\tt m}-by-{\tt n} with {\tt nz} entries.
strategy. You may also use these four user-callable routines in your own C
programs. You need to include the {\tt amd.h} file only if you make direct
calls to the AMD routines themselves. The {\tt int} versions are summarized
-below; {\tt long} versions are also available. Refer to the AMD User Guide
+below; {\tt UF\_long} versions are also available. Refer to the AMD User Guide
for more information, or to the file {\tt amd.h} which documents these routines.
{\footnotesize
routines in {\tt umf4\_f77zwrapper.c}. The following is a synopsis
of each routine. All the arguments are the same as the real versions,
except {\tt Az}, {\tt xz}, and {\tt bz} are the imaginary parts of
-the matrix, solution, and right-hand-side, respectively. The
+the matrix, solution, and right-hand side, respectively. The
{\tt Ax}, {\tt x}, and {\tt b} are the real parts.
{\footnotesize
You can skip this section and go to next one if all you want to use is
the UMFPACK and AMD mexFunctions in MATLAB.
-You will need to install both UMFPACK v4.4 and AMD v1.1 (or AMD v1.0) to use UMFPACK.
+You will need to install both UMFPACK v5.0 and AMD v2.0 to use UMFPACK.
The {\tt UMFPACK} and {\tt AMD} subdirectories must be placed side-by-side
within the same directory. AMD is a stand-alone package that
is required by UMFPACK. UMFPACK can be compiled without the
BLAS \cite{DaydeDuff99,ACM679a,ATLAS,GotoVandeGeijn02},
but your performance will be much less than what it should be.
-System-dependent configurations are in the {\tt AMD/Make}
-and {\tt UMFPACK/Make} directories (the \newline
-{\tt UMFPACK/Make} directory is actually
-just a symbolic link to {\tt AMD/Make}\footnote{Windows might not extract
-the symbolic link {\tt UMFPACK/Make} correctly. If it doesn't, simply
-create the {\tt UMFPACK/Make} folder by copying it from {\tt AMD/Make}.}).
-You can edit the {\tt Make.include}
-files in either of those directories to customize the compilation. The default
+System-dependent configurations are in the {\tt UFconfig/UFconfig.mk}
+file. The default
settings will work on most systems, except that UMFPACK will be compiled so
-that it does not use the BLAS. Sample configuration files are provided
+that it does not use the BLAS. Sample configurations are provided
for Linux, Sun Solaris, SGI IRIX, IBM AIX, and the DEC/Compaq Alpha.
To compile and install both packages,
The outputs of these demo programs will then be compared with output
files in the distribution. Expect to see a few differences, such as
residual norms, compile-time control settings, and perhaps memory usage
-differences. The AMD and UMFPACK mexFunctions for
-use in MATLAB will also be compiled. If you do not have MATLAB 6.0 or
-later, type {\tt make lib} instead.
+differences.
+
+To use {\tt make} to compile the MATLAB mexFunctions for MATLAB
+and AMD, you can either type {\tt make mex} in the UMFPACK directory.
+You may first need to edit the {\tt UFconfig/UFconfig.mk} file to
+modify the definition of the {\tt MEX}, if you have a version of MATLAB
+older than Version 7.2. Remove the {\tt -largeArrayDims} definition.
+If you use the MATLAB command {\tt umfpack\_make} in the MATLAB directory,
+then this case is handled for you automatically.
-If you have the GNU version of {\tt make}, the {\tt Source/GNUmakefile} and
+If you have the GNU version of {\tt make}, the {\tt Lib/GNUmakefile} and
{\tt MATLAB/GNUmakefile} files are used. These are much more concise than
what the ``old'' version of {\tt make} can handle. If you do not have
-GNU {\tt make}, the {\tt Source/Makefile} and {\tt MATLAB/Makefile} files
+GNU {\tt make}, the {\tt Lib/Makefile} and {\tt MATLAB/Makefile} files
are used instead. Each UMFPACK source file is compiled into four
-versions ({\tt double} / complex, and {\tt int} / {\tt long}). A proper
+versions ({\tt double} / complex, and {\tt int} / {\tt UF\_long}). A proper
old-style {\tt Makefile} is cumbersome in this case, so these two
{\tt Makefile}'s have been constructed by brute force. They ignore
dependencies, and simply compile everything. I highly recommend using GNU
{\tt make} if you wish to modify UMFPACK.
-If you compile UMFPACK and AMD and then later change the {\tt Make.include}
-file or your system-specific configuration file such as {\tt Make.linux},
+If you compile UMFPACK and AMD and then later change the
+{\tt UFconfig/UFconfig.mk} file
then you should type {\tt make purge} and then {\tt make} to recompile.
Here are the various parameters that you can control in your
-{\tt Make.include} file:
+{\tt UFconfig/UFconfig.mk} file:
\begin{itemize}
\item {\tt CC = } your C compiler, such as {\tt cc}.
\item {\tt RANLIB = } your system's {\tt ranlib} program, if needed.
\item {\tt CFLAGS = } optimization flags, such as {\tt -O}.
- Add {\tt -DLP64} if you are compiling in 64-bit mode
- (32 bit {\tt int}'s, 64 bit {\tt long}'s, and 64 bit pointers).
-\item {\tt CONFIG = } configuration settings for the BLAS, memory allocation
- routines, and timing routines.
+\item {\tt UMFPACK\_CONFIG = } configuration settings for the BLAS,
+ memory allocation routines, and timing routines.
\item {\tt LIB = } your libraries, such as {\tt -lm} or {\tt -lblas}.
\item {\tt RM =} the command to delete a file.
\item {\tt MV =} the command to rename a file.
\item {\tt MEX =} the command to compile a MATLAB mexFunction.
If you are using MATLAB 5, you need to add {\tt -DNBLAS} and
- {\tt -DNUTIL} to this command. An example is provided in
- the {\tt Make/Make.include} file.
+ {\tt -DNUTIL} to this command.
\item {\tt F77 =} the command to compile a Fortran program (optional).
\item {\tt F77FLAGS =} the Fortran compiler flags (optional).
\item {\tt F77LIB =} the Fortran libraries (optional).
\end{itemize}
-The {\tt CONFIG} string can include combinations of the following;
+The {\tt UMFPACK\_CONFIG} string can include combinations of the following;
most deal with how the BLAS are called:
\begin{itemize}
\item {\tt -DNBLAS} if you do not have any BLAS at all.
-\item {\tt -DCBLAS} if you have the C-BLAS \cite{ATLAS}.
\item {\tt -DNSUNPERF} if you are on Solaris but do not have the Sun
Performance Library (for the BLAS).
-\item {\tt -DNSCSL} if you on SGI IRIX but do not have the SCSL BLAS library.
-\item {\tt -DLONGBLAS} if your BLAS can take {\tt long} integer input
- arguments. If not defined, then the {\tt umfpack\_*l\_*} versions of
- UMFPACK that use {\tt long} integers do not call the BLAS.
- This flag is set internally when using the Sun Performance BLAS
- or SGI's SCSL BLAS (both have 64-bit versions of the BLAS).
-\item Options for controlling how C calls the Fortran BLAS:
- {\tt -DBLAS\_BY\_VALUE}, {\tt -DBLAS\_NO\_UNDERSCORE},
- and {\tt -DBLAS\_CHAR\_ARG}. These are set automatically for Windows,
+\item {\tt -DLONGBLAS} if your BLAS takes non-{\tt int} integer arguments.
+\item {\tt -DBLAS\_INT = } the integer used by the BLAS.
+
+\item {\tt -DBLAS\_NO\_UNDERSCORE}
+ for controlling how C calls the Fortran BLAS.
+ This is set automatically for Windows,
Sun Solaris, SGI Irix, Red Hat Linux, Compaq Alpha, and
- AIX (the IBM RS 6000). They are ignored if you are using
- the C-BLAS interface to the BLAS.
+ AIX (the IBM RS 6000).
+
\item {\tt -DGETRUSAGE} if you have the {\tt getrusage} function.
-\item {\tt -DNUTIL} if you wish to compile the MATLAB-callable
- UMFPACK mexFunction with the {\tt mxMalloc}, {\tt mxRealloc}
- and {\tt mxFree} routines, instead of the undocumented (but
- superior) {\tt utMalloc}, {\tt utRealloc}, and {\tt utFree}
- routines. The default is to use the {\tt ut*} routines on
- Unix, and the {\tt mx*} routines on Windows.
\item {\tt -DNPOSIX} if you do not have the POSIX-compliant
{\tt sysconf} and {\tt times} routines used by
{\tt umfpack\_tic} and {\tt umfpack\_toc}.
statement, as described in Section~\ref{Synopsis}.
If you would like to compile both 32-bit and 64-bit versions of the libraries,
-you will need to do it in two steps. Modify your {\tt Make/Make.<arch>}
+you will need to do it in two steps. Modify your {\tt UFconfig/UFconfig.mk}
file, and select the 32-bit option. Type {\tt make} in the {\tt UMFPACK}
directory, which creates the {\tt UMFPACK/Lib/libumfpack.a} and
{\tt AMD/Lib/libamd.a} libraries. Rename those two files. Edit your
-{\tt Make/Make.<arch>} and select the 64-bit option. Type {\tt make purge},
+{\tt UFconfig/UFconfig.mk} file and select the 64-bit option.
+Type {\tt make purge},
and then {\tt make}, and you will create the 64-bit libraries.
You can use the same {\tt umfpack.h} include file for both 32-bit and
64-bit versions. Simply link your program with the appropriate 32-bit
compile the UMFPACK mexFunction). This works on any computer with MATLAB,
including Windows.
-You will be prompted to select several configuration options, including
-whether or not to use the BLAS.
-MATLAB 5.3 (or earlier) does not include the BLAS, so you either have to
-compile UMFPACK without the BLAS (UMFPACK will be slow), or modify your
-{\tt <matlab>/bin/mexopts.sh} by adding your BLAS library
-to the {\tt CLIBS} string,
-where {\tt <matlab>} is the directory in which MATLAB is installed.
+% You will be prompted to select several configuration options, including
+% whether or not to use the BLAS.
+% MATLAB 5.3 (or earlier) does not include the BLAS, so you either have to
+% compile UMFPACK without the BLAS (UMFPACK will be slow), or modify your
+% {\tt <matlab>/bin/mexopts.sh} by adding your BLAS library
+% to the {\tt CLIBS} string,
+% where {\tt <matlab>} is the directory in which MATLAB is installed.
If you are using Windows and the {\tt lcc} compiler bundled with
MATLAB 6.1, then you may need to copy the
\label{Future}
%-------------------------------------------------------------------------------
-Here are a few features that are not in UMFPACK Version 4.4, in no particular
+Here are a few features that are not in the current version of UMFPACK,
+in no particular
order. They may appear in a future release of UMFPACK. If you are interested,
let me know and I could consider including them:
\begin{enumerate}
+\item Remove the restriction that the column-oriented form be given with
+ sorted columns. This has already been done in AMD Version 2.0.
+
\item Future versions may have different default {\tt Control} parameters.
Future versions may return more statistics in the {\tt Info} array, and
they may use more entries in the {\tt Control} array.
solver that could be used to write a MATLAB mexFunction
{\tt x = lu\_refine (A, b, L, U, P, Q, R)} that gives MATLAB access
to the iterative refinement algorithm with sparse backward error
- analysis. It would also be easier to handle sparse right-hand-sides
+ analysis. It would also be easier to handle sparse right-hand sides
in this data structure, and end up with good asymptotic run-time
in this case
(particularly for $\m{Lx}=\m{b}$; see \cite{GilbertPeierls88}).
+ See also CSparse and
+ CXSparse for software for handling sparse right-hand sides.
\item Complex absolute value computations could be
based on FDLIBM (see \newline
\item The solve routines could handle multiple right-hand sides, and sparse
right-hand sides. See {\tt umfpack\_solve} for the MATLAB version
of this feature.
+ See also CSparse and
+ CXSparse for software for handling sparse right-hand sides.
\item An option to redirect the error and diagnostic output.
to C and included in UMFPACK. This would result in better performance
for matrices from circuit simulation and
chemical process engineering. See {\tt umfpack\_btf.m} for the MATLAB
- version of this feature. An upcoming package (KLU) will include
- this feature.
-
-\item The ability to use user-provided {\tt malloc}, {\tt free}, and
- {\tt realloc} memory allocation routines. Note that UMFPACK makes very
- few calls to these routines. You can do this at compile-time by
- modifying the definitions of {\tt ALLOCATE}, {\tt FREE}, and
- {\tt REALLOCATE} in the file {\tt umf\_internal.h}. Be sure to document
- your changes carefully when you change UMFPACK source code.
+ version of this feature. KLU includes this feature.
+ See also {\tt cs\_dmperm} in CSparse and CXSparse.
\item The ability to use user-provided work arrays, so that {\tt malloc},
{\tt free}, and {\tt realloc} realloc are not called. The
time proportional to the number of nonzeros in the upper bound of $\m{U}$.
The method used in UMFPACK exploits super-columns, however, so this
bound is rarely reached.
+ See {\tt cs\_counts} in CSparse and CXSparse,
+ and {\tt cholmod\_analyze} in CHOLMOD.
\item Other basic sparse matrix operations, such as sparse matrix
multiplication, could be included.
The include files are the same for all four versions of
UMFPACK. The generic integer type is {\tt Int}, which is an {\tt int} or
-{\tt long}, depending on which version of UMFPACK you are using.
+{\tt UF\_long}, depending on which version of UMFPACK you are using.
\subsection{umfpack\_*\_symbolic}
--- /dev/null
+ 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
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+\f
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+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
+\f
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
--- /dev/null
+/* ========================================================================== */
+/* === UFconfig.h =========================================================== */
+/* ========================================================================== */
+
+/* Configuration file for SuiteSparse: a Suite of Sparse matrix packages
+ * (AMD, COLAMD, CCOLAMD, CAMD, CHOLMOD, UMFPACK, CXSparse, and others).
+ *
+ * UFconfig.h provides the definition of the long integer. On most systems,
+ * a C program can be compiled in LP64 mode, in which long's and pointers are
+ * both 64-bits, and int's are 32-bits. Windows 64, however, uses the LLP64
+ * model, in which int's and long's are 32-bits, and long long's and pointers
+ * are 64-bits.
+ *
+ * SuiteSparse packages that include long integer versions are
+ * intended for the LP64 mode. However, as a workaround for Windows 64
+ * (and perhaps other systems), the long integer can be redefined.
+ *
+ * If _WIN64 is defined, then the __int64 type is used instead of long.
+ *
+ * The long integer can also be defined at compile time. For example, this
+ * could be added to UFconfig.mk:
+ *
+ * CFLAGS = -O -D'UF_long=long long' -D'UF_long_max=9223372036854775801' \
+ * -D'UF_long_id="%lld"'
+ *
+ * This file defines UF_long as either long (on all but _WIN64) or
+ * __int64 on Windows 64. The intent is that a UF_long is always a 64-bit
+ * integer in a 64-bit code. ptrdiff_t might be a better choice than long;
+ * it is always the same size as a pointer.
+ *
+ * This file also defines the SUITESPARSE_VERSION and related definitions.
+ *
+ * Copyright (c) 2007, University of Florida. No licensing restrictions
+ * apply to this file or to the UFconfig directory. Author: Timothy A. Davis.
+ */
+
+#ifndef _UFCONFIG_H
+#define _UFCONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <limits.h>
+
+/* ========================================================================== */
+/* === UF_long ============================================================== */
+/* ========================================================================== */
+
+#ifndef UF_long
+
+#ifdef _WIN64
+
+#define UF_long __int64
+#define UF_long_max _I64_MAX
+#define UF_long_id "%I64d"
+
+#else
+
+#define UF_long long
+#define UF_long_max LONG_MAX
+#define UF_long_id "%ld"
+
+#endif
+#endif
+
+/* ========================================================================== */
+/* === SuiteSparse version ================================================== */
+/* ========================================================================== */
+
+/* SuiteSparse is not a package itself, but a collection of packages, some of
+ * which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD,
+ * COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the
+ * collection itself. The versions of packages within each version of
+ * SuiteSparse are meant to work together. Combining one packge from one
+ * version of SuiteSparse, with another package from another version of
+ * SuiteSparse, may or may not work.
+ *
+ * SuiteSparse Version 3.0.0 contains the following packages:
+ *
+ * AMD version 2.2.0
+ * CAMD version 2.2.0
+ * COLAMD version 2.7.0
+ * CCOLAMD version 2.7.0
+ * CHOLMOD version 1.5.0
+ * CSparse version 2.2.0
+ * CXSparse version 2.2.0
+ * KLU version 1.0.0
+ * BTF version 1.0.0
+ * LDL version 2.0.0
+ * UFconfig version number is the same as SuiteSparse
+ * UMFPACK version 5.1.0
+ * RBio version 1.1.0
+ * UFcollection version 1.1.0
+ *
+ * Other package dependencies:
+ * BLAS required by CHOLMOD and UMFPACK
+ * LAPACK required by CHOLMOD
+ * METIS 4.0.1 required by CHOLMOD (optional) and KLU (optional)
+ */
+
+#define SUITESPARSE_DATE "May 31, 2007"
+#define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub))
+#define SUITESPARSE_MAIN_VERSION 3
+#define SUITESPARSE_SUB_VERSION 0
+#define SUITESPARSE_SUBSUB_VERSION 0
+#define SUITESPARSE_VERSION \
+ SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
#ifndef UMFPACK_H
#define UMFPACK_H
+/* -------------------------------------------------------------------------- */
+/* Make it easy for C++ programs to include UMFPACK */
+/* -------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* define UF_long */
+#include "UFconfig.h"
+
/* -------------------------------------------------------------------------- */
/* size of Info and Control arrays */
/* -------------------------------------------------------------------------- */
#include "umfpack_timer.h"
#include "umfpack_tictoc.h"
+/* AMD */
+#include "../../AMD/Include/amd.h"
+
+/* global function pointers */
+#include "umfpack_global.h"
+
/* -------------------------------------------------------------------------- */
/* Version, copyright, and license */
/* -------------------------------------------------------------------------- */
-#define UMFPACK_VERSION "UMFPACK V4.4 (Jan. 28, 2005)"
+#define UMFPACK_VERSION "UMFPACK V5.1.0 (May 31, 2007)"
#define UMFPACK_COPYRIGHT \
-"UMFPACK: Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved.\n"
+"UMFPACK: Copyright (c) 2005-2006 by Timothy A. Davis. All Rights Reserved.\n"
#define UMFPACK_LICENSE_PART1 \
"\nUMFPACK License:\n" \
"\n" \
+" UMFPACK is available under alternate licenses,\n" \
+" contact T. Davis for details.\n" \
+"\n" \
" Your use or distribution of UMFPACK or any modified version of\n" \
" UMFPACK implies that you agree to this License.\n" \
"\n" \
-" THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY\n" \
-" EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.\n"
+" This library is free software; you can redistribute it and/or\n" \
+" modify it under the terms of the GNU Lesser General Public\n" \
+" License as published by the Free Software Foundation; either\n" \
+" version 2.1 of the License, or (at your option) any later version.\n" \
+"\n" \
+" This library is distributed in the hope that it will be useful,\n" \
+" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" \
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" \
+" Lesser General Public License for more details.\n" \
+"\n" \
+" You should have received a copy of the GNU Lesser General Public\n" \
+" License along with this library; if not, write to the Free Software\n" \
+" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301\n" \
+" USA\n" \
+
#define UMFPACK_LICENSE_PART2 \
"\n" \
-" Permission is hereby granted to use or copy this program, provided\n" \
-" that the Copyright, this License, and the Availability of the original\n" \
-" version is retained on all copies. User documentation of any code that\n" \
-" uses UMFPACK or any modified version of UMFPACK code must cite the\n" \
-" Copyright, this License, the Availability note, and \"Used by permission.\"\n"
+" Permission is hereby granted to use or copy this program under the\n" \
+" terms of the GNU LGPL, provided that the Copyright, this License,\n" \
+" and the Availability of the original version is retained on all copies.\n" \
+" User documentation of any code that uses this code or any modified\n" \
+" version of this code must cite the Copyright, this License, the\n" \
+" Availability note, and \"Used by permission.\" Permission to modify\n" \
+" the code and to distribute modified code is granted, provided the\n" \
+" Copyright, this License, and the Availability note are retained,\n" \
+" and a notice that the code was modified is included.\n"
+
#define UMFPACK_LICENSE_PART3 \
-" Permission to modify the code and to distribute modified code is granted,\n" \
-" provided the Copyright, this License, and the Availability note are\n" \
-" retained, and a notice that the code was modified is included. This\n" \
-" software was developed with support from the National Science Foundation,\n" \
-" and is provided to you free of charge.\n" \
"\n" \
"Availability: http://www.cise.ufl.edu/research/sparse/umfpack\n" \
"\n"
+/* UMFPACK Version 4.5 and later will include the following definitions.
+ * As an example, to test if the version you are using is 4.5 or later:
+ *
+ * #ifdef UMFPACK_VER
+ * if (UMFPACK_VER >= UMFPACK_VER_CODE (4,5)) ...
+ * #endif
+ *
+ * This also works during compile-time:
+ *
+ * #if defined(UMFPACK_VER) && (UMFPACK >= UMFPACK_VER_CODE (4,5))
+ * printf ("This is version 4.5 or later\n") ;
+ * #else
+ * printf ("This is an early version\n") ;
+ * #endif
+ *
+ * Versions 4.4 and earlier of UMFPACK do not include a #define'd version
+ * number, although they do include the UMFPACK_VERSION string, defined
+ * above.
+ */
+
+#define UMFPACK_DATE "May 31, 2007"
+#define UMFPACK_VER_CODE(main,sub) ((main) * 1000 + (sub))
+#define UMFPACK_MAIN_VERSION 5
+#define UMFPACK_SUB_VERSION 1
+#define UMFPACK_SUBSUB_VERSION 0
+#define UMFPACK_VER UMFPACK_VER_CODE(UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION)
+
/* -------------------------------------------------------------------------- */
/* contents of Info */
/* -------------------------------------------------------------------------- */
/* computed in UMFPACK_*symbolic: */
#define UMFPACK_SIZE_OF_INT 4 /* sizeof (int) */
-#define UMFPACK_SIZE_OF_LONG 5 /* sizeof (long) */
+#define UMFPACK_SIZE_OF_LONG 5 /* sizeof (UF_long) */
#define UMFPACK_SIZE_OF_POINTER 6 /* sizeof (void *) */
#define UMFPACK_SIZE_OF_ENTRY 7 /* sizeof (Entry), real or complex */
#define UMFPACK_NDENSE_ROW 8 /* number of dense rows */
/* Integer constants are used for status and solve codes instead of enum */
/* to make it easier for a Fortran code to call UMFPACK. */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* UMFPACK_H */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
int Tj [ ]
) ;
-long umfpack_dl_col_to_triplet
+UF_long umfpack_dl_col_to_triplet
(
- long n_col,
- const long Ap [ ],
- long Tj [ ]
+ UF_long n_col,
+ const UF_long Ap [ ],
+ UF_long Tj [ ]
) ;
int umfpack_zi_col_to_triplet
int Tj [ ]
) ;
-long umfpack_zl_col_to_triplet
+UF_long umfpack_zl_col_to_triplet
(
- long n_col,
- const long Ap [ ],
- long Tj [ ]
+ UF_long n_col,
+ const UF_long Ap [ ],
+ UF_long Tj [ ]
) ;
/*
int n_col, *Tj, *Ap, status ;
status = umfpack_di_col_to_triplet (n_col, Ap, Tj) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long n_col, *Tj, *Ap, status ;
+ UF_long n_col, *Tj, *Ap, status ;
status = umfpack_dl_col_to_triplet (n_col, Ap, Tj) ;
complex int Syntax:
int n_col, *Tj, *Ap, status ;
status = umfpack_zi_col_to_triplet (n_col, Ap, Tj) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long n_col, *Tj, *Ap, status ;
+ UF_long n_col, *Tj, *Ap, status ;
status = umfpack_zl_col_to_triplet (n_col, Ap, Tj) ;
Purpose:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Control [UMFPACK_CONTROL] ;
umfpack_di_defaults (Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL] ;
double Control [UMFPACK_CONTROL] ;
umfpack_zi_defaults (Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL] ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void *Numeric ;
umfpack_di_free_numeric (&Numeric) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
void *Numeric ;
umfpack_zi_free_numeric (&Numeric) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void *Symbolic ;
umfpack_di_free_symbolic (&Symbolic) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
void *Symbolic ;
umfpack_zi_free_symbolic (&Symbolic) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
+/* UMFPACK_get_determinant contributed by David Bateman, Motorola, Paris. */
/* -------------------------------------------------------------------------- */
int umfpack_di_get_determinant
double User_Info [UMFPACK_INFO]
) ;
-long umfpack_dl_get_determinant
+UF_long umfpack_dl_get_determinant
(
double *Mx,
double *Ex,
double User_Info [UMFPACK_INFO]
) ;
-long umfpack_zl_get_determinant
+UF_long umfpack_zl_get_determinant
(
double *Mx,
double *Mz,
double Mx, Ex, Info [UMFPACK_INFO] ;
status = umfpack_di_get_determinant (&Mx, &Ex, Numeric, Info) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status ;
+ UF_long status ;
double Mx, Ex, Info [UMFPACK_INFO] ;
status = umfpack_dl_get_determinant (&Mx, &Ex, Numeric, Info) ;
#include "umfpack.h"
void *Numeric ;
- long status ;
+ UF_long status ;
double *Mx, *Mz, *Ex, Info [UMFPACK_INFO] ;
status = umfpack_zl_get_determinant (&Mx, &Mz, &Ex, Numeric, Info) ;
Same as above, except Mz is NULL.
+Author: Contributed by David Bateman, Motorola, Paris
+
Purpose:
Using the LU factors and the permutation vectors contained in the Numeric
obtaining the determinant is used, the overflow has already
occurred.
+
*/
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void *Numeric
) ;
-long umfpack_dl_get_lunz
+UF_long umfpack_dl_get_lunz
(
- long *lnz,
- long *unz,
- long *n_row,
- long *n_col,
- long *nz_udiag,
+ UF_long *lnz,
+ UF_long *unz,
+ UF_long *n_row,
+ UF_long *n_col,
+ UF_long *nz_udiag,
void *Numeric
) ;
void *Numeric
) ;
-long umfpack_zl_get_lunz
+UF_long umfpack_zl_get_lunz
(
- long *lnz,
- long *unz,
- long *n_row,
- long *n_col,
- long *nz_udiag,
+ UF_long *lnz,
+ UF_long *unz,
+ UF_long *n_row,
+ UF_long *n_col,
+ UF_long *nz_udiag,
void *Numeric
) ;
#include "umfpack.h"
void *Numeric ;
- int status, lnz, unz, n_row, n_col ;
- status = umfpack_di_get_lunz (&lnz, &unz, &n_row, &n_col, Numeric) ;
+ int status, lnz, unz, n_row, n_col, nz_udiag ;
+ status = umfpack_di_get_lunz (&lnz, &unz, &n_row, &n_col, &nz_udiag,
+ Numeric) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status, lnz, unz, n_row, n_col ;
- status = umfpack_dl_get_lunz (&lnz, &unz, &n_row, &n_col, Numeric) ;
+ UF_long status, lnz, unz, n_row, n_col, nz_udiag ;
+ status = umfpack_dl_get_lunz (&lnz, &unz, &n_row, &n_col, &nz_udiag,
+ Numeric) ;
complex int Syntax:
#include "umfpack.h"
void *Numeric ;
- int status, lnz, unz, n_row, n_col ;
- status = umfpack_zi_get_lunz (&lnz, &unz, &n_row, &n_col, Numeric) ;
+ int status, lnz, unz, n_row, n_col, nz_udiag ;
+ status = umfpack_zi_get_lunz (&lnz, &unz, &n_row, &n_col, &nz_udiag,
+ Numeric) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status, lnz, unz, n_row, n_col ;
- status = umfpack_zl_get_lunz (&lnz, &unz, &n_row, &n_col, Numeric) ;
+ UF_long status, lnz, unz, n_row, n_col, nz_udiag ;
+ status = umfpack_zl_get_lunz (&lnz, &unz, &n_row, &n_col, &nz_udiag,
+ Numeric) ;
Purpose:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void *Numeric
) ;
-long umfpack_dl_get_numeric
+UF_long umfpack_dl_get_numeric
(
- long Lp [ ],
- long Lj [ ],
+ UF_long Lp [ ],
+ UF_long Lj [ ],
double Lx [ ],
- long Up [ ],
- long Ui [ ],
+ UF_long Up [ ],
+ UF_long Ui [ ],
double Ux [ ],
- long P [ ],
- long Q [ ],
+ UF_long P [ ],
+ UF_long Q [ ],
double Dx [ ],
- long *do_recip,
+ UF_long *do_recip,
double Rs [ ],
void *Numeric
) ;
void *Numeric
) ;
-long umfpack_zl_get_numeric
+UF_long umfpack_zl_get_numeric
(
- long Lp [ ],
- long Lj [ ],
+ UF_long Lp [ ],
+ UF_long Lj [ ],
double Lx [ ], double Lz [ ],
- long Up [ ],
- long Ui [ ],
+ UF_long Up [ ],
+ UF_long Ui [ ],
double Ux [ ], double Uz [ ],
- long P [ ],
- long Q [ ],
+ UF_long P [ ],
+ UF_long Q [ ],
double Dx [ ], double Dz [ ],
- long *do_recip,
+ UF_long *do_recip,
double Rs [ ],
void *Numeric
) ;
status = umfpack_di_get_numeric (Lp, Lj, Lx, Up, Ui, Ux, P, Q, Dx,
&do_recip, Rs, Numeric) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long *Lp, *Lj, *Up, *Ui, *P, *Q, status, do_recip ;
+ UF_long *Lp, *Lj, *Up, *Ui, *P, *Q, status, do_recip ;
double *Lx, *Ux, *Dx, *Rs ;
status = umfpack_dl_get_numeric (Lp, Lj, Lx, Up, Ui, Ux, P, Q, Dx,
&do_recip, Rs, Numeric) ;
status = umfpack_zi_get_numeric (Lp, Lj, Lx, Lz, Up, Ui, Ux, Uz, P, Q,
Dx, Dz, &do_recip, Rs, Numeric) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long *Lp, *Lj, *Up, *Ui, *P, *Q, status, do_recip ;
+ UF_long *Lp, *Lj, *Up, *Ui, *P, *Q, status, do_recip ;
double *Lx, *Lz, *Ux, *Uz, *Dx, *Dz, *Rs ;
status = umfpack_zl_get_numeric (Lp, Lj, Lx, Lz, Up, Ui, Ux, Uz, P, Q,
Dx, Dz, &do_recip, Rs, Numeric) ;
-packed complex int/long Syntax:
+packed complex int/UF_long Syntax:
Same as above, except Lz, Uz, and Dz are all NULL.
Int *do_recip ; Output argument.
- If do_recip is returned as zero (false), then the scale factors Rs [i]
- are to be used by multiplying row i by Rs [i]. Otherwise, the entries
- in row i are to be divided by Rs [i].
+ This argument defines how the scale factors Rs are to be interpretted.
+
+ If do_recip is TRUE (one), then the scale factors Rs [i] are to be used
+ by multiplying row i by Rs [i]. Otherwise, the entries in row i are to
+ be divided by Rs [i].
If UMFPACK has been compiled with gcc, or for MATLAB as either a
built-in routine or as a mexFunction, then the NRECIPROCAL flag is
- set, and do_recip will always be zero (false).
+ set, and do_recip will always be FALSE (zero).
double Rs [n_row] ; Output argument.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void *Symbolic
) ;
-long umfpack_dl_get_symbolic
+UF_long umfpack_dl_get_symbolic
(
- long *n_row,
- long *n_col,
- long *n1,
- long *nz,
- long *nfr,
- long *nchains,
- long P [ ],
- long Q [ ],
- long Front_npivcol [ ],
- long Front_parent [ ],
- long Front_1strow [ ],
- long Front_leftmostdesc [ ],
- long Chain_start [ ],
- long Chain_maxrows [ ],
- long Chain_maxcols [ ],
+ UF_long *n_row,
+ UF_long *n_col,
+ UF_long *n1,
+ UF_long *nz,
+ UF_long *nfr,
+ UF_long *nchains,
+ UF_long P [ ],
+ UF_long Q [ ],
+ UF_long Front_npivcol [ ],
+ UF_long Front_parent [ ],
+ UF_long Front_1strow [ ],
+ UF_long Front_leftmostdesc [ ],
+ UF_long Chain_start [ ],
+ UF_long Chain_maxrows [ ],
+ UF_long Chain_maxcols [ ],
void *Symbolic
) ;
void *Symbolic
) ;
-long umfpack_zl_get_symbolic
+UF_long umfpack_zl_get_symbolic
(
- long *n_row,
- long *n_col,
- long *n1,
- long *nz,
- long *nfr,
- long *nchains,
- long P [ ],
- long Q [ ],
- long Front_npivcol [ ],
- long Front_parent [ ],
- long Front_1strow [ ],
- long Front_leftmostdesc [ ],
- long Chain_start [ ],
- long Chain_maxrows [ ],
- long Chain_maxcols [ ],
+ UF_long *n_row,
+ UF_long *n_col,
+ UF_long *n1,
+ UF_long *nz,
+ UF_long *nfr,
+ UF_long *nchains,
+ UF_long P [ ],
+ UF_long Q [ ],
+ UF_long Front_npivcol [ ],
+ UF_long Front_parent [ ],
+ UF_long Front_1strow [ ],
+ UF_long Front_leftmostdesc [ ],
+ UF_long Chain_start [ ],
+ UF_long Chain_maxrows [ ],
+ UF_long Chain_maxcols [ ],
void *Symbolic
) ;
Front_leftmostdesc, Chain_start, Chain_maxrows, Chain_maxcols,
Symbolic) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long status, n_row, n_col, nz, nfr, nchains, *P, *Q,
+ UF_long status, n_row, n_col, nz, nfr, nchains, *P, *Q,
*Front_npivcol, *Front_parent, *Front_1strow, *Front_leftmostdesc,
*Chain_start, *Chain_maxrows, *Chain_maxcols ;
void *Symbolic ;
Front_leftmostdesc, Chain_start, Chain_maxrows, Chain_maxcols,
Symbolic) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long status, n_row, n_col, nz, nfr, nchains, *P, *Q,
+ UF_long status, n_row, n_col, nz, nfr, nchains, *P, *Q,
*Front_npivcol, *Front_parent, *Front_1strow, *Front_leftmostdesc,
*Chain_start, *Chain_maxrows, *Chain_maxcols ;
void *Symbolic ;
--- /dev/null
+/* ========================================================================== */
+/* === umfpack_global ======================================================= */
+/* ========================================================================== */
+
+/* -------------------------------------------------------------------------- */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
+/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
+/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
+/* -------------------------------------------------------------------------- */
+
+/* prototypes for global variables, and basic operators for complex values */
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
+EXTERN double (*umfpack_hypot) (double, double) ;
+EXTERN int (*umfpack_divcomplex) (double, double, double, double, double *, double *) ;
+
+double umf_hypot (double x, double y) ;
+int umf_divcomplex (double, double, double, double, double *, double *) ;
+
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
char *filename
) ;
-long umfpack_dl_load_numeric
+UF_long umfpack_dl_load_numeric
(
void **Numeric,
char *filename
char *filename
) ;
-long umfpack_zl_load_numeric
+UF_long umfpack_zl_load_numeric
(
void **Numeric,
char *filename
void *Numeric ;
status = umfpack_di_load_numeric (&Numeric, filename) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Numeric ;
status = umfpack_dl_load_numeric (&Numeric, filename) ;
void *Numeric ;
status = umfpack_zi_load_numeric (&Numeric, filename) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Numeric ;
status = umfpack_zl_load_numeric (&Numeric, filename) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
char *filename
) ;
-long umfpack_dl_load_symbolic
+UF_long umfpack_dl_load_symbolic
(
void **Symbolic,
char *filename
char *filename
) ;
-long umfpack_zl_load_symbolic
+UF_long umfpack_zl_load_symbolic
(
void **Symbolic,
char *filename
void *Symbolic ;
status = umfpack_di_load_symbolic (&Symbolic, filename) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Symbolic ;
status = umfpack_dl_load_symbolic (&Symbolic, filename) ;
void *Symbolic ;
status = umfpack_zi_load_symbolic (&Symbolic, filename) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Symbolic ;
status = umfpack_zl_load_symbolic (&Symbolic, filename) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Info [UMFPACK_INFO]
) ;
-long umfpack_dl_numeric
+UF_long umfpack_dl_numeric
(
- const long Ap [ ],
- const long Ai [ ],
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
void *Symbolic,
void **Numeric,
double Info [UMFPACK_INFO]
) ;
-long umfpack_zl_numeric
+UF_long umfpack_zl_numeric
(
- const long Ap [ ],
- const long Ai [ ],
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
void *Symbolic,
void **Numeric,
double *Ax, Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
status = umfpack_di_numeric (Ap, Ai, Ax, Symbolic, &Numeric, Control, Info);
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Symbolic, *Numeric ;
- long *Ap, *Ai, status ;
+ UF_long *Ap, *Ai, status ;
double *Ax, Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
status = umfpack_dl_numeric (Ap, Ai, Ax, Symbolic, &Numeric, Control, Info);
status = umfpack_zi_numeric (Ap, Ai, Ax, Az, Symbolic, &Numeric,
Control, Info) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Symbolic, *Numeric ;
- long *Ap, *Ai, status ;
+ UF_long *Ap, *Ai, status ;
double *Ax, *Az, Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
status = umfpack_zl_numeric (Ap, Ai, Ax, Az, Symbolic, &Numeric,
Control, Info) ;
collection then occurs.
The strategy of attempting to "malloc" a working space, and
- re-trying with a smaller space, may not work under MATLAB, since
- mxMalloc aborts the mexFunction if it fails. The built-in umfpack
- routine in MATLAB 6.5 uses utMalloc instead, which
- avoids this problem. As a mexFunction, utMalloc is used unless
- -DNUTIL is defined at compile time. The utMalloc routine, and
- utFree and utRealloc, are not documented. If the mexFunction
- doesn't work, then compile it with -DNUTIL instead.
+ re-trying with a smaller space, may not work when UMFPACK is used
+ as a mexFunction MATLAB, since mxMalloc aborts the mexFunction if it
+ fails. This issue does not affect the use of UMFPACK as a part of
+ the built-in x=A\b in MATLAB 6.5 and later.
If you are using the umfpack mexFunction, decrease the magnitude of
Control [UMFPACK_ALLOC_INIT] if you run out of memory in MATLAB.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Info [UMFPACK_INFO]
) ;
-long umfpack_dl_qsymbolic
+UF_long umfpack_dl_qsymbolic
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
- const long Qinit [ ],
+ const UF_long Qinit [ ],
void **Symbolic,
const double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO]
double Info [UMFPACK_INFO]
) ;
-long umfpack_zl_qsymbolic
+UF_long umfpack_zl_qsymbolic
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
- const long Qinit [ ],
+ const UF_long Qinit [ ],
void **Symbolic,
const double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO]
status = umfpack_di_qsymbolic (n_row, n_col, Ap, Ai, Ax, Qinit,
&Symbolic, Control, Info) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
- long n_row, n_col, *Ap, *Ai, *Qinit, status ;
+ UF_long n_row, n_col, *Ap, *Ai, *Qinit, status ;
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO], *Ax ;
status = umfpack_dl_qsymbolic (n_row, n_col, Ap, Ai, Ax, Qinit,
&Symbolic, Control, Info) ;
status = umfpack_zi_qsymbolic (n_row, n_col, Ap, Ai, Ax, Az, Qinit,
&Symbolic, Control, Info) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
- long n_row, n_col, *Ap, *Ai, *Qinit, status ;
+ UF_long n_row, n_col, *Ap, *Ai, *Qinit, status ;
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO], *Ax, *Az ;
status = umfpack_zl_qsymbolic (n_row, n_col, Ap, Ai, Ax, Az, Qinit,
&Symbolic, Control, Info) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Control [UMFPACK_CONTROL] ;
umfpack_di_report_control (Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL] ;
double Control [UMFPACK_CONTROL] ;
umfpack_zi_report_control (Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL] ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
umfpack_di_report_info (Control, Info) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
umfpack_zi_report_info (Control, Info) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_dl_report_matrix
+UF_long umfpack_dl_report_matrix
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
- long col_form,
+ UF_long col_form,
const double Control [UMFPACK_CONTROL]
) ;
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_zl_report_matrix
+UF_long umfpack_zl_report_matrix
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
- long col_form,
+ UF_long col_form,
const double Control [UMFPACK_CONTROL]
) ;
or:
status = umfpack_di_report_matrix (n_row, n_col, Ap, Ai, Ax, 0, Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, *Ap, *Ai, status ;
+ UF_long n_row, n_col, *Ap, *Ai, status ;
double *Ax, Control [UMFPACK_CONTROL] ;
status = umfpack_dl_report_matrix (n_row, n_col, Ap, Ai, Ax, 1, Control) ;
or:
status = umfpack_zi_report_matrix (n_row, n_col, Ap, Ai, Ax, Az, 0,
Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, *Ap, *Ai, status ;
+ UF_long n_row, n_col, *Ap, *Ai, status ;
double *Ax, Control [UMFPACK_CONTROL] ;
status = umfpack_zl_report_matrix (n_row, n_col, Ap, Ai, Ax, Az, 1,
Control) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_dl_report_numeric
+UF_long umfpack_dl_report_numeric
(
void *Numeric,
const double Control [UMFPACK_CONTROL]
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_zl_report_numeric
+UF_long umfpack_zl_report_numeric
(
void *Numeric,
const double Control [UMFPACK_CONTROL]
int status ;
status = umfpack_di_report_numeric (Numeric, Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
double Control [UMFPACK_CONTROL] ;
- long status ;
+ UF_long status ;
status = umfpack_dl_report_numeric (Numeric, Control) ;
complex int Syntax:
int status ;
status = umfpack_zi_report_numeric (Numeric, Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
double Control [UMFPACK_CONTROL] ;
- long status ;
+ UF_long status ;
status = umfpack_zl_report_numeric (Numeric, Control) ;
Purpose:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_dl_report_perm
+UF_long umfpack_dl_report_perm
(
- long np,
- const long Perm [ ],
+ UF_long np,
+ const UF_long Perm [ ],
const double Control [UMFPACK_CONTROL]
) ;
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_zl_report_perm
+UF_long umfpack_zl_report_perm
(
- long np,
- const long Perm [ ],
+ UF_long np,
+ const UF_long Perm [ ],
const double Control [UMFPACK_CONTROL]
) ;
double Control [UMFPACK_CONTROL] ;
status = umfpack_di_report_perm (np, Perm, Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long np, *Perm, status ;
+ UF_long np, *Perm, status ;
double Control [UMFPACK_CONTROL] ;
status = umfpack_dl_report_perm (np, Perm, Control) ;
double Control [UMFPACK_CONTROL] ;
status = umfpack_zi_report_perm (np, Perm, Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long np, *Perm, status ;
+ UF_long np, *Perm, status ;
double Control [UMFPACK_CONTROL] ;
status = umfpack_zl_report_perm (np, Perm, Control) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void umfpack_dl_report_status
(
const double Control [UMFPACK_CONTROL],
- long status
+ UF_long status
) ;
void umfpack_zi_report_status
void umfpack_zl_report_status
(
const double Control [UMFPACK_CONTROL],
- long status
+ UF_long status
) ;
/*
int status ;
umfpack_di_report_status (Control, status) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL] ;
- long status ;
+ UF_long status ;
umfpack_dl_report_status (Control, status) ;
complex int Syntax:
int status ;
umfpack_zi_report_status (Control, status) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
double Control [UMFPACK_CONTROL] ;
- long status ;
+ UF_long status ;
umfpack_zl_report_status (Control, status) ;
Purpose:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_dl_report_symbolic
+UF_long umfpack_dl_report_symbolic
(
void *Symbolic,
const double Control [UMFPACK_CONTROL]
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_zl_report_symbolic
+UF_long umfpack_zl_report_symbolic
(
void *Symbolic,
const double Control [UMFPACK_CONTROL]
int status ;
status = umfpack_di_report_symbolic (Symbolic, Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
double Control [UMFPACK_CONTROL] ;
- long status ;
+ UF_long status ;
status = umfpack_dl_report_symbolic (Symbolic, Control) ;
complex int Syntax:
int status ;
status = umfpack_zi_report_symbolic (Symbolic, Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
double Control [UMFPACK_CONTROL] ;
- long status ;
+ UF_long status ;
status = umfpack_zl_report_symbolic (Symbolic, Control) ;
Purpose:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_dl_report_triplet
+UF_long umfpack_dl_report_triplet
(
- long n_row,
- long n_col,
- long nz,
- const long Ti [ ],
- const long Tj [ ],
+ UF_long n_row,
+ UF_long n_col,
+ UF_long nz,
+ const UF_long Ti [ ],
+ const UF_long Tj [ ],
const double Tx [ ],
const double Control [UMFPACK_CONTROL]
) ;
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_zl_report_triplet
+UF_long umfpack_zl_report_triplet
(
- long n_row,
- long n_col,
- long nz,
- const long Ti [ ],
- const long Tj [ ],
+ UF_long n_row,
+ UF_long n_col,
+ UF_long nz,
+ const UF_long Ti [ ],
+ const UF_long Tj [ ],
const double Tx [ ], const double Tz [ ],
const double Control [UMFPACK_CONTROL]
) ;
double *Tx, Control [UMFPACK_CONTROL] ;
status = umfpack_di_report_triplet (n_row, n_col, nz, Ti, Tj, Tx, Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, nz, *Ti, *Tj, status ;
+ UF_long n_row, n_col, nz, *Ti, *Tj, status ;
double *Tx, Control [UMFPACK_CONTROL] ;
status = umfpack_dl_report_triplet (n_row, n_col, nz, Ti, Tj, Tx, Control) ;
status = umfpack_zi_report_triplet (n_row, n_col, nz, Ti, Tj, Tx, Tz,
Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, nz, *Ti, *Tj, status ;
+ UF_long n_row, n_col, nz, *Ti, *Tj, status ;
double *Tx, *Tz, Control [UMFPACK_CONTROL] ;
status = umfpack_zl_report_triplet (n_row, n_col, nz, Ti, Tj, Tx, Tz,
Control) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_dl_report_vector
+UF_long umfpack_dl_report_vector
(
- long n,
+ UF_long n,
const double X [ ],
const double Control [UMFPACK_CONTROL]
) ;
const double Control [UMFPACK_CONTROL]
) ;
-long umfpack_zl_report_vector
+UF_long umfpack_zl_report_vector
(
- long n,
+ UF_long n,
const double Xx [ ], const double Xz [ ],
const double Control [UMFPACK_CONTROL]
) ;
double *X, Control [UMFPACK_CONTROL] ;
status = umfpack_di_report_vector (n, X, Control) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long n, status ;
+ UF_long n, status ;
double *X, Control [UMFPACK_CONTROL] ;
status = umfpack_dl_report_vector (n, X, Control) ;
double *Xx, *Xz, Control [UMFPACK_CONTROL] ;
status = umfpack_zi_report_vector (n, Xx, Xz, Control) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long n, status ;
+ UF_long n, status ;
double *Xx, *Xz, Control [UMFPACK_CONTROL] ;
status = umfpack_zl_report_vector (n, Xx, Xz, Control) ;
when passed to umfpack_*_report_vector (this is untested, however).
This is the "merged" form of the complex vector X.
- Note that all complex routines in UMFPACK V4.4 use this same
+ Note that all complex routines in UMFPACK V4.4 and later use this same
strategy for their complex arguments. The split format is useful for
MATLAB, which holds its real and imaginary parts in seperate arrays.
The packed format is compatible with the intrinsic double _Complex
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
char *filename
) ;
-long umfpack_dl_save_numeric
+UF_long umfpack_dl_save_numeric
(
void *Numeric,
char *filename
char *filename
) ;
-long umfpack_zl_save_numeric
+UF_long umfpack_zl_save_numeric
(
void *Numeric,
char *filename
void *Numeric ;
status = umfpack_di_save_numeric (Numeric, filename) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Numeric ;
status = umfpack_dl_save_numeric (Numeric, filename) ;
void *Numeric ;
status = umfpack_zi_save_numeric (Numeric, filename) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Numeric ;
status = umfpack_zl_save_numeric (Numeric, filename) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
char *filename
) ;
-long umfpack_dl_save_symbolic
+UF_long umfpack_dl_save_symbolic
(
void *Symbolic,
char *filename
char *filename
) ;
-long umfpack_zl_save_symbolic
+UF_long umfpack_zl_save_symbolic
(
void *Symbolic,
char *filename
void *Symbolic ;
status = umfpack_di_save_symbolic (Symbolic, filename) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Symbolic ;
status = umfpack_dl_save_symbolic (Symbolic, filename) ;
void *Symbolic ;
status = umfpack_zi_save_symbolic (Symbolic, filename) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long status ;
+ UF_long status ;
char *filename ;
void *Symbolic ;
status = umfpack_zl_save_symbolic (Symbolic, filename) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
void *Numeric
) ;
-long umfpack_dl_scale
+UF_long umfpack_dl_scale
(
double X [ ],
const double B [ ],
void *Numeric
) ;
-long umfpack_zl_scale
+UF_long umfpack_zl_scale
(
double Xx [ ], double Xz [ ],
const double Bx [ ], const double Bz [ ],
double *B, *X ;
status = umfpack_di_scale (X, B, Numeric) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
double *Bx, *Bz, *Xx, *Xz ;
status = umfpack_zi_scale (Xx, Xz, Bx, Bz, Numeric) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Info [UMFPACK_INFO]
) ;
-long umfpack_dl_solve
+UF_long umfpack_dl_solve
(
- long sys,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long sys,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
double X [ ],
const double B [ ],
double Info [UMFPACK_INFO]
) ;
-long umfpack_zl_solve
+UF_long umfpack_zl_solve
(
- long sys,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long sys,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
double Xx [ ], double Xz [ ],
const double Bx [ ], const double Bz [ ],
double *B, *X, *Ax, Info [UMFPACK_INFO], Control [UMFPACK_CONTROL] ;
status = umfpack_di_solve (sys, Ap, Ai, Ax, X, B, Numeric, Control, Info) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status, *Ap, *Ai, sys ;
+ UF_long status, *Ap, *Ai, sys ;
double *B, *X, *Ax, Info [UMFPACK_INFO], Control [UMFPACK_CONTROL] ;
status = umfpack_dl_solve (sys, Ap, Ai, Ax, X, B, Numeric, Control, Info) ;
status = umfpack_zi_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
Control, Info) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status, *Ap, *Ai, sys ;
+ UF_long status, *Ap, *Ai, sys ;
double *Bx, *Bz, *Xx, *Xz, *Ax, *Az, Info [UMFPACK_INFO],
Control [UMFPACK_CONTROL] ;
status = umfpack_zl_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Info [UMFPACK_INFO]
) ;
-long umfpack_dl_symbolic
+UF_long umfpack_dl_symbolic
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
void **Symbolic,
const double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO]
) ;
-long umfpack_zl_symbolic
+UF_long umfpack_zl_symbolic
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
void **Symbolic,
const double Control [UMFPACK_CONTROL],
status = umfpack_di_symbolic (n_row, n_col, Ap, Ai, Ax,
&Symbolic, Control, Info) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
- long n_row, n_col, *Ap, *Ai, status ;
+ UF_long n_row, n_col, *Ap, *Ai, status ;
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO], *Ax ;
status = umfpack_dl_symbolic (n_row, n_col, Ap, Ai, Ax,
&Symbolic, Control, Info) ;
status = umfpack_zi_symbolic (n_row, n_col, Ap, Ai, Ax, Az,
&Symbolic, Control, Info) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Symbolic ;
- long n_row, n_col, *Ap, *Ai, status ;
+ UF_long n_row, n_col, *Ap, *Ai, status ;
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO], *Ax, *Az ;
status = umfpack_zl_symbolic (n_row, n_col, Ap, Ai, Ax, Az,
&Symbolic, Control, Info) ;
A value less than 1 is treated as 1. Default: 32. Modifying this
parameter affects when updates are applied to the working frontal
matrix, and can indirectly affect fill-in and operation count.
- As long as the block size is large enough (8 or so), this parameter
+ Assuming the block size is large enough (8 or so), this parameter
has a modest effect on performance.
Control [UMFPACK_2BY2_TOLERANCE]: a diagonal entry S (k,k) is
Info [UMFPACK_SIZE_OF_INT]: the number of bytes in an int.
- Info [UMFPACK_SIZE_OF_LONG]: the number of bytes in a long.
+ Info [UMFPACK_SIZE_OF_LONG]: the number of bytes in a UF_long.
Info [UMFPACK_SIZE_OF_POINTER]: the number of bytes in a void *
pointer.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double Rx [ ]
) ;
-long umfpack_dl_transpose
+UF_long umfpack_dl_transpose
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
- const long P [ ],
- const long Q [ ],
- long Rp [ ],
- long Ri [ ],
+ const UF_long P [ ],
+ const UF_long Q [ ],
+ UF_long Rp [ ],
+ UF_long Ri [ ],
double Rx [ ]
) ;
int do_conjugate
) ;
-long umfpack_zl_transpose
+UF_long umfpack_zl_transpose
(
- long n_row,
- long n_col,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long n_row,
+ UF_long n_col,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
- const long P [ ],
- const long Q [ ],
- long Rp [ ],
- long Ri [ ],
+ const UF_long P [ ],
+ const UF_long Q [ ],
+ UF_long Rp [ ],
+ UF_long Ri [ ],
double Rx [ ], double Rz [ ],
- long do_conjugate
+ UF_long do_conjugate
) ;
/*
double *Ax, *Rx ;
status = umfpack_di_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, Rp, Ri, Rx) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, status, *Ap, *Ai, *P, *Q, *Rp, *Ri ;
+ UF_long n_row, n_col, status, *Ap, *Ai, *P, *Q, *Rp, *Ri ;
double *Ax, *Rx ;
status = umfpack_dl_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, Rp, Ri, Rx) ;
status = umfpack_zi_transpose (n_row, n_col, Ap, Ai, Ax, Az, P, Q,
Rp, Ri, Rx, Rz, do_conjugate) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, status, *Ap, *Ai, *P, *Q, *Rp, *Ri, do_conjugate ;
+ UF_long n_row, n_col, status, *Ap, *Ai, *P, *Q, *Rp, *Ri, do_conjugate ;
double *Ax, *Az, *Rx, *Rz ;
status = umfpack_zl_transpose (n_row, n_col, Ap, Ai, Ax, Az, P, Q,
Rp, Ri, Rx, Rz, do_conjugate) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
int Map [ ]
) ;
-long umfpack_dl_triplet_to_col
+UF_long umfpack_dl_triplet_to_col
(
- long n_row,
- long n_col,
- long nz,
- const long Ti [ ],
- const long Tj [ ],
+ UF_long n_row,
+ UF_long n_col,
+ UF_long nz,
+ const UF_long Ti [ ],
+ const UF_long Tj [ ],
const double Tx [ ],
- long Ap [ ],
- long Ai [ ],
+ UF_long Ap [ ],
+ UF_long Ai [ ],
double Ax [ ],
- long Map [ ]
+ UF_long Map [ ]
) ;
int umfpack_zi_triplet_to_col
int Map [ ]
) ;
-long umfpack_zl_triplet_to_col
+UF_long umfpack_zl_triplet_to_col
(
- long n_row,
- long n_col,
- long nz,
- const long Ti [ ],
- const long Tj [ ],
+ UF_long n_row,
+ UF_long n_col,
+ UF_long nz,
+ const UF_long Ti [ ],
+ const UF_long Tj [ ],
const double Tx [ ], const double Tz [ ],
- long Ap [ ],
- long Ai [ ],
+ UF_long Ap [ ],
+ UF_long Ai [ ],
double Ax [ ], double Az [ ],
- long Map [ ]
+ UF_long Map [ ]
) ;
/*
status = umfpack_di_triplet_to_col (n_row, n_col, nz, Ti, Tj, Tx,
Ap, Ai, Ax, Map) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, nz, *Ti, *Tj, *Ap, *Ai, status, *Map ;
+ UF_long n_row, n_col, nz, *Ti, *Tj, *Ap, *Ai, status, *Map ;
double *Tx, *Ax ;
status = umfpack_dl_triplet_to_col (n_row, n_col, nz, Ti, Tj, Tx,
Ap, Ai, Ax, Map) ;
status = umfpack_zi_triplet_to_col (n_row, n_col, nz, Ti, Tj, Tx, Tz,
Ap, Ai, Ax, Az, Map) ;
-long Syntax:
+UF_long Syntax:
#include "umfpack.h"
- long n_row, n_col, nz, *Ti, *Tj, *Ap, *Ai, status, *Map ;
+ UF_long n_row, n_col, nz, *Ti, *Tj, *Ap, *Ai, status, *Map ;
double *Tx, *Tz, *Ax, *Az ;
status = umfpack_zl_triplet_to_col (n_row, n_col, nz, Ti, Tj, Tx, Tz,
Ap, Ai, Ax, Az, Map) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
double W [ ]
) ;
-long umfpack_dl_wsolve
+UF_long umfpack_dl_wsolve
(
- long sys,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long sys,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ],
double X [ ],
const double B [ ],
void *Numeric,
const double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO],
- long Wi [ ],
+ UF_long Wi [ ],
double W [ ]
) ;
double W [ ]
) ;
-long umfpack_zl_wsolve
+UF_long umfpack_zl_wsolve
(
- long sys,
- const long Ap [ ],
- const long Ai [ ],
+ UF_long sys,
+ const UF_long Ap [ ],
+ const UF_long Ai [ ],
const double Ax [ ], const double Az [ ],
double Xx [ ], double Xz [ ],
const double Bx [ ], const double Bz [ ],
void *Numeric,
const double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO],
- long Wi [ ],
+ UF_long Wi [ ],
double W [ ]
) ;
status = umfpack_di_wsolve (sys, Ap, Ai, Ax, X, B, Numeric,
Control, Info, Wi, W) ;
-double long Syntax:
+double UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status, *Ap, *Ai, *Wi, sys ;
+ UF_long status, *Ap, *Ai, *Wi, sys ;
double *B, *X, *Ax, *W, Info [UMFPACK_INFO], Control [UMFPACK_CONTROL] ;
status = umfpack_dl_wsolve (sys, Ap, Ai, Ax, X, B, Numeric,
Control, Info, Wi, W) ;
status = umfpack_zi_wsolve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
Control, Info, Wi, W) ;
-complex long Syntax:
+complex UF_long Syntax:
#include "umfpack.h"
void *Numeric ;
- long status, *Ap, *Ai, *Wi, sys ;
+ UF_long status, *Ap, *Ai, *Wi, sys ;
double *Bx, *Bz, *Xx, *Xz, *Ax, *Az, *W,
Info [UMFPACK_INFO], Control [UMFPACK_CONTROL] ;
status = umfpack_zl_wsolve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
%Contents of the UMFPACK sparse matrix toolbox:
%
-% umfpack computes x=A\b, x=A/b, or lu (A) for a sparse matrix A
-% umfpack_make to compile umfpack for use in MATLAB
-% umfpack_details details on all the options for using umfpack in MATLAB
-% umfpack_report prints optional control settings and statistics
-% umfpack_demo a long demo
-% umfpack_simple a simple demo
-% umfpack_btf factorize A using a block triangular form
-% umfpack_solve x = A\b or x = b/A
-% lu_normest estimates norm (L*U-A, 1) without forming L*U-A
-% luflop given L and U, computes # of flops required to compute them
-% umfpack_test for testing umfpack (requires UFget interface to UF sparse
-% matrix collection)
+% umfpack2 - computes x=A\b, x=A/b, or lu (A) for a sparse matrix A
+% umfpack_make - to compile umfpack2 for use in MATLAB
+% umfpack_install - to compile and install umfpack2 and amd2 for use in MATLAB
+% umfpack_details - details on all the options for using umfpack2 in MATLAB
+% umfpack_report - prints optional control settings and statistics
+% umfpack_demo - a lenghty demo
+% umfpack_simple - a simple demo
+% umfpack_btf - factorize A using a block triangular form
+% umfpack_solve - x = A\b or x = b/A
+% lu_normest - estimates norm (L*U-A, 1) without forming L*U-A
+% luflop - given L and U, computes # of flops required to compute them
+% umfpack_test - for testing umfpack2 (requires UFget)
%
-% See also:
-% amd symmetric minimum degree ordering
+% Example:
+% x = umfpack2 (A, '\', b) ; % same as x = A\b, if A square and unsymmetric
+%
+% See also these built-in functions:
+% umfpack the built-in version of UMFPACK
+% amd symmetric minimum degree ordering
% colamd unsymmetric column approx minimum degree ordering
% symamd symmetric approx minimum degree ordering, based on colamd
%
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% NOTE: UMFPACK is a built-in function in MATLAB, used in x=A\b. This is the
+% source code for the built-in umfpack, but the MATLAB function has been renamed
+% here to umfpack2, to avoid a filename clash with itself.
+%
+% Copyright 1995-2007 by Timothy A. Davis.
% All Rights Reserved. Type umfpack_details for License.
help Contents
# UMFPACK GNUmakefile for the UMFPACK MATLAB mexFunction (GNU "make" only)
#-------------------------------------------------------------------------------
-all: umfpack luflop
+default: umfpack2 luflop
-include ../Make/Make.include
+include ../../UFconfig/UFconfig.mk
-MX = $(MEX) -I../Include -I../Source -I../../AMD/Include -I../../AMD/Source
+I = -I../Include -I../Source -I../../AMD/Include -I../../UFconfig
+
+MX = $(MEX) $(I)
+
#-------------------------------------------------------------------------------
# source files
umf_valid_symbolic umf_grow_front umf_start_front umf_2by2 \
umf_store_lu umf_scale
-# non-user-callable umf_*.[ch] files, int/long versions only (no real/complex):
+# non-user-callable umf_*.[ch] files, int/UF_long versions only (no real/complex):
UMFINT = umf_analyze umf_apply_order umf_colamd umf_free umf_fsize \
umf_is_permutation umf_malloc umf_realloc umf_report_perm \
umf_singletons
-# non-user-callable and user-callable amd_*.[ch] files (int/long versions only):
+# non-user-callable and user-callable amd_*.[ch] files (int/UF_long versions only):
AMD = amd_aat amd_1 amd_2 amd_dump amd_postorder amd_post_tree amd_defaults \
- amd_order amd_control amd_info amd_valid amd_preprocess
+ amd_order amd_control amd_info amd_valid amd_preprocess amd_global
# non-user-callable, created from umf_ltsolve.c, umf_utsolve.c,
-# umf_triplet.c, and umf_assemble.c , with int/long and real/complex versions:
+# umf_triplet.c, and umf_assemble.c , with int/UF_long and real/complex versions:
UMF_CREATED = umf_lhsolve umf_uhsolve umf_triplet_map_nox \
umf_triplet_nomap_x umf_triplet_nomap_nox umf_triplet_map_x \
umf_assemble_fixq umf_store_lu_drop
-# non-user-callable, int/long and real/complex versions:
+# non-user-callable, int/UF_long and real/complex versions:
UMF = $(UMF_CREATED) $(UMFCH)
-# user-callable umfpack_*.[ch] files (int/long and real/complex):
+# user-callable umfpack_*.[ch] files (int/UF_long and real/complex):
UMFPACK = umfpack_col_to_triplet umfpack_defaults umfpack_free_numeric \
umfpack_free_symbolic umfpack_get_numeric umfpack_get_lunz \
umfpack_get_symbolic umfpack_get_determinant umfpack_numeric \
umfpack_load_symbolic umfpack_save_symbolic
# user-callable, created from umfpack_solve.c (umfpack_wsolve.h exists, though):
-# with int/long and real/complex versions:
+# with int/UF_long and real/complex versions:
UMFPACKW = umfpack_wsolve
USER = $(UMFPACKW) $(UMFPACK)
-# user-callable, only one version for int/long, real/complex, *.[ch] files:
-GENERIC = umfpack_timer umfpack_tictoc
+# user-callable, only one version for int/UF_long, real/complex, *.[ch] files:
+GENERIC = umfpack_timer umfpack_tictoc umfpack_global
#-------------------------------------------------------------------------------
# include files:
#-------------------------------------------------------------------------------
-AMDH = ../../AMD/Source/amd_internal.h ../../AMD/Include/amd.h
+AMDH = ../../AMD/Include/amd_internal.h ../../AMD/Include/amd.h \
+ ../../UFconfig/UFconfig.h
INC1 = umf_config.h umf_version.h umf_internal.h umf_triplet.h
# Note that mex has no "-o" option, thus the need for $(MV) commands.
# If it did, then the rules would be much simpler:
-# $(MX) -DDINT -c $< -o $@
+# $(MX) -DDLONG -c $< -o $@
#----------------------------------------
# integer-only routines (no real/complex):
#----------------------------------------
amd_m_%.o: ../../AMD/Source/amd_%.c $(AMDH)
- $(MX) -DDINT -c $<
+ $(MX) -DDLONG -c $<
- $(MV) amd_$*.o $@
umf_m_%.o: ../Source/umf_%.c $(INC)
- $(MX) -DDINT -c $<
+ $(MX) -DDLONG -c $<
- $(MV) umf_$*.o $@
#----------------------------------------
#----------------------------------------
umf_md_%.o: ../Source/umf_%.c $(INC)
- $(MX) -DDINT -c $<
+ $(MX) -DDLONG -c $<
- $(MV) umf_$*.o $@
umf_md_%hsolve.o: ../Source/umf_%tsolve.c $(INC)
- $(MX) -DDINT -DCONJUGATE_SOLVE -c $<
+ $(MX) -DDLONG -DCONJUGATE_SOLVE -c $<
- $(MV) umf_$*tsolve.o $@
umf_md_triplet_map_x.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DDINT -DDO_MAP -DDO_VALUES -c $<
+ $(MX) -DDLONG -DDO_MAP -DDO_VALUES -c $<
- $(MV) umf_triplet.o $@
umf_md_triplet_map_nox.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DDINT -DDO_MAP -c $<
+ $(MX) -DDLONG -DDO_MAP -c $<
- $(MV) umf_triplet.o $@
umf_md_triplet_nomap_x.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DDINT -DDO_VALUES -c $<
+ $(MX) -DDLONG -DDO_VALUES -c $<
- $(MV) umf_triplet.o $@
umf_md_triplet_nomap_nox.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DDINT -c $<
+ $(MX) -DDLONG -c $<
- $(MV) umf_triplet.o $@
umf_md_assemble_fixq.o: ../Source/umf_assemble.c $(INC)
- $(MX) -DDINT -DFIXQ -c $<
+ $(MX) -DDLONG -DFIXQ -c $<
- $(MV) umf_assemble.o $@
umf_md_store_lu_drop.o: ../Source/umf_store_lu.c $(INC)
- $(MX) -DDINT -DDROP -c $<
+ $(MX) -DDLONG -DDROP -c $<
- $(MV) umf_store_lu.o $@
umfpack_md_wsolve.o: ../Source/umfpack_solve.c $(INC)
- $(MX) -DDINT -DWSOLVE -c $<
+ $(MX) -DDLONG -DWSOLVE -c $<
- $(MV) umfpack_solve.o $@
umfpack_md_%.o: ../Source/umfpack_%.c $(INC)
- $(MX) -DDINT -c $<
+ $(MX) -DDLONG -c $<
- $(MV) umfpack_$*.o $@
#----------------------------------------
#----------------------------------------
umf_mz_%.o: ../Source/umf_%.c $(INC)
- $(MX) -DZINT -c $<
+ $(MX) -DZLONG -c $<
- $(MV) umf_$*.o $@
umf_mz_%hsolve.o: ../Source/umf_%tsolve.c $(INC)
- $(MX) -DZINT -DCONJUGATE_SOLVE -c $<
+ $(MX) -DZLONG -DCONJUGATE_SOLVE -c $<
- $(MV) umf_$*tsolve.o $@
umf_mz_triplet_map_x.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DZINT -DDO_MAP -DDO_VALUES -c $<
+ $(MX) -DZLONG -DDO_MAP -DDO_VALUES -c $<
- $(MV) umf_triplet.o $@
umf_mz_triplet_map_nox.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DZINT -DDO_MAP -c $<
+ $(MX) -DZLONG -DDO_MAP -c $<
- $(MV) umf_triplet.o $@
umf_mz_triplet_nomap_x.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DZINT -DDO_VALUES -c $<
+ $(MX) -DZLONG -DDO_VALUES -c $<
- $(MV) umf_triplet.o $@
umf_mz_triplet_nomap_nox.o: ../Source/umf_triplet.c $(INC)
- $(MX) -DZINT -c $<
+ $(MX) -DZLONG -c $<
- $(MV) umf_triplet.o $@
umf_mz_assemble_fixq.o: ../Source/umf_assemble.c $(INC)
- $(MX) -DZINT -DFIXQ -c $<
+ $(MX) -DZLONG -DFIXQ -c $<
- $(MV) umf_assemble.o $@
umf_mz_store_lu_drop.o: ../Source/umf_store_lu.c $(INC)
- $(MX) -DZINT -DDROP -c $<
+ $(MX) -DZLONG -DDROP -c $<
- $(MV) umf_store_lu.o $@
umfpack_mz_wsolve.o: ../Source/umfpack_solve.c $(INC)
- $(MX) -DZINT -DWSOLVE -c $<
+ $(MX) -DZLONG -DWSOLVE -c $<
- $(MV) umfpack_solve.o $@
umfpack_mz_%.o: ../Source/umfpack_%.c $(INC)
- $(MX) -DZINT -c $<
+ $(MX) -DZLONG -c $<
- $(MV) umfpack_$*.o $@
#----------------------------------------
$(MX) -c $<
- $(MV) umfpack_tictoc.o $@
+umfpack_m_global.o: ../Source/umfpack_global.c $(INC)
+ $(MX) -c $<
+ - $(MV) umfpack_global.o $@
+
#----------------------------------------
# umfpack mexFunction
#----------------------------------------
-umfpack: umfpackmex.c $(MEXUMFPACK) $(MEXAMD)
- $(MX) -output umfpack umfpackmex.c $(MEXUMFPACK) $(MEXAMD)
+umfpack2: umfpackmex.c $(MEXUMFPACK) $(MEXAMD)
+ $(MX) -output umfpack2 umfpackmex.c $(MEXUMFPACK) $(MEXAMD)
luflop: luflopmex.c
$(MX) -output luflop luflopmex.c
#-------------------------------------------------------------------------------
purge: clean
- - $(RM) *.mex* *.dll
+ - $(RM) *.mex*
+
+clean:
+ - $(RM) $(CLEAN)
# This is a very ugly Makefile, and is only provided for those who do not
# have GNU make. Note that it is not used if you have GNU make. It ignores
-# dependency checking and just compiles everything. It was created
-# automatically, via make -n using the GNUmakefile. That way, I don't have
-# maintain two Makefiles.
+# dependency checking and just compiles everything.
-all: umfpack luflop
+default: umfpack luflop
-include ../Make/Make.include
+include ../../UFconfig/UFconfig.mk
-MX = $(MEX) -I../Include -I../Source -I../../AMD/Include -I../../AMD/Source
+MX = $(MEX) -I../Include -I../Source -I../../AMD/Include -I../../UFconfig
umfpack:
- $(MX) -DDINT -c ../Source/umf_analyze.c
+ $(MX) -c ../Source/umfpack_global.c
+ $(MV) -f umfpack_global.o umfpack_m_global.o
+ $(MX) -DDLONG -c ../Source/umf_analyze.c
$(MV) -f umf_analyze.o umf_m_analyze.o
- $(MX) -DDINT -c ../Source/umf_apply_order.c
+ $(MX) -DDLONG -c ../Source/umf_apply_order.c
$(MV) -f umf_apply_order.o umf_m_apply_order.o
- $(MX) -DDINT -c ../Source/umf_colamd.c
+ $(MX) -DDLONG -c ../Source/umf_colamd.c
$(MV) -f umf_colamd.o umf_m_colamd.o
- $(MX) -DDINT -c ../Source/umf_free.c
+ $(MX) -DDLONG -c ../Source/umf_free.c
$(MV) -f umf_free.o umf_m_free.o
- $(MX) -DDINT -c ../Source/umf_fsize.c
+ $(MX) -DDLONG -c ../Source/umf_fsize.c
$(MV) -f umf_fsize.o umf_m_fsize.o
- $(MX) -DDINT -c ../Source/umf_is_permutation.c
+ $(MX) -DDLONG -c ../Source/umf_is_permutation.c
$(MV) -f umf_is_permutation.o umf_m_is_permutation.o
- $(MX) -DDINT -c ../Source/umf_malloc.c
+ $(MX) -DDLONG -c ../Source/umf_malloc.c
$(MV) -f umf_malloc.o umf_m_malloc.o
- $(MX) -DDINT -c ../Source/umf_realloc.c
+ $(MX) -DDLONG -c ../Source/umf_realloc.c
$(MV) -f umf_realloc.o umf_m_realloc.o
- $(MX) -DDINT -c ../Source/umf_report_perm.c
+ $(MX) -DDLONG -c ../Source/umf_report_perm.c
$(MV) -f umf_report_perm.o umf_m_report_perm.o
- $(MX) -DDINT -c ../Source/umf_singletons.c
+ $(MX) -DDLONG -c ../Source/umf_singletons.c
$(MV) -f umf_singletons.o umf_m_singletons.o
- $(MX) -DDINT -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c
+ $(MX) -DDLONG -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c
$(MV) -f umf_ltsolve.o umf_md_lhsolve.o
- $(MX) -DDINT -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c
+ $(MX) -DDLONG -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c
$(MV) -f umf_utsolve.o umf_md_uhsolve.o
- $(MX) -DDINT -DDO_MAP -c ../Source/umf_triplet.c
+ $(MX) -DDLONG -DDO_MAP -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_md_triplet_map_nox.o
- $(MX) -DDINT -DDO_VALUES -c ../Source/umf_triplet.c
+ $(MX) -DDLONG -DDO_VALUES -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_md_triplet_nomap_x.o
- $(MX) -DDINT -c ../Source/umf_triplet.c
+ $(MX) -DDLONG -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_md_triplet_nomap_nox.o
- $(MX) -DDINT -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c
+ $(MX) -DDLONG -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_md_triplet_map_x.o
- $(MX) -DDINT -DFIXQ -c ../Source/umf_assemble.c
+ $(MX) -DDLONG -DFIXQ -c ../Source/umf_assemble.c
$(MV) -f umf_assemble.o umf_md_assemble_fixq.o
- $(MX) -DDINT -DDROP -c ../Source/umf_store_lu.c
+ $(MX) -DDLONG -DDROP -c ../Source/umf_store_lu.c
$(MV) -f umf_store_lu.o umf_md_store_lu_drop.o
- $(MX) -DDINT -c ../Source/umf_assemble.c
+ $(MX) -DDLONG -c ../Source/umf_assemble.c
$(MV) -f umf_assemble.o umf_md_assemble.o
- $(MX) -DDINT -c ../Source/umf_blas3_update.c
+ $(MX) -DDLONG -c ../Source/umf_blas3_update.c
$(MV) -f umf_blas3_update.o umf_md_blas3_update.o
- $(MX) -DDINT -c ../Source/umf_build_tuples.c
+ $(MX) -DDLONG -c ../Source/umf_build_tuples.c
$(MV) -f umf_build_tuples.o umf_md_build_tuples.o
- $(MX) -DDINT -c ../Source/umf_create_element.c
+ $(MX) -DDLONG -c ../Source/umf_create_element.c
$(MV) -f umf_create_element.o umf_md_create_element.o
- $(MX) -DDINT -c ../Source/umf_dump.c
+ $(MX) -DDLONG -c ../Source/umf_dump.c
$(MV) -f umf_dump.o umf_md_dump.o
- $(MX) -DDINT -c ../Source/umf_extend_front.c
+ $(MX) -DDLONG -c ../Source/umf_extend_front.c
$(MV) -f umf_extend_front.o umf_md_extend_front.o
- $(MX) -DDINT -c ../Source/umf_garbage_collection.c
+ $(MX) -DDLONG -c ../Source/umf_garbage_collection.c
$(MV) -f umf_garbage_collection.o umf_md_garbage_collection.o
- $(MX) -DDINT -c ../Source/umf_get_memory.c
+ $(MX) -DDLONG -c ../Source/umf_get_memory.c
$(MV) -f umf_get_memory.o umf_md_get_memory.o
- $(MX) -DDINT -c ../Source/umf_init_front.c
+ $(MX) -DDLONG -c ../Source/umf_init_front.c
$(MV) -f umf_init_front.o umf_md_init_front.o
- $(MX) -DDINT -c ../Source/umf_kernel.c
+ $(MX) -DDLONG -c ../Source/umf_kernel.c
$(MV) -f umf_kernel.o umf_md_kernel.o
- $(MX) -DDINT -c ../Source/umf_kernel_init.c
+ $(MX) -DDLONG -c ../Source/umf_kernel_init.c
$(MV) -f umf_kernel_init.o umf_md_kernel_init.o
- $(MX) -DDINT -c ../Source/umf_kernel_wrapup.c
+ $(MX) -DDLONG -c ../Source/umf_kernel_wrapup.c
$(MV) -f umf_kernel_wrapup.o umf_md_kernel_wrapup.o
- $(MX) -DDINT -c ../Source/umf_local_search.c
+ $(MX) -DDLONG -c ../Source/umf_local_search.c
$(MV) -f umf_local_search.o umf_md_local_search.o
- $(MX) -DDINT -c ../Source/umf_lsolve.c
+ $(MX) -DDLONG -c ../Source/umf_lsolve.c
$(MV) -f umf_lsolve.o umf_md_lsolve.o
- $(MX) -DDINT -c ../Source/umf_ltsolve.c
+ $(MX) -DDLONG -c ../Source/umf_ltsolve.c
$(MV) -f umf_ltsolve.o umf_md_ltsolve.o
- $(MX) -DDINT -c ../Source/umf_mem_alloc_element.c
+ $(MX) -DDLONG -c ../Source/umf_mem_alloc_element.c
$(MV) -f umf_mem_alloc_element.o umf_md_mem_alloc_element.o
- $(MX) -DDINT -c ../Source/umf_mem_alloc_head_block.c
+ $(MX) -DDLONG -c ../Source/umf_mem_alloc_head_block.c
$(MV) -f umf_mem_alloc_head_block.o umf_md_mem_alloc_head_block.o
- $(MX) -DDINT -c ../Source/umf_mem_alloc_tail_block.c
+ $(MX) -DDLONG -c ../Source/umf_mem_alloc_tail_block.c
$(MV) -f umf_mem_alloc_tail_block.o umf_md_mem_alloc_tail_block.o
- $(MX) -DDINT -c ../Source/umf_mem_free_tail_block.c
+ $(MX) -DDLONG -c ../Source/umf_mem_free_tail_block.c
$(MV) -f umf_mem_free_tail_block.o umf_md_mem_free_tail_block.o
- $(MX) -DDINT -c ../Source/umf_mem_init_memoryspace.c
+ $(MX) -DDLONG -c ../Source/umf_mem_init_memoryspace.c
$(MV) -f umf_mem_init_memoryspace.o umf_md_mem_init_memoryspace.o
- $(MX) -DDINT -c ../Source/umf_report_vector.c
+ $(MX) -DDLONG -c ../Source/umf_report_vector.c
$(MV) -f umf_report_vector.o umf_md_report_vector.o
- $(MX) -DDINT -c ../Source/umf_row_search.c
+ $(MX) -DDLONG -c ../Source/umf_row_search.c
$(MV) -f umf_row_search.o umf_md_row_search.o
- $(MX) -DDINT -c ../Source/umf_scale_column.c
+ $(MX) -DDLONG -c ../Source/umf_scale_column.c
$(MV) -f umf_scale_column.o umf_md_scale_column.o
- $(MX) -DDINT -c ../Source/umf_set_stats.c
+ $(MX) -DDLONG -c ../Source/umf_set_stats.c
$(MV) -f umf_set_stats.o umf_md_set_stats.o
- $(MX) -DDINT -c ../Source/umf_solve.c
+ $(MX) -DDLONG -c ../Source/umf_solve.c
$(MV) -f umf_solve.o umf_md_solve.o
- $(MX) -DDINT -c ../Source/umf_symbolic_usage.c
+ $(MX) -DDLONG -c ../Source/umf_symbolic_usage.c
$(MV) -f umf_symbolic_usage.o umf_md_symbolic_usage.o
- $(MX) -DDINT -c ../Source/umf_transpose.c
+ $(MX) -DDLONG -c ../Source/umf_transpose.c
$(MV) -f umf_transpose.o umf_md_transpose.o
- $(MX) -DDINT -c ../Source/umf_tuple_lengths.c
+ $(MX) -DDLONG -c ../Source/umf_tuple_lengths.c
$(MV) -f umf_tuple_lengths.o umf_md_tuple_lengths.o
- $(MX) -DDINT -c ../Source/umf_usolve.c
+ $(MX) -DDLONG -c ../Source/umf_usolve.c
$(MV) -f umf_usolve.o umf_md_usolve.o
- $(MX) -DDINT -c ../Source/umf_utsolve.c
+ $(MX) -DDLONG -c ../Source/umf_utsolve.c
$(MV) -f umf_utsolve.o umf_md_utsolve.o
- $(MX) -DDINT -c ../Source/umf_valid_numeric.c
+ $(MX) -DDLONG -c ../Source/umf_valid_numeric.c
$(MV) -f umf_valid_numeric.o umf_md_valid_numeric.o
- $(MX) -DDINT -c ../Source/umf_valid_symbolic.c
+ $(MX) -DDLONG -c ../Source/umf_valid_symbolic.c
$(MV) -f umf_valid_symbolic.o umf_md_valid_symbolic.o
- $(MX) -DDINT -c ../Source/umf_grow_front.c
+ $(MX) -DDLONG -c ../Source/umf_grow_front.c
$(MV) -f umf_grow_front.o umf_md_grow_front.o
- $(MX) -DDINT -c ../Source/umf_start_front.c
+ $(MX) -DDLONG -c ../Source/umf_start_front.c
$(MV) -f umf_start_front.o umf_md_start_front.o
- $(MX) -DDINT -c ../Source/umf_2by2.c
+ $(MX) -DDLONG -c ../Source/umf_2by2.c
$(MV) -f umf_2by2.o umf_md_2by2.o
- $(MX) -DDINT -c ../Source/umf_store_lu.c
+ $(MX) -DDLONG -c ../Source/umf_store_lu.c
$(MV) -f umf_store_lu.o umf_md_store_lu.o
- $(MX) -DDINT -c ../Source/umf_scale.c
+ $(MX) -DDLONG -c ../Source/umf_scale.c
$(MV) -f umf_scale.o umf_md_scale.o
- $(MX) -DDINT -DWSOLVE -c ../Source/umfpack_solve.c
+ $(MX) -DDLONG -DWSOLVE -c ../Source/umfpack_solve.c
$(MV) -f umfpack_solve.o umfpack_md_wsolve.o
- $(MX) -DDINT -c ../Source/umfpack_col_to_triplet.c
+ $(MX) -DDLONG -c ../Source/umfpack_col_to_triplet.c
$(MV) -f umfpack_col_to_triplet.o umfpack_md_col_to_triplet.o
- $(MX) -DDINT -c ../Source/umfpack_defaults.c
+ $(MX) -DDLONG -c ../Source/umfpack_defaults.c
$(MV) -f umfpack_defaults.o umfpack_md_defaults.o
- $(MX) -DDINT -c ../Source/umfpack_free_numeric.c
+ $(MX) -DDLONG -c ../Source/umfpack_free_numeric.c
$(MV) -f umfpack_free_numeric.o umfpack_md_free_numeric.o
- $(MX) -DDINT -c ../Source/umfpack_free_symbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_free_symbolic.c
$(MV) -f umfpack_free_symbolic.o umfpack_md_free_symbolic.o
- $(MX) -DDINT -c ../Source/umfpack_get_numeric.c
+ $(MX) -DDLONG -c ../Source/umfpack_get_numeric.c
$(MV) -f umfpack_get_numeric.o umfpack_md_get_numeric.o
- $(MX) -DDINT -c ../Source/umfpack_get_lunz.c
+ $(MX) -DDLONG -c ../Source/umfpack_get_lunz.c
$(MV) -f umfpack_get_lunz.o umfpack_md_get_lunz.o
- $(MX) -DDINT -c ../Source/umfpack_get_symbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_get_symbolic.c
$(MV) -f umfpack_get_symbolic.o umfpack_md_get_symbolic.o
- $(MX) -DDINT -c ../Source/umfpack_get_determinant.c
+ $(MX) -DDLONG -c ../Source/umfpack_get_determinant.c
$(MV) -f umfpack_get_determinant.o umfpack_md_get_determinant.o
- $(MX) -DDINT -c ../Source/umfpack_numeric.c
+ $(MX) -DDLONG -c ../Source/umfpack_numeric.c
$(MV) -f umfpack_numeric.o umfpack_md_numeric.o
- $(MX) -DDINT -c ../Source/umfpack_qsymbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_qsymbolic.c
$(MV) -f umfpack_qsymbolic.o umfpack_md_qsymbolic.o
- $(MX) -DDINT -c ../Source/umfpack_report_control.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_control.c
$(MV) -f umfpack_report_control.o umfpack_md_report_control.o
- $(MX) -DDINT -c ../Source/umfpack_report_info.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_info.c
$(MV) -f umfpack_report_info.o umfpack_md_report_info.o
- $(MX) -DDINT -c ../Source/umfpack_report_matrix.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_matrix.c
$(MV) -f umfpack_report_matrix.o umfpack_md_report_matrix.o
- $(MX) -DDINT -c ../Source/umfpack_report_numeric.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_numeric.c
$(MV) -f umfpack_report_numeric.o umfpack_md_report_numeric.o
- $(MX) -DDINT -c ../Source/umfpack_report_perm.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_perm.c
$(MV) -f umfpack_report_perm.o umfpack_md_report_perm.o
- $(MX) -DDINT -c ../Source/umfpack_report_status.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_status.c
$(MV) -f umfpack_report_status.o umfpack_md_report_status.o
- $(MX) -DDINT -c ../Source/umfpack_report_symbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_symbolic.c
$(MV) -f umfpack_report_symbolic.o umfpack_md_report_symbolic.o
- $(MX) -DDINT -c ../Source/umfpack_report_triplet.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_triplet.c
$(MV) -f umfpack_report_triplet.o umfpack_md_report_triplet.o
- $(MX) -DDINT -c ../Source/umfpack_report_vector.c
+ $(MX) -DDLONG -c ../Source/umfpack_report_vector.c
$(MV) -f umfpack_report_vector.o umfpack_md_report_vector.o
- $(MX) -DDINT -c ../Source/umfpack_solve.c
+ $(MX) -DDLONG -c ../Source/umfpack_solve.c
$(MV) -f umfpack_solve.o umfpack_md_solve.o
- $(MX) -DDINT -c ../Source/umfpack_symbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_symbolic.c
$(MV) -f umfpack_symbolic.o umfpack_md_symbolic.o
- $(MX) -DDINT -c ../Source/umfpack_transpose.c
+ $(MX) -DDLONG -c ../Source/umfpack_transpose.c
$(MV) -f umfpack_transpose.o umfpack_md_transpose.o
- $(MX) -DDINT -c ../Source/umfpack_triplet_to_col.c
+ $(MX) -DDLONG -c ../Source/umfpack_triplet_to_col.c
$(MV) -f umfpack_triplet_to_col.o umfpack_md_triplet_to_col.o
- $(MX) -DDINT -c ../Source/umfpack_scale.c
+ $(MX) -DDLONG -c ../Source/umfpack_scale.c
$(MV) -f umfpack_scale.o umfpack_md_scale.o
- $(MX) -DDINT -c ../Source/umfpack_load_numeric.c
+ $(MX) -DDLONG -c ../Source/umfpack_load_numeric.c
$(MV) -f umfpack_load_numeric.o umfpack_md_load_numeric.o
- $(MX) -DDINT -c ../Source/umfpack_save_numeric.c
+ $(MX) -DDLONG -c ../Source/umfpack_save_numeric.c
$(MV) -f umfpack_save_numeric.o umfpack_md_save_numeric.o
- $(MX) -DDINT -c ../Source/umfpack_load_symbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_load_symbolic.c
$(MV) -f umfpack_load_symbolic.o umfpack_md_load_symbolic.o
- $(MX) -DDINT -c ../Source/umfpack_save_symbolic.c
+ $(MX) -DDLONG -c ../Source/umfpack_save_symbolic.c
$(MV) -f umfpack_save_symbolic.o umfpack_md_save_symbolic.o
- $(MX) -DZINT -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c
+ $(MX) -DZLONG -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c
$(MV) -f umf_ltsolve.o umf_mz_lhsolve.o
- $(MX) -DZINT -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c
+ $(MX) -DZLONG -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c
$(MV) -f umf_utsolve.o umf_mz_uhsolve.o
- $(MX) -DZINT -DDO_MAP -c ../Source/umf_triplet.c
+ $(MX) -DZLONG -DDO_MAP -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_mz_triplet_map_nox.o
- $(MX) -DZINT -DDO_VALUES -c ../Source/umf_triplet.c
+ $(MX) -DZLONG -DDO_VALUES -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_mz_triplet_nomap_x.o
- $(MX) -DZINT -c ../Source/umf_triplet.c
+ $(MX) -DZLONG -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_mz_triplet_nomap_nox.o
- $(MX) -DZINT -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c
+ $(MX) -DZLONG -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c
$(MV) -f umf_triplet.o umf_mz_triplet_map_x.o
- $(MX) -DZINT -DFIXQ -c ../Source/umf_assemble.c
+ $(MX) -DZLONG -DFIXQ -c ../Source/umf_assemble.c
$(MV) -f umf_assemble.o umf_mz_assemble_fixq.o
- $(MX) -DZINT -DDROP -c ../Source/umf_store_lu.c
+ $(MX) -DZLONG -DDROP -c ../Source/umf_store_lu.c
$(MV) -f umf_store_lu.o umf_mz_store_lu_drop.o
- $(MX) -DZINT -c ../Source/umf_assemble.c
+ $(MX) -DZLONG -c ../Source/umf_assemble.c
$(MV) -f umf_assemble.o umf_mz_assemble.o
- $(MX) -DZINT -c ../Source/umf_blas3_update.c
+ $(MX) -DZLONG -c ../Source/umf_blas3_update.c
$(MV) -f umf_blas3_update.o umf_mz_blas3_update.o
- $(MX) -DZINT -c ../Source/umf_build_tuples.c
+ $(MX) -DZLONG -c ../Source/umf_build_tuples.c
$(MV) -f umf_build_tuples.o umf_mz_build_tuples.o
- $(MX) -DZINT -c ../Source/umf_create_element.c
+ $(MX) -DZLONG -c ../Source/umf_create_element.c
$(MV) -f umf_create_element.o umf_mz_create_element.o
- $(MX) -DZINT -c ../Source/umf_dump.c
+ $(MX) -DZLONG -c ../Source/umf_dump.c
$(MV) -f umf_dump.o umf_mz_dump.o
- $(MX) -DZINT -c ../Source/umf_extend_front.c
+ $(MX) -DZLONG -c ../Source/umf_extend_front.c
$(MV) -f umf_extend_front.o umf_mz_extend_front.o
- $(MX) -DZINT -c ../Source/umf_garbage_collection.c
+ $(MX) -DZLONG -c ../Source/umf_garbage_collection.c
$(MV) -f umf_garbage_collection.o umf_mz_garbage_collection.o
- $(MX) -DZINT -c ../Source/umf_get_memory.c
+ $(MX) -DZLONG -c ../Source/umf_get_memory.c
$(MV) -f umf_get_memory.o umf_mz_get_memory.o
- $(MX) -DZINT -c ../Source/umf_init_front.c
+ $(MX) -DZLONG -c ../Source/umf_init_front.c
$(MV) -f umf_init_front.o umf_mz_init_front.o
- $(MX) -DZINT -c ../Source/umf_kernel.c
+ $(MX) -DZLONG -c ../Source/umf_kernel.c
$(MV) -f umf_kernel.o umf_mz_kernel.o
- $(MX) -DZINT -c ../Source/umf_kernel_init.c
+ $(MX) -DZLONG -c ../Source/umf_kernel_init.c
$(MV) -f umf_kernel_init.o umf_mz_kernel_init.o
- $(MX) -DZINT -c ../Source/umf_kernel_wrapup.c
+ $(MX) -DZLONG -c ../Source/umf_kernel_wrapup.c
$(MV) -f umf_kernel_wrapup.o umf_mz_kernel_wrapup.o
- $(MX) -DZINT -c ../Source/umf_local_search.c
+ $(MX) -DZLONG -c ../Source/umf_local_search.c
$(MV) -f umf_local_search.o umf_mz_local_search.o
- $(MX) -DZINT -c ../Source/umf_lsolve.c
+ $(MX) -DZLONG -c ../Source/umf_lsolve.c
$(MV) -f umf_lsolve.o umf_mz_lsolve.o
- $(MX) -DZINT -c ../Source/umf_ltsolve.c
+ $(MX) -DZLONG -c ../Source/umf_ltsolve.c
$(MV) -f umf_ltsolve.o umf_mz_ltsolve.o
- $(MX) -DZINT -c ../Source/umf_mem_alloc_element.c
+ $(MX) -DZLONG -c ../Source/umf_mem_alloc_element.c
$(MV) -f umf_mem_alloc_element.o umf_mz_mem_alloc_element.o
- $(MX) -DZINT -c ../Source/umf_mem_alloc_head_block.c
+ $(MX) -DZLONG -c ../Source/umf_mem_alloc_head_block.c
$(MV) -f umf_mem_alloc_head_block.o umf_mz_mem_alloc_head_block.o
- $(MX) -DZINT -c ../Source/umf_mem_alloc_tail_block.c
+ $(MX) -DZLONG -c ../Source/umf_mem_alloc_tail_block.c
$(MV) -f umf_mem_alloc_tail_block.o umf_mz_mem_alloc_tail_block.o
- $(MX) -DZINT -c ../Source/umf_mem_free_tail_block.c
+ $(MX) -DZLONG -c ../Source/umf_mem_free_tail_block.c
$(MV) -f umf_mem_free_tail_block.o umf_mz_mem_free_tail_block.o
- $(MX) -DZINT -c ../Source/umf_mem_init_memoryspace.c
+ $(MX) -DZLONG -c ../Source/umf_mem_init_memoryspace.c
$(MV) -f umf_mem_init_memoryspace.o umf_mz_mem_init_memoryspace.o
- $(MX) -DZINT -c ../Source/umf_report_vector.c
+ $(MX) -DZLONG -c ../Source/umf_report_vector.c
$(MV) -f umf_report_vector.o umf_mz_report_vector.o
- $(MX) -DZINT -c ../Source/umf_row_search.c
+ $(MX) -DZLONG -c ../Source/umf_row_search.c
$(MV) -f umf_row_search.o umf_mz_row_search.o
- $(MX) -DZINT -c ../Source/umf_scale_column.c
+ $(MX) -DZLONG -c ../Source/umf_scale_column.c
$(MV) -f umf_scale_column.o umf_mz_scale_column.o
- $(MX) -DZINT -c ../Source/umf_set_stats.c
+ $(MX) -DZLONG -c ../Source/umf_set_stats.c
$(MV) -f umf_set_stats.o umf_mz_set_stats.o
- $(MX) -DZINT -c ../Source/umf_solve.c
+ $(MX) -DZLONG -c ../Source/umf_solve.c
$(MV) -f umf_solve.o umf_mz_solve.o
- $(MX) -DZINT -c ../Source/umf_symbolic_usage.c
+ $(MX) -DZLONG -c ../Source/umf_symbolic_usage.c
$(MV) -f umf_symbolic_usage.o umf_mz_symbolic_usage.o
- $(MX) -DZINT -c ../Source/umf_transpose.c
+ $(MX) -DZLONG -c ../Source/umf_transpose.c
$(MV) -f umf_transpose.o umf_mz_transpose.o
- $(MX) -DZINT -c ../Source/umf_tuple_lengths.c
+ $(MX) -DZLONG -c ../Source/umf_tuple_lengths.c
$(MV) -f umf_tuple_lengths.o umf_mz_tuple_lengths.o
- $(MX) -DZINT -c ../Source/umf_usolve.c
+ $(MX) -DZLONG -c ../Source/umf_usolve.c
$(MV) -f umf_usolve.o umf_mz_usolve.o
- $(MX) -DZINT -c ../Source/umf_utsolve.c
+ $(MX) -DZLONG -c ../Source/umf_utsolve.c
$(MV) -f umf_utsolve.o umf_mz_utsolve.o
- $(MX) -DZINT -c ../Source/umf_valid_numeric.c
+ $(MX) -DZLONG -c ../Source/umf_valid_numeric.c
$(MV) -f umf_valid_numeric.o umf_mz_valid_numeric.o
- $(MX) -DZINT -c ../Source/umf_valid_symbolic.c
+ $(MX) -DZLONG -c ../Source/umf_valid_symbolic.c
$(MV) -f umf_valid_symbolic.o umf_mz_valid_symbolic.o
- $(MX) -DZINT -c ../Source/umf_grow_front.c
+ $(MX) -DZLONG -c ../Source/umf_grow_front.c
$(MV) -f umf_grow_front.o umf_mz_grow_front.o
- $(MX) -DZINT -c ../Source/umf_start_front.c
+ $(MX) -DZLONG -c ../Source/umf_start_front.c
$(MV) -f umf_start_front.o umf_mz_start_front.o
- $(MX) -DZINT -c ../Source/umf_2by2.c
+ $(MX) -DZLONG -c ../Source/umf_2by2.c
$(MV) -f umf_2by2.o umf_mz_2by2.o
- $(MX) -DZINT -c ../Source/umf_store_lu.c
+ $(MX) -DZLONG -c ../Source/umf_store_lu.c
$(MV) -f umf_store_lu.o umf_mz_store_lu.o
- $(MX) -DZINT -c ../Source/umf_scale.c
+ $(MX) -DZLONG -c ../Source/umf_scale.c
$(MV) -f umf_scale.o umf_mz_scale.o
- $(MX) -DZINT -DWSOLVE -c ../Source/umfpack_solve.c
+ $(MX) -DZLONG -DWSOLVE -c ../Source/umfpack_solve.c
$(MV) -f umfpack_solve.o umfpack_mz_wsolve.o
- $(MX) -DZINT -c ../Source/umfpack_col_to_triplet.c
+ $(MX) -DZLONG -c ../Source/umfpack_col_to_triplet.c
$(MV) -f umfpack_col_to_triplet.o umfpack_mz_col_to_triplet.o
- $(MX) -DZINT -c ../Source/umfpack_defaults.c
+ $(MX) -DZLONG -c ../Source/umfpack_defaults.c
$(MV) -f umfpack_defaults.o umfpack_mz_defaults.o
- $(MX) -DZINT -c ../Source/umfpack_free_numeric.c
+ $(MX) -DZLONG -c ../Source/umfpack_free_numeric.c
$(MV) -f umfpack_free_numeric.o umfpack_mz_free_numeric.o
- $(MX) -DZINT -c ../Source/umfpack_free_symbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_free_symbolic.c
$(MV) -f umfpack_free_symbolic.o umfpack_mz_free_symbolic.o
- $(MX) -DZINT -c ../Source/umfpack_get_numeric.c
+ $(MX) -DZLONG -c ../Source/umfpack_get_numeric.c
$(MV) -f umfpack_get_numeric.o umfpack_mz_get_numeric.o
- $(MX) -DZINT -c ../Source/umfpack_get_lunz.c
+ $(MX) -DZLONG -c ../Source/umfpack_get_lunz.c
$(MV) -f umfpack_get_lunz.o umfpack_mz_get_lunz.o
- $(MX) -DZINT -c ../Source/umfpack_get_symbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_get_symbolic.c
$(MV) -f umfpack_get_symbolic.o umfpack_mz_get_symbolic.o
- $(MX) -DZINT -c ../Source/umfpack_get_determinant.c
+ $(MX) -DZLONG -c ../Source/umfpack_get_determinant.c
$(MV) -f umfpack_get_determinant.o umfpack_mz_get_determinant.o
- $(MX) -DZINT -c ../Source/umfpack_numeric.c
+ $(MX) -DZLONG -c ../Source/umfpack_numeric.c
$(MV) -f umfpack_numeric.o umfpack_mz_numeric.o
- $(MX) -DZINT -c ../Source/umfpack_qsymbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_qsymbolic.c
$(MV) -f umfpack_qsymbolic.o umfpack_mz_qsymbolic.o
- $(MX) -DZINT -c ../Source/umfpack_report_control.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_control.c
$(MV) -f umfpack_report_control.o umfpack_mz_report_control.o
- $(MX) -DZINT -c ../Source/umfpack_report_info.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_info.c
$(MV) -f umfpack_report_info.o umfpack_mz_report_info.o
- $(MX) -DZINT -c ../Source/umfpack_report_matrix.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_matrix.c
$(MV) -f umfpack_report_matrix.o umfpack_mz_report_matrix.o
- $(MX) -DZINT -c ../Source/umfpack_report_numeric.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_numeric.c
$(MV) -f umfpack_report_numeric.o umfpack_mz_report_numeric.o
- $(MX) -DZINT -c ../Source/umfpack_report_perm.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_perm.c
$(MV) -f umfpack_report_perm.o umfpack_mz_report_perm.o
- $(MX) -DZINT -c ../Source/umfpack_report_status.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_status.c
$(MV) -f umfpack_report_status.o umfpack_mz_report_status.o
- $(MX) -DZINT -c ../Source/umfpack_report_symbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_symbolic.c
$(MV) -f umfpack_report_symbolic.o umfpack_mz_report_symbolic.o
- $(MX) -DZINT -c ../Source/umfpack_report_triplet.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_triplet.c
$(MV) -f umfpack_report_triplet.o umfpack_mz_report_triplet.o
- $(MX) -DZINT -c ../Source/umfpack_report_vector.c
+ $(MX) -DZLONG -c ../Source/umfpack_report_vector.c
$(MV) -f umfpack_report_vector.o umfpack_mz_report_vector.o
- $(MX) -DZINT -c ../Source/umfpack_solve.c
+ $(MX) -DZLONG -c ../Source/umfpack_solve.c
$(MV) -f umfpack_solve.o umfpack_mz_solve.o
- $(MX) -DZINT -c ../Source/umfpack_symbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_symbolic.c
$(MV) -f umfpack_symbolic.o umfpack_mz_symbolic.o
- $(MX) -DZINT -c ../Source/umfpack_transpose.c
+ $(MX) -DZLONG -c ../Source/umfpack_transpose.c
$(MV) -f umfpack_transpose.o umfpack_mz_transpose.o
- $(MX) -DZINT -c ../Source/umfpack_triplet_to_col.c
+ $(MX) -DZLONG -c ../Source/umfpack_triplet_to_col.c
$(MV) -f umfpack_triplet_to_col.o umfpack_mz_triplet_to_col.o
- $(MX) -DZINT -c ../Source/umfpack_scale.c
+ $(MX) -DZLONG -c ../Source/umfpack_scale.c
$(MV) -f umfpack_scale.o umfpack_mz_scale.o
- $(MX) -DZINT -c ../Source/umfpack_load_numeric.c
+ $(MX) -DZLONG -c ../Source/umfpack_load_numeric.c
$(MV) -f umfpack_load_numeric.o umfpack_mz_load_numeric.o
- $(MX) -DZINT -c ../Source/umfpack_save_numeric.c
+ $(MX) -DZLONG -c ../Source/umfpack_save_numeric.c
$(MV) -f umfpack_save_numeric.o umfpack_mz_save_numeric.o
- $(MX) -DZINT -c ../Source/umfpack_load_symbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_load_symbolic.c
$(MV) -f umfpack_load_symbolic.o umfpack_mz_load_symbolic.o
- $(MX) -DZINT -c ../Source/umfpack_save_symbolic.c
+ $(MX) -DZLONG -c ../Source/umfpack_save_symbolic.c
$(MV) -f umfpack_save_symbolic.o umfpack_mz_save_symbolic.o
$(MX) -c ../Source/umfpack_timer.c
$(MV) -f umfpack_timer.o umfpack_m_timer.o
$(MX) -c ../Source/umfpack_tictoc.c
$(MV) -f umfpack_tictoc.o umfpack_m_tictoc.o
- $(MX) -DDINT -c ../../AMD/Source/amd_aat.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_global.c
+ $(MV) -f amd_global.o amd_m_global.o
+ $(MX) -DDLONG -c ../../AMD/Source/amd_aat.c
$(MV) -f amd_aat.o amd_m_aat.o
- $(MX) -DDINT -c ../../AMD/Source/amd_1.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_1.c
$(MV) -f amd_1.o amd_m_1.o
- $(MX) -DDINT -c ../../AMD/Source/amd_2.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_2.c
$(MV) -f amd_2.o amd_m_2.o
- $(MX) -DDINT -c ../../AMD/Source/amd_dump.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_dump.c
$(MV) -f amd_dump.o amd_m_dump.o
- $(MX) -DDINT -c ../../AMD/Source/amd_postorder.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_postorder.c
$(MV) -f amd_postorder.o amd_m_postorder.o
- $(MX) -DDINT -c ../../AMD/Source/amd_post_tree.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_post_tree.c
$(MV) -f amd_post_tree.o amd_m_post_tree.o
- $(MX) -DDINT -c ../../AMD/Source/amd_defaults.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_defaults.c
$(MV) -f amd_defaults.o amd_m_defaults.o
- $(MX) -DDINT -c ../../AMD/Source/amd_order.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_order.c
$(MV) -f amd_order.o amd_m_order.o
- $(MX) -DDINT -c ../../AMD/Source/amd_control.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_control.c
$(MV) -f amd_control.o amd_m_control.o
- $(MX) -DDINT -c ../../AMD/Source/amd_info.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_info.c
$(MV) -f amd_info.o amd_m_info.o
- $(MX) -DDINT -c ../../AMD/Source/amd_valid.c
+ $(MX) -DDLONG -c ../../AMD/Source/amd_valid.c
$(MV) -f amd_valid.o amd_m_valid.o
- $(MX) -output umfpack umfpackmex.c \
+ $(MX) -output umfpack2 umfpackmex.c \
umf_m_analyze.o umf_m_apply_order.o umf_m_colamd.o umf_m_free.o \
umf_m_fsize.o umf_m_is_permutation.o umf_m_malloc.o \
umf_m_realloc.o umf_m_report_perm.o umf_m_singletons.o \
umfpack_mz_triplet_to_col.o umfpack_mz_scale.o \
umfpack_mz_load_numeric.o umfpack_mz_save_numeric.o \
umfpack_mz_load_symbolic.o umfpack_mz_save_symbolic.o \
- umfpack_m_timer.o umfpack_m_tictoc.o \
+ umfpack_m_timer.o umfpack_m_tictoc.o umfpack_m_global.o \
+ amd_m_global.o \
amd_m_aat.o amd_m_1.o amd_m_2.o amd_m_dump.o \
amd_m_postorder.o amd_m_post_tree.o amd_m_defaults.o amd_m_order.o \
amd_m_control.o amd_m_info.o amd_m_valid.o
#-------------------------------------------------------------------------------
purge: clean
- - $(RM) *.mex* *.dll
+ - $(RM) *.mex*
+
+clean:
+ - $(RM) $(CLEAN)
--- /dev/null
+LIBRARY liblapack.dll
+EXPORTS
+dasum
+daxpy
+dbdsdc
+dbdsqr
+dcopy
+ddisna
+ddot
+dgbbrd
+dgbcon
+dgbequ
+dgbmv
+dgbrfs
+dgbsv
+dgbsvx
+dgbtf2
+dgbtrf
+dgbtrs
+dgebak
+dgebal
+dgebd2
+dgebrd
+dgecon
+dgeequ
+dgees
+dgeesx
+dgeev
+dgeevx
+dgegs
+dgegv
+dgehd2
+dgehrd
+dgelq2
+dgelqf
+dgels
+dgelsd
+dgelss
+dgelsx
+dgelsy
+dgemm
+dgemv
+dgeql2
+dgeqlf
+dgeqp3
+dgeqpf
+dgeqr2
+dgeqrf
+dger
+dgerfs
+dgerq2
+dgerqf
+dgesc2
+dgesdd
+dgesv
+dgesvd
+dgesvx
+dgetc2
+dgetf2
+dgetrf
+dgetri
+dgetrs
+dggbak
+dggbal
+dgges
+dggesx
+dggev
+dggevx
+dggglm
+dgghrd
+dgglse
+dggqrf
+dggrqf
+dggsvd
+dggsvp
+dgtcon
+dgtrfs
+dgtsv
+dgtsvx
+dgttrf
+dgttrs
+dgtts2
+dhgeqz
+dhsein
+dhseqr
+dlabad
+dlabrd
+dlacon
+dlacpy
+dladiv
+dlae2
+dlaebz
+dlaed0
+dlaed1
+dlaed2
+dlaed3
+dlaed4
+dlaed5
+dlaed6
+dlaed7
+dlaed8
+dlaed9
+dlaeda
+dlaein
+dlaev2
+dlaexc
+dlag2
+dlags2
+dlagtf
+dlagtm
+dlagts
+dlagv2
+dlahqr
+dlahrd
+dlaic1
+dlaln2
+dlals0
+dlalsa
+dlalsd
+dlamch
+dlamrg
+dlangb
+dlange
+dlangt
+dlanhs
+dlansb
+dlansp
+dlanst
+dlansy
+dlantb
+dlantp
+dlantr
+dlanv2
+dlapll
+dlapmt
+dlapy2
+dlapy3
+dlaqgb
+dlaqge
+dlaqp2
+dlaqps
+dlaqsb
+dlaqsp
+dlaqsy
+dlaqtr
+dlar1v
+dlar2v
+dlarf
+dlarfb
+dlarfg
+dlarft
+dlarfx
+dlargv
+dlarnv
+dlarrb
+dlarre
+dlarrf
+dlarrv
+dlartg
+dlartv
+dlaruv
+dlarz
+dlarzb
+dlarzt
+dlas2
+dlascl
+dlasd0
+dlasd1
+dlasd2
+dlasd3
+dlasd4
+dlasd5
+dlasd6
+dlasd7
+dlasd8
+dlasd9
+dlasda
+dlasdq
+dlasdt
+dlaset
+dlasq1
+dlasq2
+dlasq3
+dlasq4
+dlasq5
+dlasq6
+dlasr
+dlasrt
+dlassq
+dlasv2
+dlaswp
+dlasy2
+dlasyf
+dlatbs
+dlatdf
+dlatps
+dlatrd
+dlatrs
+dlatrz
+dlatzm
+dlauu2
+dlauum
+dnrm2
+dopgtr
+dopmtr
+dorg2l
+dorg2r
+dorgbr
+dorghr
+dorgl2
+dorglq
+dorgql
+dorgqr
+dorgr2
+dorgrq
+dorgtr
+dorm2l
+dorm2r
+dormbr
+dormhr
+dorml2
+dormlq
+dormql
+dormqr
+dormr2
+dormr3
+dormrq
+dormrz
+dormtr
+dpbcon
+dpbequ
+dpbrfs
+dpbstf
+dpbsv
+dpbsvx
+dpbtf2
+dpbtrf
+dpbtrs
+dpocon
+dpoequ
+dporfs
+dposv
+dposvx
+dpotf2
+dpotrf
+dpotri
+dpotrs
+dppcon
+dppequ
+dpprfs
+dppsv
+dppsvx
+dpptrf
+dpptri
+dpptrs
+dptcon
+dpteqr
+dptrfs
+dptsv
+dptsvx
+dpttrf
+dpttrs
+dptts2
+drot
+drotg
+drscl
+dsbev
+dsbevd
+dsbevx
+dsbgst
+dsbgv
+dsbgvd
+dsbgvx
+dsbmv
+dsbtrd
+dscal
+dspcon
+dspev
+dspevd
+dspevx
+dspgst
+dspgv
+dspgvd
+dspgvx
+dspmv
+dspr
+dspr2
+dsprfs
+dspsv
+dspsvx
+dsptrd
+dsptrf
+dsptri
+dsptrs
+dstebz
+dstedc
+dstegr
+dstein
+dsteqr
+dsterf
+dstev
+dstevd
+dstevr
+dstevx
+dswap
+dsycon
+dsyev
+dsyevd
+dsyevr
+dsyevx
+dsygs2
+dsygst
+dsygv
+dsygvd
+dsygvx
+dsymm
+dsymv
+dsyr
+dsyr2
+dsyr2k
+dsyrfs
+dsyrk
+dsysv
+dsysvx
+dsytd2
+dsytf2
+dsytrd
+dsytrf
+dsytri
+dsytrs
+dtbcon
+dtbmv
+dtbrfs
+dtbsv
+dtbtrs
+dtgevc
+dtgex2
+dtgexc
+dtgsen
+dtgsja
+dtgsna
+dtgsy2
+dtgsyl
+dtpcon
+dtpmv
+dtprfs
+dtpsv
+dtptri
+dtptrs
+dtrcon
+dtrevc
+dtrexc
+dtrmm
+dtrmv
+dtrrfs
+dtrsen
+dtrsm
+dtrsna
+dtrsv
+dtrsyl
+dtrti2
+dtrtri
+dtrtrs
+dtzrqf
+dtzrzf
+dzasum
+dznrm2
+dzsum1
+idamax
+ieeeck
+ilaenv
+izamax
+izmax1
+lsame
+lsamen
+xerbla
+zaxpy
+zbdsqr
+zcopy
+zdotc
+zdotu
+zdrot
+zdrscl
+zdscal
+zgbbrd
+zgbcon
+zgbequ
+zgbmv
+zgbrfs
+zgbsv
+zgbsvx
+zgbtf2
+zgbtrf
+zgbtrs
+zgebak
+zgebal
+zgebd2
+zgebrd
+zgecon
+zgeequ
+zgees
+zgeesx
+zgeev
+zgeevx
+zgegs
+zgegv
+zgehd2
+zgehrd
+zgelq2
+zgelqf
+zgels
+zgelsd
+zgelss
+zgelsx
+zgelsy
+zgemm
+zgemv
+zgeql2
+zgeqlf
+zgeqp3
+zgeqpf
+zgeqr2
+zgeqrf
+zgerc
+zgerfs
+zgerq2
+zgerqf
+zgeru
+zgesc2
+zgesdd
+zgesv
+zgesvd
+zgesvx
+zgetc2
+zgetf2
+zgetrf
+zgetri
+zgetrs
+zggbak
+zggbal
+zgges
+zggesx
+zggev
+zggevx
+zggglm
+zgghrd
+zgglse
+zggqrf
+zggrqf
+zggsvd
+zggsvp
+zgtcon
+zgtrfs
+zgtsv
+zgtsvx
+zgttrf
+zgttrs
+zgtts2
+zhbev
+zhbevd
+zhbevx
+zhbgst
+zhbgv
+zhbgvd
+zhbgvx
+zhbmv
+zhbtrd
+zhecon
+zheev
+zheevd
+zheevr
+zheevx
+zhegs2
+zhegst
+zhegv
+zhegvd
+zhegvx
+zhemm
+zhemv
+zher
+zher2
+zher2k
+zherfs
+zherk
+zhesv
+zhesvx
+zhetd2
+zhetf2
+zhetrd
+zhetrf
+zhetri
+zhetrs
+zhgeqz
+zhpcon
+zhpev
+zhpevd
+zhpevx
+zhpgst
+zhpgv
+zhpgvd
+zhpgvx
+zhpmv
+zhpr
+zhpr2
+zhprfs
+zhpsv
+zhpsvx
+zhptrd
+zhptrf
+zhptri
+zhptrs
+zhsein
+zhseqr
+zlabrd
+zlacgv
+zlacon
+zlacp2
+zlacpy
+zlacrm
+zlacrt
+zladiv
+zlaed0
+zlaed7
+zlaed8
+zlaein
+zlaesy
+zlaev2
+zlags2
+zlagtm
+zlahef
+zlahqr
+zlahrd
+zlaic1
+zlals0
+zlalsa
+zlalsd
+zlangb
+zlange
+zlangt
+zlanhb
+zlanhe
+zlanhp
+zlanhs
+zlanht
+zlansb
+zlansp
+zlansy
+zlantb
+zlantp
+zlantr
+zlapll
+zlapmt
+zlaqgb
+zlaqge
+zlaqhb
+zlaqhe
+zlaqhp
+zlaqp2
+zlaqps
+zlaqsb
+zlaqsp
+zlaqsy
+zlar1v
+zlar2v
+zlarcm
+zlarf
+zlarfb
+zlarfg
+zlarft
+zlarfx
+zlargv
+zlarnv
+zlarrv
+zlartg
+zlartv
+zlarz
+zlarzb
+zlarzt
+zlascl
+zlaset
+zlasr
+zlassq
+zlaswp
+zlasyf
+zlatbs
+zlatdf
+zlatps
+zlatrd
+zlatrs
+zlatrz
+zlatzm
+zlauu2
+zlauum
+zpbcon
+zpbequ
+zpbrfs
+zpbstf
+zpbsv
+zpbsvx
+zpbtf2
+zpbtrf
+zpbtrs
+zpocon
+zpoequ
+zporfs
+zposv
+zposvx
+zpotf2
+zpotrf
+zpotri
+zpotrs
+zppcon
+zppequ
+zpprfs
+zppsv
+zppsvx
+zpptrf
+zpptri
+zpptrs
+zptcon
+zpteqr
+zptrfs
+zptsv
+zptsvx
+zpttrf
+zpttrs
+zptts2
+zrot
+zrotg
+zscal
+zspcon
+zspmv
+zspr
+zsprfs
+zspsv
+zspsvx
+zsptrf
+zsptri
+zsptrs
+zstedc
+zstegr
+zstein
+zsteqr
+zswap
+zsycon
+zsymm
+zsymv
+zsyr
+zsyr2k
+zsyrfs
+zsyrk
+zsysv
+zsysvx
+zsytf2
+zsytrf
+zsytri
+zsytrs
+ztbcon
+ztbmv
+ztbrfs
+ztbsv
+ztbtrs
+ztgevc
+ztgex2
+ztgexc
+ztgsen
+ztgsja
+ztgsna
+ztgsy2
+ztgsyl
+ztpcon
+ztpmv
+ztprfs
+ztpsv
+ztptri
+ztptrs
+ztrcon
+ztrevc
+ztrexc
+ztrmm
+ztrmv
+ztrrfs
+ztrsen
+ztrsm
+ztrsna
+ztrsv
+ztrsyl
+ztrti2
+ztrtri
+ztrtrs
+ztzrqf
+ztzrzf
+zung2l
+zung2r
+zungbr
+zunghr
+zungl2
+zunglq
+zungql
+zungqr
+zungr2
+zungrq
+zungtr
+zunm2l
+zunm2r
+zunmbr
+zunmhr
+zunml2
+zunmlq
+zunmql
+zunmqr
+zunmr2
+zunmr3
+zunmrq
+zunmrz
+zunmtr
+zupgtr
+zupmtr
function rho = lu_normest (A, L, U)
-% LU_NORMEST: estimate the 1-norm of A-L*U without computing L*U
+%LU_NORMEST estimates norm (L*U-A, 1) without forming L*U-A
%
-% Usage:
+% Example:
%
% rho = lu_normest (A, L, U)
%
% For a detailed description, see Davis, T. A. and Hager, W. W.,
% Modifying a sparse Cholesky factorization, SIAM J. Matrix Analysis and
% Applications, 1999, vol. 20, no. 3, 606-627.
+%
+% See also normest
% The three places that the matrix-vector multiply E*x is used are highlighted.
% Note that E is never formed explicity.
+% Copyright 1995-2007 by William W. Hager and Timothy A. Davis
+
[m n] = size (A) ;
if (m ~= n)
end
end
-[m n] = size (A) ;
+[m n] = size (A) ; %#ok
notvisited = ones (m, 1) ; % nonvisited(j) is zero if j is visited, 1 otherwise
rho = 0 ; % the global rho
-At = A' ;
-Lt = L' ;
-
for trial = 1:3 % {
x = notvisited ./ sum (notvisited) ;
-function f = luflop (L, U)
-%LUFLOP
+function f = luflop (L, U) %#ok
+%LUFLOP given L and U, computes # of flops required to compute them
%
+% Example:
% f = luflop (L, U)
%
% Given an LU factorization, compute how many flops took to compute it. This
% Note: the above expression has a subtle undercount when exact numerical
% cancelation occurs. Try [L,U,P] = lu (sparse (ones (10))) and then
% luflop (L,U).
+%
+% See also LU
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis.
help luflop
error ('luflop mexFunction not found! Use umfpack_make to compile luflop.') ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
without allocating O (lunz) space.
+ v5.1: port to 64-bit MATLAB
*/
#include "mex.h"
-#include "matrix.h"
+#include "UFconfig.h"
#ifndef TRUE
#define TRUE (1)
double flop_count ;
double *pflop ;
- int *Lp, *Li, *Up, *Ui, *Unz, n, k, row, col, p, Lnz_k, Unz_k ;
+ UF_long *Lp, *Li, *Up, *Ui, *Unz, n, k, row, col, p, Lnz_k, Unz_k ;
mxArray *Lmatrix, *Umatrix ;
/* ---------------------------------------------------------------------- */
mexErrMsgTxt ("Usage: f = luflop (L, U) ; L and U must be sparse") ;
}
- Lp = mxGetJc (Lmatrix) ;
- Li = mxGetIr (Lmatrix) ;
+ Lp = (UF_long *) mxGetJc (Lmatrix) ;
+ Li = (UF_long *) mxGetIr (Lmatrix) ;
- Up = mxGetJc (Umatrix) ;
- Ui = mxGetIr (Umatrix) ;
+ Up = (UF_long *) mxGetJc (Umatrix) ;
+ Ui = (UF_long *) mxGetIr (Umatrix) ;
- Unz = (int *) mxMalloc (n * sizeof (int)) ;
+ Unz = (UF_long *) mxMalloc (n * sizeof (UF_long)) ;
/* ---------------------------------------------------------------------- */
/* count the nonzeros in each row of U */
pflop = mxGetPr (plhs [0]) ;
pflop [0] = flop_count ;
}
-
-function [out1, out2, out3, out4, out5] = umfpack (in1, in2, in3, in4, in5)
-% UMFPACK v4.4 is a MATLAB mexFunction for solving sparse linear systems.
+function [out1, out2, out3, out4, out5] = umfpack2(in1, in2, in3, in4, in5) %#ok
+%UMFPACK2 computes x=A\b, x=A/b, or lu (A) for a sparse matrix A
+% It is also a built-in function in MATLAB, used in x=A\b.
%
-% UMFPACK v4.4: | MATLAB approximate equivalent:
+% Example:
+%
+% UMFPACK: | MATLAB approximate equivalent:
% ---------------------------------------------------------------------
-% x = umfpack (A, '\', b) ; | x = A \ b
+% x = umfpack2 (A, '\', b) ; | x = A \ b
% |
-% x = umfpack (b, '/', A) ; | x = b / A
+% x = umfpack2 (b, '/', A) ; | x = b / A
% |
-% [L,U,P,Q] = umfpack (A) ; | [m,n] = size (A) ;
+% [L,U,P,Q] = umfpack2 (A) ; | [m,n] = size (A) ;
% | I = speye (n) ;
% | Q = I (:, colamd (A)) ;
% | [L,U,P] = lu (A*Q) ;
% |
-% [L,U,P,Q,R] = umfpack (A) ; | [m,n] = size (A) ;
+% [L,U,P,Q,R] = umfpack2 (A) ; | [m,n] = size (A) ;
% | I = speye (n) ;
% | Q = I (:, colamd (A)) ;
% | r = full (sum (abs (A), 2)) ;
% | R = spdiags (r, 0, m, m) ;
% | [L,U,P] = lu ((R\A)*Q) ;
% |
-% [P,Q,F,C] = umfpack (A, 'symbolic') | [m,n] = size (A) ;
+% [P,Q,F,C] = umfpack2 (A, 'symbolic')| [m,n] = size (A) ;
% | I = speye (n) ;
% | Q = I (:, colamd (A)) ;
% | [count,h,parent,post] = ...
%
% A must be sparse. It can be complex, singular, and/or rectangular. A must be
% square for '/' or '\'. b must be a full real or complex vector. For
-% [L,U,P,Q,R] = umfpack (A), the factorization is L*U = P*(R\A)*Q. If A has a
+% [L,U,P,Q,R] = umfpack2 (A), the factorization is L*U = P*(R\A)*Q. If A has a
% mostly symmetric nonzero pattern, then replace "colamd" with "amd" in the
% MATLAB-equivalent column in the table above. Type umfpack_details for more
% information.
%
-% See also: lu_normest, colamd, amd.
+% See also: lu_normest, colamd, amd, umfpack.
% To use UMFPACK for an arbitrary b, see umfpack_solve.
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis.
-help umfpack
-error ('umfpack mexFunction not found! Use umfpack_make to compile umfpack.') ;
+help umfpack2
+error ('umfpack2 mexFunction not found') ;
function x = umfpack_btf (A, b, Control)
-% UMFPACK_BTF
+%UMFPACK_BTF factorize A using a block triangular form
%
-% x = umfpack_btf (A, b, Control)
+% Example:
+% x = umfpack_btf (A, b, Control)
%
% solve Ax=b by first permuting the matrix A to block triangular form via dmperm
% and then using UMFPACK to factorize each diagonal block. Adjacent 1-by-1
% MATLAB's \ operator. The Control parameter is optional (Type umfpack_details
% and umfpack_report for details on its use). A must be square.
%
-% See also: umfpack, umfpack_factorize, umfpack_details, dmperm
+% See also umfpack, umfpack2, umfpack_details, dmperm
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis.
if (nargin < 2)
help umfpack_btf
help umfpack_btf
error ('umfpack_btf: A must be square') ;
end
-[m1 n1] = size (b) ;
+m1 = size (b,1) ;
if (m1 ~= n)
help umfpack_btf
error ('umfpack_btf: b has the wrong dimensions') ;
end
if (nargin < 3)
- Control = umfpack ;
+ Control = umfpack2 ;
end
%-------------------------------------------------------------------------------
% solve the system
%-------------------------------------------------------------------------------
-if (nblocks == 1 | sprank (A) < n)
+if (nblocks == 1 | sprank (A) < n) %#ok
%---------------------------------------------------------------------------
% matrix is irreducible or structurally singular
-function umfpack_demo
-% UMFPACK DEMO
+function umfpack_demo (c)
+%UMFPACK_DEMO a lenghty demo
%
% A demo of UMFPACK for MATLAB.
%
-% See also umfpack, umfpack_make, umfpack_details, umfpack_report,
+% Example:
+% umfpack_demo
+%
+% See also umfpack, umfpack2, umfpack_make, umfpack_details, umfpack_report,
% and umfpack_simple.
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis.
%-------------------------------------------------------------------------------
% get default control parameters
%-------------------------------------------------------------------------------
-control = umfpack ;
-fprintf ('\nEnter the printing level for UMFPACK''s output statistics:\n') ;
-fprintf ('0: none, 1: errors only, 2: statistics, 4: print some of outputs\n') ;
-c = input ('5: print all output [default is 1]: ') ;
+control = umfpack2 ;
+if (nargin < 1)
+ fprintf ('\nEnter the printing level for UMFPACK''s output statistics:\n') ;
+ fprintf ('0: none, 1: errors only, 2: statistics, 4: print some outputs\n');
+ c = input ('5: print all output [default is 1]: ', 's') ;
+ c = str2double (c) ;
+end
if (isempty (c))
c = 1 ;
end
end
load west0067
-A = Problem.A ;
+A = spconvert (west0067) ;
+
n = size (A, 1) ;
b = rand (n, 1) ;
fprintf ('Solving Ax=b via UMFPACK:\n') ;
-[xu, info] = umfpack (A, '\', b, control) ;
-x = xu ;
+xu = umfpack2 (A, '\', b, control) ;
fprintf ('Solving Ax=b via MATLAB:\n') ;
xm = A\b ;
-x = xm ;
fprintf ('Difference between UMFPACK and MATLAB solution: %g\n', ...
norm (xu - xm, Inf)) ;
title ('The matrix A') ;
subplot (2,3,2)
-[P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ;
+[P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic') ; %#ok
treeplot (Fr (1:end-1,2)') ;
title ('Supernodal column elimination tree') ;
subplot (2,3,4)
fprintf ('\n--------------------------------------------------------------\n') ;
-fprintf ('\nFactorizing [L, U, P, Q, R] = umfpack (A)\n') ;
-[L, U, P, Q, R] = umfpack (A) ;
+fprintf ('\nFactorizing [L, U, P, Q, R] = umfpack2 (A)\n') ;
+[L, U, P, Q, R] = umfpack2 (A) ;
spy (P*A*Q)
title ('A, with final row/column order') ;
fprintf ('\nSolution to Ax=b via UMFPACK factorization:\n') ;
fprintf ('x = Q * (U \\ (L \\ (P * (R \\ b))))\n') ;
xu = Q * (U \ (L \ (P * (R \ b)))) ;
-x = xu ;
fprintf ('\nUMFPACK flop count: %d\n', luflop (L, U)) ;
fprintf ('Solve A''x=b:\n') ;
fprintf ('Solving A''x=b via UMFPACK:\n') ;
-[xu, info] = umfpack (b', '/', A, control) ;
+xu = umfpack2 (b', '/', A, control) ;
xu = xu' ;
fprintf ('Solving A''x=b via MATLAB:\n') ;
xm = (b'/A)' ;
-x = xm ;
fprintf ('Difference between UMFPACK and MATLAB solution: %g\n', ...
norm (xu - xm, Inf)) ;
C = A' ;
% factorize C (P,Q) = L*U
-[L, U, P, Q, R, info] = umfpack (C, control) ;
+[L, U, P, Q, R, info] = umfpack2 (C, control) ; %#ok
fprintf ('\nP * (R\\C) * Q - L*U should be zero:\n') ;
fprintf ('norm (P*(R\\C)*Q - L*U, 1) = %g (exact) %g (estimated)\n', ...
fprintf ('\nSolution to Ax=b via UMFPACK, using the factors of C:\n') ;
fprintf ('x = R \\ (P'' * (L'' \\ (U'' \\ (Q'' * b)))) ;\n') ;
xu = R \ (P' * (L' \ (U' \ (Q' * b)))) ;
-x = xu ;
fprintf ('Solution to Ax=b via MATLAB:\n') ;
xm = A\b ;
-x = xm ;
fprintf ('Difference between UMFPACK and MATLAB solution: %g\n', ...
norm (xu - xm, Inf)) ;
%-------------------------------------------------------------------------------
fprintf ('\n--------------------------------------------------------------\n') ;
-fprintf ('det(A): %g UMFPACK determinant: %g\n', det (A), umfpack (A, 'det')) ;
+fprintf ('det(A): %g UMFPACK determinant: %g\n', det (A), umfpack2 (A, 'det'));
->> umfpack_demo
+umfpack_demo
Enter the printing level for UMFPACK's output statistics:
-0: none, 1: errors only, 2: statistics, 4: print some of outputs
+0: none, 1: errors only, 2: statistics, 4: print some outputs
5: print all output [default is 1]:
--------------------------------------------------------------
--------------------------------------------------------------
-Factorizing [L, U, P, Q, R] = umfpack (A)
+Factorizing [L, U, P, Q, R] = umfpack2 (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)
+norm (P*(R\A)*Q - L*U, 1) = 2.77556e-16 (exact) 1.21864e-16 (estimated)
Solution to Ax=b via UMFPACK factorization:
x = Q * (U \ (L \ (P * (R \ b))))
-UMFPACK flop count: 2354
+UMFPACK flop count: 2453
Factorizing [L, U, P] = lu (A (:, q))
If you are using a version of MATLAB prior to V6.0, then the
Solution to Ax=b via MATLAB factorization:
x = U \ (L \ (P * b)) ; x (q) = x ;
-Difference between UMFPACK and MATLAB solution: 7.10543e-15
+Difference between UMFPACK and MATLAB solution: 5.55112e-15
-MATLAB LU flop count: 3164
+MATLAB LU flop count: 3160
--------------------------------------------------------------
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
+Difference between UMFPACK and MATLAB solution: 1.77636e-15
--------------------------------------------------------------
Compute C = A', and compute the LU factorization of C.
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)
+norm (P*(R\C)*Q - L*U, 1) = 1.17961e-16 (exact) 5.60533e-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
+Difference between UMFPACK and MATLAB solution: 3.55271e-15
--------------------------------------------------------------
Solve AX=B, where B is n-by-10, and sparse
-Difference between UMFPACK and MATLAB solution: 6.72949e-14
+Difference between UMFPACK and MATLAB solution: 6.3926e-14
--------------------------------------------------------------
Solve AX=B, where B is n-by-10, and sparse, using umfpack_btf
-Difference between UMFPACK and MATLAB solution: 8.51541e-14
+Difference between UMFPACK and MATLAB solution: 4.41347e-14
--------------------------------------------------------------
Solve A'X=B, where B is n-by-10, and sparse
-Difference between UMFPACK and MATLAB solution: 7.99291e-14
+Difference between UMFPACK and MATLAB solution: 8.90054e-14
--------------------------------------------------------------
det(A): -4.07453e-05 UMFPACK determinant: -4.07453e-05
->>
->> diary off
+diary off
-function [out1, out2, out3, out4, out5] = umfpack (in1, in2, in3, in4, in5)
-% UMFPACK v4.4: details on each usage.
+function umfpack_details
+%UMFPACK_DETAILS details on all the options for using umfpack2 in MATLAB
%
% Factor or solve a sparse linear system, returning either the solution x to
% Ax=b or A'x'=b', the factorization LU=PAQ, or LU=P(R\A)Q. A must be sparse.
% submatrix S is then analyzed, based on the symmetry of the nonzero pattern of
% the submatrix and the values on the diagaonal. The strategies include:
%
-% (1) unsymmetric: use a COLAMD pre-ordering, a column elimination tree
-% post-ordering, refine the column ordering during factorization,
-% and make no effort at selecting pivots on the diagonal.
-% (2) 2-by-2: like the symmetric strategy (see below), except that local
-% row permutations are first made to attempt to place large entries
-% on the diagonal.
-% (3) symmetric: use an AMD pre-ordering on the matrix S+S', an
-% elimination tree post-ordering, do not refine the column ordering
-% during factorization, and attempt to select pivots on the diagonal.
-%
-% Each of the following uses of umfpack (except for "Control = umfpack") is
-% stand-alone. That is, no call to umfpack is required for any subsequent
+% (1) unsymmetric: use a COLAMD pre-ordering, a column elimination tree
+% post-ordering, refine the column ordering during factorization,
+% and make no effort at selecting pivots on the diagonal.
+% (2) 2-by-2: like the symmetric strategy (see below), except that local
+% row permutations are first made to attempt to place large entries
+% on the diagonal.
+% (3) symmetric: use an AMD pre-ordering on the matrix S+S', an
+% elimination tree post-ordering, do not refine the column ordering
+% during factorization, and attempt to select pivots on the diagonal.
+%
+% Each of the following uses of umfpack2 (except for "Control = umfpack2") is
+% stand-alone. That is, no call to umfpack2 is required for any subsequent
% call. In each usage, the Info output argument is optional.
%
-% Usage:
+% Example:
%
-% [x, Info] = umfpack (A, '\', b) ;
-% [x, Info] = umfpack (A, '\', b, Control) ;
-% [x, Info] = umfpack (A, Qinit, '\', b, Control) ;
-% [x, Info] = umfpack (A, Qinit, '\', b) ;
+% [x, Info] = umfpack2 (A, '\', b) ;
+% [x, Info] = umfpack2 (A, '\', b, Control) ;
+% [x, Info] = umfpack2 (A, Qinit, '\', b, Control) ;
+% [x, Info] = umfpack2 (A, Qinit, '\', b) ;
%
% Solves Ax=b (similar to x = A\b in MATLAB).
%
-% [x, Info] = umfpack (b, '/', A) ;
-% [x, Info] = umfpack (b, '/', A, Control) ;
-% [x, Info] = umfpack (b, '/', A, Qinit) ;
-% [x, Info] = umfpack (b, '/', A, Qinit, Control) ;
+% [x, Info] = umfpack2 (b, '/', A) ;
+% [x, Info] = umfpack2 (b, '/', A, Control) ;
+% [x, Info] = umfpack2 (b, '/', A, Qinit) ;
+% [x, Info] = umfpack2 (b, '/', A, Qinit, Control) ;
%
% Solves A'x'=b' (similar to x = b/A in MATLAB).
%
-% [L, U, P, Q, R, Info] = umfpack (A) ;
-% [L, U, P, Q, R, Info] = umfpack (A, Control) ;
-% [L, U, P, Q, R, Info] = umfpack (A, Qinit) ;
-% [L, U, P, Q, R, Info] = umfpack (A, Qinit, Control) ;
+% [L, U, P, Q, R, Info] = umfpack2 (A) ;
+% [L, U, P, Q, R, Info] = umfpack2 (A, Control) ;
+% [L, U, P, Q, R, Info] = umfpack2 (A, Qinit) ;
+% [L, U, P, Q, R, Info] = umfpack2 (A, Qinit, Control) ;
%
% Returns the LU factorization of A. P and Q are returned as permutation
% matrices. R is a diagonal sparse matrix of scale factors for the rows
-% of A, L is lower triangular, and U is upper triangular. The
-% factorization is L*U = P*(R\A)*Q. You can turn off scaling by setting
-% Control (17) to zero (in which case R = speye (m)), or by using the
-% following syntaxes (in which case Control (17) is ignored):
+% of A, L is lower triangular, and U is upper triangular. The
+% factorization is L*U = P*(R\A)*Q. You can turn off scaling by setting
+% Control (17) to zero (in which case R = speye (m)), or by using the
+% following syntaxes (in which case Control (17) is ignored):
%
-% [L, U, P, Q] = umfpack (A) ;
-% [L, U, P, Q] = umfpack (A, Control) ;
-% [L, U, P, Q] = umfpack (A, Qinit) ;
-% [L, U, P, Q] = umfpack (A, Qinit, Control) ;
+% [L, U, P, Q] = umfpack2 (A) ;
+% [L, U, P, Q] = umfpack2 (A, Control) ;
+% [L, U, P, Q] = umfpack2 (A, Qinit) ;
+% [L, U, P, Q] = umfpack2 (A, Qinit, Control) ;
%
% Same as above, except that no row scaling is performed. The Info array
-% is not returned, either.
+% is not returned, either.
%
-% [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ;
-% [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic', Control) ;
-% [P1, Q1, Fr, Ch, Info] = umfpack (A, Qinit, 'symbolic') ;
-% [P1, Q1, Fr, Ch, Info] = umfpack (A, Qinit, 'symbolic', Control);
+% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic') ;
+% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic', Control) ;
+% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, Qinit, 'symbolic') ;
+% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, Qinit, 'symbolic', Control);
%
% Performs only the fill-reducing column pre-ordering (including the
% elimination tree post-ordering) and symbolic factorization. Q1 is the
-% initial column permutation (either from colamd, amd, or the input
-% ordering Qinit), possibly followed by a column elimination tree post-
-% ordering or a symmetric elimination tree post-ordering, depending on
-% the strategy used.
+% initial column permutation (either from colamd, amd, or the input
+% ordering Qinit), possibly followed by a column elimination tree post-
+% ordering or a symmetric elimination tree post-ordering, depending on
+% the strategy used.
%
-% For the unsymmetric strategy, P1 is the row ordering induced by Q1
-% (row-merge order). For the 2-by-2 strategy, P1 is the row ordering that
-% places large entries on the diagonal of P1*A*Q1. For the symmetric
-% strategy, P1 = Q1.
+% For the unsymmetric strategy, P1 is the row ordering induced by Q1
+% (row-merge order). For the 2-by-2 strategy, P1 is the row ordering that
+% places large entries on the diagonal of P1*A*Q1. For the symmetric
+% strategy, P1 = Q1.
%
% Fr is a (nfr+1)-by-4 array containing information about each frontal
% matrix, where nfr <= n is the number of frontal matrices. Fr (:,1) is
% columns for the first front, the next Fr (2,1) columns of P1*A*Q1
% are the pivot columns for the second front, and so on.
%
-% For the unsymmetric strategy, Fr (:,3) is the row index of the first
-% row in P1*A*Q1 whose leftmost nonzero entry is in a pivot column for
-% the kth front. Fr (:,4) is the leftmost descendent of the kth front.
-% Rows in the range Fr (Fr (k,4),3) to Fr (k+1,3)-1 form the entire set
-% of candidate pivot rows for the kth front (some of these will typically
-% have been selected as pivot rows of fronts Fr (k,3) to k-1, before the
-% factorization reaches the kth front. If front k is a leaf node, then
-% Fr (k,4) is k.
+% For the unsymmetric strategy, Fr (:,3) is the row index of the first
+% row in P1*A*Q1 whose leftmost nonzero entry is in a pivot column for
+% the kth front. Fr (:,4) is the leftmost descendent of the kth front.
+% Rows in the range Fr (Fr (k,4),3) to Fr (k+1,3)-1 form the entire set
+% of candidate pivot rows for the kth front (some of these will typically
+% have been selected as pivot rows of fronts Fr (k,3) to k-1, before the
+% factorization reaches the kth front. If front k is a leaf node, then
+% Fr (k,4) is k.
%
% Ch is a (nchains+1)-by-3 array containing information about each "chain"
% (unifrontal sequence) of frontal matrices, and where nchains <= nfr
% Chain (i,1) to Chain (i+1,1)-1, and the largest front in chain i is
% Chain (i,2)-by-Chain (i,3).
%
-% This use of umfpack is not required to factor or solve a linear system
+% This use of umfpack2 is not required to factor or solve a linear system
% in MATLAB. It analyzes the matrix A and provides information only.
% The MATLAB statement "treeplot (Fr (:,2)')" plots the column elimination
% tree.
%
-% Control = umfpack ;
+% Control = umfpack2 ;
%
-% Returns a 20-by-1 vector of default parameter settings for umfpack.
+% Returns a 20-by-1 vector of default parameter settings for umfpack2.
%
% umfpack_report (Control, Info) ;
%
% Prints the current Control settings, and Info
%
-% det = umfpack (A, 'det') ;
-% [det dexp] = umfpack (A, 'det') ;
+% det = umfpack2 (A, 'det') ;
+% [det dexp] = umfpack2 (A, 'det') ;
%
-% Computes the determinant of A. The 2nd form returns the determinant
-% in the form det*10^dexp, where det is in the range +/- 1 to 10,
-% which helps to avoid overflow/underflow when dexp is out of range of
-% normal floating-point numbers.
+% Computes the determinant of A. The 2nd form returns the determinant
+% in the form det*10^dexp, where det is in the range +/- 1 to 10,
+% which helps to avoid overflow/underflow when dexp is out of range of
+% normal floating-point numbers.
%
% If present, Qinit is a user-supplied 1-by-n permutation vector. It is an
% initial fill-reducing column pre-ordering for A; if not present, then colamd
% are used. If a Control entry is NaN, then the default is used for that entry.
%
%
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis, University of Florida.
+% All Rights Reserved.
+% UMFPACK is available under alternate licenses, contact T. Davis for details.
%
% UMFPACK License:
%
-% Your use or distribution of UMFPACK or any modified version of
-% UMFPACK implies that you agree to this License.
-%
-% THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
-% EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-%
-% Permission is hereby granted to use or copy this program, provided
-% that the Copyright, this License, and the Availability of the original
-% version is retained on all copies. User documentation of any code that
-% uses UMFPACK or any modified version of UMFPACK code must cite the
-% Copyright, this License, the Availability note, and "Used by permission."
-% Permission to modify the code and to distribute modified code is granted,
-% provided the Copyright, this License, and the Availability note are
-% retained, and a notice that the code was modified is included. This
-% software was developed with support from the National Science Foundation,
-% and is provided to you free of charge.
+% Your use or distribution of UMFPACK or any modified version of
+% UMFPACK implies that you agree to this License.
+%
+% This library is free software; you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation; either
+% version 2.1 of the License, or (at your option) any later version.
+%
+% This library is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% Lesser General Public License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public
+% License along with this library; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+% USA
+%
+% Permission is hereby granted to use or copy this program under the
+% terms of the GNU LGPL, provided that the Copyright, this License,
+% and the Availability of the original version is retained on all copies.
+% User documentation of any code that uses this code or any modified
+% version of this code must cite the Copyright, this License, the
+% Availability note, and "Used by permission." Permission to modify
+% the code and to distribute modified code is granted, provided the
+% Copyright, this License, and the Availability note are retained,
+% and a notice that the code was modified is included.
%
% Availability: http://www.cise.ufl.edu/research/sparse/umfpack
%
-% See also umfpack, umfpack_make, umfpack_report,
+% See also umfpack, umfpack2, umfpack_make, umfpack_report,
% umfpack_demo, and umfpack_simple.
more on
--- /dev/null
+function umfpack_install
+%UMFPACK_INSTALL to compile and install umfpack2 and amd2 for use in MATLAB
+% Your current directory must be UMFPACK/MATLAB for this function to work.
+%
+% Example:
+% umfpack_install
+%
+% See also umfpack2, amd2.
+
+% Copyright 1995-2007 by Timothy A. Davis.
+
+% compile and install UMFPACK
+umfpack_path = pwd ;
+addpath (umfpack_path) ;
+try
+ umfpack_make
+catch
+ fprintf ('Trying to install with lcc_lib/libmwlapack.lib instead\n') ;
+ umfpack_make ('lcc_lib/libmwlapack.lib') ;
+end
+
+% compile and install AMD
+cd ../../AMD/MATLAB
+amd_path = pwd ;
+addpath (amd_path) ;
+amd_make ;
+
+cd (umfpack_path)
+
+fprintf ('Now trying the umfpack_simple demo.\n');
+umfpack_simple
+
+fprintf ('Added the following directories to the path. You may wish to add\n');
+fprintf ('these permanently with the MATLAB pathtool command:\n') ;
+fprintf ('%s\n', umfpack_path) ;
+fprintf ('%s\n', amd_path) ;
+
-function umfpack_make
-% UMFPACK_MAKE
+function umfpack_make (lapack)
+%UMFPACK_MAKE to compile umfpack2 for use in MATLAB
%
-% Compiles the UMFPACK mexFunction and then runs a simple demo.
+% Compiles the umfpack2 mexFunction and then runs a simple demo.
%
-% See also: umfpack, umfpack_details, umfpack_report, umfpack_demo, and
-% umfpack_simple.
+% Example:
+% umfpack_make % use default LAPACK and BLAS
+% umfpack_make ('lcc_lib/libmwlapack.lib') % try this if umfpack_make fails
%
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% See also: umfpack, umfpack2, umfpack_details, umfpack_report, umfpack_demo,
+% and umfpack_simple.
-help umfpack_make
+% Copyright 1995-2007 by Timothy A. Davis.
-fprintf ('\n--------------------------------------------------------------\n') ;
-fprintf ('Now compiling the UMFPACK and AMD mexFunctions.\n') ;
-fprintf ('--------------------------------------------------------------\n') ;
+details = 0 ;
-try
- % ispc does not appear in MATLAB 5.3
- pc = ispc ;
-catch
- % if ispc fails, assume we aren't on a Windows PC.
- pc = 0 ;
+d = '' ;
+if (~isempty (strfind (computer, '64')))
+ d = ' -largeArrayDims' ;
end
-obj = 'o' ;
-blas_lib = '' ;
+[v,pc] = getversion ;
+fprintf ('Compiling UMFPACK for MATLAB Version %g\n', v) ;
+
if (pc)
obj = 'obj' ;
+else
+ obj = 'o' ;
end
+kk = 0 ;
+
%-------------------------------------------------------------------------------
% BLAS option
%-------------------------------------------------------------------------------
-msg = [ ...
- '\nUsing the BLAS is faster, but might not compile correctly.\n', ...
- 'If you get an error stating that dgemm, dgemv, dger, zgemm,\n', ...
- 'zgemv, and/or zger are not defined, then recompile without the\n', ...
- 'BLAS. You can ignore warnings that these routines are implicitly\n', ...
- 'declared.\n\nPlease select one of the following options: \n', ...
- ' 1: attempt to compile with the BLAS (default)\n', ...
- ' 2: do not use the BLAS\n'] ;
-fprintf (msg) ;
-blas = input (': ') ;
-if (isempty (blas))
- blas = 1 ;
-end
-if (blas == 1)
- % try to link to MATLAB's built-in BLAS
- blas = '' ;
+if (nargin < 1)
if (pc)
- % the default lcc compiler needs this library to access the BLAS
- blas_lib = ' libmwlapack.lib' ;
- msg = [ ...
- '\nCheck to see if you have a file called libmwlapack.lib in the\n', ...
- '<matlab>\\extern\\lib\\win32\\lcc\\ directory, where <matlab> is ', ...
- 'the\ndirectory where MATLAB is installed. If a file of that ', ...
- 'name is already\nthere, then you don''t have to do anything. ', ...
- 'Otherwise, you must first\ncopy the libmwlapack.lib file from ', ...
- 'the umfpack\\lcc_lib\\ directory to the\n', ...
- '<matlab>\\extern\\lib\\win32\\lcc\\ directory. Next, type\n\n', ...
- ' mex -setup\n\n', ...
- 'at the MATLAB prompt, and ask MATLAB to select the lcc compiler. ',...
- 'You can skip\nall of this if you have already done it, or have ', ...
- 'configured mex to use\na different compiler. If you are using ', ...
- 'Norton anti-virus software on Windows\n98SE, then you need to ', ...
- 'exit MATLAB, turn off virus checking, and restart MATLAB\n', ...
- 'before you can use the mex command or compile UMFPACK.\n', ...
- 'You may also need to turn off virus checking in other cases.\n', ...
- '\nHit enter to continue, or type control-C if you do not wish to '] ;
- fprintf (msg) ;
- input ('proceed: ') ;
- end
- fprintf ('\nUsing the BLAS (recommended).\n') ;
-else
- % No BLAS
- fprintf ('\nNot using the BLAS. UMFPACK will be slow.\n') ;
- blas = ' -DNBLAS' ;
-end
-
-%-------------------------------------------------------------------------------
-% -DNUTIL option (using utMalloc or mxMalloc)
-%-------------------------------------------------------------------------------
-
-utils = '' ;
-
-if (~pc)
- msg = [ ...
- '--------------------------------------------------------------\n', ...
- '\nUMFPACK uses MATLAB''s memory allocation routines. The internal', ...
- '\nutMalloc, utFree, and utRealloc allow for better use of memory,', ...
- '\nbut they are internal utility routines that are not documented.\n', ...
- 'Thus, they might not always work. Using mxMalloc, mxFree, and\n', ...
- 'mxRealloc works, but UMFPACK might run out of memory when solving\n', ...
- 'problems that it could otherwise solve. Try using the default.\n', ...
- 'If you get an error stating that utMalloc, utFree, and/or\n', ...
- 'utRealloc are not defined, then recompile with the mx* routines.\n', ...
- '\nPlease select one of the following options:\n', ...
- ' 1: attempt to use the ut* routines (default)\n', ...
- ' 2: use the standard mx* routines\n'] ;
- fprintf (msg) ;
- utils = input (': ') ;
- if (isempty (utils))
- utils = 1 ;
- end
- if (utils == 2)
- fprintf ('\nNot using utMalloc, utFree, or utRealloc\n') ;
- utils = ' -DNUTIL' ;
+ if (v < 6.5)
+ % MATLAB 6.1 and earlier: use the version supplied here
+ lapack = 'lcc_lib/libmwlapack.lib' ;
+ fprintf ('Using %s. If this fails with dgemm and others\n',lapack);
+ fprintf ('undefined, then edit umfpack_make.m and modify the') ;
+ fprintf (' statement:\nlapack = ''%s'' ;\n', lapack) ;
+ else
+ lapack = 'libmwlapack.lib' ;
+ end
else
- fprintf ('\nUsing utMalloc, utFree, and utRealloc\n') ;
- utils = '' ;
+ % For other systems, mex should find lapack on its own, but this has
+ % been broken in MATLAB R2007a; the following is now required.
+ lapack = '-lmwlapack' ;
end
end
posix = '' ;
-if (~pc)
- msg = [ ...
- '--------------------------------------------------------------\n', ...
- '\nUMFPACK can use the POSIX routines sysconf () and times ()\n', ...
- 'to provide CPU time and wallclock time statistics. If you do not\n', ...
- 'have a POSIX-compliant operating system, then UMFPACK won''t\n', ...
- 'compile. If you don''t know which option to pick, try the\n', ...
- 'default. If you get an error saying that sysconf and/or times\n', ...
- 'are not defined, then recompile with the non-POSIX option.\n', ...
- '\nPlease select one of the following options:\n', ...
- ' 1: use POSIX sysconf and times routines (default)\n', ...
- ' 2: do not use POSIX routines\n'] ;
- fprintf (msg) ;
- posix = input (': ') ;
- if (isempty (posix))
- posix = 1 ;
- end
- if (posix == 2)
- fprintf ('\nNot using POSIX sysconf and times routines.\n') ;
- posix = ' -DNPOSIX' ;
- else
- fprintf ('\nUsing POSIX sysconf and times routines.\n') ;
- posix = '' ;
- end
-end
+% if (~pc)
+% msg = [ ...
+% '--------------------------------------------------------------\n', ...
+% '\nUMFPACK can use the POSIX routines sysconf () and times ()\n', ...
+% 'to provide CPU time and wallclock time statistics. If you do not\n', ...
+% 'have a POSIX-compliant operating system, then UMFPACK won''t\n', ...
+% 'compile. If you don''t know which option to pick, try the\n', ...
+% 'default. If you get an error saying that sysconf and/or times\n', ...
+% 'are not defined, then recompile with the non-POSIX option.\n', ...
+% '\nPlease select one of the following options:\n', ...
+% ' 1: use POSIX sysconf and times routines (default)\n', ...
+% ' 2: do not use POSIX routines\n'] ;
+% fprintf (msg) ;
+% posix = str2num (input (': ', 's')) ;
+% if (isempty (posix))
+% posix = 1 ;
+% end
+% if (posix == 2)
+% fprintf ('\nNot using POSIX sysconf and times routines.\n') ;
+% posix = ' -DNPOSIX' ;
+% else
+% fprintf ('\nUsing POSIX sysconf and times routines.\n') ;
+% posix = '' ;
+% end
+% end
%-------------------------------------------------------------------------------
% mex command
%-------------------------------------------------------------------------------
-umfdir = sprintf ('..%sSource%s', filesep, filesep) ;
-amddir = sprintf ('..%s..%sAMD%sSource%s', filesep, filesep, filesep, filesep) ;
-incdir = sprintf ( ...
-' -I..%sInclude -I..%sSource -I..%s..%sAMD%sInclude -I..%s..%sAMD%sSource', ...
-filesep,filesep, filesep, filesep, filesep, filesep, filesep, filesep) ;
-
-mx = sprintf ('mex -inline -O%s%s%s%s', blas, utils, posix, incdir) ;
-msg = [ ...
- '--------------------------------------------------------------\n', ...
- '\nCompile options:\n%s\nNow compiling. Please wait.\n'] ;
-fprintf (msg, mx) ;
-
-% The following is adapted from GNUmakefile
+umfdir = '../Source/' ;
+amddir = '../../AMD/Source/' ;
+incdir = ' -I../Include -I../Source -I../../AMD/Include -I../../UFconfig' ;
+mx = sprintf ('mex -O%s%s%s ', posix, incdir, d) ;
+% fprintf ('compile options:\n%s\n', mx) ;
%-------------------------------------------------------------------------------
% source files
'singletons' } ;
% non-user-callable and user-callable amd_*.[ch] files (int versions only):
-amd = { 'aat', '1', '2', 'dump', 'postorder', 'post_tree', 'defaults', ...
- 'order', 'control', 'info', 'valid', 'preprocess' } ;
+amdsrc = { 'aat', '1', '2', 'dump', 'postorder', 'post_tree', 'defaults', ...
+ 'order', 'control', 'info', 'valid', 'preprocess', 'global' } ;
% user-callable umfpack_*.[ch] files (real/complex):
user = { 'col_to_triplet', 'defaults', 'free_numeric', ...
'load_numeric', 'save_numeric', 'load_symbolic', 'save_symbolic' } ;
% user-callable umfpack_*.[ch], only one version
-generic = { 'timer', 'tictoc' } ;
+generic = { 'timer', 'tictoc', 'global' } ;
M = cell (0) ;
%-------------------------------------------------------------------------------
-% Create the umfpack and amd mexFunctions for MATLAB (int versions only)
+% Create the umfpack2 and amd2 mexFunctions for MATLAB (int versions only)
%-------------------------------------------------------------------------------
for k = 1:length(umfint)
- M = make (M, '%s -DDINT -c %sumf_%s.c', 'umf_%s.%s', 'umf_%s_%s.%s', ...
- mx, umfint {k}, umfint {k}, 'm', obj, umfdir) ;
+ [M, kk] = make (M, '%s -DDLONG -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s.%s', mx, umfint {k}, umfint {k}, 'm', obj, umfdir, ...
+ kk, details) ;
end
-rules = { [mx ' -DDINT'] , [mx ' -DZINT'] } ;
+rules = { [mx ' -DDLONG'] , [mx ' -DZLONG'] } ;
kinds = { 'md', 'mz' } ;
for what = 1:2
rule = rules {what} ;
kind = kinds {what} ;
- M = make (M, '%s -DCONJUGATE_SOLVE -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s.%s', rule, 'ltsolve', 'lhsolve', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DCONJUGATE_SOLVE -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s.%s', rule, 'ltsolve', 'lhsolve', kind, obj, umfdir, ...
+ kk, details) ;
- M = make (M, '%s -DCONJUGATE_SOLVE -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s.%s', rule, 'utsolve', 'uhsolve', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DCONJUGATE_SOLVE -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s.%s', rule, 'utsolve', 'uhsolve', kind, obj, umfdir, ...
+ kk, details) ;
- M = make (M, '%s -DDO_MAP -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s_map_nox.%s', rule, 'triplet', 'triplet', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DDO_MAP -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s_map_nox.%s', rule, 'triplet', 'triplet', kind, obj, ...
+ umfdir, kk, details) ;
- M = make (M, '%s -DDO_VALUES -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s_nomap_x.%s', rule, 'triplet', 'triplet', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DDO_VALUES -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s_nomap_x.%s', rule, 'triplet', 'triplet', kind, obj, ...
+ umfdir, kk, details) ;
- M = make (M, '%s -c %sumf_%s.c', 'umf_%s.%s', ...
+ [M, kk] = make (M, '%s -c %sumf_%s.c', 'umf_%s.%s', ...
'umf_%s_%s_nomap_nox.%s', rule, 'triplet', 'triplet', kind, obj, ...
- umfdir) ;
+ umfdir, kk, details) ;
- M = make (M, '%s -DDO_MAP -DDO_VALUES -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s_map_x.%s', rule, 'triplet', 'triplet', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DDO_MAP -DDO_VALUES -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s_map_x.%s', rule, 'triplet', 'triplet', kind, obj, ...
+ umfdir, kk, details) ;
- M = make (M, '%s -DFIXQ -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s_fixq.%s', rule, 'assemble', 'assemble', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DFIXQ -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s_fixq.%s', rule, 'assemble', 'assemble', kind, obj, ...
+ umfdir, kk, details) ;
- M = make (M, '%s -DDROP -c %sumf_%s.c', 'umf_%s.%s', ...
- 'umf_%s_%s_drop.%s', rule, 'store_lu', 'store_lu', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DDROP -c %sumf_%s.c', 'umf_%s.%s', ...
+ 'umf_%s_%s_drop.%s', rule, 'store_lu', 'store_lu', kind, obj, ...
+ umfdir, kk, details) ;
for k = 1:length(umfch)
- M = make (M, '%s -c %sumf_%s.c', 'umf_%s.%s', 'umf_%s_%s.%s', ...
- rule, umfch {k}, umfch {k}, kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -c %sumf_%s.c', 'umf_%s.%s', 'umf_%s_%s.%s', ...
+ rule, umfch {k}, umfch {k}, kind, obj, umfdir, kk, details) ;
end
- M = make (M, '%s -DWSOLVE -c %sumfpack_%s.c', 'umfpack_%s.%s', ...
- 'umfpack_%s_w%s.%s', rule, 'solve', 'solve', kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -DWSOLVE -c %sumfpack_%s.c', 'umfpack_%s.%s', ...
+ 'umfpack_%s_w%s.%s', rule, 'solve', 'solve', kind, obj, umfdir, ...
+ kk, details) ;
for k = 1:length(user)
- M = make (M, '%s -c %sumfpack_%s.c', 'umfpack_%s.%s', ...
- 'umfpack_%s_%s.%s', rule, user {k}, user {k}, kind, obj, umfdir) ;
+ [M, kk] = make (M, '%s -c %sumfpack_%s.c', 'umfpack_%s.%s', ...
+ 'umfpack_%s_%s.%s', rule, user {k}, user {k}, kind, obj, ...
+ umfdir, kk, details) ;
end
end
for k = 1:length(generic)
- M = make (M, '%s -c %sumfpack_%s.c', 'umfpack_%s.%s', ...
- 'umfpack_%s_%s.%s', mx, generic {k}, generic {k}, 'm', obj, umfdir) ;
+ [M, kk] = make (M, '%s -c %sumfpack_%s.c', 'umfpack_%s.%s', ...
+ 'umfpack_%s_%s.%s', mx, generic {k}, generic {k}, 'm', obj, ...
+ umfdir, kk, details) ;
end
%----------------------------------------
% AMD routines (int only)
%----------------------------------------
-for k = 1:length(amd)
- M = make (M, '%s -DDINT -c %samd_%s.c', 'amd_%s.%s', 'amd_%s_%s.%s', ...
- mx, amd {k}, amd {k}, 'm', obj, amddir) ;
+for k = 1:length(amdsrc)
+ [M, kk] = make (M, '%s -DDLONG -c %samd_%s.c', 'amd_%s.%s', ...
+ 'amd_%s_%s.%s', mx, amdsrc {k}, amdsrc {k}, 'm', obj, amddir, ...
+ kk, details) ;
end
%----------------------------------------
-% compile the umfpack mexFunction
+% compile the umfpack2 mexFunction
%----------------------------------------
-C = sprintf ('%s -output umfpack umfpackmex.c', mx) ;
+C = sprintf ('%s -output umfpack2 umfpackmex.c', mx) ;
for i = 1:length (M)
- C = [C ' ' (M {i})] ;
+ C = [C ' ' (M {i})] ; %#ok
end
-C = [C ' ' blas_lib] ;
-cmd (C) ;
+C = [C ' ' lapack] ;
+kk = cmd (C, kk, details) ;
%----------------------------------------
% delete the object files
% compile the luflop mexFunction
%----------------------------------------
-cmd (sprintf ('%s -output luflop luflopmex.c', mx)) ;
+cmd (sprintf ('%s -output luflop luflopmex.c', mx), kk, details) ;
+
+fprintf ('\nUMFPACK successfully compiled\n') ;
+
+%===============================================================================
+% end of umfpack_make
+%===============================================================================
-fprintf ('\n\nCompilation has completed. Now trying the umfpack_simple demo.\n');
-umfpack_simple
-%-------------------------------------------------------------------------------
-% rmfile: delete a file, but only if it exists
%-------------------------------------------------------------------------------
function rmfile (file)
-if (length (dir (file)) > 0)
+% rmfile: delete a file, but only if it exists
+if (length (dir (file)) > 0) %#ok
delete (file) ;
end
-%-------------------------------------------------------------------------------
-% cpfile: copy the src file to the filename dst, overwriting dst if it exists
%-------------------------------------------------------------------------------
function cpfile (src, dst)
+% cpfile: copy the src file to the filename dst, overwriting dst if it exists
rmfile (dst)
-if (length (dir (src)) == 0)
- help umfpack_make
- error (sprintf ('File does not exist: %s\n', src)) ;
+if (length (dir (src)) == 0) %#ok
+ fprintf ('File does not exist: %s\n', src) ;
+ error ('File does not exist') ;
end
copyfile (src, dst) ;
-%-------------------------------------------------------------------------------
-% mvfile: move the src file to the filename dst, overwriting dst if it exists
%-------------------------------------------------------------------------------
function mvfile (src, dst)
+% mvfile: move the src file to the filename dst, overwriting dst if it exists
cpfile (src, dst) ;
rmfile (src) ;
-%-------------------------------------------------------------------------------
-% cmd: display and execute a command
%-------------------------------------------------------------------------------
-function cmd (s)
-fprintf ('.') ;
+function kk = cmd (s, kk, details)
+%CMD: evaluate a command, and either print it or print a "."
+if (details)
+ fprintf ('%s\n', s) ;
+else
+ if (mod (kk, 60) == 0)
+ fprintf ('\n') ;
+ end
+ kk = kk + 1 ;
+ fprintf ('.') ;
+end
eval (s) ;
-%-------------------------------------------------------------------------------
-% make: execute a "make" command for a source file
%-------------------------------------------------------------------------------
-function M = make (M, s, src, dst, rule, file1, file2, kind, obj, srcdir)
-cmd (sprintf (s, rule, srcdir, file1)) ;
+function [M, kk] = make (M, s, src, dst, rule, file1, file2, kind, obj, ...
+ srcdir, kk, details)
+% make: execute a "make" command for a source file
+kk = cmd (sprintf (s, rule, srcdir, file1), kk, details) ;
src = sprintf (src, file1, obj) ;
dst = sprintf (dst, kind, file2, obj) ;
mvfile (src, dst) ;
M {end + 1} = dst ;
+
+%-------------------------------------------------------------------------------
+function [v,pc] = getversion
+% determine the MATLAB version, and return it as a double.
+% only the primary and secondary version numbers are kept.
+% MATLAB 7.0.4 becomes 7.0, version 6.5.2 becomes 6.5, etc.
+v = version ;
+t = find (v == '.') ;
+if (length (t) > 1)
+ v = v (1:(t(2)-1)) ;
+end
+v = str2double (v) ;
+try
+ % ispc does not appear in MATLAB 5.3
+ pc = ispc ;
+catch
+ % if ispc fails, assume we are on a Windows PC if it's not unix
+ pc = ~isunix ;
+end
function umfpack_report (Control, Info)
-% UMFPACK_REPORT
+%UMFPACK_REPORT prints optional control settings and statistics
%
+% Example:
% umfpack_report (Control, Info) ;
%
-% Prints the current Control settings for umfpack, and the statistical
-% information returned by umfpack in the Info array. If Control is
+% Prints the current Control settings for umfpack2, and the statistical
+% information returned by umfpack2 in the Info array. If Control is
% an empty matrix, then the default control settings are printed.
%
% Control is 20-by-1, and Info is 90-by-1. Not all entries are used.
% umfpack_report ; print the default control parameters
% and an empty Info array.
%
-% See also umfpack, umfpack_make, umfpack_details,
+% See also umfpack, umfpack2, umfpack_make, umfpack_details,
% umfpack_demo, and umfpack_simple.
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis.
%-------------------------------------------------------------------------------
% get inputs, use defaults if input arguments not present
Info = [] ;
end
if (isempty (Control))
- Control = umfpack ;
+ Control = umfpack2 ;
end
if (isempty (Info))
Info = [ 0 (-ones (1, 89)) ] ;
% control settings
%-------------------------------------------------------------------------------
-fprintf ('\nUMFPACK Version 4.4: Control settings:\n\n') ;
+fprintf ('\nUMFPACK: Control settings:\n\n') ;
fprintf (' Control (1): print level: %d\n', Control (1)) ;
fprintf (' Control (2): dense row parameter: %g\n', Control (2)) ;
fprintf (' "dense" rows have > max (16, (%g)*16*sqrt(n_col)) entries\n', Control (2)) ;
fprintf (' Control (10): compiled for MATLAB\n') ;
elseif (Control (10) == 2)
fprintf (' Control (10): compiled for MATLAB\n') ;
- fprintf (' Uses internal utMalloc, utFree, utRealloc, utPrintf\n') ;
- fprintf (' utDivideComplex, and utFdlibm_hypot routines.\n') ;
else
fprintf (' Control (10): not compiled for MATLAB\n') ;
- fprintf (' Uses ANSI C malloc, free, realloc, and printf\n') ;
- fprintf (' instead of mxMalloc, mxFree, mxRealloc, and mexPrintf.\n') ;
fprintf (' Printing will be in terms of 0-based matrix indexing,\n') ;
fprintf (' not 1-based as is expected in MATLAB. Diary output may\n') ;
fprintf (' not be properly recorded.\n') ;
fprintf (' ###########################################\n') ;
fprintf (' ### This will be exceedingly slow! ########\n') ;
fprintf (' ###########################################\n') ;
- if (Control (10) == 1)
- fprintf (' Uses mxAssert.\n') ;
- elseif (Control (10) == 2)
- fprintf (' Uses utAssert.\n') ;
- else
- fprintf (' Uses ANSI C assert instead of mxAssert.\n') ;
- end
else
fprintf (' Control (12): compiled for normal operation (no debugging)\n') ;
end
fprintf ('ERROR required argument is missing\n') ;
elseif (status == -6)
fprintf ('ERROR n <= 0\n') ;
-elseif (status <= -7 & status >= -12 | status == -14)
+elseif (status <= -7 & status >= -12 | status == -14) %#ok
fprintf ('ERROR matrix A is corrupted\n') ;
elseif (status == -13)
fprintf ('ERROR invalid system\n') ;
fprintf (' Info (3): %d, nnz (A)\n', Info (3)) ;
fprintf (' Info (4): %d, Unit size, in bytes, for memory usage reported below\n', Info (4)) ;
fprintf (' Info (5): %d, size of int (in bytes)\n', Info (5)) ;
-fprintf (' Info (6): %d, size of long (in bytes)\n', Info (6)) ;
+fprintf (' Info (6): %d, size of UF_long (in bytes)\n', Info (6)) ;
fprintf (' Info (7): %d, size of pointer (in bytes)\n', Info (7)) ;
fprintf (' Info (8): %d, size of numerical entry (in bytes)\n', Info (8)) ;
fprintf (' Info (57): %d, # of pivots with one entry in pivot column\n', Info (57)) ;
fprintf (' Info (58): %d, # of pivots with one entry in pivot row\n', Info (58)) ;
fprintf (' Info (59): %d, # of rows/columns in submatrix S (if square)\n', Info (59)) ;
-fprintf (' Info (60): %d ') ;
+fprintf (' Info (60): ') ;
if (Info (60) > 0)
fprintf ('submatrix S square and diagonal preserved\n') ;
elseif (Info (60) == 0)
fprintf (' Info (65): %d, numerical values stored in L and U\n', Info (65)) ;
fprintf (' Info (66): %.2f, numeric factorization CPU time (seconds)\n', Info (66)) ;
fprintf (' Info (76): %.2f, numeric factorization wall clock time (seconds)\n', Info (76)) ;
-if (Info (66) > 0.05 & Info (43) > 0)
+if (Info (66) > 0.05 & Info (43) > 0) %#ok
fprintf (' mflops in numeric factorization phase: %.2f\n', 1e-6 * Info (43) / Info (66)) ;
end
fprintf (' Info (67): %d, nnz (diag (U))\n', Info (67)) ;
%-------------------------------------------------------------------------------
function prstrat (fmt, strategy)
+% prstrat print the ordering strategy
fprintf (fmt, strategy) ;
if (strategy == 1)
fprintf ('(unsymmetric)\n') ;
fprintf (' Q = AMD (A+A''), Q not refined during numeric factorization,\n') ;
fprintf (' and diagonal pivoting (P=Q'') attempted.\n') ;
else
- strategy = 0 ;
+ % strategy = 0 ;
fprintf ('(auto)\n') ;
end
%-------------------------------------------------------------------------------
function yes_no (s)
+% yes_no print yes or no
if (s == 0)
fprintf ('(no)\n') ;
else
-% umfpack_simple: a simple demo of UMFPACK
+%UMFPACK_SIMPLE a simple demo
%
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Example:
+% umfpack_simple
+%
+% Copyright 1995-2007 by Timothy A. Davis.
%
% UMFPACK License:
%
% Your use or distribution of UMFPACK or any modified version of
-% UMFPACK implies that you agree to this License.
-%
-% THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
-% EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-%
-% Permission is hereby granted to use or copy this program, provided
-% that the Copyright, this License, and the Availability of the original
-% version is retained on all copies. User documentation of any code that
-% uses UMFPACK or any modified version of UMFPACK code must cite the
-% Copyright, this License, the Availability note, and "Used by permission."
-% Permission to modify the code and to distribute modified code is granted,
-% provided the Copyright, this License, and the Availability note are
-% retained, and a notice that the code was modified is included. This
-% software was developed with support from the National Science Foundation,
-% and is provided to you free of charge.
-%
+% UMFPACK implies that you agree to this License. UMFPACK is
+% is free software; you can redistribute it and/or
+% modify it under the terms of the GNU Lesser General Public
+% License as published by the Free Software Foundation; either
+% version 2.1 of the License, or (at your option) any later version.
+
% Availability: http://www.cise.ufl.edu/research/sparse/umfpack
%
-% See also: umfpack, umfpack_details
+% See also: umfpack, umfpack2, umfpack_details
help umfpack_simple
-i = input ('Hit enter to agree to the above License: ', 's') ;
-if (~isempty (i))
- error ('terminating') ;
-end
format short
0 -1 -3 2 0
0 0 1 0 0
0 4 2 0 1
-]
+] ;
+fprintf ('A = \n') ; disp (A) ;
A = sparse (A) ;
-b = [8 45 -3 3 19]'
+b = [8 45 -3 3 19]' ;
+fprintf ('b = \n') ; disp (b) ;
fprintf ('Solution to Ax=b via UMFPACK:\n') ;
-fprintf ('x1 = umfpack (A, ''\\'', b)\n') ;
+fprintf ('x1 = umfpack2 (A, ''\\'', b)\n') ;
-x1 = umfpack (A, '\', b)
+x1 = umfpack2 (A, '\', b) ;
+fprintf ('x1 = \n') ; disp (x1) ;
fprintf ('Solution to Ax=b via MATLAB:\n') ;
fprintf ('x2 = A\\b\n') ;
-x2 = A\b
+x2 = A\b ;
+fprintf ('x2 = \n') ; disp (x2) ;
fprintf ('norm (x1-x2) should be small: %g\n', norm (x1-x2)) ;
->> umfpack_simple
- umfpack_simple: a simple demo of UMFPACK
+umfpack_simple
+ UMFPACK_SIMPLE a simple demo
- UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
- All Rights Reserved. Type umfpack_details for License.
+ Example:
+ umfpack_simple
+
+ Copyright 1995-2007 by Timothy A. Davis.
UMFPACK License:
Your use or distribution of UMFPACK or any modified version of
- UMFPACK implies that you agree to this License.
-
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses UMFPACK or any modified version of UMFPACK code must cite the
- Copyright, this License, the Availability note, and "Used by permission."
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
-
- Availability: http://www.cise.ufl.edu/research/sparse/umfpack
-
- See also: umfpack, umfpack_details
-
-
-
-Hit enter to agree to the above License:
-
-A =
+ UMFPACK implies that you agree to this License. UMFPACK is
+ is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+A =
2 3 0 0 0
3 0 4 0 6
0 -1 -3 2 0
0 0 1 0 0
0 4 2 0 1
-
-
-b =
-
+b =
8
45
-3
3
19
-
Solution to Ax=b via UMFPACK:
-x1 = umfpack (A, '\', b)
-
-x1 =
-
+x1 = umfpack2 (A, '\', b)
+x1 =
1.0000
2.0000
3.0000
4.0000
5.0000
-
Solution to Ax=b via MATLAB:
x2 = A\b
-
-x2 =
-
+x2 =
1.0000
2.0000
3.0000
4.0000
5.0000
-
norm (x1-x2) should be small: 1.28037e-15
Type 'umfpack_demo' for a full demo of UMFPACK
->> diary off
+diary off
function x = umfpack_solve (arg1, op, arg2, Control)
-% UMFPACK_SOLVE
+%UMFPACK_SOLVE x = A\b or x = b/A
%
-% x = umfpack_solve (A, '\', b, Control)
-% x = umfpack_solve (b, '/', A, Control)
+% Example:
+% x = umfpack_solve (A, '\', b, Control)
+% x = umfpack_solve (b, '/', A, Control)
%
% Computes x = A\b, or b/A, where A is square. Uses UMFPACK if A is sparse.
% The Control argument is optional.
%
-% See also umfpack, umfpack_make, umfpack_details, umfpack_report,
+% See also umfpack, umfpack2, umfpack_make, umfpack_details, umfpack_report,
% and umfpack_simple.
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Copyright 1995-2007 by Timothy A. Davis.
%-------------------------------------------------------------------------------
% check inputs and get default control parameters
end
[m1 n1] = size (b) ;
-if ((op == '\' & n ~= m1) | (op == '/' & n1 ~= m))
+if ((op == '\' & n ~= m1) | (op == '/' & n1 ~= m)) %#ok
help umfpack_solve
error ('umfpack_solve: b has the wrong dimensions') ;
end
if (nargin < 4)
- Control = umfpack ;
+ Control = umfpack2 ;
end
%-------------------------------------------------------------------------------
% A is not sparse, so just use MATLAB
x = A\b ;
- elseif (n1 == 1 & ~issparse (b))
+ elseif (n1 == 1 & ~issparse (b)) %#ok
% the UMFPACK '\' requires b to be a dense column vector
- x = umfpack (A, '\', b, Control) ;
+ x = umfpack2 (A, '\', b, Control) ;
else
% factorize with UMFPACK and do the forward/back solves in MATLAB
- [L, U, P, Q, R] = umfpack (A, Control) ;
+ [L, U, P, Q, R] = umfpack2 (A, Control) ;
x = Q * (U \ (L \ (P * (R \ b)))) ;
end
% A is not sparse, so just use MATLAB
x = b/A ;
- elseif (m1 == 1 & ~issparse (b))
+ elseif (m1 == 1 & ~issparse (b)) %#ok
% the UMFPACK '\' requires b to be a dense column vector
- x = umfpack (b, '/', A, Control) ;
+ x = umfpack2 (b, '/', A, Control) ;
else
% factorize with UMFPACK and do the forward/back solves in MATLAB
% this mimics the behavior of x = b/A, except for the row scaling
- [L, U, P, Q, R] = umfpack (A.', Control) ;
+ [L, U, P, Q, R] = umfpack2 (A.', Control) ;
x = (Q * (U \ (L \ (P * (R \ (b.')))))).' ;
% an alternative method:
- % [L, U, P, Q, r] = umfpack (A, Control) ;
+ % [L, U, P, Q, r] = umfpack2 (A, Control) ;
% x = (R \ (P' * (L.' \ (U.' \ (Q' * b.'))))).' ;
end
-% UMFPACK_TEST: test UMFPACK solve: b/A, A\b with iterative refinement
-% Requires the UFsparse package for downloading matrices from the UF
-% sparse matrix library.
+%UMFPACK_TEST for testing umfpack2 (requires UFget)
%
-% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
-% All Rights Reserved. Type umfpack_details for License.
+% Example:
+% umfpack_test
+% See also umfpack2
+
+% Copyright 1995-2007 by Timothy A. Davis.
index = UFget ;
[ignore, i] = sort (index.nrows (f)) ;
f = f (i) ;
-Control = umfpack ;
+Control = umfpack2 ;
Control (1) = 0 ;
-warning ('off', 'all') ;
figure (1)
clf
% symbolic factorization
%-----------------------------------------------------------------------
- [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ;
+ [P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic') ;
subplot (2,2,1)
spy (A)
title ('A')
% P(R\A)Q = LU
%-----------------------------------------------------------------------
- [L,U,P,Q,R,Info] = umfpack (A) ;
+ [L,U,P,Q,R,Info] = umfpack2 (A) ;
err = lu_normest (P*(R\A)*Q, L, U) ;
fprintf ('norm est PR\\AQ-LU: %g relative: %g\n', ...
err, err / norm (A,1)) ;
% PAQ = LU
%-----------------------------------------------------------------------
- [L,U,P,Q] = umfpack (A) ;
+ [L,U,P,Q] = umfpack2 (A) ;
err = lu_normest (P*A*Q, L, U) ;
fprintf ('norm est PAQ-LU: %g relative: %g\n', ...
err, err / norm (A,1)) ;
% factor the transpose
Control (8) = 2 ;
- [x, info] = umfpack (A', '\', c, Control) ;
+ [x, info] = umfpack2 (A', '\', c, Control) ;
lunz0 = info (44) + info (45) - info (67) ;
r = norm (A'*x-c) ;
% factor the original matrix and solve xA=b
for ir = 0:4
Control (8) = ir ;
- [x, info] = umfpack (b, '/', A, Control) ;
+ [x, info] = umfpack2 (b, '/', A, Control) ;
r = norm (b-x*A) ;
if (ir == 0)
lunz1 = info (44) + info (45) - info (67) ;
% factor the original matrix and solve Ax=b
for ir = 0:4
Control (8) = ir ;
- [x, info] = umfpack (A, '\', c, Control) ;
+ [x, info] = umfpack2 (A, '\', c, Control) ;
r = norm (A*x-c) ;
fprintf ('%d: %8.2e %d %d\n', ir, r, info (81), info (82)) ;
end
- fprintf ('lunz trans %12d no trans: %12d trans/notrans: %10.4f\n', ...
+ fprintf (...
+ 'lunz trans %12d no trans: %12d trans/notrans: %10.4f\n', ...
lunz0, lunz1, lunz0 / lunz1) ;
%-----------------------------------------------------------------------
%-----------------------------------------------------------------------
det1 = det (A) ;
- det2 = umfpack (A, 'det') ;
- [det3 dexp3] = umfpack (A, 'det') ;
+ det2 = umfpack2 (A, 'det') ;
+ [det3 dexp3] = umfpack2 (A, 'det') ;
err = abs (det1-det2) ;
err3 = abs (det1 - (det3 * 10^dexp3)) ;
denom = det1 ;
end
err = err / denom ;
err3 = err3 / denom ;
- fprintf ('det: %24.16e + (%24.16e)i MATLAB\n', real(det1), imag(det1)) ;
- fprintf ('det: %24.16e + (%24.16e)i umfpack\n',real(det2), imag(det2)) ;
- fprintf ('det: (%24.16e + (%24.16e)i) * 10^(%g) umfpack\n', real(det3), imag(det3), dexp3) ;
+ fprintf ('det: %20.12e + (%20.12e)i MATLAB\n', ...
+ real(det1), imag(det1)) ;
+ fprintf ('det: %20.12e + (%20.12e)i umfpack2\n', ...
+ real(det2), imag(det2)) ;
+ fprintf ('det: (%20.12e + (%20.12e)i) * 10^(%g) umfpack2\n', ...
+ real(det3), imag(det3), dexp3) ;
fprintf ('diff %g %g\n', err, err3) ;
catch
fprintf ('failed\n') ;
end
-
-% pause
-
end
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
Modified for v4.3.1, Jan 10, 2005: default has been changed to
NO_TRANSPOSE_FORWARD_SLASH, to test iterative refinement for b/A.
v4.4: added method for computing the determinant.
+
+ v5.1: port to 64-bit MATLAB
*/
+
#define NO_TRANSPOSE_FORWARD_SLASH /* default has changed for v4.3.1 */
+#include "UFconfig.h"
#include "umfpack.h"
#include "mex.h"
#include "matrix.h"
static void error
(
char *s,
- int A_is_complex,
+ UF_long A_is_complex,
int nargout,
mxArray *pargout [ ],
double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO],
- int status,
- int do_info
+ UF_long status,
+ UF_long do_info
)
{
- int i ;
- double *OutInfo ;
+ UF_long i ;
+ double *Out_Info ;
if (A_is_complex)
{
- umfpack_zi_report_status (Control, status) ;
- umfpack_zi_report_info (Control, Info) ;
+ umfpack_zl_report_status (Control, status) ;
+ umfpack_zl_report_info (Control, Info) ;
}
else
{
- umfpack_di_report_status (Control, status) ;
- umfpack_di_report_info (Control, Info) ;
+ umfpack_dl_report_status (Control, status) ;
+ umfpack_dl_report_info (Control, Info) ;
}
if (do_info > 0)
{
/* return Info */
pargout [do_info] = mxCreateDoubleMatrix (1, UMFPACK_INFO, mxREAL) ;
- OutInfo = mxGetPr (pargout [do_info]) ;
+ Out_Info = mxGetPr (pargout [do_info]) ;
for (i = 0 ; i < UMFPACK_INFO ; i++)
{
- OutInfo [i] = Info [i] ;
+ Out_Info [i] = Info [i] ;
}
}
mexErrMsgTxt (s) ;
double Info [UMFPACK_INFO], Control [UMFPACK_CONTROL], dx, dz, dexp ;
double *Lx, *Lz, *Ux, *Uz, *Ax, *Az, *Bx, *Bz, *Xx, *Xz, *User_Control,
- *p, *q, *OutInfo, *p1, *p2, *p3, *p4, *Ltx, *Ltz, *Rs, *Px, *Qx ;
+ *p, *q, *Out_Info, *p1, *p2, *p3, *p4, *Ltx, *Ltz, *Rs, *Px, *Qx ;
void *Symbolic, *Numeric ;
- int *Lp, *Li, *Up, *Ui, *Ap, *Ai, *P, *Q, do_solve, lnz, unz, nn, i,
+ UF_long *Lp, *Li, *Up, *Ui, *Ap, *Ai, *P, *Q, do_solve, lnz, unz, nn, i,
transpose, size, do_info, do_numeric, *Front_npivcol, op, k, *Rp, *Ri,
*Front_parent, *Chain_start, *Chain_maxrows, *Chain_maxcols, nz, status,
nfronts, nchains, *Ltp, *Ltj, *Qinit, print_level, status2, no_scale,
char warning [200] ;
#ifndef NO_TRANSPOSE_FORWARD_SLASH
- int *Cp, *Ci ;
+ UF_long *Cp, *Ci ;
double *Cx, *Cz ;
#endif
+ /* ---------------------------------------------------------------------- */
+ /* define the memory manager and printf functions for UMFPACK and AMD */
+ /* ---------------------------------------------------------------------- */
+
+ /* with these settings, the UMFPACK mexFunction can use ../Lib/libumfpack.a
+ * and ../Lib/libamd.a, instead compiling UMFPACK and AMD specifically for
+ * the MATLAB mexFunction. */
+ amd_malloc = mxMalloc ;
+ amd_free = mxFree ;
+ amd_calloc = mxCalloc ;
+ amd_realloc = mxRealloc ;
+ amd_printf = mexPrintf ;
+
+ /* The default values for these function pointers are fine.
+ umfpack_hypot = umf_hypot ;
+ umfpack_divcomplex = umf_divcomplex ;
+ */
+
/* ---------------------------------------------------------------------- */
/* get inputs A, b, and the operation to perform */
/* ---------------------------------------------------------------------- */
pargout [0] = mxCreateDoubleMatrix (UMFPACK_CONTROL, 1, mxREAL) ;
User_Control = mxGetPr (pargout [0]) ;
- umfpack_di_defaults (User_Control) ;
+ umfpack_dl_defaults (User_Control) ;
return ;
}
}
/* The real/complex status of A determines which version to use, */
- /* (umfpack_di_* or umfpack_zi_*). */
+ /* (umfpack_dl_* or umfpack_zl_*). */
A_is_complex = mxIsComplex (Amatrix) ;
Atype = A_is_complex ? mxCOMPLEX : mxREAL ;
- Ap = mxGetJc (Amatrix) ;
- Ai = mxGetIr (Amatrix) ;
+ Ap = (UF_long *) mxGetJc (Amatrix) ;
+ Ai = (UF_long *) mxGetIr (Amatrix) ;
Ax = mxGetPr (Amatrix) ;
Az = mxGetPi (Amatrix) ;
if (A_is_complex)
{
- umfpack_zi_defaults (Control) ;
+ umfpack_zl_defaults (Control) ;
}
else
{
- umfpack_di_defaults (Control) ;
+ umfpack_dl_defaults (Control) ;
}
if (User_Control_matrix)
{
}
else
{
- print_level = (int) Control [UMFPACK_PRL] ;
+ print_level = (UF_long) Control [UMFPACK_PRL] ;
}
Control [UMFPACK_PRL] = print_level ;
{
mexErrMsgTxt ("input Qinit must be dense") ;
}
- Qinit = (int *) mxMalloc (n_col * sizeof (int)) ;
+ Qinit = (UF_long *) mxMalloc (n_col * sizeof (UF_long)) ;
p = mxGetPr (User_Qinit) ;
for (k = 0 ; k < n_col ; k++)
{
/* convert from 1-based to 0-based indexing */
- Qinit [k] = ((int) (p [k])) - 1 ;
+ Qinit [k] = ((UF_long) (p [k])) - 1 ;
}
}
{
/* umfpack_*_qsymbolic will call colamd to get Qinit. This is the */
/* same as calling umfpack_*_symbolic with Qinit set to NULL*/
- Qinit = (int *) NULL ;
+ Qinit = (UF_long *) NULL ;
}
/* ---------------------------------------------------------------------- */
if (A_is_complex)
{
- umfpack_zi_report_control (Control) ;
+ umfpack_zl_report_control (Control) ;
if (print_level >= 3) mexPrintf ("\nA: ") ;
- (void) umfpack_zi_report_matrix (n_row, n_col, Ap, Ai, Ax, Az,
+ (void) umfpack_zl_report_matrix (n_row, n_col, Ap, Ai, Ax, Az,
1, Control) ;
if (Qinit)
{
if (print_level >= 3) mexPrintf ("\nQinit: ") ;
- (void) umfpack_zi_report_perm (n_col, Qinit, Control) ;
+ (void) umfpack_zl_report_perm (n_col, Qinit, Control) ;
}
}
else
{
- umfpack_di_report_control (Control) ;
+ umfpack_dl_report_control (Control) ;
if (print_level >= 3) mexPrintf ("\nA: ") ;
- (void) umfpack_di_report_matrix (n_row, n_col, Ap, Ai, Ax,
+ (void) umfpack_dl_report_matrix (n_row, n_col, Ap, Ai, Ax,
1, Control) ;
if (Qinit)
{
if (print_level >= 3) mexPrintf ("\nQinit: ") ;
- (void) umfpack_di_report_perm (n_col, Qinit, Control) ;
+ (void) umfpack_dl_report_perm (n_col, Qinit, Control) ;
}
}
/* make sure Ci and Cx exist, avoid malloc of zero-sized arrays. */
nz = MAX (Ap [nn], 1) ;
- Cp = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Ci = (int *) mxMalloc (nz * sizeof (int)) ;
+ Cp = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Ci = (UF_long *) mxMalloc (nz * sizeof (UF_long)) ;
Cx = (double *) mxMalloc (nz * sizeof (double)) ;
if (A_is_complex)
{
Cz = (double *) mxMalloc (nz * sizeof (double)) ;
- status = umfpack_zi_transpose (nn, nn, Ap, Ai, Ax, Az,
- (int *) NULL, (int *) NULL, Cp, Ci, Cx, Cz, FALSE) ;
+ status = umfpack_zl_transpose (nn, nn, Ap, Ai, Ax, Az,
+ (UF_long *) NULL, (UF_long *) NULL, Cp, Ci, Cx, Cz, FALSE) ;
}
else
{
- status = umfpack_di_transpose (nn, nn, Ap, Ai, Ax,
- (int *) NULL, (int *) NULL, Cp, Ci, Cx) ;
+ status = umfpack_dl_transpose (nn, nn, Ap, Ai, Ax,
+ (UF_long *) NULL, (UF_long *) NULL, Cp, Ci, Cx) ;
}
if (status != UMFPACK_OK)
if (A_is_complex)
{
- status = umfpack_zi_qsymbolic (n_row, n_col, Ap, Ai, Ax, Az,
+ status = umfpack_zl_qsymbolic (n_row, n_col, Ap, Ai, Ax, Az,
Qinit, &Symbolic, Control, Info) ;
}
else
{
- status = umfpack_di_qsymbolic (n_row, n_col, Ap, Ai, Ax,
+ status = umfpack_dl_qsymbolic (n_row, n_col, Ap, Ai, Ax,
Qinit, &Symbolic, Control, Info) ;
}
if (A_is_complex)
{
- (void) umfpack_zi_report_symbolic (Symbolic, Control) ;
+ (void) umfpack_zl_report_symbolic (Symbolic, Control) ;
}
else
{
- (void) umfpack_di_report_symbolic (Symbolic, Control) ;
+ (void) umfpack_dl_report_symbolic (Symbolic, Control) ;
}
/* ---------------------------------------------------------------------- */
if (A_is_complex)
{
- status = umfpack_zi_numeric (Ap, Ai, Ax, Az, Symbolic, &Numeric,
+ status = umfpack_zl_numeric (Ap, Ai, Ax, Az, Symbolic, &Numeric,
Control, Info) ;
}
else
{
- status = umfpack_di_numeric (Ap, Ai, Ax, Symbolic, &Numeric,
+ status = umfpack_dl_numeric (Ap, Ai, Ax, Symbolic, &Numeric,
Control, Info) ;
}
if (A_is_complex)
{
- umfpack_zi_free_symbolic (&Symbolic) ;
+ umfpack_zl_free_symbolic (&Symbolic) ;
}
else
{
- umfpack_di_free_symbolic (&Symbolic) ;
+ umfpack_dl_free_symbolic (&Symbolic) ;
}
/* ------------------------------------------------------------------ */
if (A_is_complex)
{
- (void) umfpack_zi_report_numeric (Numeric, Control) ;
+ (void) umfpack_zl_report_numeric (Numeric, Control) ;
}
else
{
- (void) umfpack_di_report_numeric (Numeric, Control) ;
+ (void) umfpack_dl_report_numeric (Numeric, Control) ;
}
/* ------------------------------------------------------------------ */
if (print_level >= 3) mexPrintf ("\nright-hand side, b: ") ;
if (B_is_complex)
{
- (void) umfpack_zi_report_vector (nn, Bx, Bz, Control) ;
+ (void) umfpack_zl_report_vector (nn, Bx, Bz, Control) ;
}
else
{
- (void) umfpack_di_report_vector (nn, Bx, Control) ;
+ (void) umfpack_dl_report_vector (nn, Bx, Control) ;
}
/* -------------------------------------------------------------- */
{
if (!B_is_complex)
{
- /* umfpack_zi_solve expects a complex B */
+ /* umfpack_zl_solve expects a complex B */
Bz = (double *) mxCalloc (nn, sizeof (double)) ;
}
- status = umfpack_zi_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz,
+ status = umfpack_zl_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz,
Numeric, Control, Info) ;
if (!B_is_complex)
{
/* Ax=b when b is complex and A is sparse can be split */
/* into two systems, A*xr=br and A*xi=bi, where r denotes */
/* the real part and i the imaginary part of x and b. */
- status2 = umfpack_di_solve (sys, Ap, Ai, Ax, Xz, Bz,
+ status2 = umfpack_dl_solve (sys, Ap, Ai, Ax, Xz, Bz,
Numeric, Control, Info) ;
}
- status = umfpack_di_solve (sys, Ap, Ai, Ax, Xx, Bx,
+ status = umfpack_dl_solve (sys, Ap, Ai, Ax, Xx, Bx,
Numeric, Control, Info) ;
}
if (A_is_complex)
{
- umfpack_zi_free_numeric (&Numeric) ;
+ umfpack_zl_free_numeric (&Numeric) ;
}
else
{
- umfpack_di_free_numeric (&Numeric) ;
+ umfpack_dl_free_numeric (&Numeric) ;
}
/* -------------------------------------------------------------- */
if (print_level >= 3) mexPrintf ("\nsolution, x: ") ;
if (X_is_complex)
{
- (void) umfpack_zi_report_vector (nn, Xx, Xz, Control) ;
+ (void) umfpack_zl_report_vector (nn, Xx, Xz, Control) ;
}
else
{
- (void) umfpack_di_report_vector (nn, Xx, Control) ;
+ (void) umfpack_dl_report_vector (nn, Xx, Control) ;
}
/* -------------------------------------------------------------- */
}
if (A_is_complex)
{
- status = umfpack_zi_get_determinant (&dx, &dz, p,
+ status = umfpack_zl_get_determinant (&dx, &dz, p,
Numeric, Info) ;
- umfpack_zi_free_numeric (&Numeric) ;
+ umfpack_zl_free_numeric (&Numeric) ;
}
else
{
- status = umfpack_di_get_determinant (&dx, p,
+ status = umfpack_dl_get_determinant (&dx, p,
Numeric, Info) ;
- umfpack_di_free_numeric (&Numeric) ;
+ umfpack_dl_free_numeric (&Numeric) ;
dz = 0 ;
}
if (status < 0)
if (A_is_complex)
{
- status = umfpack_zi_get_lunz (&lnz, &unz, &ignore1, &ignore2,
+ status = umfpack_zl_get_lunz (&lnz, &unz, &ignore1, &ignore2,
&ignore3, Numeric) ;
}
else
{
- status = umfpack_di_get_lunz (&lnz, &unz, &ignore1, &ignore2,
+ status = umfpack_dl_get_lunz (&lnz, &unz, &ignore1, &ignore2,
&ignore3, Numeric) ;
}
{
if (A_is_complex)
{
- umfpack_zi_free_numeric (&Numeric) ;
+ umfpack_zl_free_numeric (&Numeric) ;
}
else
{
- umfpack_di_free_numeric (&Numeric) ;
+ umfpack_dl_free_numeric (&Numeric) ;
}
error ("extracting LU factors failed", A_is_complex, nargout,
pargout, Control, Info, status, do_info) ;
unz = MAX (unz, 1) ;
/* get temporary space, for the *** ROW *** form of L */
- Ltp = (int *) mxMalloc ((n_row+1) * sizeof (int)) ;
- Ltj = (int *) mxMalloc (lnz * sizeof (int)) ;
+ Ltp = (UF_long *) mxMalloc ((n_row+1) * sizeof (UF_long)) ;
+ Ltj = (UF_long *) mxMalloc (lnz * sizeof (UF_long)) ;
Ltx = (double *) mxMalloc (lnz * sizeof (double)) ;
if (A_is_complex)
{
/* create permanent copy of the output matrix U */
pargout [1] = mxCreateSparse (n_inner, n_col, unz, Atype) ;
- Up = mxGetJc (pargout [1]) ;
- Ui = mxGetIr (pargout [1]) ;
+ Up = (UF_long *) mxGetJc (pargout [1]) ;
+ Ui = (UF_long *) mxGetIr (pargout [1]) ;
Ux = mxGetPr (pargout [1]) ;
Uz = mxGetPi (pargout [1]) ;
/* temporary space for the integer permutation vectors */
- P = (int *) mxMalloc (n_row * sizeof (int)) ;
- Q = (int *) mxMalloc (n_col * sizeof (int)) ;
+ P = (UF_long *) mxMalloc (n_row * sizeof (UF_long)) ;
+ Q = (UF_long *) mxMalloc (n_col * sizeof (UF_long)) ;
/* get scale factors, if requested */
status2 = UMFPACK_OK ;
{
/* create a diagonal sparse matrix for the scale factors */
pargout [4] = mxCreateSparse (n_row, n_row, n_row, mxREAL) ;
- Rp = mxGetJc (pargout [4]) ;
- Ri = mxGetIr (pargout [4]) ;
+ Rp = (UF_long *) mxGetJc (pargout [4]) ;
+ Ri = (UF_long *) mxGetIr (pargout [4]) ;
for (i = 0 ; i < n_row ; i++)
{
Rp [i] = i ;
/* get Lt, U, P, Q, and Rs from the numeric object */
if (A_is_complex)
{
- status = umfpack_zi_get_numeric (Ltp, Ltj, Ltx, Ltz, Up, Ui, Ux,
+ status = umfpack_zl_get_numeric (Ltp, Ltj, Ltx, Ltz, Up, Ui, Ux,
Uz, P, Q, (double *) NULL, (double *) NULL,
&do_recip, Rs, Numeric) ;
- umfpack_zi_free_numeric (&Numeric) ;
+ umfpack_zl_free_numeric (&Numeric) ;
}
else
{
- status = umfpack_di_get_numeric (Ltp, Ltj, Ltx, Up, Ui,
+ status = umfpack_dl_get_numeric (Ltp, Ltj, Ltx, Up, Ui,
Ux, P, Q, (double *) NULL,
&do_recip, Rs, Numeric) ;
- umfpack_di_free_numeric (&Numeric) ;
+ umfpack_dl_free_numeric (&Numeric) ;
}
/* for the mexFunction, -DNRECIPROCAL must be set,
/* create sparse permutation matrix for P */
pargout [2] = mxCreateSparse (n_row, n_row, n_row, mxREAL) ;
- Pp = mxGetJc (pargout [2]) ;
- Pi = mxGetIr (pargout [2]) ;
+ Pp = (UF_long *) mxGetJc (pargout [2]) ;
+ Pi = (UF_long *) mxGetIr (pargout [2]) ;
Px = mxGetPr (pargout [2]) ;
for (k = 0 ; k < n_row ; k++)
{
/* create sparse permutation matrix for Q */
pargout [3] = mxCreateSparse (n_col, n_col, n_col, mxREAL) ;
- Qp = mxGetJc (pargout [3]) ;
- Qi = mxGetIr (pargout [3]) ;
+ Qp = (UF_long *) mxGetJc (pargout [3]) ;
+ Qi = (UF_long *) mxGetIr (pargout [3]) ;
Qx = mxGetPr (pargout [3]) ;
for (k = 0 ; k < n_col ; k++)
{
/* permanent copy of L */
pargout [0] = mxCreateSparse (n_row, n_inner, lnz, Atype) ;
- Lp = mxGetJc (pargout [0]) ;
- Li = mxGetIr (pargout [0]) ;
+ Lp = (UF_long *) mxGetJc (pargout [0]) ;
+ Li = (UF_long *) mxGetIr (pargout [0]) ;
Lx = mxGetPr (pargout [0]) ;
Lz = mxGetPi (pargout [0]) ;
if (A_is_complex)
{
/* non-conjugate array transpose */
- status = umfpack_zi_transpose (n_inner, n_row, Ltp, Ltj, Ltx,
- Ltz, (int *) NULL, (int *) NULL, Lp, Li, Lx, Lz, FALSE) ;
+ status = umfpack_zl_transpose (n_inner, n_row, Ltp, Ltj, Ltx,
+ Ltz, (UF_long *) NULL, (UF_long *) NULL, Lp, Li, Lx, Lz,
+ FALSE) ;
}
else
{
- status = umfpack_di_transpose (n_inner, n_row, Ltp, Ltj, Ltx,
- (int *) NULL, (int *) NULL, Lp, Li, Lx) ;
+ status = umfpack_dl_transpose (n_inner, n_row, Ltp, Ltj, Ltx,
+ (UF_long *) NULL, (UF_long *) NULL, Lp, Li, Lx) ;
}
mxFree (Ltp) ;
if (A_is_complex)
{
if (print_level >= 3) mexPrintf ("\nL: ") ;
- (void) umfpack_zi_report_matrix (n_row, n_inner, Lp, Li,
+ (void) umfpack_zl_report_matrix (n_row, n_inner, Lp, Li,
Lx, Lz, 1, Control) ;
if (print_level >= 3) mexPrintf ("\nU: ") ;
- (void) umfpack_zi_report_matrix (n_inner, n_col, Up, Ui,
+ (void) umfpack_zl_report_matrix (n_inner, n_col, Up, Ui,
Ux, Uz, 1, Control) ;
if (print_level >= 3) mexPrintf ("\nP: ") ;
- (void) umfpack_zi_report_perm (n_row, P, Control) ;
+ (void) umfpack_zl_report_perm (n_row, P, Control) ;
if (print_level >= 3) mexPrintf ("\nQ: ") ;
- (void) umfpack_zi_report_perm (n_col, Q, Control) ;
+ (void) umfpack_zl_report_perm (n_col, Q, Control) ;
}
else
{
if (print_level >= 3) mexPrintf ("\nL: ") ;
- (void) umfpack_di_report_matrix (n_row, n_inner, Lp, Li,
+ (void) umfpack_dl_report_matrix (n_row, n_inner, Lp, Li,
Lx, 1, Control) ;
if (print_level >= 3) mexPrintf ("\nU: ") ;
- (void) umfpack_di_report_matrix (n_inner, n_col, Up, Ui,
+ (void) umfpack_dl_report_matrix (n_inner, n_col, Up, Ui,
Ux, 1, Control) ;
if (print_level >= 3) mexPrintf ("\nP: ") ;
- (void) umfpack_di_report_perm (n_row, P, Control) ;
+ (void) umfpack_dl_report_perm (n_row, P, Control) ;
if (print_level >= 3) mexPrintf ("\nQ: ") ;
- (void) umfpack_di_report_perm (n_col, Q, Control) ;
+ (void) umfpack_dl_report_perm (n_col, Q, Control) ;
}
mxFree (P) ;
/* return the symbolic factorization */
/* ------------------------------------------------------------------ */
- Q = (int *) mxMalloc (n_col * sizeof (int)) ;
- P = (int *) mxMalloc (n_row * sizeof (int)) ;
- Front_npivcol = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Front_parent = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Front_1strow = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Front_leftmostdesc = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Chain_start = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Chain_maxrows = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
- Chain_maxcols = (int *) mxMalloc ((nn+1) * sizeof (int)) ;
+ Q = (UF_long *) mxMalloc (n_col * sizeof (UF_long)) ;
+ P = (UF_long *) mxMalloc (n_row * sizeof (UF_long)) ;
+ Front_npivcol = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Front_parent = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Front_1strow = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Front_leftmostdesc = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Chain_start = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Chain_maxrows = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
+ Chain_maxcols = (UF_long *) mxMalloc ((nn+1) * sizeof (UF_long)) ;
if (A_is_complex)
{
- status = umfpack_zi_get_symbolic (&ignore1, &ignore2, &ignore3,
+ status = umfpack_zl_get_symbolic (&ignore1, &ignore2, &ignore3,
&nz, &nfronts, &nchains, P, Q, Front_npivcol,
Front_parent, Front_1strow, Front_leftmostdesc,
Chain_start, Chain_maxrows, Chain_maxcols, Symbolic) ;
- umfpack_zi_free_symbolic (&Symbolic) ;
+ umfpack_zl_free_symbolic (&Symbolic) ;
}
else
{
- status = umfpack_di_get_symbolic (&ignore1, &ignore2, &ignore3,
+ status = umfpack_dl_get_symbolic (&ignore1, &ignore2, &ignore3,
&nz, &nfronts, &nchains, P, Q, Front_npivcol,
Front_parent, Front_1strow, Front_leftmostdesc,
Chain_start, Chain_maxrows, Chain_maxcols, Symbolic) ;
- umfpack_di_free_symbolic (&Symbolic) ;
+ umfpack_dl_free_symbolic (&Symbolic) ;
}
if (status < 0)
/* create sparse permutation matrix for P */
pargout [0] = mxCreateSparse (n_row, n_row, n_row, mxREAL) ;
- Pp = mxGetJc (pargout [0]) ;
- Pi = mxGetIr (pargout [0]) ;
+ Pp = (UF_long *) mxGetJc (pargout [0]) ;
+ Pi = (UF_long *) mxGetIr (pargout [0]) ;
Px = mxGetPr (pargout [0]) ;
for (k = 0 ; k < n_row ; k++)
{
/* create sparse permutation matrix for Q */
pargout [1] = mxCreateSparse (n_col, n_col, n_col, mxREAL) ;
- Qp = mxGetJc (pargout [1]) ;
- Qi = mxGetIr (pargout [1]) ;
+ Qp = (UF_long *) mxGetJc (pargout [1]) ;
+ Qi = (UF_long *) mxGetIr (pargout [1]) ;
Qx = mxGetPr (pargout [1]) ;
for (k = 0 ; k < n_col ; k++)
{
if (A_is_complex)
{
- umfpack_zi_report_info (Control, Info) ;
+ umfpack_zl_report_info (Control, Info) ;
}
else
{
- umfpack_di_report_info (Control, Info) ;
+ umfpack_dl_report_info (Control, Info) ;
}
if (do_info > 0)
{
/* return Info */
pargout [do_info] = mxCreateDoubleMatrix (1, UMFPACK_INFO, mxREAL) ;
- OutInfo = mxGetPr (pargout [do_info]) ;
+ Out_Info = mxGetPr (pargout [do_info]) ;
for (i = 0 ; i < UMFPACK_INFO ; i++)
{
- OutInfo [i] = Info [i] ;
+ Out_Info [i] = Info [i] ;
}
}
}
--- /dev/null
+ 5 1 -0.278842
+ 6 1 -0.268019
+ 7 1 -0.232372
+ 8 1 -0.157508
+ 9 1 -0.0632598
+25 1 0.139421
+26 1 0.134009
+27 1 0.116186
+28 1 0.0787541
+29 1 0.0316299
+ 5 2 -0.8
+21 2 -0.915953
+25 2 0.4
+61 2 1
+ 6 3 -0.8
+22 3 -0.915953
+26 3 0.4
+61 3 1
+ 7 4 -0.8
+23 4 -0.915953
+27 4 0.4
+61 4 1
+ 8 5 -0.8
+24 5 -0.915953
+28 5 0.4
+61 5 1
+ 9 6 -0.8
+29 6 0.4
+61 6 1
+ 5 7 0.134462
+ 6 7 0.117568
+ 7 7 0.0885926
+ 8 7 0.0475944
+ 9 7 0.0117829
+ 1 8 -0.834182
+ 5 8 0.4
+57 8 1
+ 2 9 -0.834182
+ 6 9 0.4
+57 9 1
+ 3 10 -0.834182
+ 7 10 0.4
+57 10 1
+ 4 11 -0.834182
+ 8 11 0.4
+57 11 1
+ 9 12 0.4
+57 12 1
+ 1 13 1.26582
+ 5 13 0.4
+10 13 -1.26582
+11 13 0.333333
+58 13 1
+ 2 14 1.01266
+ 6 14 0.4
+10 14 -1.01266
+12 14 0.333333
+58 14 1
+ 3 15 0.759494
+ 7 15 0.4
+10 15 -0.759494
+13 15 0.333333
+58 15 1
+ 4 16 0.506329
+ 8 16 0.4
+10 16 -0.506329
+14 16 0.333333
+58 16 1
+ 9 17 0.4
+10 17 -0.253165
+15 17 0.333333
+58 17 1
+ 1 18 -0.336156
+ 2 18 -0.29392
+ 3 18 -0.221481
+ 4 18 -0.118986
+10 18 1
+15 19 0.666667
+56 19 1
+11 20 -0.207176
+12 20 -0.214039
+13 20 -0.214421
+14 20 -0.198677
+15 20 -0.165687
+16 20 0.124305
+17 20 0.128423
+18 20 0.128652
+19 20 0.119206
+20 20 0.0994125
+11 21 -1
+16 21 0.6
+59 21 1
+12 22 -1
+17 22 0.6
+59 22 1
+13 23 -1
+18 23 0.6
+59 23 1
+14 24 -1
+19 24 0.6
+59 24 1
+15 25 -1
+20 25 0.6
+59 25 1
+16 26 0.45
+36 26 -0.958319
+40 26 0.5
+64 26 1
+17 27 0.45
+37 27 -0.958319
+41 27 0.5
+64 27 1
+18 28 0.45
+38 28 -0.958319
+42 28 0.5
+64 28 1
+19 29 0.45
+39 29 -0.958319
+43 29 0.5
+64 29 1
+20 30 0.45
+44 30 0.5
+64 30 1
+16 31 -0.207099
+17 31 -0.2233
+18 31 -0.228626
+19 31 -0.202453
+20 31 -0.138523
+25 31 -0.207099
+26 31 -0.2233
+27 31 -0.228626
+28 31 -0.202453
+29 31 -0.138523
+16 32 -1.05
+25 32 -1.05
+60 32 1
+17 33 -1.05
+26 33 -1.05
+60 33 1
+18 34 -1.05
+27 34 -1.05
+60 34 1
+19 35 -1.05
+28 35 -1.05
+60 35 1
+20 36 -1.05
+29 36 -1.05
+60 36 1
+25 37 0.0814745
+26 37 0.0978901
+27 37 0.113161
+28 37 0.115056
+29 37 0.0924191
+31 37 0.0905272
+32 37 0.108767
+33 37 0.125734
+34 37 0.127839
+35 37 0.102688
+21 38 1.5674
+25 38 0.65
+30 38 -1.5674
+31 38 0.722222
+62 38 1
+22 39 1.25392
+26 39 0.65
+30 39 -1.25392
+32 39 0.722222
+62 39 1
+23 40 0.940439
+27 40 0.65
+30 40 -0.940439
+33 40 0.722222
+62 40 1
+24 41 0.626959
+28 41 0.65
+30 41 -0.626959
+34 41 0.722222
+62 41 1
+29 42 0.65
+30 42 -0.31348
+35 42 0.722222
+62 42 1
+21 43 -0.278842
+22 43 -0.268019
+23 43 -0.232372
+24 43 -0.157508
+30 43 1
+31 44 0.25
+46 44 -0.824225
+50 44 0.5
+66 44 1
+32 45 0.25
+47 45 -0.824225
+51 45 0.5
+66 45 1
+33 46 0.25
+48 46 -0.824225
+52 46 0.5
+66 46 1
+34 47 0.25
+49 47 -0.824225
+53 47 0.5
+66 47 1
+35 48 0.25
+54 48 0.5
+66 48 1
+31 49 -0.158163
+32 49 -0.194771
+33 49 -0.230392
+34 49 -0.236285
+35 49 -0.18039
+40 49 -0.158163
+41 49 -0.194771
+42 49 -0.230392
+43 49 -0.236285
+44 49 -0.18039
+31 50 -0.972222
+40 50 -0.972222
+63 50 1
+32 51 -0.972222
+41 51 -0.972222
+63 51 1
+33 52 -0.972222
+42 52 -0.972222
+63 52 1
+34 53 -0.972222
+43 53 -0.972222
+63 53 1
+35 54 -0.972222
+44 54 -0.972222
+63 54 1
+40 55 0.0532286
+41 55 0.0757454
+42 55 0.106103
+43 55 0.133388
+44 55 0.131535
+50 55 -0.106457
+51 55 -0.151491
+52 55 -0.212206
+53 55 -0.266776
+54 55 -0.263071
+36 56 1.86335
+40 56 0.472222
+45 56 -1.86335
+50 56 -0.944444
+65 56 1
+37 57 1.49068
+41 57 0.472222
+45 57 -1.49068
+51 57 -0.944444
+65 57 1
+38 58 1.11801
+42 58 0.472222
+45 58 -1.11801
+52 58 -0.944444
+65 58 1
+39 59 0.745342
+43 59 0.472222
+45 59 -0.745342
+53 59 -0.944444
+65 59 1
+44 60 0.472222
+45 60 -0.372671
+54 60 -0.944444
+65 60 1
+36 61 -0.206995
+37 61 -0.235647
+38 61 -0.247567
+39 61 -0.207487
+45 61 1
+46 62 1.86335
+50 62 0.444444
+55 62 -1.86335
+67 62 1
+47 63 1.49068
+51 63 0.444444
+55 63 -1.49068
+67 63 1
+48 64 1.11801
+52 64 0.444444
+55 64 -1.11801
+67 64 1
+49 65 0.745342
+53 65 0.444444
+55 65 -0.745342
+67 65 1
+54 66 0.444444
+55 66 -0.372671
+67 66 1
+46 67 -0.144335
+47 67 -0.191856
+48 67 -0.24215
+49 67 -0.254119
+55 67 1
-UMFPACK Version 4.4: a set of routines solving sparse linear systems via LU
- factorization. Requires two other packages: the BLAS (dense matrix
- operations) and AMD (sparse matrix minimum degree ordering). Includes
- a C-callable and MATLAB interface, and a basic FORTRAN 77 interface to
- a subset of the C-callable routines.
+UMFPACK Version 5.0.2: a set of routines solving sparse linear systems via LU
+ factorization. Requires three other packages: the BLAS (dense matrix
+ operations), AMD (sparse matrix minimum degree ordering), and UFconfig.
+ Includes a C-callable and MATLAB interface, and a basic FORTRAN 77
+ interface to a subset of the C-callable routines. Requires AMD Version
+ 2.0 or later.
+
+The AMD, UFconfig, and UMFPACK directories must all reside in the same parent
+directory.
Quick start (Unix, or Windows with Cygwin):
To compile, test, and install both UMFPACK and AMD, the UMFPACK and AMD
directories must be in the same parent directory. To configure, edit
- UMFPACK/Make/Make.include and AMD/Make/Make.include (otherwise the BLAS
- will not be used, and UMFPACK will be slow). cd to this directory (UMFPACK)
- and type "make" (or "make lib" if you do not have MATLAB). To compile and
- run a demo program for Harwell/Boeing matrices, type "make hb". To compile
- a FORTRAN main program that calls the 32-bit C-callable UMFPACK library,
- type "make fortran". When done, type "make clean" to remove unused *.o
- files (keeps the compiled libraries and demo programs). See the User Guide
- (Doc/UserGuide.pdf), or UMFPACK/Make/Make.include, for more details
- (including options for compiling 64-bit mode).
+ the UFconfig/UFconfig.mk file (otherwise, you may get warnings that the
+ BLAS (dgemm, etc) are not found). You may use UMFPACK_CONFIG = -DNBLAS in
+ the UFconfig/UFconfig.mk file, to avoid using the BLAS, but UMFPACK will be
+ slow. Next, cd to this directory (UMFPACK) and type "make". To compile
+ and run a FORTRAN demo program for Harwell/Boeing matrices, type "make hb".
+ To compile a FORTRAN main program that calls the 32-bit C-callable UMFPACK
+ library, type "make fortran". When done, type "make clean" to remove
+ unused *.o files (keeps the compiled libraries and demo programs). See
+ the User Guide (Doc/UserGuide.pdf), or ../UFconfig/UFconfig.mk for more
+ details (including options for compiling in 64-bit mode).
Quick start (for MATLAB users):
To compile, test, and install the UMFPACK mexFunction, cd to the
UMFPACK/MATLAB directory and type umfpack_make at the MATLAB prompt.
- This works on any system supported by MATLAB.
+
+ NOTE: DO NOT ATTEMPT TO USE THIS CODE IN 64-BIT MATLAB (v7.3).
+ It is not yet ported to that version of MATLAB.
--------------------------------------------------------------------------------
-UMFPACK Version 4.4 (Jan. 28, 2005), Copyright (c) 2005 by Timothy A.
-Davis. All Rights Reserved.
+UMFPACK, Copyright (c) 1995-2006 by Timothy A. Davis. All Rights Reserved.
+UMFPACK is available under alternate licences; contact T. Davis for details.
UMFPACK License:
Your use or distribution of UMFPACK or any modified version of
UMFPACK implies that you agree to this License.
- THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
- EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-
- Permission is hereby granted to use or copy this program, provided
- that the Copyright, this License, and the Availability of the original
- version is retained on all copies. User documentation of any code that
- uses UMFPACK or any modified version of UMFPACK code must cite the
- Copyright, this License, the Availability note, and "Used by permission."
- Permission to modify the code and to distribute modified code is granted,
- provided the Copyright, this License, and the Availability note are
- retained, and a notice that the code was modified is included. This
- software was developed with support from the National Science Foundation,
- and is provided to you free of charge.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ Permission is hereby granted to use or copy this program under the
+ terms of the GNU LGPL, provided that the Copyright, this License,
+ and the Availability of the original version is retained on all copies.
+ User documentation of any code that uses this code or any modified
+ version of this code must cite the Copyright, this License, the
+ Availability note, and "Used by permission." Permission to modify
+ the code and to distribute modified code is granted, provided the
+ Copyright, this License, and the Availability note are retained,
+ and a notice that the code was modified is included.
Availability:
http://www.cise.ufl.edu/research/sparse/umfpack
- UMFPACK (including versions 2.2.1 and earlier, in Fortran) is available at
+ UMFPACK (including versions 2.2.1 and earlier, in FORTRAN) is available at
http://www.cise.ufl.edu/research/sparse. MA38 is available in the Harwell
Subroutine Library. This version of UMFPACK includes a modified form of
COLAMD Version 2.0, originally released on Jan. 31, 2000, also available at
Refer to ../AMD/README for the License for AMD, which is a separate
package for ordering sparse matrices that is required by UMFPACK.
-UMFPACK v4.4 can use either AMD v1.0 or v1.1.
+UMFPACK v4.5 cannot use AMD v1.1 or earlier. UMFPACK 5.0
+requires AMD v2.0 or later.
--------------------------------------------------------------------------------
with a MATLAB (Version 6.0 or later) interface.
For best performance, UMFPACK requires an optimized BLAS library. It can
- also be compiled without any BLAS at all. UMFPACK requires AMD Version 1.0
- or Version 1.1
+ also be compiled without any BLAS at all. UMFPACK requires AMD Version 2.0.
Authors:
----------------------------------------------------------------------------
Doc documentation
- Make for compiling UMFPACK (a symbolic link to ../AMD/Make)
Source primary source code
Include include files for use in your code that calls UMFPACK
Demo demo programs. also serves as test of the UMFPACK installation.
UserGuide.stex User Guide (LaTeX)
UserGuide.pdf User Guide (PDF)
- ----------------------------------------------------------------------------
- Make directory: for compiling the UMFPACK library (Lib/libumfpack.a)
- ----------------------------------------------------------------------------
-
- This is a symbolic link to the ../AMD/Make directory. Refer to the
- ../AMD/README file for a list of its contents.
-
----------------------------------------------------------------------------
Source directory:
----------------------------------------------------------------------------
- GNUmakefile a nice Makefile, for GNU make
- Makefile an ugly Unix Makefile (for older make's)
+ cholmod_blas.h an exact copy of CHOLMOD/Include/cholmod_blas.h
umfpack_col_to_triplet.c convert col form to triplet
umfpack_defaults.c set Control defaults
umf_config.h configuration file (BLAS, memory, timer)
umf_internal.h definitions internal to UMFPACK
- umf_version.h version definitions (int/long, real/complex)
+ umf_version.h version definitions (int/UF_long, real/complex)
umf_2by2.[ch]
umf_analyze.[ch] symbolic factorization of A'*A
umfpack_zl_demo.sed for creating umfpack_zl_demo.c
umfpack_di_demo.c a full demo (real/int version)
- umfpack_dl_demo.c a full demo (real/long version)
+ umfpack_dl_demo.c a full demo (real/UF_long version)
umfpack_zi_demo.c a full demo (complex/int version)
- umfpack_zl_demo.c a full demo (complex/long version)
+ umfpack_zl_demo.c a full demo (complex/UF_long version)
- umfpack_di_demo.out umfpack_di_demo output, unmodified Make.include
- umfpack_dl_demo.out umfpack_dl_demo output, unmodified Make.include
- umfpack_zi_demo.out umfpack_zi_demo output, unmodified Make.include
- umfpack_zl_demo.out umfpack_zl_demo output, unmodified Make.include
+ umfpack_di_demo.out umfpack_di_demo output
+ umfpack_dl_demo.out umfpack_dl_demo output
+ umfpack_zi_demo.out umfpack_zi_demo output
+ umfpack_zl_demo.out umfpack_zl_demo output
umf4.c a demo (real/int) for Harwell/Boeing matrices
- umf4.out output of "make hb", unmodified Make.include
+ umf4.out output of "make hb"
HB directory of sample Harwell/Boeing matrices
readhb.f reads HB matrices, keeps zero entries
readhb_nozeros.f reads HB matrices, removes zero entries
Lib directory: libumfpack.a library placed here
----------------------------------------------------------------------------
+ GNUmakefile a nice Makefile, for GNU make
+ Makefile an ugly Unix Makefile (for older make's)
libumfpack.def UMPFACK definitions for Windows
$(addsuffix .h,$(UMFINT)) \
$(addprefix ../Include/, $(addsuffix .h,$(USER))) \
$(addprefix ../Include/, $(addsuffix .h,$(GENERIC))) \
- ../../AMD/Source/amd_internal.h ../../AMD/Include/amd.h
+ ../../AMD/Include/amd_internal.h ../../AMD/Include/amd.h
#-------------------------------------------------------------------------------
# object files for each version
--- /dev/null
+/* ========================================================================== */
+/* === Include/cholmod_blas.h =============================================== */
+/* ========================================================================== */
+
+/* -----------------------------------------------------------------------------
+ * CHOLMOD/Include/cholmod_blas.h.
+ * Copyright (C) Univ. of Florida. Author: Timothy A. Davis
+ * CHOLMOD/Include/cholmod_blas.h is licensed under Version 2.1 of the GNU
+ * Lesser General Public License. See lesser.txt for a text of the license.
+ * CHOLMOD is also available under other licenses; contact authors for details.
+ * http://www.cise.ufl.edu/research/sparse
+ * -------------------------------------------------------------------------- */
+
+/* This does not need to be included in the user's program. */
+
+#ifndef CHOLMOD_BLAS_H
+#define CHOLMOD_BLAS_H
+
+/* ========================================================================== */
+/* === Architecture ========================================================= */
+/* ========================================================================== */
+
+#if defined (__sun) || defined (MSOL2) || defined (ARCH_SOL2)
+#define CHOLMOD_SOL2
+#define CHOLMOD_ARCHITECTURE "Sun Solaris"
+
+#elif defined (__sgi) || defined (MSGI) || defined (ARCH_SGI)
+#define CHOLMOD_SGI
+#define CHOLMOD_ARCHITECTURE "SGI Irix"
+
+#elif defined (__linux) || defined (MGLNX86) || defined (ARCH_GLNX86)
+#define CHOLMOD_LINUX
+#define CHOLMOD_ARCHITECTURE "Linux"
+
+#elif defined (_AIX) || defined (MIBM_RS) || defined (ARCH_IBM_RS)
+#define CHOLMOD_AIX
+#define CHOLMOD_ARCHITECTURE "IBM AIX"
+#define BLAS_NO_UNDERSCORE
+
+#elif defined (__alpha) || defined (MALPHA) || defined (ARCH_ALPHA)
+#define CHOLMOD_ALPHA
+#define CHOLMOD_ARCHITECTURE "Compaq Alpha"
+
+#elif defined (_WIN32) || defined (WIN32) || defined (_WIN64) || defined (WIN64)
+#if defined (__MINGW32__) || defined (__MINGW32__)
+#define CHOLMOD_MINGW
+#elif defined (__CYGWIN32__) || defined (__CYGWIN32__)
+#define CHOLMOD_CYGWIN
+#else
+#define CHOLMOD_WINDOWS
+#define BLAS_NO_UNDERSCORE
+#endif
+#define CHOLMOD_ARCHITECTURE "Microsoft Windows"
+
+#elif defined (__hppa) || defined (__hpux) || defined (MHPUX) || defined (ARCH_HPUX)
+#define CHOLMOD_HP
+#define CHOLMOD_ARCHITECTURE "HP Unix"
+#define BLAS_NO_UNDERSCORE
+
+#elif defined (__hp700) || defined (MHP700) || defined (ARCH_HP700)
+#define CHOLMOD_HP
+#define CHOLMOD_ARCHITECTURE "HP 700 Unix"
+#define BLAS_NO_UNDERSCORE
+
+#else
+/* If the architecture is unknown, and you call the BLAS, you may need to */
+/* define BLAS_BY_VALUE, BLAS_NO_UNDERSCORE, and/or BLAS_CHAR_ARG yourself. */
+#define CHOLMOD_ARCHITECTURE "unknown"
+#endif
+
+
+/* ========================================================================== */
+/* === BLAS and LAPACK names ================================================ */
+/* ========================================================================== */
+
+/* Prototypes for the various versions of the BLAS. */
+
+/* Determine if the 64-bit Sun Performance BLAS is to be used */
+#if defined(CHOLMOD_SOL2) && !defined(NSUNPERF) && defined(LONG) && defined(LONGBLAS)
+#define SUN64
+#endif
+
+#ifdef SUN64
+
+#define BLAS_DTRSV dtrsv_64_
+#define BLAS_DGEMV dgemv_64_
+#define BLAS_DTRSM dtrsm_64_
+#define BLAS_DGEMM dgemm_64_
+#define BLAS_DSYRK dsyrk_64_
+#define BLAS_DGER dger_64_
+#define BLAS_DSCAL dscal_64_
+#define LAPACK_DPOTRF dpotrf_64_
+
+#define BLAS_ZTRSV ztrsv_64_
+#define BLAS_ZGEMV zgemv_64_
+#define BLAS_ZTRSM ztrsm_64_
+#define BLAS_ZGEMM zgemm_64_
+#define BLAS_ZHERK zherk_64_
+#define BLAS_ZGER zgeru_64_
+#define BLAS_ZSCAL zscal_64_
+#define LAPACK_ZPOTRF zpotrf_64_
+
+#elif defined (BLAS_NO_UNDERSCORE)
+
+#define BLAS_DTRSV dtrsv
+#define BLAS_DGEMV dgemv
+#define BLAS_DTRSM dtrsm
+#define BLAS_DGEMM dgemm
+#define BLAS_DSYRK dsyrk
+#define BLAS_DGER dger
+#define BLAS_DSCAL dscal
+#define LAPACK_DPOTRF dpotrf
+
+#define BLAS_ZTRSV ztrsv
+#define BLAS_ZGEMV zgemv
+#define BLAS_ZTRSM ztrsm
+#define BLAS_ZGEMM zgemm
+#define BLAS_ZHERK zherk
+#define BLAS_ZGER zgeru
+#define BLAS_ZSCAL zscal
+#define LAPACK_ZPOTRF zpotrf
+
+#else
+
+#define BLAS_DTRSV dtrsv_
+#define BLAS_DGEMV dgemv_
+#define BLAS_DTRSM dtrsm_
+#define BLAS_DGEMM dgemm_
+#define BLAS_DSYRK dsyrk_
+#define BLAS_DGER dger_
+#define BLAS_DSCAL dscal_
+#define LAPACK_DPOTRF dpotrf_
+
+#define BLAS_ZTRSV ztrsv_
+#define BLAS_ZGEMV zgemv_
+#define BLAS_ZTRSM ztrsm_
+#define BLAS_ZGEMM zgemm_
+#define BLAS_ZHERK zherk_
+#define BLAS_ZGER zgeru_
+#define BLAS_ZSCAL zscal_
+#define LAPACK_ZPOTRF zpotrf_
+
+#endif
+
+/* ========================================================================== */
+/* === BLAS and LAPACK integer arguments ==================================== */
+/* ========================================================================== */
+
+/* CHOLMOD can be compiled with -D'LONGBLAS=long' for the Sun Performance
+ * Library, or -D'LONGBLAS=long long' for SGI's SCSL BLAS. This defines the
+ * integer used in the BLAS for the cholmod_l_* routines.
+ *
+ * The "int" version of CHOLMOD always uses the "int" version of the BLAS.
+ */
+
+#if defined (LONGBLAS) && defined (LONG)
+#define BLAS_INT LONGBLAS
+#else
+#define BLAS_INT int
+#endif
+
+/* If the BLAS integer is smaller than the basic CHOLMOD integer, then we need
+ * to check for integer overflow when converting from one to the other. If
+ * any integer overflows, the externally-defined blas_ok variable is set to
+ * FALSE. blas_ok should be set to TRUE before calling any BLAS_* macro.
+ */
+
+#define CHECK_BLAS_INT (sizeof (BLAS_INT) < sizeof (Int))
+#define EQ(K,k) (((BLAS_INT) K) == ((Int) k))
+
+/* ========================================================================== */
+/* === BLAS and LAPACK prototypes and macros ================================ */
+/* ========================================================================== */
+
+void BLAS_DGEMV (char *trans, BLAS_INT *m, BLAS_INT *n, double *alpha,
+ double *A, BLAS_INT *lda, double *X, BLAS_INT *incx, double *beta,
+ double *Y, BLAS_INT *incy) ;
+
+#define BLAS_dgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy) \
+{ \
+ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx) \
+ && EQ (INCY,incy) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DGEMV (trans, &M, &N, alpha, A, &LDA, X, &INCX, beta, Y, &INCY) ; \
+ } \
+}
+
+void BLAS_ZGEMV (char *trans, BLAS_INT *m, BLAS_INT *n, double *alpha,
+ double *A, BLAS_INT *lda, double *X, BLAS_INT *incx, double *beta,
+ double *Y, BLAS_INT *incy) ;
+
+#define BLAS_zgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy) \
+{ \
+ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx) \
+ && EQ (INCY,incy) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZGEMV (trans, &M, &N, alpha, A, &LDA, X, &INCX, beta, Y, &INCY) ; \
+ } \
+}
+
+void BLAS_DTRSV (char *uplo, char *trans, char *diag, BLAS_INT *n, double *A,
+ BLAS_INT *lda, double *X, BLAS_INT *incx) ;
+
+#define BLAS_dtrsv(uplo,trans,diag,n,A,lda,X,incx) \
+{ \
+ BLAS_INT N = n, LDA = lda, INCX = incx ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DTRSV (uplo, trans, diag, &N, A, &LDA, X, &INCX) ; \
+ } \
+}
+
+void BLAS_ZTRSV (char *uplo, char *trans, char *diag, BLAS_INT *n, double *A,
+ BLAS_INT *lda, double *X, BLAS_INT *incx) ;
+
+#define BLAS_ztrsv(uplo,trans,diag,n,A,lda,X,incx) \
+{ \
+ BLAS_INT N = n, LDA = lda, INCX = incx ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZTRSV (uplo, trans, diag, &N, A, &LDA, X, &INCX) ; \
+ } \
+}
+
+void BLAS_DTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m,
+ BLAS_INT *n, double *alpha, double *A, BLAS_INT *lda, double *B,
+ BLAS_INT *ldb) ;
+
+#define BLAS_dtrsm(side,uplo,transa,diag,m,n,alpha,A,lda,B,ldb) \
+{ \
+ BLAS_INT M = m, N = n, LDA = lda, LDB = ldb ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && EQ (LDB,ldb) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
+ } \
+}
+
+void BLAS_ZTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m,
+ BLAS_INT *n, double *alpha, double *A, BLAS_INT *lda, double *B,
+ BLAS_INT *ldb) ;
+
+#define BLAS_ztrsm(side,uplo,transa,diag,m,n,alpha,A,lda,B,ldb) \
+{ \
+ BLAS_INT M = m, N = n, LDA = lda, LDB = ldb ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && EQ (LDB,ldb) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
+ } \
+}
+
+void BLAS_DGEMM (char *transa, char *transb, BLAS_INT *m, BLAS_INT *n,
+ BLAS_INT *k, double *alpha, double *A, BLAS_INT *lda, double *B,
+ BLAS_INT *ldb, double *beta, double *C, BLAS_INT *ldc) ;
+
+#define BLAS_dgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc) \
+{ \
+ BLAS_INT M = m, N = n, K = k, LDA = lda, LDB = ldb, LDC = ldc ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (K,k) && EQ (LDA,lda) \
+ && EQ (LDB,ldb) && EQ (LDC,ldc) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DGEMM (transa, transb, &M, &N, &K, alpha, A, &LDA, B, &LDB, beta, \
+ C, &LDC) ; \
+ } \
+}
+
+void BLAS_ZGEMM (char *transa, char *transb, BLAS_INT *m, BLAS_INT *n,
+ BLAS_INT *k, double *alpha, double *A, BLAS_INT *lda, double *B,
+ BLAS_INT *ldb, double *beta, double *C, BLAS_INT *ldc) ;
+
+#define BLAS_zgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc) \
+{ \
+ BLAS_INT M = m, N = n, K = k, LDA = lda, LDB = ldb, LDC = ldc ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (K,k) && EQ (LDA,lda) \
+ && EQ (LDB,ldb) && EQ (LDC,ldc) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZGEMM (transa, transb, &M, &N, &K, alpha, A, &LDA, B, &LDB, beta, \
+ C, &LDC) ; \
+ } \
+}
+
+void BLAS_DSYRK (char *uplo, char *trans, BLAS_INT *n, BLAS_INT *k,
+ double *alpha, double *A, BLAS_INT *lda, double *beta, double *C,
+ BLAS_INT *ldc) ;
+
+#define BLAS_dsyrk(uplo,trans,n,k,alpha,A,lda,beta,C,ldc) \
+{ \
+ BLAS_INT N = n, K = k, LDA = lda, LDC = ldc ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (K,k) && EQ (LDA,lda) && EQ (LDC,ldc) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DSYRK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \
+ } \
+} \
+
+void BLAS_ZHERK (char *uplo, char *trans, BLAS_INT *n, BLAS_INT *k,
+ double *alpha, double *A, BLAS_INT *lda, double *beta, double *C,
+ BLAS_INT *ldc) ;
+
+#define BLAS_zherk(uplo,trans,n,k,alpha,A,lda,beta,C,ldc) \
+{ \
+ BLAS_INT N = n, K = k, LDA = lda, LDC = ldc ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (K,k) && EQ (LDA,lda) && EQ (LDC,ldc) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZHERK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \
+ } \
+} \
+
+void LAPACK_DPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda,
+ BLAS_INT *info) ;
+
+#define LAPACK_dpotrf(uplo,n,A,lda,info) \
+{ \
+ BLAS_INT N = n, LDA = lda, INFO = 1 ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (LDA,lda) ; \
+ } \
+ if (blas_ok) \
+ { \
+ LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
+ } \
+ info = INFO ; \
+}
+
+void LAPACK_ZPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda,
+ BLAS_INT *info) ;
+
+#define LAPACK_zpotrf(uplo,n,A,lda,info) \
+{ \
+ BLAS_INT N = n, LDA = lda, INFO = 1 ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (LDA,lda) ; \
+ } \
+ if (blas_ok) \
+ { \
+ LAPACK_ZPOTRF (uplo, &N, A, &LDA, &INFO) ; \
+ } \
+ info = INFO ; \
+}
+
+/* ========================================================================== */
+
+void BLAS_DSCAL (BLAS_INT *n, double *alpha, double *Y, BLAS_INT *incy) ;
+
+#define BLAS_dscal(n,alpha,Y,incy) \
+{ \
+ BLAS_INT N = n, INCY = incy ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (INCY,incy) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DSCAL (&N, alpha, Y, &INCY) ; \
+ } \
+}
+
+void BLAS_ZSCAL (BLAS_INT *n, double *alpha, double *Y, BLAS_INT *incy) ;
+
+#define BLAS_zscal(n,alpha,Y,incy) \
+{ \
+ BLAS_INT N = n, INCY = incy ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (N,n) && EQ (INCY,incy) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZSCAL (&N, alpha, Y, &INCY) ; \
+ } \
+}
+
+void BLAS_DGER (BLAS_INT *m, BLAS_INT *n, double *alpha,
+ double *X, BLAS_INT *incx, double *Y, BLAS_INT *incy,
+ double *A, BLAS_INT *lda) ;
+
+#define BLAS_dger(m,n,alpha,X,incx,Y,incy,A,lda) \
+{ \
+ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx) \
+ && EQ (INCY,incy) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_DGER (&M, &N, alpha, X, &INCX, Y, &INCY, A, &LDA) ; \
+ } \
+}
+
+void BLAS_ZGERU (BLAS_INT *m, BLAS_INT *n, double *alpha,
+ double *X, BLAS_INT *incx, double *Y, BLAS_INT *incy,
+ double *A, BLAS_INT *lda) ;
+
+#define BLAS_zgeru(m,n,alpha,X,incx,Y,incy,A,lda) \
+{ \
+ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \
+ if (CHECK_BLAS_INT) \
+ { \
+ blas_ok &= EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx) \
+ && EQ (INCY,incy) ; \
+ } \
+ if (blas_ok) \
+ { \
+ BLAS_ZGER (&M, &N, alpha, X, &INCX, Y, &INCY, A, &LDA) ; \
+ } \
+}
+
+#endif
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
#endif
Ri, Rp, n2, n2, Rp [n2]) ;
#endif
- ASSERT (AMD_valid (n2, n2, Rp, Ri)) ;
+ ASSERT (AMD_valid (n2, n2, Rp, Ri) == AMD_OK) ;
/* ---------------------------------------------------------------------- */
/* for each weak diagonal, find a pair of strong off-diagonal entries */
#ifndef NDEBUG
/* UMF_debug += 99 ; */
DEBUGm3 (("\n ==================================UMF_2by2: tol %g\n", tol)) ;
- ASSERT (AMD_valid (n, n, Ap, Ai)) ;
+ ASSERT (AMD_valid (n, n, Ap, Ai) == AMD_OK) ;
for (k = n1 ; k < n - nempty ; k++)
{
ASSERT (Cperm1 [k] == Rperm1 [k]) ;
}
}
Cp [n2] = pp ;
- ASSERT (AMD_valid (n2, n2, Cp, Ci)) ;
+ ASSERT (AMD_valid (n2, n2, Cp, Ci) == AMD_OK) ;
if (nweak == 0)
{
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* Degree update and numerical assembly. This is compiled twice (with and
- * without FIXQ) for each real/complex int/long version, for a total of 8
+ * without FIXQ) for each real/complex int/UF_long version, for a total of 8
* versions.*/
#include "umf_internal.h"
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
Entry *L, *U, *C, *LU ;
- Int k, m, n, d, nb, dc ;
+ Int i, j, s, k, m, n, d, nb, dc ;
+
+#ifndef NBLAS
+ Int blas_ok = TRUE ;
+#else
+#define blas_ok FALSE
+#endif
DEBUG5 (("In UMF_blas3_update "ID" "ID" "ID"\n",
Work->fnpiv, Work->fnrows, Work->fncols)) ;
if (k == 1)
{
-#ifdef USE_NO_BLAS
-
- /* no BLAS available - use plain C code instead */
- Int i, j ;
+#ifndef NBLAS
+ BLAS_GER (m, n, L, U, C, d) ;
+#endif
- /* rank-1 outer product to update the C block */
- for (j = 0 ; j < n ; j++)
+ if (!blas_ok)
{
- Entry u_j = U [j] ;
- if (IS_NONZERO (u_j))
+ /* rank-1 outer product to update the C block */
+ for (j = 0 ; j < n ; j++)
{
- Entry *c_ij, *l_is ;
- c_ij = & C [j*d] ;
- l_is = & L [0] ;
-#pragma ivdep
- for (i = 0 ; i < m ; i++)
+ Entry u_j = U [j] ;
+ if (IS_NONZERO (u_j))
{
- /* C [i+j*d]-= L [i] * U [j] */
- MULT_SUB (*c_ij, *l_is, u_j) ;
- c_ij++ ;
- l_is++ ;
+ Entry *c_ij, *l_is ;
+ c_ij = & C [j*d] ;
+ l_is = & L [0] ;
+#pragma ivdep
+ for (i = 0 ; i < m ; i++)
+ {
+ /* C [i+j*d]-= L [i] * U [j] */
+ MULT_SUB (*c_ij, *l_is, u_j) ;
+ c_ij++ ;
+ l_is++ ;
+ }
}
}
}
-#else
- BLAS_GER (m, n, L, U, C, d) ;
-
-#endif /* USE_NO_BLAS */
-
}
else
{
-#ifdef USE_NO_BLAS
+ /* triangular solve to update the U block */
- /* no BLAS available - use plain C code instead */
- Int i, j, s ;
+#ifndef NBLAS
+ BLAS_TRSM_RIGHT (n, k, LU, nb, U, dc) ;
+#endif
- /* triangular solve to update the U block */
- for (s = 0 ; s < k ; s++)
+ if (!blas_ok)
{
- for (i = s+1 ; i < k ; i++)
+ /* use plain C code if no BLAS at compile time, or if integer
+ * overflow has occurred */
+ for (s = 0 ; s < k ; s++)
{
- Entry l_is = LU [i+s*nb] ;
- if (IS_NONZERO (l_is))
+ for (i = s+1 ; i < k ; i++)
{
- Entry *u_ij, *u_sj ;
- u_ij = & U [i*dc] ;
- u_sj = & U [s*dc] ;
-#pragma ivdep
- for (j = 0 ; j < n ; j++)
+ Entry l_is = LU [i+s*nb] ;
+ if (IS_NONZERO (l_is))
{
- /* U [i*dc+j] -= LU [i+s*nb] * U [s*dc+j] ; */
- MULT_SUB (*u_ij, l_is, *u_sj) ;
- u_ij++ ;
- u_sj++ ;
+ Entry *u_ij, *u_sj ;
+ u_ij = & U [i*dc] ;
+ u_sj = & U [s*dc] ;
+#pragma ivdep
+ for (j = 0 ; j < n ; j++)
+ {
+ /* U [i*dc+j] -= LU [i+s*nb] * U [s*dc+j] ; */
+ MULT_SUB (*u_ij, l_is, *u_sj) ;
+ u_ij++ ;
+ u_sj++ ;
+ }
}
}
}
/* rank-k outer product to update the C block */
/* C = C - L*U' (U is stored by rows, not columns) */
- for (s = 0 ; s < k ; s++)
+
+#ifndef NBLAS
+ BLAS_GEMM (m, n, k, L, U, dc, C, d) ;
+#endif
+
+ if (!blas_ok)
{
- for (j = 0 ; j < n ; j++)
+ /* use plain C code if no BLAS at compile time, or if integer
+ * overflow has occurred */
+
+ for (s = 0 ; s < k ; s++)
{
- Entry u_sj = U [j+s*dc] ;
- if (IS_NONZERO (u_sj))
+ for (j = 0 ; j < n ; j++)
{
- Entry *c_ij, *l_is ;
- c_ij = & C [j*d] ;
- l_is = & L [s*d] ;
-#pragma ivdep
- for (i = 0 ; i < m ; i++)
+ Entry u_sj = U [j+s*dc] ;
+ if (IS_NONZERO (u_sj))
{
- /* C [i+j*d]-= L [i+s*d] * U [s*dc+j] */
- MULT_SUB (*c_ij, *l_is, u_sj) ;
- c_ij++ ;
- l_is++ ;
+ Entry *c_ij, *l_is ;
+ c_ij = & C [j*d] ;
+ l_is = & L [s*d] ;
+#pragma ivdep
+ for (i = 0 ; i < m ; i++)
+ {
+ /* C [i+j*d]-= L [i+s*d] * U [s*dc+j] */
+ MULT_SUB (*c_ij, *l_is, u_sj) ;
+ c_ij++ ;
+ l_is++ ;
+ }
}
}
}
}
-
-#else
-
- BLAS_TRSM_RIGHT (n, k, LU, nb, U, dc) ;
- BLAS_GEMM (m, n, k, L, U, dc, C, d) ;
-
-#endif /* USE_NO_BLAS */
-
}
#ifndef NDEBUG
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/*
This file controls the compile-time configuration of UMFPACK. Modify the
- Makefile, the architecture-dependent Make.* file, and this file if
- necessary, to control these options. The following flags may be given
- as options to your C compiler (as in "cc -DNBLAS", for example). These
- flags are normally placed in your CONFIG string, defined in your Make.*.
+ UFconfig/UFconfig.mk file and this file if necessary, to control these
+ options. The following flags may be given as options to your C compiler
+ (as in "cc -DNSUNPERF", for example). These flags are normally placed in
+ your UMFPACK_CONFIG string, defined in the UFconfig/UFconfig.mk file.
All of these options, except for the timer, are for accessing the BLAS.
- -DNBLAS
-
- BLAS mode. If -DNBLAS is set, then no BLAS will be used. Vanilla
- C code will be used instead. This is portable, and easier to
- install, but you won't get the best performance.
-
- If -DNBLAS is not set, then externally-available BLAS routines
- (dgemm, dger, and dgemv or the equivalent C-BLAS routines) will be
- used. This will give you the best performance, but perhaps at the
- expense of portability.
-
- The default is to use the BLAS, for both the C-callable libumfpack.a
- library and the MATLAB mexFunction. If you have trouble installing
- UMFPACK, set -DNBLAS (but then UMFPACK will be slow).
-
- -DCBLAS
-
- If -DCBLAS is set, then the C-BLAS interface to the BLAS is
- used. If your vendor-supplied BLAS library does not have a C-BLAS
- interface, you can obtain the ATLAS BLAS, available at
- http://www.netlib.org/atlas.
-
- This flag is ignored if -DNBLAS is set.
-
- -DLP64
-
- This should be defined if you are compiling in the LP64 model
- (32 bit int's, 64 bit long's, and 64 bit pointers). In Solaris,
- this is obtained with the flags -xtarget=ultra -xarch=v9 for
- the cc compiler (for example).
-
- -DLONGBLAS
-
- If not defined, then the BLAS are not called in the long integer
- version of UMFPACK (the umfpack_*l_* routines). The most common
- definitions of the BLAS, unfortunately, use int arguments, and
- are thus not suitable for use in the LP64 model. Only the Sun
- Performance Library, as far as I can tell, has a version of the
- BLAS that allows long integer (64-bit) input arguments. This
- flag is set automatically in Sun Solaris if you are using the
- Sun Performance BLAS. You can set it yourself, too, if your BLAS
- routines can take long integer input arguments.
-
-DNSUNPERF
Applies only to Sun Solaris. If -DNSUNPERF is set, then the Sun
The Sun Performance Library BLAS is used by default when compiling
the C-callable libumfpack.a library on Sun Solaris.
- This flag is ignored if -DNBLAS is set.
-
- -DNSCSL
-
- Applies only to SGI IRIX. If -DSCSL is set, then the SGI SCSL
- Scientific Library BLAS will not be used.
-
- The SGI SCSL Scientific Library BLAS is used by default when
- compiling the C-callable libumfpack.a library on SGI IRIX.
-
- This flag is ignored if -DNBLAS is set.
+ -DLONGBLAS
-DNPOSIX
If -DNO_TIMER is set, then no timing routines are used at all.
- -DNUTIL
-
- If -DNUTIL is set, then the internal MATLAB utMalloc, utFree, and
- utRealloc routines are not used in the UMFPACK mexFunction. The
- regular mxMalloc, mxFree, and mxRealloc routines are used instead.
- These routines are not documented, but are available for use. For
- Windows, -DNUTIL is defined below, because access to the ut*
- routines is not available by default.
-
-DNRECIPROCAL
This option controls a tradeoff between speed and accuracy. Using
If the pivot is zero, and this flag is set, then no divide-by-zero
occurs.
- You should normally not set these flags yourself:
-
- -DBLAS_BY_VALUE if scalars are passed by value, not reference
- -DBLAS_NO_UNDERSCORE if no underscore should be appended
- -DBLAS_CHAR_ARG if BLAS options are single char's, not strings
-
- The BLAS options are normally set automatically. If your
- architecture cannot be determined (see UMFPACK_ARCHITECTURE, below)
- then you may need to set these flags yourself.
-
The following options are controlled by amd_internal.h:
-DMATLAB_MEX_FILE
This flag is turned on when compiling the umfpack mexFunction for
- use in MATLAB. When compiling the MATLAB mexFunction, the MATLAB
- BLAS are used (unless -DNBLAS is set). The -DCBLAS, -DNSCSL, and
- -DNSUNPERF flags are all ignored. The -DNRECIPROCAL flag is
- forced on. Otherwise, [L,U,P,Q,R] = umfpack (A) would return
- either L*U = P*(R\A)*Q or L*U = P*R*A*Q. Rather than returning a
- flag stating how the scale factors R are to be applied, the umfpack
- mexFunction always takes the more accurate route and returns
+ use in MATLAB. The -DNRECIPROCAL flag is forced on (more accurate,
+ slightly slower). The umfpack mexFunction always returns
L*U = P*(R\A)*Q.
-DMATHWORKS
This flag is turned on when compiling umfpack as a built-in routine
- in MATLAB. The MATLAB BLAS are used for all architectures (-DNBLAS,
- -DCBLAS, -DNSCSL, and -DNSUNPERF flags are all ignored). Internal
- routines utMalloc, utFree, utRealloc, utPrintf, utDivideComplex,
- and utFdlibm_hypot are used, and the "util.h" file is included.
- This avoids the problem discussed in the User Guide regarding memory
- allocation in MATLAB. utMalloc returns NULL on failure, instead of
- terminating the mexFunction (which is what mxMalloc does). However,
- the ut* routines are not documented by The MathWorks, Inc., so I
- cannot guarantee that you will always be able to use them.
- The -DNRECIPROCAL flag is turned on.
+ in MATLAB. The -DNRECIPROCAL flag is forced on.
-DNDEBUG
/* === Microsoft Windows configuration ====================================== */
/* ========================================================================== */
-#ifdef UMF_WINDOWS
-/* Windows can't access the ut* routines, and it isn't Unix. */
-#define NUTIL
+#if defined (UMF_WINDOWS) || defined (UMF_MINGW)
+/* Windows isn't Unix. Profound. */
#define NPOSIX
#endif
/* Sun Solaris, SGI Irix, Linux, Compaq Alpha, and IBM RS 6000 all have */
/* getrusage. It's in BSD unix, so perhaps all unix systems have it. */
#if defined (UMF_SOL2) || defined (UMF_SGI) || defined (UMF_LINUX) \
-|| defined (UMF_ALPHA) || defined (UMF_AIX)
+|| defined (UMF_ALPHA) || defined (UMF_AIX) || defined (UMF_CYGWIN)
#define GETRUSAGE
#endif
/* === BLAS ================================================================= */
/* ========================================================================== */
-/*
- The adventure begins. Figure out how to call the BLAS ...
-
- This works, but it is incredibly ugly. The C-BLAS was supposed to solve
- this problem, and make it easier to interface a C program to the BLAS.
- Unfortunately, the C-BLAS does not have a "long" integer (64 bit) version.
- Various vendors have done their own 64-bit BLAS. Sun has dgemm_64 routines
- with "long" integers, SGI has a 64-bit dgemm in their scsl_blas_i8 library
- with "long long" integers, and so on.
-
- Different vendors also have different ways of defining a complex number,
- some using struct's. That's a bad idea. See umf_version.h for the better
- way to do it (the method that was also chosen for the complex C-BLAS,
- which is compatible and guaranteed to be portable with ANSI C).
-
- To make matters worse, SGI's SCSL BLAS has a C-BLAS interface which
- differs from the ATLAS C-BLAS interface (see immediately below);
- although a more recent version of SGI's C-BLAS interface is correct
- if SCSL_VOID_ARGS is defined.
-*/
-
-
-/* -------------------------------------------------------------------------- */
-/* Determine which BLAS to use. */
-/* -------------------------------------------------------------------------- */
-
-#if defined (MATHWORKS)
-#define USE_MATLAB_BLAS
-
-#elif defined (NBLAS)
-#define USE_NO_BLAS
-
-#elif defined (MATLAB_MEX_FILE)
-#define USE_MATLAB_BLAS
-
-#elif defined (CBLAS)
-#define USE_C_BLAS
-
-#elif defined (UMF_SOL2) && !defined (NSUNPERF)
-#define USE_SUNPERF_BLAS
-
-#elif defined (UMF_SGI) && !defined (NSCSL)
-#define USE_SCSL_BLAS
-
-#else
-#define USE_FORTRAN_BLAS
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* int vs. long integer arguments */
-/* -------------------------------------------------------------------------- */
-
-/*
- Determine if the BLAS exists for the long integer version. It exists if
- LONGBLAS is defined in the Makefile, or if using the BLAS from the
- Sun Performance Library, or SGI's SCSL Scientific Library.
-*/
-
-#if defined (USE_SUNPERF_BLAS) || defined (USE_SCSL_BLAS)
-#ifndef LONGBLAS
-#define LONGBLAS
-#endif
-#endif
-
-/* do not use the BLAS if Int's are long and LONGBLAS is not defined */
-#if defined (LONG_INTEGER) && !defined (LONGBLAS) && !defined (USE_NO_BLAS)
-#define USE_NO_BLAS
-#endif
+#include "cholmod_blas.h"
/* -------------------------------------------------------------------------- */
-/* Use (void *) arguments for the SGI */
+/* DGEMM */
/* -------------------------------------------------------------------------- */
-#if defined (UMF_SGI)
-/*
- Use (void *) pointers for complex types in SCSL.
- The ATLAS C-BLAS, and the SGI C-BLAS differ. The former uses (void *)
- arguments, the latter uses SCSL_ZOMPLEX_T, which are either scsl_zomplex
- or (void *). Using (void *) is simpler, and is selected by defining
- SCSL_VOID_ARGS, below. The cc compiler doesn't complain, but gcc is
- more picky, and generates a warning without this next statement.
- With gcc and the 07/09/98 version of SGI's cblas.h, spurious warnings
- about complex BLAS arguments will be reported anyway. This is because this
- older version of SGI's cblas.h does not make use of the SCSL_VOID_ARGS
- parameter, which is present in the 12/6/01 version of SGI's cblas.h. You
- can safely ignore these warnings.
-*/
-#define SCSL_VOID_ARGS
-#endif
-
-
-/* -------------------------------------------------------------------------- */
-/* The BLAS exists, construct appropriate macros */
-/* -------------------------------------------------------------------------- */
-
-#if !defined (USE_NO_BLAS) /* { */
-
-/*
- If the compile-time flag -DNBLAS is defined, then the BLAS are not used,
- portable vanilla C code is used instead, and the remainder of this file
- is ignored.
-
- Using the BLAS is much faster, but how C calls the Fortran BLAS is
- machine-dependent and thus can cause portability problems. Thus, use
- -DNBLAS to ensure portability (at the expense of speed).
-
- Preferences:
-
- *** The best interface to use, regardless of the option you select
- below, is the standard C-BLAS interface. Not all BLAS libraries
- use this interface. The only problem with this interface is that
- it does not extend to the LP64 model. The C-BLAS does not provide
- for a 64-bit integer. In addition, SGI's older cblas.h can cause
- spurious warnings when using the C-BLAS interface.
-
- 1) often the most preferred (but see option (3)): use the
- optimized vendor-supplied library (such as the Sun Performance
- Library, or IBM's ESSL). This is often the fastest, but might not
- be portable and might not always be available. When compiling a
- MATLAB mexFunction it might be difficult get the mex compiler
- script to recognize the vendor- supplied BLAS. Note that the
- freely-available BLAS (option 3) can be faster than the vendor-
- specific BLAS. You are encourage to try both option (1) and (3).
-
- 2) When compiling the UMFPACK mexFunction to use UMFPACK in MATLAB, use
- the BLAS provided by The Mathworks, Inc. This assumes you are using
- MATLAB V6 or higher, since the BLAS are not incorporated in V5 or
- earlier versions. On my Sun workstation, the MATLAB BLAS gave
- slightly worse performance than the Sun Perf. BLAS. The advantage
- of using the MATLAB BLAS is that it's available on any computer that
- has MATLAB V6 or higher. I have not tried using MATLAB BLAS outside
- of a mexFunction in a stand-alone C code, but MATLAB (V6) allows for
- this. This is well worth trying if you have MATLAB and don't want
- to bother installing the ATLAS BLAS (option 3a, below). The only
- glitch to this is that MATLAB does not provide a portable interface
- to the BLAS (an underscore is required for some but not all
- architectures). For Windows and MATLAB 6.0 or 6.1, you also need
- to copy the libmwlapack.dll file into your MATLAB installation
- directory; see the User Guide for details.
-
- In the current distribution, the only BLAS that the UMFPACK
- mexFunction will use is the internal MATLAB BLAS. It's possible to
- use other BLAS, but handling the porting of using the mex compiler
- with different BLAS libraries is not trivial.
-
- As of MATLAB 6.5, the BLAS used internally in MATLAB is the ATLAS
- BLAS.
-
- 3) Use a freely-available high-performance BLAS library:
-
- (a) The BLAS by Kazashige Goto and Robert van de Geijn, at
- http://www.cs.utexas.edu/users/flame/goto. This BLAS increased
- the performance of UMFPACK by almost 50% as compared to the
- ATLAS BLAS (v3.2).
-
- (b) The ATLAS BLAS, available at http://www.netlib.org/atlas,
- by R. Clint Whaley, Antoine Petitet, and Jack Dongarra.
- This has a standard C interface, and thus the interface to it is
- fully portable. Its performance rivals, and sometimes exceeds,
- the vendor-supplied BLAS on many computers.
-
- (b) The Fortran RISC BLAS by Michel Dayde', Iain Duff, Antoine
- Petitet, and Abderrahim Qrichi Aniba, available via anonymous
- ftp to ftp.enseeiht.fr in the pub/numerique/BLAS/RISC directory,
- See M. J. Dayde' and I. S. Duff, "The RISC BLAS: A blocked
- implementation of level 3 BLAS for RISC processors, ACM Trans.
- Math. Software, vol. 25, no. 3., Sept. 1999. This will give
- you good performance, but with the same C-to-Fortran portability
- problems as option (1).
-
- 4) Use UMFPACK's built-in vanilla C code by setting -DNBLAS at compile
- time. The key advantage is portability, which is guaranteed if you
- have an ANSI C compliant compiler. You also don't need to download
- any other package - UMFPACK is stand-alone. No Fortran is used
- anywhere in UMFPACK. UMFPACK will be much slower than when using
- options (1) through (3), however.
-
- 5) least preferred: use the standard Fortran implementation of the
- BLAS, also available at Netlib (http://www.netlib.org/blas). This
- will be no faster than option (4), and not portable because of
- C-to-Fortran calling conventions. Don't bother trying option (5).
-
- The mechanics of how C calls the BLAS on various computers are as follows:
-
- * C-BLAS (from the ATLAS library, for example):
- The same interface is used on all computers.
-
- * Defaults for calling the Fortran BLAS:
- add underscore, pass scalars by reference, use string arguments.
-
- * The Fortran BLAS on Sun Solaris (when compiling the MATLAB mexFunction
- or when using the Fortran RISC BLAS), SGI IRIX, Linux, and Compaq
- Alpha: use defaults.
-
- * Sun Solaris (when using the C-callable Sun Performance library):
- no underscore, pass scalars by value, use character arguments.
-
- * The Fortran BLAS (ESSL Library) on the IBM RS 6000, and HP Unix:
- no underscore, pass scalars by reference, use string arguments.
-
- * The Fortran BLAS on Windows:
- no underscore, pass scalars by reference, use string arguments.
- If you compile the umfpack mexFunction using umfpack_make, and are
- using the lcc compiler bundled with MATLAB, then you must first
- copy the umfpack\lcc_lib\libmwlapack.lib file into the
- <matlab>\extern\lib\win32\lcc\ directory, where <matlab> is the
- directory in which MATLAB is installed. Next, type mex -setup
- at the MATLAB prompt, and ask MATLAB to select the lcc compiler.
- MATLAB has built-in BLAS, but it cannot be accessed by a program
- compiled by lcc without first copying this file.
-*/
-
-
-
-/* -------------------------------------------------------------------------- */
-#ifdef USE_C_BLAS /* { */
-/* -------------------------------------------------------------------------- */
-
-
-/* -------------------------------------------------------------------------- */
-/* use the C-BLAS (any computer) */
-/* -------------------------------------------------------------------------- */
-
-/*
- C-BLAS is the default interface, with the following exceptions. Solaris
- uses the Sun Performance BLAS for libumfpack.a (the C-callable library).
- SGI IRIX uses the SCSL BLAS for libumfpack.a. All architectures use
- MATLAB's internal BLAS for the mexFunction on any architecture. These
- options are set in the Make.* files. The Make.generic file uses no BLAS
- at all.
-
- If you use the ATLAS C-BLAS, then be sure to set the -I flag to
- -I/path/ATLAS/include, where /path/ATLAS is the ATLAS installation
- directory. See Make.solaris for an example. You do not need to do this
- for the SGI, which has a /usr/include/cblas.h.
-*/
-
-#include "cblas.h"
-
-#ifdef COMPLEX
-#define BLAS_GEMM_ROUTINE cblas_zgemm
-#define BLAS_TRSM_ROUTINE cblas_ztrsm
-#define BLAS_TRSV_ROUTINE cblas_ztrsv
-#define BLAS_GEMV_ROUTINE cblas_zgemv
-#define BLAS_GER_ROUTINE cblas_zgeru
-#define BLAS_SCAL_ROUTINE cblas_zscal
-#define BLAS_COPY_ROUTINE cblas_zcopy
-#define BLAS_DECLARE_SCALAR(x) double x [2]
-#define BLAS_ASSIGN(x,xr,xi) { x [0] = xr ; x [1] = xi ; }
-#else
-#define BLAS_GEMM_ROUTINE cblas_dgemm
-#define BLAS_TRSM_ROUTINE cblas_dtrsm
-#define BLAS_TRSV_ROUTINE cblas_dtrsv
-#define BLAS_GEMV_ROUTINE cblas_dgemv
-#define BLAS_GER_ROUTINE cblas_dger
-#define BLAS_SCAL_ROUTINE cblas_dscal
-#define BLAS_COPY_ROUTINE cblas_dcopy
-#define BLAS_DECLARE_SCALAR(x) double x
-#define BLAS_ASSIGN(x,xr,xi) { x = xr ; }
-#endif
-
-#define BLAS_LOWER CblasLower
-#define BLAS_UNIT_DIAGONAL CblasUnit
-#define BLAS_RIGHT CblasRight
-#define BLAS_NO_TRANSPOSE CblasNoTrans
-#define BLAS_TRANSPOSE CblasTrans
-#define BLAS_COLUMN_MAJOR_ORDER CblasColMajor,
-#define BLAS_SCALAR(x) x
-#define BLAS_INT_SCALAR(n) n
-#define BLAS_ARRAY(a) a
-
-
-
-/* -------------------------------------------------------------------------- */
-#else /* } USE_C_BLAS { */
-/* -------------------------------------------------------------------------- */
-
-/* -------------------------------------------------------------------------- */
-/* use Fortran (or other architecture-specific) BLAS */
-/* -------------------------------------------------------------------------- */
-
-/* No such argument when not using the C-BLAS */
-#define BLAS_COLUMN_MAJOR_ORDER
-
-/* Determine which architecture we're on and set options accordingly. */
-/* The default, if nothing is defined is to add an underscore, */
-/* pass scalars by reference, and use string arguments. */
-
-/* ---------------------------------- */
-/* Sun Performance BLAS */
-/* ---------------------------------- */
-
-#ifdef USE_SUNPERF_BLAS
-#ifdef _SUNPERF_H
-/* <sunperf.h> has been included somehow anyway, outside of umf_config.h */
-#error "sunperf.h must NOT be #include'd. See umf_config.h for details."
-#endif
-#define BLAS_BY_VALUE
-#define BLAS_NO_UNDERSCORE
-#define BLAS_CHAR_ARG
-#endif /* USE_SUNPERF_BLAS */
-
-/* ---------------------------------- */
-/* SGI SCSL BLAS */
-/* ---------------------------------- */
-
-#ifdef USE_SCSL_BLAS
-#if defined (LP64)
-#include <scsl_blas_i8.h>
-#else
-#include <scsl_blas.h>
-#endif
-#define BLAS_BY_VALUE
-#define BLAS_NO_UNDERSCORE
-#endif /* USE_SCSL_BLAS */
-
-/* ---------------------------------- */
-/* IBM AIX, Windows, and HP Fortran BLAS */
-/* ---------------------------------- */
-
-#if defined (UMF_AIX) || defined (UMF_WINDOWS) || defined (UMF_HP)
-#define BLAS_NO_UNDERSCORE
-#endif
-
-
-/* -------------------------------------------------------------------------- */
-/* BLAS names */
-/* -------------------------------------------------------------------------- */
-
-#if defined (LP64) && defined (USE_SUNPERF_BLAS) && defined (LONG_INTEGER)
-
-/* 64-bit sunperf BLAS, for Sun Solaris only */
-#ifdef COMPLEX
-#define BLAS_GEMM_ROUTINE zgemm_64
-#define BLAS_TRSM_ROUTINE ztrsm_64
-#define BLAS_TRSV_ROUTINE ztrsv_64
-#define BLAS_GEMV_ROUTINE zgemv_64
-#define BLAS_GER_ROUTINE zgeru_64
-#define BLAS_SCAL_ROUTINE zscal_64
-#define BLAS_COPY_ROUTINE zcopy_64
-#else
-#define BLAS_GEMM_ROUTINE dgemm_64
-#define BLAS_TRSM_ROUTINE dtrsm_64
-#define BLAS_TRSV_ROUTINE dtrsv_64
-#define BLAS_GEMV_ROUTINE dgemv_64
-#define BLAS_GER_ROUTINE dger_64
-#define BLAS_SCAL_ROUTINE dscal_64
-#define BLAS_COPY_ROUTINE dcopy_64
-#endif /* COMPLEX */
-
-#else
-
+/* C = C - A*B', where:
+ * A is m-by-k with leading dimension ldac
+ * B is k-by-n with leading dimension ldb
+ * C is m-by-n with leading dimension ldac */
#ifdef COMPLEX
-
-/* naming convention (use underscore, or not) */
-#ifdef BLAS_NO_UNDERSCORE
-#define BLAS_GEMM_ROUTINE zgemm
-#define BLAS_TRSM_ROUTINE ztrsm
-#define BLAS_TRSV_ROUTINE ztrsv
-#define BLAS_GEMV_ROUTINE zgemv
-#define BLAS_GER_ROUTINE zgeru
-#define BLAS_SCAL_ROUTINE zscal
-#define BLAS_COPY_ROUTINE zcopy
-#else
-/* default: add underscore */
-#define BLAS_GEMM_ROUTINE zgemm_
-#define BLAS_TRSM_ROUTINE ztrsm_
-#define BLAS_TRSV_ROUTINE ztrsv_
-#define BLAS_GEMV_ROUTINE zgemv_
-#define BLAS_GER_ROUTINE zgeru_
-#define BLAS_SCAL_ROUTINE zscal_
-#define BLAS_COPY_ROUTINE zcopy_
-#endif
-
-#else
-
-/* naming convention (use underscore, or not) */
-#ifdef BLAS_NO_UNDERSCORE
-#define BLAS_GEMM_ROUTINE dgemm
-#define BLAS_TRSM_ROUTINE dtrsm
-#define BLAS_TRSV_ROUTINE dtrsv
-#define BLAS_GEMV_ROUTINE dgemv
-#define BLAS_GER_ROUTINE dger
-#define BLAS_SCAL_ROUTINE dscal
-#define BLAS_COPY_ROUTINE dcopy
+#define BLAS_GEMM(m,n,k,A,B,ldb,C,ldac) \
+{ \
+ double alpha [2] = {-1,0}, beta [2] = {1,0} ; \
+ BLAS_zgemm ("N", "T", m, n, k, alpha, (double *) A, ldac, \
+ (double *) B, ldb, beta, (double *) C, ldac) ; \
+}
#else
-/* default: add underscore */
-#define BLAS_GEMM_ROUTINE dgemm_
-#define BLAS_TRSM_ROUTINE dtrsm_
-#define BLAS_TRSV_ROUTINE dtrsv_
-#define BLAS_GEMV_ROUTINE dgemv_
-#define BLAS_GER_ROUTINE dger_
-#define BLAS_SCAL_ROUTINE dscal_
-#define BLAS_COPY_ROUTINE dcopy_
+#define BLAS_GEMM(m,n,k,A,B,ldb,C,ldac) \
+{ \
+ double alpha = -1, beta = 1 ; \
+ BLAS_dgemm ("N", "T", m, n, k, &alpha, A, ldac, B, ldb, &beta, C, ldac) ; \
+}
#endif
-#endif /* COMPLEX */
-
-#endif /* LP64 && USE_SUNPERF_BLAS */
-
/* -------------------------------------------------------------------------- */
-/* BLAS real or complex floating-point scalars */
+/* GER */
/* -------------------------------------------------------------------------- */
+/* A = A - x*y', where:
+ * A is m-by-n with leading dimension d
+ x is a column vector with stride 1
+ y is a column vector with stride 1 */
#ifdef COMPLEX
-
-/*
- The SunPerf BLAS expects to see a doublecomplex scalar, but it
- also will accept an array of size 2. See the manual, normally at
- file:///opt/SUNWspro/WS6U1/lib/locale/C/html/manuals/perflib/user_guide
- /plug_using_perflib.html . This manual is inconsistent with the man pages
- for zgemm, zgemv, and zgeru and also inconsistent with the <sunperf.h>
- include file. Use this instead, for SunPerf (only works if you do NOT
- include sunperf.h). Fortunately, this file (umf_config.h) is not included
- in any user code that calls UMFPACK. Thus, the caller may include
- sunperf.h in his or her own code, and that is safely ignored here.
- SGI's SCSL BLAS has yet a different kind of struct, but we can use a
- double array of size 2 instead (since SCSL_VOID_ARGS is defined).
- Most BLAS expect complex scalars as pointers to double arrays of size 2.
-*/
-
-#define BLAS_DECLARE_SCALAR(x) double x [2]
-#define BLAS_ASSIGN(x,xr,xi) { x [0] = xr ; x [1] = xi ; }
-#define BLAS_SCALAR(x) x
-
-#else
-
-#define BLAS_DECLARE_SCALAR(x) double x
-#define BLAS_ASSIGN(x,xr,xi) { x = xr ; }
-#ifdef BLAS_BY_VALUE
-#define BLAS_SCALAR(x) x
-#else
-#define BLAS_SCALAR(x) &(x)
-#endif
-
-#endif /* COMPLEX */
-
-
-/* -------------------------------------------------------------------------- */
-/* BLAS integer scalars */
-/* -------------------------------------------------------------------------- */
-
-/*
- Fortran requires integers to be passed by reference.
- The SCSL BLAS requires long long arguments in LP64 mode.
-*/
-
-#if defined (USE_SCSL_BLAS) && defined (LP64)
-#define BLAS_INT_SCALAR(n) ((long long) n)
-#else
-#ifdef BLAS_BY_VALUE
-#define BLAS_INT_SCALAR(n) n
-#else
-#define BLAS_INT_SCALAR(n) &(n)
-#endif
-#endif
-
-
-/* -------------------------------------------------------------------------- */
-/* BLAS strings */
-/* -------------------------------------------------------------------------- */
-
-/*
- The Sun Performance BLAS wants a character instead of a string.
-*/
-
-#ifdef BLAS_CHAR_ARG
-#define BLAS_NO_TRANSPOSE 'N'
-#define BLAS_TRANSPOSE 'T'
-#define BLAS_LEFT 'L'
-#define BLAS_RIGHT 'R'
-#define BLAS_LOWER 'L'
-#define BLAS_UNIT_DIAGONAL 'U'
+#define BLAS_GER(m,n,x,y,A,d) \
+{ \
+ double alpha [2] = {-1,0} ; \
+ BLAS_zgeru (m, n, alpha, (double *) x, 1, (double *) y, 1, \
+ (double *) A, d) ; \
+}
#else
-#define BLAS_NO_TRANSPOSE "N"
-#define BLAS_TRANSPOSE "T"
-#define BLAS_LEFT "L"
-#define BLAS_RIGHT "R"
-#define BLAS_LOWER "L"
-#define BLAS_UNIT_DIAGONAL "U"
+#define BLAS_GER(m,n,x,y,A,d) \
+{ \
+ double alpha = -1 ; \
+ BLAS_dger (m, n, &alpha, x, 1, y, 1, A, d) ; \
+}
#endif
/* -------------------------------------------------------------------------- */
-/* BLAS arrays */
+/* GEMV */
/* -------------------------------------------------------------------------- */
-/*
- The complex SunPerf BLAS expects to see a doublecomplex array of size s.
- This is broken (see above, regarding complex scalars in sunperf.h).
- For SunPerf BLAS, just pass a pointer to the array, and ignore sunperf.h.
- With sunperf.h, you would need:
-
- #define BLAS_ARRAY(a) ((doublecomplex *)(a))
-
- SGI's SCSL BLAS has yet a different kind of struct, but we can use a
- double array of size 2 instead (since SCSL_VOID_ARGS is defined).
-
- The real versions all use just a (double *) pointer.
-
- In all cases, no typecast is required. This will break if <sunperf.h> is
- included.
-
- If you have read this far, I hope you see now why (void *) a much better
- choice for complex BLAS prototypes, and why double x [2] is better than
- an architecture dependent struct { double real ; double imag ; }
- type definition.
-
-*/
-
-#define BLAS_ARRAY(a) (a)
-
-
-/* -------------------------------------------------------------------------- */
-#endif /* USE_C_BLAS } */
-/* -------------------------------------------------------------------------- */
-
-
-
-
-
-/* -------------------------------------------------------------------------- */
-/* BLAS macros, for all interfaces */
-/* -------------------------------------------------------------------------- */
-
-/*
- All architecture dependent issues have now been taken into consideration,
- and folded into the macros BLAS_DECLARE_SCALAR, BLAS_ASSIGN, BLAS_*_ROUTINE,
- BLAS_COLUMN_MAJOR_ORDER, BLAS_NO_TRANSPOSE, BLAS_TRANSPOSE, BLAS_SCALAR,
- BLAS_INT_SCALAR, BLAS_ARRAY, and Int.
-
- You will note that there is not a *** single *** name, declaration, or
- argument to the BLAS which is not somehow different in one or more versions
- of the BLAS!
-*/
-
-
-/* C = C - A*B', where:
- * A is m-by-k with leading dimension ldac
- * B is k-by-n with leading dimension ldb
- * C is m-by-n with leading dimension ldac */
-#define BLAS_GEMM(m,n,k,A,B,ldb,C,ldac) \
-{ \
- BLAS_DECLARE_SCALAR (alpha) ; \
- BLAS_DECLARE_SCALAR (beta) ; \
- BLAS_ASSIGN (alpha, -1.0, 0.0) ; \
- BLAS_ASSIGN (beta, 1.0, 0.0) ; \
- (void) BLAS_GEMM_ROUTINE (BLAS_COLUMN_MAJOR_ORDER \
- BLAS_NO_TRANSPOSE, BLAS_TRANSPOSE, \
- BLAS_INT_SCALAR (m), BLAS_INT_SCALAR (n), BLAS_INT_SCALAR (k), \
- BLAS_SCALAR (alpha), \
- BLAS_ARRAY (A), BLAS_INT_SCALAR (ldac), \
- BLAS_ARRAY (B), BLAS_INT_SCALAR (ldb), BLAS_SCALAR (beta), \
- BLAS_ARRAY (C), BLAS_INT_SCALAR (ldac)) ; \
-}
-
-/* A = A - x*y', where:
- * A is m-by-n with leading dimension d
+/* y = y - A*x, where A is m-by-n with leading dimension d,
x is a column vector with stride 1
y is a column vector with stride 1 */
-#define BLAS_GER(m,n,x,y,A,d) \
+#ifdef COMPLEX
+#define BLAS_GEMV(m,n,A,x,y,d) \
{ \
- Int one = 1 ; \
- BLAS_DECLARE_SCALAR (alpha) ; \
- BLAS_ASSIGN (alpha, -1.0, 0.0) ; \
- (void) BLAS_GER_ROUTINE (BLAS_COLUMN_MAJOR_ORDER \
- BLAS_INT_SCALAR (m), BLAS_INT_SCALAR (n), \
- BLAS_SCALAR (alpha), \
- BLAS_ARRAY (x), BLAS_INT_SCALAR (one), \
- BLAS_ARRAY (y), BLAS_INT_SCALAR (one), \
- BLAS_ARRAY (A), BLAS_INT_SCALAR (d)) ; \
+ double alpha [2] = {-1,0}, beta [2] = {1,0} ; \
+ BLAS_zgemv ("N", m, n, alpha, (double *) A, d, (double *) x, 1, beta, \
+ (double *) y, 1) ; \
}
-
-/* y = y - A*x, where A is m-by-n with leading dimension d,
- x is a column vector with stride 1
- y is a column vector with stride 1 */
+#else
#define BLAS_GEMV(m,n,A,x,y,d) \
{ \
- Int one = 1 ; \
- BLAS_DECLARE_SCALAR (alpha) ; \
- BLAS_DECLARE_SCALAR (beta) ; \
- BLAS_ASSIGN (alpha, -1.0, 0.0) ; \
- BLAS_ASSIGN (beta, 1.0, 0.0) ; \
- (void) BLAS_GEMV_ROUTINE (BLAS_COLUMN_MAJOR_ORDER \
- BLAS_NO_TRANSPOSE, \
- BLAS_INT_SCALAR (m), BLAS_INT_SCALAR (n), \
- BLAS_SCALAR (alpha), \
- BLAS_ARRAY (A), BLAS_INT_SCALAR (d), \
- BLAS_ARRAY (x), BLAS_INT_SCALAR (one), BLAS_SCALAR (beta), \
- BLAS_ARRAY (y), BLAS_INT_SCALAR (one)) ; \
+ double alpha = -1, beta = 1 ; \
+ BLAS_dgemv ("N", m, n, &alpha, A, d, x, 1, &beta, y, 1) ; \
}
+#endif
+/* -------------------------------------------------------------------------- */
+/* TRSV */
+/* -------------------------------------------------------------------------- */
+
/* solve Lx=b, where:
* B is a column vector (m-by-1) with leading dimension d
* A is m-by-m with leading dimension d */
+#ifdef COMPLEX
+#define BLAS_TRSV(m,A,b,d) \
+{ \
+ BLAS_ztrsv ("L", "N", "U", m, (double *) A, d, (double *) b, 1) ; \
+}
+#else
#define BLAS_TRSV(m,A,b,d) \
{ \
- Int one = 1 ; \
- (void) BLAS_TRSV_ROUTINE (BLAS_COLUMN_MAJOR_ORDER \
- BLAS_LOWER, BLAS_NO_TRANSPOSE, BLAS_UNIT_DIAGONAL, \
- BLAS_INT_SCALAR (m), \
- BLAS_ARRAY (A), BLAS_INT_SCALAR (d), \
- BLAS_ARRAY (b), BLAS_INT_SCALAR (one)) ; \
+ BLAS_dtrsv ("L", "N", "U", m, A, d, b, 1) ; \
}
+#endif
+
+
+/* -------------------------------------------------------------------------- */
+/* TRSM */
+/* -------------------------------------------------------------------------- */
/* solve XL'=B where:
* B is m-by-n with leading dimension ldb
* A is n-by-n with leading dimension lda */
+#ifdef COMPLEX
#define BLAS_TRSM_RIGHT(m,n,A,lda,B,ldb) \
{ \
- BLAS_DECLARE_SCALAR (alpha) ; \
- BLAS_ASSIGN (alpha, 1.0, 0.0) ; \
- (void) BLAS_TRSM_ROUTINE (BLAS_COLUMN_MAJOR_ORDER \
- BLAS_RIGHT, BLAS_LOWER, BLAS_TRANSPOSE, BLAS_UNIT_DIAGONAL, \
- BLAS_INT_SCALAR (m), BLAS_INT_SCALAR (n), \
- BLAS_SCALAR (alpha), \
- BLAS_ARRAY (A), BLAS_INT_SCALAR (lda), \
- BLAS_ARRAY (B), BLAS_INT_SCALAR (ldb)) ; \
+ double alpha [2] = {1,0} ; \
+ BLAS_ztrsm ("R", "L", "T", "U", m, n, alpha, (double *) A, lda, \
+ (double *) B, ldb) ; \
}
+#else
+#define BLAS_TRSM_RIGHT(m,n,A,lda,B,ldb) \
+{ \
+ double alpha = 1 ; \
+ BLAS_dtrsm ("R", "L", "T", "U", m, n, &alpha, A, lda, B, ldb) ; \
+}
+#endif
+
+
+/* -------------------------------------------------------------------------- */
+/* SCAL */
+/* -------------------------------------------------------------------------- */
/* x = s*x, where x is a stride-1 vector of length n */
+#ifdef COMPLEX
#define BLAS_SCAL(n,s,x) \
{ \
- Int one = 1 ; \
- BLAS_DECLARE_SCALAR (alpha) ; \
- BLAS_ASSIGN (alpha, REAL_COMPONENT (s), IMAG_COMPONENT (s)) ; \
- (void) BLAS_SCAL_ROUTINE ( \
- BLAS_INT_SCALAR (n), BLAS_SCALAR (alpha), \
- BLAS_ARRAY (x), BLAS_INT_SCALAR (one)) ; \
+ double alpha [2] ; \
+ alpha [0] = REAL_COMPONENT (s) ; \
+ alpha [1] = IMAG_COMPONENT (s) ; \
+ BLAS_zscal (n, alpha, (double *) x, 1) ; \
}
-
-/* x = y, where x and y are a stride-1 vectors of length n */
-#define BLAS_COPY(n,x,y) \
+#else
+#define BLAS_SCAL(n,s,x) \
{ \
- Int one = 1 ; \
- (void) BLAS_COPY_ROUTINE ( \
- BLAS_INT_SCALAR (n), \
- BLAS_ARRAY (x), BLAS_INT_SCALAR (one), \
- BLAS_ARRAY (y), BLAS_INT_SCALAR (one)) ; \
+ double alpha = REAL_COMPONENT (s) ; \
+ BLAS_dscal (n, &alpha, (double *) x, 1) ; \
}
-
-#endif /* !defined (USE_NO_BLAS) } */
+#endif
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
for (j = 0 ; j < fncols ; j++)
{
copy_column (fnrows, Fcol, C) ;
-#if 0
-#ifdef USE_NO_BLAS
- copy_column (fnrows, Fcol, C) ;
-#else
- could also use BLAS-COPY (fnrows, Fcol, C) here, but it is typically
- not as fast as the inlined copy_column subroutine, above.
-#endif
- for (i = 0 ; i < fnrows ; i++)
- {
- C [i] = Fcol [i] ;
- }
-#endif
Fcol += fnr_curr ;
C += fnrows ;
}
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
DEBUG0 (("umfpack: debug version (SLOW!) ")) ;
- DEBUG0 ((" BLAS: ")) ;
-
-#if defined (USE_NO_BLAS)
- DEBUG0 (("none.")) ;
-#elif defined (USE_C_BLAS)
- DEBUG0 (("C-BLAS.")) ;
-#elif defined (USE_MATLAB_BLAS)
- DEBUG0 (("built-in MATLAB BLAS.")) ;
-#elif defined (USE_SUNPERF_BLAS)
- DEBUG0 (("Sun Performance Library BLAS.")) ;
-#elif defined (USE_SCSL_BLAS)
- DEBUG0 (("SGI SCSL BLAS.")) ;
-#elif defined (USE_FORTRAN_BLAS)
- DEBUG0 (("Fortran BLAS.")) ;
-#endif
-
DEBUG0 ((" MATLAB: ")) ;
#ifdef MATLAB_MEX_FILE
DEBUG0 (("mexFunction.\n")) ;
#else
#ifdef MATHWORKS
- DEBUG0 (("yes (uses MathWorks internal ut* routines).\n")) ;
+ DEBUG0 (("yes.\n")) ;
#else
DEBUG0 (("no.\n")) ;
#endif
sizeof (int), sizeof (int) / sizeof (int), UNITS (int, 1) )) ;
DEBUG2 (("sizeof (size_t) %u %u %u\n",
sizeof (size_t), sizeof (size_t) / sizeof (size_t), UNITS (size_t, 1) )) ;
- DEBUG2 (("sizeof (long) %u %u %u\n",
- sizeof (long), sizeof (long) / sizeof (long), UNITS (long, 1) )) ;
+ DEBUG2 (("sizeof (UF_long) %u %u %u\n",
+ sizeof (UF_long), sizeof (UF_long) / sizeof (UF_long), UNITS (UF_long, 1)));
DEBUG2 (("sizeof (double) %u %u %u\n",
sizeof (double), sizeof (double) / sizeof (int), UNITS (double, 1) )) ;
DEBUG2 (("sizeof (Unit) %u %u %u\n",
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
) ;
#define UMF_DBMAX 50000
-GLOBAL extern Int UMF_debug ;
-GLOBAL extern Int UMF_allocfail ;
-GLOBAL extern double UMF_gprob ;
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
+GLOBAL EXTERN Int UMF_debug ;
+GLOBAL EXTERN Int UMF_allocfail ;
+GLOBAL EXTERN double UMF_gprob ;
#define DEBUGk(k,params) { if (UMF_debug >= (k)) { PRINTF (params) ; } }
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
if (p)
{
- /* see umf_config.h for the memory allocator selection */
- FREE (p) ;
+ /* see AMD/Source/amd_global.c for the memory allocator selection */
+ amd_free (p) ;
#if defined (UMF_MALLOC_COUNT) || !defined (NDEBUG)
/* One more object has been free'd. Keep track of the count. */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
#define UMF_ALPHA
#define UMFPACK_ARCHITECTURE "Compaq Alpha"
-#elif defined (__WIN32) || defined (_WIN32) || defined (_win32) || defined (__win32) || defined (WIN32)
+#elif defined (_WIN32) || defined (WIN32)
+#if defined (__MINGW32__)
+#define UMF_MINGW
+#elif defined (__CYGWIN32__)
+#define UMF_CYGWIN
+#else
#define UMF_WINDOWS
+#endif
#define UMFPACK_ARCHITECTURE "Microsoft Windows"
#elif defined (__hppa) || defined (__hpux) || defined (MHPUX) || defined (ARCH_HPUX)
/* AMD include file */
/* -------------------------------------------------------------------------- */
-/* stdio.h, stdlib.h, limits.h, and math.h, NDEBUG definition,
- * assert.h, and MATLAB include files */
+/* stdio.h, stdlib.h, limits.h, and math.h, NDEBUG definition, assert.h */
#include "amd_internal.h"
/* -------------------------------------------------------------------------- */
-/* Real/complex and int/long definitions, double relops */
+/* MATLAB include files */
+/* -------------------------------------------------------------------------- */
+
+/* only used when compiling the UMFPACK mexFunction */
+#ifdef MATLAB_MEX_FILE
+#include "matrix.h"
+#include "mex.h"
+#endif
+
+/* -------------------------------------------------------------------------- */
+/* Real/complex and int/UF_long definitions, double relops */
/* -------------------------------------------------------------------------- */
#include "umf_version.h"
/* Memory allocator */
/* -------------------------------------------------------------------------- */
-/* The MATLAB mexFunction uses MATLAB's memory manager, while the C-callable
- * AMD library uses the ANSI C malloc, free, and realloc routines. To use
- * the mx* memory allocation routines, use -DNUTIL when compiling.
- */
-
-#undef ALLOCATE
-#undef FREE
-#undef REALLOC
-
-#ifdef MATLAB_MEX_FILE
-
-#ifdef NUTIL
-
-/* These functions simply terminate the mexFunction if they fail to allocate
- * memory. That's too restrictive for UMFPACK. */
-#define ALLOCATE mxMalloc
-#define FREE mxFree
-#define REALLOCATE mxRealloc
-
-#else
-
-/* Use internal MATLAB memory allocation routines, used by built-in MATLAB
- * functions. These are not documented, but are available for use. Their
- * prototypes are in util.h, but that file is not provided to the MATLAB user.
- * The advantage of using these routines is that they return NULL if out of
- * memory, instead of terminating the mexFunction. UMFPACK attempts to allocate
- * extra space for "elbow room", and then reduces its request if the memory is
- * not available. That strategy doesn't work with the mx* routines.
+/* See AMD/Source/amd_global.c and AMD/Source/amd.h for the
+ * definition of the memory allocator used by UMFPACK. Versions 4.4 and
+ * earlier had their memory allocator definitions here. Other global
+ * function pointers for UMFPACK are located in umf_global.c.
+ *
+ * The MATLAB mexFunction uses MATLAB's memory manager and mexPrintf, while the
+ * C-callable AMD library uses the ANSI C malloc, free, realloc, and printf
+ * routines.
*/
-void *utMalloc (size_t size) ;
-void utFree (void *p) ;
-void *utRealloc (void *p, size_t size) ;
-#define ALLOCATE utMalloc
-#define FREE utFree
-#define REALLOCATE utRealloc
-
-#endif
-#else
-#ifdef MATHWORKS
-
-/* Compiling as a built-in routine. Since out-of-memory conditions are checked
- * after every allocation, we can use ut* routines here. */
-#define ALLOCATE utMalloc
-#define FREE utFree
-#define REALLOCATE utRealloc
-
-#else
-
-/* use the ANSI C memory allocation routines */
-#define ALLOCATE malloc
-#define FREE free
-#define REALLOCATE realloc
-
-#endif
-#endif
/* -------------------------------------------------------------------------- */
/* Memory space definitions */
/* for testing out-of-memory conditions: */
#define UMF_TCOV_TEST
-GLOBAL extern int umf_fail, umf_fail_lo, umf_fail_hi ;
-GLOBAL extern int umf_realloc_fail, umf_realloc_lo, umf_realloc_hi ;
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
+GLOBAL EXTERN int umf_fail, umf_fail_lo, umf_fail_hi ;
+GLOBAL EXTERN int umf_realloc_fail, umf_realloc_lo, umf_realloc_hi ;
/* for testing malloc count: */
#define UMF_MALLOC_COUNT
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
do_recip = FALSE ;
#endif
/* check the input matrix */
- if (!AMD_valid (n_row, n_col, Ap, Ai))
+ if (AMD_valid (n_row, n_col, Ap, Ai) != AMD_OK)
{
/* matrix is invalid */
return (FALSE) ;
k, newrow)) ;
if (--(Wp [newrow]) < 0)
{
- /* :: pattern change (singleton row too long) :: */
- DEBUGm4 (("bad U singleton row (too long)\n")) ;
+ /* :: pattern change (singleton row too lengthy) :: */
+ DEBUGm4 (("bad U singleton row (too lengthy)\n")) ;
return (FALSE) ; /* pattern changed */
}
*(Rpi [newrow]++) = k ;
k, newrow)) ;
if (llen >= lilen)
{
- DEBUGm4 (("bad L singleton col (too long)\n")) ;
+ DEBUGm4 (("bad L singleton col (too lengthy)\n")) ;
return (FALSE) ; /* pattern changed */
}
Li [llen] = newrow ;
if (llen != lilen)
{
- /* :: pattern change (singleton column too long) :: */
+ /* :: pattern change (singleton column too lengthy) :: */
DEBUGm4 (("bad L singleton col (too short)\n")) ;
return (FALSE) ; /* pattern changed */
}
k, newrow)) ;
if (--(Wp [newrow]) < 0)
{
- DEBUGm4 (("bad row of U or A (too long)\n")) ;
+ DEBUGm4 (("bad row of U or A (too lengthy)\n")) ;
return (FALSE) ; /* pattern changed */
}
*(Rpi [newrow]++) = k ;
k, e, newrow)) ;
if (clen >= esize)
{
- DEBUGm4 (("bad A column (too long)\n")) ;
+ DEBUGm4 (("bad A column (too lengthy)\n")) ;
return (FALSE) ; /* pattern changed */
}
ASSERT (E [e]) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
Tuple *tp, *tpend, *tp1, *tp2 ;
Element *ep ;
+#ifndef NBLAS
+ Int blas_ok = TRUE ;
+#else
+#define blas_ok FALSE
+#endif
+
#ifndef NDEBUG
Int debug_ok, n_row, n_col, *Row_degree ;
Row_degree = Numeric->Rperm ; /* for NON_PIVOTAL_ROW macro only */
{
/* solve Lx=b, where b = U (:,k), stored in the LU block */
-#ifdef USE_NO_BLAS
-
- /* no BLAS available - use plain C code instead */
- Entry *Flub = Flublock ;
- for (j = 0 ; j < fnpiv ; j++)
+#ifndef NBLAS
+ BLAS_TRSV (fnpiv, Flublock, Flu, nb) ;
+#endif
+ if (!blas_ok)
{
- Entry Fuj = Flu [j] ;
-#pragma ivdep
- for (i = j+1 ; i < fnpiv ; i++)
+ /* use plain C code if no BLAS, or on integer overflow */
+ Entry *Flub = Flublock ;
+ for (j = 0 ; j < fnpiv ; j++)
{
- /* Flu [i] -= Flublock [i + j*nb] * Flu [j] ; */
- MULT_SUB (Flu [i], Flub [i], Fuj) ;
+ Entry Fuj = Flu [j] ;
+#pragma ivdep
+ for (i = j+1 ; i < fnpiv ; i++)
+ {
+ /* Flu [i] -= Flublock [i + j*nb] * Flu [j] ; */
+ MULT_SUB (Flu [i], Flub [i], Fuj) ;
+ }
+ Flub += nb ;
}
- Flub += nb ;
}
-
-#else
- BLAS_TRSV (fnpiv, Flublock, Flu, nb) ;
-#endif
-
}
/* ------------------------------------------------------------------ */
/* this work will be discarded if the pivcol [OUT] is chosen instead */
-#ifdef USE_NO_BLAS
+#ifdef NBLAS
/* no BLAS available - use plain C code instead */
for (j = 0 ; j < fnpiv ; j++)
{
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
}
size *= size_of_object ;
- /* see umf_config.h for the memory allocator selection */
- p = ALLOCATE (size) ;
+ /* see AMD/Source/amd_global.c for the memory allocator selection */
+ p = amd_malloc (size) ;
DEBUG0 ((ID"\n", (Int) p)) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
#define _UMF_MALLOC
#if defined (UMF_MALLOC_COUNT) || !defined (NDEBUG)
-GLOBAL extern Int UMF_malloc_count ;
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
+GLOBAL EXTERN Int UMF_malloc_count ;
#endif
GLOBAL void *UMF_malloc
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
DEBUG0 (("UMF_realloc: "ID" n_objects "ID" size_of_object "ID"\n",
(Int) p, n_objects, (Int) size_of_object)) ;
- /* see umf_config.h for the memory allocator selection */
- p2 = REALLOCATE (p, size) ;
+ /* see AMD/Source/amd_global.c for the memory allocator selection */
+ p2 = amd_realloc (p, size) ;
#if defined (UMF_MALLOC_COUNT) || !defined (NDEBUG)
/* If p didn't exist on input, and p2 exists, then a new object has been
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
{
/* ------------------------------------------------------------------ */
- /* normal case. select the x/pivot or x * (1/pivot) method */
+ /* normal case */
/* ------------------------------------------------------------------ */
/* The pivot is not tiny, and is not NaN. Don't bother to check for
- * zeros in the pivot column, X. */
-
-#if !defined (NRECIPROCAL) && !(defined (__GNUC__) && defined (COMPLEX))
-
- /* -------------------------------------------------------------- */
- /* multiply x by (1/pivot) */
- /* -------------------------------------------------------------- */
-
- /* Slightly less accurate, but faster. It allows the use of
- * the level-1 BLAS dscal or zscal routine. This not used when
- * UMFPACK is used in MATLAB (either as a built-in routine, or as
- * a mexFunction).
- *
- * Using gcc version 3.2 can cause the following code to fail for
- * some complex matrices (not all), with or without the BLAS. This
- * was found in Red Hat Linux 7.3 on a Dell Latitude C840 with a
- * Pentium 4M. Thus, this code is not used when gcc is used, for
- * the complex case.
- *
- * It works just fine with Intel's icc compiler, version 7.0.
- */
-
- /* pivot = 1 / pivot */
- RECIPROCAL (pivot) ;
-
-#if defined (USE_NO_BLAS)
- for (i = 0 ; i < n ; i++)
- {
- /* X [i] *= pivot ; */
- x = X [i] ;
- MULT (X [i], x, pivot) ;
- }
-#else
- BLAS_SCAL (n, pivot, X) ;
-#endif
-
-#else
-
- /* -------------------------------------------------------------- */
- /* divide x by the pivot */
- /* -------------------------------------------------------------- */
-
- /* This is slightly more accurate, particularly if the pivot column
- * consists of only IEEE subnormals. Always do this if UMFPACK is
- * being compiled as a built-in routine or mexFunction in MATLAB,
- * or if gcc is being used with complex matrices. */
-
- for (i = 0 ; i < n ; i++)
- {
- /* X [i] /= pivot ; */
- x = X [i] ;
- DIV (X [i], x, pivot) ;
- }
-
-#endif
+ * zeros in the pivot column, X. This is slightly more accurate than
+ * multiplying by 1/pivot (but slightly slower), particularly if the
+ * pivot column consists of only IEEE subnormals. */
+ for (i = 0 ; i < n ; i++)
+ {
+ /* X [i] /= pivot ; */
+ x = X [i] ;
+ DIV (X [i], x, pivot) ;
+ }
}
}
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
* that the matrix is in the following form:
*
* x x x x x x x x x
- * 0 x x x x x x x x
- * 0 0 x x x x x x x
- * 0 0 0 x 0 0 0 0 0
- * 0 0 0 x x 0 0 0 0
- * 0 0 0 x x s s s s
- * 0 0 0 x x s s s s
- * 0 0 0 x x s s s s
- * 0 0 0 x x s s s s
+ * . x x x x x x x x
+ * . . x x x x x x x
+ * . . . x . . . . .
+ * . . . x x . . . .
+ * . . . x x s s s s
+ * . . . x x s s s s
+ * . . . x x s s s s
+ * . . . x x s s s s
*
* The above example has 3 column singletons (the first three columns and
* their corresponding pivot rows) and 2 row singletons. The singletons are
* ordered first, because they have zero Markowitz cost. The LU factorization
* for these first five rows and columns is free - there is no work to do
* (except to scale the pivot columns for the 2 row singletons), and no
- * fill-in occurs. * The remaining * submatrix (4-by-4 in the above example)
+ * fill-in occurs. The remaining submatrix (4-by-4 in the above example)
* has no rows or columns with degree one. It may have empty rows or columns.
*
* This algorithm does not perform a full permutation to block triangular
* form. If there are one or more singletons, then the matrix can be
* permuted to block triangular form, but UMFPACK does not perform the full
- * BTF permutation (see also "dmperm" in MATLAB).
+ * BTF permutation (see also "dmperm" in MATLAB, CSparse cs_dmperm,
+ * and SuiteSparse/BTF).
*/
#include "umf_internal.h"
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
Uses the sparse backward error method of Arioli, Demmel, and Duff
(Solving sparse linear systems with sparse backward error, SIAM J. Matrix
Analysis and Applic., vol 10, pp. 165-190).
+
+ Added on option that allows the complex A and X to be split differently
+ than B, Oct 10, 2005. Contributed by David Bateman.
*/
#include "umf_internal.h"
double *Z2, *Y, *B2, *Rs ;
Int *Rperm, *Cperm, i, n, p, step, j, nz, status, p2, do_scale ;
#ifdef COMPLEX
- Int split ;
+ Int AXsplit ;
+ Int Bsplit ;
#endif
#ifndef NRECIPROCAL
Int do_recip = Numeric->do_recip ;
return (UMFPACK_ERROR_argument_missing) ;
}
/* A, B, and X in split format if Az, Bz, and Xz present */
- split = SPLIT (Az) && SPLIT (Bz) && SPLIT (Xz) ;
+ AXsplit = SPLIT (Az) || SPLIT(Xz);
Z = (Entry *) (SolveWork + 4*n) ; /* Entry Z [0..n-1] */
S = (Entry *) (SolveWork + 6*n) ; /* Entry S [0..n-1] */
Y = (double *) (SolveWork + 8*n) ; /* double Y [0..n-1] */
}
else
{
- /* A is ignored, only look at X and B for split/packed cases */
- split = SPLIT (Bz) && SPLIT (Xz) ;
+ /* A is ignored, only look at X for split/packed cases */
+ AXsplit = SPLIT(Xz);
}
- if (split)
+ Bsplit = SPLIT (Bz);
+
+ if (AXsplit)
{
X = (Entry *) (SolveWork + 2*n) ; /* Entry X [0..n-1] */
}
for (p = 0 ; p < p2 ; p++)
{
/* Y [Ai [p]] += ABS (Ax [p]) ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
Y [Ai [p]] += d ;
}
for (i = 0 ; i < n ; i++)
{
/* B2 [i] = ABS (B [i]) ; */
- ASSIGN (bi, Bx, Bz, i, split) ;
+ ASSIGN (bi, Bx, Bz, i, Bsplit) ;
ABS (B2 [i], bi) ;
}
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
SCALE (X [i], Rs [i]) ;
}
}
/* divide by the scale factors */
for (i = 0 ; i < n ; i++)
{
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
SCALE_DIV (X [i], Rs [i]) ;
}
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [Rperm [i]] ; */
- ASSIGN (W [i], Bx, Bz, Rperm [i], split) ;
+ ASSIGN (W [i], Bx, Bz, Rperm [i], Bsplit) ;
}
}
}
for (i = 0 ; i < n ; i++)
{
/* Z [i] = B [i] ; */
- ASSIGN (Z [i], Bx, Bz, i, split) ;
+ ASSIGN (Z [i], Bx, Bz, i, Bsplit) ;
}
flops += MULTSUB_FLOPS * nz ;
for (i = 0 ; i < n ; i++)
for (p = Ap [i] ; p < p2 ; p++)
{
/* Z [Ai [p]] -= Ax [p] * xi ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
MULT_SUB (Z [Ai [p]], aij, xi) ;
}
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx, Bz, i, split) ;
+ ASSIGN (W [i], Bx, Bz, i, Bsplit) ;
Z2 [i] = 0. ;
}
flops += (MULT_FLOPS + DECREMENT_FLOPS + ABS_FLOPS + 1) * nz ;
i = Ai [p] ;
/* axx = Ax [p] * xj ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
MULT (axx, aij, xj) ;
/* W [i] -= axx ; */
/* yi += ABS (Ax [p]) * Rs [Ai [p]] ; */
/* note that abs (aij) is the same as
* abs (conj (aij)) */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
yi += (d * Rs [Ai [p]]) ;
}
/* yi += ABS (Ax [p]) / Rs [Ai [p]] ; */
/* note that abs (aij) is the same as
* abs (conj (aij)) */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
yi += (d / Rs [Ai [p]]) ;
}
/* yi += ABS (Ax [p]) ; */
/* note that abs (aij) is the same as
* abs (conj (aij)) */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
yi += d ;
}
for (i = 0 ; i < n ; i++)
{
/* B2 [i] = ABS (B [i]) ; */
- ASSIGN (bi, Bx, Bz, i, split) ;
+ ASSIGN (bi, Bx, Bz, i, Bsplit) ;
ABS (B2 [i], bi) ;
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [Cperm [i]] ; */
- ASSIGN (W [i], Bx, Bz, Cperm [i], split) ;
+ ASSIGN (W [i], Bx, Bz, Cperm [i], Bsplit) ;
}
}
else
for (i = 0 ; i < n ; i++)
{
/* Z [i] = B [i] ; */
- ASSIGN (Z [i], Bx, Bz, i, split) ;
+ ASSIGN (Z [i], Bx, Bz, i, Bsplit) ;
}
flops += MULTSUB_FLOPS * nz ;
for (i = 0 ; i < n ; i++)
for (p = Ap [i] ; p < p2 ; p++)
{
/* zi -= conjugate (Ax [p]) * X [Ai [p]] ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, Bsplit) ;
MULT_SUB_CONJ (zi, X [Ai [p]], aij) ;
}
Z [i] = zi ;
for (i = 0 ; i < n ; i++)
{
/* wi = B [i] ; */
- ASSIGN (wi, Bx, Bz, i, split) ;
+ ASSIGN (wi, Bx, Bz, i, Bsplit) ;
z2i = 0. ;
p2 = Ap [i+1] ;
for (p = Ap [i] ; p < p2 ; p++)
{
/* axx = conjugate (Ax [p]) * X [Ai [p]] ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
MULT_CONJ (axx, X [Ai [p]], aij) ;
/* wi -= axx ; */
/* yi += ABS (Ax [p]) * Rs [Ai [p]] ; */
/* note that A.' is the array transpose,
* so no conjugate */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
yi += (d * Rs [Ai [p]]) ;
}
/* yi += ABS (Ax [p]) / Rs [Ai [p]] ; */
/* note that A.' is the array transpose,
* so no conjugate */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
yi += (d / Rs [Ai [p]]) ;
}
/* yi += ABS (Ax [p]) */
/* note that A.' is the array transpose,
* so no conjugate */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
ABS (d, aij) ;
yi += d ;
}
for (i = 0 ; i < n ; i++)
{
/* B2 [i] = ABS (B [i]) ; */
- ASSIGN (bi, Bx, Bz, i, split) ;
+ ASSIGN (bi, Bx, Bz, i, Bsplit) ;
ABS (B2 [i], bi) ;
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [Cperm [i]] ; */
- ASSIGN (W [i], Bx, Bz, Cperm [i], split) ;
+ ASSIGN (W [i], Bx, Bz, Cperm [i], Bsplit) ;
}
}
else
for (i = 0 ; i < n ; i++)
{
/* Z [i] = B [i] ; */
- ASSIGN (Z [i], Bx, Bz, i, split) ;
+ ASSIGN (Z [i], Bx, Bz, i, Bsplit) ;
}
flops += MULTSUB_FLOPS * nz ;
for (i = 0 ; i < n ; i++)
for (p = Ap [i] ; p < p2 ; p++)
{
/* zi -= Ax [p] * X [Ai [p]] ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
MULT_SUB (zi, aij, X [Ai [p]]) ;
}
Z [i] = zi ;
for (i = 0 ; i < n ; i++)
{
/* wi = B [i] ; */
- ASSIGN (wi, Bx, Bz, i, split) ;
+ ASSIGN (wi, Bx, Bz, i, Bsplit) ;
z2i = 0. ;
p2 = Ap [i+1] ;
for (p = Ap [i] ; p < p2 ; p++)
{
/* axx = Ax [p] * X [Ai [p]] ; */
- ASSIGN (aij, Ax, Az, p, split) ;
+ ASSIGN (aij, Ax, Az, p, AXsplit) ;
MULT (axx, aij, X [Ai [p]]) ;
/* wi -= axx ; */
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [Rperm [i]] ; */
- ASSIGN (X [i], Bx, Bz, Rperm [i], split) ;
+ ASSIGN (X [i], Bx, Bz, Rperm [i], Bsplit) ;
}
flops = UMF_lsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_lsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx, Bz, i, split) ;
+ ASSIGN (W [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_lhsolve (Numeric, W, Pattern) ;
for (i = 0 ; i < n ; i++)
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx, Bz, i, split) ;
+ ASSIGN (W [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_ltsolve (Numeric, W, Pattern) ;
for (i = 0 ; i < n ; i++)
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_lhsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_ltsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx, Bz, i, split) ;
+ ASSIGN (W [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_usolve (Numeric, W, Pattern) ;
for (i = 0 ; i < n ; i++)
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_usolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [Cperm [i]] ; */
- ASSIGN (X [i], Bx, Bz, Cperm [i], split) ;
+ ASSIGN (X [i], Bx, Bz, Cperm [i], Bsplit) ;
}
flops = UMF_uhsolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [Cperm [i]] ; */
- ASSIGN (X [i], Bx, Bz, Cperm [i], split) ;
+ ASSIGN (X [i], Bx, Bz, Cperm [i], Bsplit) ;
}
flops = UMF_utsolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_uhsolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx, Bz, i, split) ;
+ ASSIGN (X [i], Bx, Bz, i, Bsplit) ;
}
flops = UMF_utsolve (Numeric, X, Pattern) ;
#ifdef COMPLEX
/* copy the solution back, from Entry X [ ] to double Xx [ ] and Xz [ ] */
- if (split)
+ if (AXsplit)
{
for (i = 0 ; i < n ; i++)
{
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
{
return (UMFPACK_ERROR_invalid_permutation) ;
}
- if (!AMD_valid (n_row, n_col, Ap, Ai))
+ if (AMD_valid (n_row, n_col, Ap, Ai) != AMD_OK)
{
return (UMFPACK_ERROR_invalid_matrix) ;
}
Rz,
#endif
Ri, Rp, n_col, n_row, Rp [n_row]) ;
- ASSERT (AMD_valid (n_col, n_row, Rp, Ri)) ;
+ ASSERT (AMD_valid (n_col, n_row, Rp, Ri) == AMD_OK) ;
#endif
return (UMFPACK_OK) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
Define routine names, depending on version being compiled.
DINT: double precision, int's as integers
- DLONG: double precision, long's as integers
- ZLONG: complex double precision, long's as integers
+ DLONG: double precision, UF_long's as integers
+ ZLONG: complex double precision, UF_long's as integers
ZINT: complex double precision, int's as integers
*/
#endif
/* -------------------------------------------------------------------------- */
-/* integer type (Int is int or long) now defined in amd_internal.h */
+/* integer type (Int is int or UF_long) now defined in amd_internal.h */
/* -------------------------------------------------------------------------- */
#if defined (DLONG) || defined (ZLONG)
This is (x < 0) if the compiler is IEEE 754 compliant.
*/
-#if defined (MATHWORKS)
-
-/* The MathWorks has their own macros in util.h that handle NaN's properly. */
-#define SCALAR_IS_NAN(x) (utIsNaN (x))
-#define SCALAR_IS_ZERO(x) (utEQZero (x))
-#define SCALAR_IS_NONZERO(x) (utNEZero (x))
-#define SCALAR_IS_LTZERO(x) (utLTZero (x))
-
-#elif defined (UMF_WINDOWS)
+#if defined (UMF_WINDOWS) && !defined (MATHWORKS)
/* Yes, this is exceedingly ugly. Blame Microsoft, which hopelessly */
/* violates the IEEE 754 floating-point standard in a bizarre way. */
#define MULT_SUB(c,a,b) { (c) -= (a) * (b) ; }
#define MULT_SUB_CONJ(c,a,b) { (c) -= (a) * (b) ; }
#define DIV(c,a,b) { (c) = (a) / (b) ; }
-#define RECIPROCAL(c) { (c) = 1.0 / (c) ; }
#define DIV_CONJ(c,a,b) { (c) = (a) / (b) ; }
#define APPROX_ABS(s,a) { (s) = SCALAR_ABS (a) ; }
#define ABS(s,a) { (s) = SCALAR_ABS (a) ; }
/* -------------------------------------------------------------------------- */
-/* c = a/b, be careful to avoid underflow and overflow */
-#ifdef MATHWORKS
+/* c = a/b, using function pointer */
#define DIV(c,a,b) \
{ \
- (void) utDivideComplex ((a).Real, (a).Imag, (b).Real, (b).Imag, \
+ (void) umfpack_divcomplex ((a).Real, (a).Imag, (b).Real, (b).Imag, \
&((c).Real), &((c).Imag)) ; \
}
-#else
-/* This uses ACM Algo 116, by R. L. Smith, 1962. */
-/* c can be the same variable as a or b. */
-/* Ignore NaN case for double relop br>=bi. */
-#define DIV(c,a,b) \
-{ \
- double r, den, ar, ai, br, bi ; \
- br = (b).Real ; \
- bi = (b).Imag ; \
- ar = (a).Real ; \
- ai = (a).Imag ; \
- if (SCALAR_ABS (br) >= SCALAR_ABS (bi)) \
- { \
- r = bi / br ; \
- den = br + r * bi ; \
- (c).Real = (ar + ai * r) / den ; \
- (c).Imag = (ai - ar * r) / den ; \
- } \
- else \
- { \
- r = br / bi ; \
- den = r * br + bi ; \
- (c).Real = (ar * r + ai) / den ; \
- (c).Imag = (ai * r - ar) / den ; \
- } \
-}
-#endif
/* -------------------------------------------------------------------------- */
-/* c = 1/c, be careful to avoid underflow and overflow */
-/* Not used if MATHWORKS is defined. */
-/* This uses ACM Algo 116, by R. L. Smith, 1962. */
-/* Ignore NaN case for double relop cr>=ci. */
-#define RECIPROCAL(c) \
-{ \
- double r, den, cr, ci ; \
- cr = (c).Real ; \
- ci = (c).Imag ; \
- if (SCALAR_ABS (cr) >= SCALAR_ABS (ci)) \
- { \
- r = ci / cr ; \
- den = cr + r * ci ; \
- (c).Real = 1.0 / den ; \
- (c).Imag = - r / den ; \
- } \
- else \
- { \
- r = cr / ci ; \
- den = r * cr + ci ; \
- (c).Real = r / den ; \
- (c).Imag = - 1.0 / den ; \
- } \
-}
-
-
-/* -------------------------------------------------------------------------- */
-
-/* c = a/conjugate(b), be careful to avoid underflow and overflow */
-#ifdef MATHWORKS
+/* c = a/conjugate(b), using function pointer */
#define DIV_CONJ(c,a,b) \
{ \
- (void) utDivideComplex ((a).Real, (a).Imag, (b).Real, (-(b).Imag), \
+ (void) umfpack_divcomplex ((a).Real, (a).Imag, (b).Real, (-(b).Imag), \
&((c).Real), &((c).Imag)) ; \
}
-#else
-/* This uses ACM Algo 116, by R. L. Smith, 1962. */
-/* c can be the same variable as a or b. */
-/* Ignore NaN case for double relop br>=bi. */
-#define DIV_CONJ(c,a,b) \
-{ \
- double r, den, ar, ai, br, bi ; \
- br = (b).Real ; \
- bi = (b).Imag ; \
- ar = (a).Real ; \
- ai = (a).Imag ; \
- if (SCALAR_ABS (br) >= SCALAR_ABS (bi)) \
- { \
- r = (-bi) / br ; \
- den = br - r * bi ; \
- (c).Real = (ar + ai * r) / den ; \
- (c).Imag = (ai - ar * r) / den ; \
- } \
- else \
- { \
- r = br / (-bi) ; \
- den = r * br - bi; \
- (c).Real = (ar * r + ai) / den ; \
- (c).Imag = (ai * r - ar) / den ; \
- } \
-}
-#endif
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* exact absolute value, s = sqrt (a.real^2 + amag^2) */
-#ifdef MATHWORKS
+/* exact absolute value, s = sqrt (a.real^2 + a.imag^2) */
#define ABS(s,a) \
{ \
- (s) = utFdlibm_hypot ((a).Real, (a).Imag) ; \
+ (s) = umfpack_hypot ((a).Real, (a).Imag) ; \
}
-#else
-/* Ignore NaN case for the double relops ar>=ai and ar+ai==ar. */
-#define ABS(s,a) \
-{ \
- double r, ar, ai ; \
- ar = SCALAR_ABS ((a).Real) ; \
- ai = SCALAR_ABS ((a).Imag) ; \
- if (ar >= ai) \
- { \
- if (ar + ai == ar) \
- { \
- (s) = ar ; \
- } \
- else \
- { \
- r = ai / ar ; \
- (s) = ar * sqrt (1.0 + r*r) ; \
- } \
- } \
- else \
- { \
- if (ai + ar == ai) \
- { \
- (s) = ai ; \
- } \
- else \
- { \
- r = ar / ai ; \
- (s) = ai * sqrt (1.0 + r*r) ; \
- } \
- } \
-}
-#endif
/* -------------------------------------------------------------------------- */
#endif
/* -------------------------------------------------------------------------- */
-/* Double precision, with long's as integers */
+/* Double precision, with UF_long's as integers */
/* -------------------------------------------------------------------------- */
#ifdef DLONG
#endif
/* -------------------------------------------------------------------------- */
-/* Complex double precision, with long's as integers */
+/* Complex double precision, with UF_long's as integers */
/* -------------------------------------------------------------------------- */
#ifdef ZLONG
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* compile-time settings: cannot be modified at run-time */
/* ---------------------------------------------------------------------- */
-#ifdef USE_NO_BLAS
+#ifdef NBLAS
/* do not use the BLAS - use in-line C code instead */
Control [UMFPACK_COMPILED_WITH_BLAS] = 0 ;
#else
#endif
#ifdef MATLAB_MEX_FILE
- /* use mxMalloc, mxFree, mxRealloc, and mexPrintf */
- /* use mxAssert if debugging is enabled */
+ /* compiled as a MATLAB mexFunction */
Control [UMFPACK_COMPILED_FOR_MATLAB] = 1 ;
#else
#ifdef MATHWORKS
- /* use internal utMalloc, utFree, utRealloc, and utPrintf routines. */
- /* use utDivideComplex and utFdlibm_hypot for complex version. */
- /* use utAssert if debugging is enabled. */
+ /* compiled for internal use in MATLAB */
Control [UMFPACK_COMPILED_FOR_MATLAB] = 2 ;
#else
- /* use ANSI C malloc, free, realloc, and print */
- /* use ANSI C assert if debugging is enabled */
+ /* use ANSI C malloc, free, realloc, and printf */
Control [UMFPACK_COMPILED_FOR_MATLAB] = 0 ;
#endif
#endif
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
+/* UMFPACK_get_determinant contributed by David Bateman, Motorola, Paris. */
/* -------------------------------------------------------------------------- */
/*
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
--- /dev/null
+/* ========================================================================== */
+/* === UMFPACK_global ======================================================= */
+/* ========================================================================== */
+
+/* -------------------------------------------------------------------------- */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
+/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
+/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
+/* -------------------------------------------------------------------------- */
+
+/*
+ Global variables. UMFPACK uses these function pointers for several
+ user-redefinable functions. The amd_* functions are defined in
+ AMD/Source/amd_global.c.
+
+ Function pointer default for mexFunction
+ (see MATLAB/umfpackmex.c)
+ ---------------- ------- ---------------
+ amd_malloc malloc mxMalloc
+ amd_free free mxFree
+ amd_realloc realloc mxRealloc
+ amd_calloc calloc mxCalloc
+ amd_printf printf mexPrintf
+
+ umfpack_hypot umf_hypot umf_hypot
+ umfpack_divcomplex umf_divcomplex umf_divcomplex
+
+ This routine is compiled just once for all four versions of UMFPACK
+ (int/UF_long, double/complex).
+*/
+
+#include "umf_internal.h"
+
+double (*umfpack_hypot) (double, double) = umf_hypot ;
+int (*umfpack_divcomplex) (double, double, double, double, double *, double *)
+ = umf_divcomplex ;
+
+
+/* ========================================================================== */
+/* === umf_hypot ============================================================ */
+/* ========================================================================== */
+
+/* There is an equivalent routine called hypot in <math.h>, which conforms
+ * to ANSI C99. However, UMFPACK does not assume that ANSI C99 is available.
+ * You can use the ANSI C99 hypot routine with:
+ *
+ * #include <math.h>
+ * umfpack_hypot = hypot ;
+ *
+ * prior to calling any UMFPACK routine.
+ *
+ * s = hypot (x,y) computes s = sqrt (x*x + y*y) but does so more accurately.
+ *
+ * The NaN case for the double relops x >= y and x+y == x is safely ignored.
+ */
+
+double umf_hypot (double x, double y)
+{
+ double s, r ;
+ x = SCALAR_ABS (x) ;
+ y = SCALAR_ABS (y) ;
+ if (x >= y)
+ {
+ if (x + y == x)
+ {
+ s = x ;
+ }
+ else
+ {
+ r = y / x ;
+ s = x * sqrt (1.0 + r*r) ;
+ }
+ }
+ else
+ {
+ if (y + x == y)
+ {
+ s = y ;
+ }
+ else
+ {
+ r = x / y ;
+ s = y * sqrt (1.0 + r*r) ;
+ }
+ }
+ return (s) ;
+}
+
+
+/* ========================================================================== */
+/* === umf_divcomplex ======================================================= */
+/* ========================================================================== */
+
+/* c = a/b where c, a, and b are complex. The real and imaginary parts are
+ * passed as separate arguments to this routine. The NaN case is ignored
+ * for the double relop br >= bi. Returns TRUE (1) if the denominator is
+ * zero, FALSE (0) otherwise.
+ *
+ * This uses ACM Algo 116, by R. L. Smith, 1962, which tries to avoid
+ * underflow and overflow.
+ *
+ * c can be the same variable as a or b.
+ */
+
+int umf_divcomplex
+(
+ double ar, double ai, /* real and imaginary parts of a */
+ double br, double bi, /* real and imaginary parts of b */
+ double *cr, double *ci /* real and imaginary parts of c */
+)
+{
+ double tr, ti, r, den ;
+ if (SCALAR_ABS (br) >= SCALAR_ABS (bi))
+ {
+ r = bi / br ;
+ den = br + r * bi ;
+ tr = (ar + ai * r) / den ;
+ ti = (ai - ar * r) / den ;
+ }
+ else
+ {
+ r = br / bi ;
+ den = r * br + bi ;
+ tr = (ar * r + ai) / den ;
+ ti = (ai * r - ar) / den ;
+ }
+ *cr = tr ;
+ *ci = ti ;
+ return (SCALAR_IS_ZERO (den)) ;
+}
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
Info [UMFPACK_NCOL] = n_col ;
Info [UMFPACK_SIZE_OF_UNIT] = (double) (sizeof (Unit)) ;
Info [UMFPACK_SIZE_OF_INT] = (double) (sizeof (int)) ;
- Info [UMFPACK_SIZE_OF_LONG] = (double) (sizeof (long)) ;
+ Info [UMFPACK_SIZE_OF_LONG] = (double) (sizeof (UF_long)) ;
Info [UMFPACK_SIZE_OF_POINTER] = (double) (sizeof (void *)) ;
Info [UMFPACK_SIZE_OF_ENTRY] = (double) (sizeof (Entry)) ;
Info [UMFPACK_SYMBOLIC_DEFRAG] = 0 ;
/* :: int overflow, Clen too large :: */
/* Problem is too large for array indexing (Ci [i]) with an Int i. */
/* Cannot even analyze the problem to determine upper bounds on */
- /* memory usage. Need to use the long integer version, umfpack_*l_*. */
+ /* memory usage. Need to use the UF_long version, umfpack_*l_*. */
DEBUGm4 (("out of memory: symbolic int overflow\n")) ;
Info [UMFPACK_STATUS] = UMFPACK_ERROR_out_of_memory ;
return (UMFPACK_ERROR_out_of_memory) ;
Symbolic->nempty_col = nempty_col ;
/* UMF_singletons has verified that the user's input matrix is valid */
- ASSERT (AMD_valid (n_row, n_col, Ap, Ai)) ;
+ ASSERT (AMD_valid (n_row, n_col, Ap, Ai) == AMD_OK) ;
Symbolic->n1 = n1 ;
Symbolic->nempty = nempty ;
Rp = Sp ;
Ri = Si ;
}
- ASSERT (AMD_valid (n2, n2, Rp, Ri)) ;
+ ASSERT (AMD_valid (n2, n2, Rp, Ri) == AMD_OK) ;
nzaat = AMD_aat (n2, Rp, Ri, Sdeg, Wq, amd_Info) ;
sym = amd_Info [AMD_SYMMETRY] ;
, (double *) NULL, (double *) NULL, FALSE
#endif
) ;
- ASSERT (AMD_valid (n2, n2, Rp, Ri)) ;
+ ASSERT (AMD_valid (n2, n2, Rp, Ri) == AMD_OK) ;
/* contents of Si and Sp no longer needed, but the space is
* still needed */
DEBUG1 ((" Row "ID" in Front "ID"\n", row, nfr)) ;
}
}
- for (i = 0 ; i <= nfr ; i++)
- {
- DEBUG1 (("Front "ID" has 1strows: "ID" pivcols "ID"\n",
- i, f1rows, fpivcol)) ;
- }
#endif
/* ---------------------------------------------------------------------- */
for (p = Ap [oldcol] ; p < Ap [oldcol+1] ; p++)
{
Entry aij ;
+ CLEAR (aij) ;
oldrow = Ai [p] ;
newrow = Ci [oldrow] ;
if (Ax != (double *) NULL)
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
return ;
}
- PRINTF (("\n%s, Control:\n\n", UMFPACK_VERSION)) ;
+ PRINTF (("UMFPACK V%d.%d.%d (%s), Control:\n", UMFPACK_MAIN_VERSION,
+ UMFPACK_SUB_VERSION, UMFPACK_SUBSUB_VERSION, UMFPACK_DATE)) ;
/* ---------------------------------------------------------------------- */
/* run-time options */
#endif
#ifdef DLONG
PRINTF ((" Matrix entry defined as: double\n")) ;
- PRINTF ((" Int (generic integer) defined as: long\n")) ;
+ PRINTF ((" Int (generic integer) defined as: UF_long\n")) ;
#endif
#ifdef ZINT
PRINTF ((" Matrix entry defined as: double complex\n")) ;
#endif
#ifdef ZLONG
PRINTF ((" Matrix entry defined as: double complex\n")) ;
- PRINTF ((" Int (generic integer) defined as: long\n")) ;
+ PRINTF ((" Int (generic integer) defined as: UF_long\n")) ;
#endif
/* ---------------------------------------------------------------------- */
PRINTF ((" "ID": BLAS library used: ",
(Int) INDEX (UMFPACK_COMPILED_WITH_BLAS))) ;
-#if defined (USE_NO_BLAS)
+#ifdef NBLAS
PRINTF (("none. UMFPACK will be slow.\n")) ;
-#elif defined (USE_C_BLAS)
- PRINTF (("C-BLAS.\n")) ;
-#elif defined (USE_MATLAB_BLAS)
- PRINTF (("built-in MATLAB BLAS (ATLAS).\n")) ;
-#elif defined (USE_SUNPERF_BLAS)
- PRINTF (("Sun Performance Library BLAS.\n")) ;
-#elif defined (USE_SCSL_BLAS)
- PRINTF (("SGI SCSL BLAS.\n")) ;
-#elif defined (USE_FORTRAN_BLAS)
- PRINTF (("Fortran BLAS.\n")) ;
+#else
+ PRINTF (("Fortran BLAS. size of BLAS integer: "ID"\n",
+ (Int) (sizeof (BLAS_INT)))) ;
#endif
#ifdef MATLAB_MEX_FILE
-#ifdef NUTIL
- PRINTF ((" "ID": compiled for MATLAB"
- " (uses mxMalloc, mxFree, mxRealloc, and mexPrintf)\n",
+ PRINTF ((" "ID": compiled for MATLAB\n",
(Int) INDEX (UMFPACK_COMPILED_FOR_MATLAB))) ;
-#else
- PRINTF ((" "ID": compiled for MATLAB"
- " (uses utMalloc, utFree, utRealloc, and mexPrintf)\n",
- (Int) INDEX (UMFPACK_COMPILED_FOR_MATLAB))) ;
-#endif
#else
#ifdef MATHWORKS
- PRINTF ((" "ID": compiled for MATLAB, using internal utility routines\n"
- " (uses utMalloc, utFree, utRealloc, and utPrintf)\n",
+ PRINTF ((" "ID": compiled for MATLAB\n",
(Int) INDEX (UMFPACK_COMPILED_FOR_MATLAB))) ;
- PRINTF ((" (complex version uses utDivideComplex, utFdlibm_hypot)\n")) ;
#else
- PRINTF ((" "ID": compiled for ANSI C"
- " (uses malloc, free, realloc, and printf)\n",
+ PRINTF ((" "ID": compiled for ANSI C\n",
(Int) INDEX (UMFPACK_COMPILED_FOR_MATLAB))) ;
#endif
#endif
"**** Debugging enabled (UMFPACK will be exceedingly slow!) *****************\n"
" "ID": compiled with debugging enabled. ",
(Int) INDEX (UMFPACK_COMPILED_IN_DEBUG_MODE))) ;
-#ifdef MATLAB_MEX_FILE
- PRINTF (("Uses mxAssert.\n")) ;
-#else
-#ifdef MATHWORKS
- PRINTF (("Uses utAssert.\n")) ;
-#else
- PRINTF (("Uses ANSI C assert.\n")) ;
-#endif
-#endif
#else
PRINTF ((" "ID": compiled for normal operation (debugging disabled)\n",
(Int) INDEX (UMFPACK_COMPILED_IN_DEBUG_MODE))) ;
#endif
PRINTF ((" computer/operating system: %s\n", UMFPACK_ARCHITECTURE)) ;
- PRINTF ((" size of int: %g long: %g Int: %g pointer: %g"
+ PRINTF ((" size of int: %g UF_long: %g Int: %g pointer: %g"
" double: %g Entry: %g (in bytes)\n\n", (double) sizeof (int),
- (double) sizeof (long), (double) sizeof (Int),
+ (double) sizeof (UF_long), (double) sizeof (Int),
(double) sizeof (void *), (double) sizeof (double),
(double) sizeof (Entry))) ;
}
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* print umfpack version */
/* ---------------------------------------------------------------------- */
- PRINTF (("\n%s, Info:\n", UMFPACK_VERSION)) ;
+ PRINTF (("UMFPACK V%d.%d.%d (%s), Info:\n", UMFPACK_MAIN_VERSION,
+ UMFPACK_SUB_VERSION, UMFPACK_SUBSUB_VERSION, UMFPACK_DATE)) ;
#ifndef NDEBUG
PRINTF ((
#endif
#ifdef DLONG
PRINTF ((" matrix entry defined as: double\n")) ;
- PRINTF ((" Int (generic integer) defined as: long\n")) ;
+ PRINTF ((" Int (generic integer) defined as: UF_long\n")) ;
#endif
#ifdef ZINT
PRINTF ((" matrix entry defined as: double complex\n")) ;
#endif
#ifdef ZLONG
PRINTF ((" matrix entry defined as: double complex\n")) ;
- PRINTF ((" Int (generic integer) defined as: long\n")) ;
+ PRINTF ((" Int (generic integer) defined as: UF_long\n")) ;
#endif
/* ---------------------------------------------------------------------- */
/* print compile-time options */
/* ---------------------------------------------------------------------- */
- PRINTF ((" BLAS library used: ")) ;
+ PRINTF ((" BLAS library used: ")) ;
-#if defined (USE_NO_BLAS)
+#ifdef NBLAS
PRINTF (("none. UMFPACK will be slow.\n")) ;
-#elif defined (USE_C_BLAS)
- PRINTF (("C-BLAS.\n")) ;
-#elif defined (USE_MATLAB_BLAS)
- PRINTF (("built-in MATLAB BLAS.\n")) ;
-#elif defined (USE_SUNPERF_BLAS)
- PRINTF (("Sun Performance Library BLAS.\n")) ;
-#elif defined (USE_SCSL_BLAS)
- PRINTF (("SGI SCSL BLAS.\n")) ;
-#elif defined (USE_FORTRAN_BLAS)
- PRINTF (("Fortran BLAS.\n")) ;
+#else
+ PRINTF (("Fortran BLAS. size of BLAS integer: "ID"\n",
+ (Int) (sizeof (BLAS_INT)))) ;
#endif
PRINTF ((" MATLAB: ")) ;
PRINTF (("yes.\n")) ;
#else
#ifdef MATHWORKS
- PRINTF (("yes (using internal ut* routines).\n")) ;
+ PRINTF (("yes.\n")) ;
#else
PRINTF (("no.\n")) ;
#endif
PRINT_INFO (" size of int: "ID" bytes\n",
(Int) Info [UMFPACK_SIZE_OF_INT]) ;
- PRINT_INFO (" size of long: "ID" bytes\n",
+ PRINT_INFO (" size of UF_long: "ID" bytes\n",
(Int) Info [UMFPACK_SIZE_OF_LONG]) ;
PRINT_INFO (" size of pointer: "ID" bytes\n",
(Int) Info [UMFPACK_SIZE_OF_POINTER]) ;
PRINT_INFO (" numeric factorization wallclock time (sec): %.2f\n",
twnum) ;
- if (tnum > 0 && fnum > 0)
+#define TMIN 0.001
+
+ if (tnum > TMIN && fnum > 0)
{
PRINT_INFO (
" numeric factorization mflops (CPU time): %.2f\n",
1e-6 * fnum / tnum) ;
}
- if (twnum > 0 && fnum > 0)
+ if (twnum > TMIN && fnum > 0)
{
PRINT_INFO (
" numeric factorization mflops (wallclock): %.2f\n",
ttot = EMPTY ;
ftot = fnum ;
- if (tsym >= 0 && tnum >= 0)
+ if (tsym >= TMIN && tnum >= 0)
{
ttot = tsym + tnum ;
PRINT_INFO (" symbolic + numeric CPU time (sec): %.2f\n",
ttot) ;
- if (ftot > 0 && ttot > 0)
+ if (ftot > 0 && ttot > TMIN)
{
PRINT_INFO (
" symbolic + numeric mflops (CPU time): %.2f\n",
}
twtot = EMPTY ;
- if (twsym >= 0 && twnum >= 0)
+ if (twsym >= TMIN && twnum >= TMIN)
{
twtot = twsym + twnum ;
PRINT_INFO (" symbolic + numeric wall clock time (sec): %.2f\n",
twtot) ;
- if (ftot > 0 && twtot > 0)
+ if (ftot > 0 && twtot > TMIN)
{
PRINT_INFO (
" symbolic + numeric mflops (wall clock): %.2f\n",
tsolve) ;
PRINT_INFO (" solve wall clock time (sec): %.2f\n",
twsolve) ;
- if (fsolve > 0 && tsolve > 0)
+ if (fsolve > 0 && tsolve > TMIN)
{
PRINT_INFO (
" solve mflops (CPU time): %.2f\n",
1e-6 * fsolve / tsolve) ;
}
- if (fsolve > 0 && twsolve > 0)
+ if (fsolve > 0 && twsolve > TMIN)
{
PRINT_INFO (
" solve mflops (wall clock time): %.2f\n",
"\n total symbolic + numeric + solve flops: %.5e\n", ftot) ;
}
- if (tsolve >= 0)
+ if (tsolve >= TMIN)
{
- if (ttot >= 0 && ftot >= 0)
+ if (ttot >= TMIN && ftot >= 0)
{
ttot += tsolve ;
PRINT_INFO (
" total symbolic + numeric + solve CPU time: %.2f\n",
ttot) ;
- if (ftot > 0 && ttot > 0)
+ if (ftot > 0 && ttot > TMIN)
{
PRINT_INFO (
" total symbolic + numeric + solve mflops (CPU): %.2f\n",
}
}
- if (twsolve >= 0)
+ if (twsolve >= TMIN)
{
- if (twtot >= 0 && ftot >= 0)
+ if (twtot >= TMIN && ftot >= 0)
{
twtot += tsolve ;
PRINT_INFO (
" total symbolic+numeric+solve wall clock time: %.2f\n",
twtot) ;
- if (ftot > 0 && twtot > 0)
+ if (ftot > 0 && twtot > TMIN)
{
PRINT_INFO (
" total symbolic+numeric+solve mflops(wallclock) %.2f\n",
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
PRINTF6 (("%s", UMFPACK_LICENSE_PART1)) ;
PRINTF6 (("%s", UMFPACK_LICENSE_PART2)) ;
PRINTF6 (("%s", UMFPACK_LICENSE_PART3)) ;
- PRINTF (("%s: ", UMFPACK_VERSION)) ;
+ PRINTF (("UMFPACK V%d.%d.%d (%s): ", UMFPACK_MAIN_VERSION,
+ UMFPACK_SUB_VERSION, UMFPACK_SUBSUB_VERSION, UMFPACK_DATE)) ;
switch (status)
{
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */
+/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
<h3>General</h3>
<ol>
+ <li> <p>Updated: The version of UMFPACK bundled with deal.II has been updated
+ to release 5.1.0.
+ <br>
+ (WB 2007/08/15)
+ </p>
+
<li> <p>New: The step-27 tutorial program has been added. It solves a Laplace
equation with hp finite elements
and shows how to set finite element degrees, assemble matrices on