Rev 1820 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
/* ========================================================================== *//* === umfpack_symbolic ===================================================== *//* ========================================================================== *//* -------------------------------------------------------------------------- *//* UMFPACK Version 4.5, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, *//* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. *//* web: http://www.cise.ufl.edu/research/sparse/umfpack *//* -------------------------------------------------------------------------- */int umfpack_di_symbolic(int n_row,int n_col,const int Ap [ ],const int Ai [ ],const double Ax [ ],void **Symbolic,const double Control [UMFPACK_CONTROL],double Info [UMFPACK_INFO]) ;long umfpack_dl_symbolic(long n_row,long n_col,const long Ap [ ],const long Ai [ ],const double Ax [ ],void **Symbolic,const double Control [UMFPACK_CONTROL],double Info [UMFPACK_INFO]) ;int umfpack_zi_symbolic(int n_row,int n_col,const int Ap [ ],const int Ai [ ],const double Ax [ ], const double Az [ ],void **Symbolic,const double Control [UMFPACK_CONTROL],double Info [UMFPACK_INFO]) ;long umfpack_zl_symbolic(long n_row,long n_col,const long Ap [ ],const long Ai [ ],const double Ax [ ], const double Az [ ],void **Symbolic,const double Control [UMFPACK_CONTROL],double Info [UMFPACK_INFO]) ;/*double int Syntax:#include "umfpack.h"void *Symbolic ;int n_row, n_col, *Ap, *Ai, status ;double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO], *Ax ;status = umfpack_di_symbolic (n_row, n_col, Ap, Ai, Ax,&Symbolic, Control, Info) ;double long Syntax:#include "umfpack.h"void *Symbolic ;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) ;complex int Syntax:#include "umfpack.h"void *Symbolic ;int n_row, n_col, *Ap, *Ai, status ;double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO], *Ax, *Az ;status = umfpack_zi_symbolic (n_row, n_col, Ap, Ai, Ax, Az,&Symbolic, Control, Info) ;complex long Syntax:#include "umfpack.h"void *Symbolic ;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) ;packed complex Syntax:Same as above, except Az is NULL.Purpose:Given nonzero pattern of a sparse matrix A in column-oriented form,umfpack_*_symbolic performs a column pre-ordering to reduce fill-in(using COLAMD or AMD) and a symbolic factorization. This is requiredbefore the matrix can be numerically factorized with umfpack_*_numeric.If you wish to bypass the COLAMD or AMD pre-ordering and provide your ownordering, use umfpack_*_qsymbolic instead.Since umfpack_*_symbolic and umfpack_*_qsymbolic are very similar, optionsfor both routines are discussed below.For the following discussion, let S be the submatrix of A obtained aftereliminating all pivots of zero Markowitz cost. S has dimension(n_row-n1-nempty_row) -by- (n_col-n1-nempty_col), wheren1 = Info [UMFPACK_COL_SINGLETONS] + Info [UMFPACK_ROW_SINGLETONS],nempty_row = Info [UMFPACK_NEMPTY_ROW] andnempty_col = Info [UMFPACK_NEMPTY_COL].Returns:The status code is returned. See Info [UMFPACK_STATUS], below.Arguments: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.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 ofthe matrix A is held in Ai [(Ap [j]) ... (Ap [j+1]-1)]. The firstentry, Ap [0], must be zero, and Ap [j] <= Ap [j+1] must hold for allj in the range 0 to n_col-1. The value nz = Ap [n_col] is thus thetotal number of entries in the pattern of the matrix A. nz must begreater than or equal to zero.Int Ai [nz] ; Input argument, not modified, of size nz = Ap [n_col].The nonzero pattern (row indices) for column j is stored inAi [(Ap [j]) ... (Ap [j+1]-1)]. The row indices in a given column jmust be in ascending order, and no duplicate row indices may be present.Row indices must be in the range 0 to n_row-1 (the matrix is 0-based).See umfpack_*_triplet_to_col for how to sort the columns of a matrixand sum up the duplicate entries. See umfpack_*_report_matrix for howto print the matrix A.double Ax [nz] ; Optional input argument, not modified.Size 2*nz for packed complex case.The numerical values of the sparse matrix A. The nonzero pattern (rowindices) for column j is stored in Ai [(Ap [j]) ... (Ap [j+1]-1)], andthe corresponding numerical values are stored inAx [(Ap [j]) ... (Ap [j+1]-1)]. Used only by the 2-by-2 strategy todetermine whether entries are "large" or "small". You do not have topass the same numerical values to umfpack_*_numeric. If Ax is notpresent (a (double *) NULL pointer), then any entry in A is assumed tobe "large".double Az [nz] ; Optional input argument, not modified, for complexversions.For the complex versions, this holds the imaginary part of A. Theimaginary part of column j is held in Az [(Ap [j]) ... (Ap [j+1]-1)].If Az is NULL, then both realand imaginary parts are contained in Ax[0..2*nz-1], with Ax[2*k]and Ax[2*k+1] being the real and imaginary part of the kth entry.Used by the 2-by-2 strategy only. See the description of Ax, above.void **Symbolic ; Output argument.**Symbolic is the address of a (void *) pointer variable in the user'scalling routine (see Syntax, above). On input, the contents of thisvariable are not defined. On output, this variable holds a (void *)pointer to the Symbolic object (if successful), or (void *) NULL ifa failure occurred.double Control [UMFPACK_CONTROL] ; Input argument, not modified.If a (double *) NULL pointer is passed, then the default controlsettings are used (the defaults are suitable for all matrices,ranging from those with highly unsymmetric nonzero pattern, tosymmetric matrices). Otherwise, the settings are determined from theControl array. See umfpack_*_defaults on how to fill the Controlarray with the default settings. If Control contains NaN's, thedefaults are used. The following Control parameters are used:Control [UMFPACK_STRATEGY]: This is the most important controlparameter. It determines what kind of ordering and pivotingstrategy that UMFPACK should use. There are 4 options:UMFPACK_STRATEGY_AUTO: This is the default. The input matrix isanalyzed to determine how symmetric the nonzero pattern is, andhow many entries there are on the diagonal. It then selects oneof the following strategies. Refer to the User Guide for adescription of how the strategy is automatically selected.UMFPACK_STRATEGY_UNSYMMETRIC: Use the unsymmetric strategy. COLAMDis used to order the columns of A, followed by a postorder ofthe column elimination tree. No attempt is made to performdiagonal pivoting. The column ordering is refined duringfactorization.In the numerical factorization, theControl [UMFPACK_SYM_PIVOT_TOLERANCE] parameter is ignored. Apivot is selected if its magnitude is >=Control [UMFPACK_PIVOT_TOLERANCE] (default 0.1) times thelargest entry in its column.UMFPACK_STRATEGY_SYMMETRIC: Use the symmetric strategyIn this method, the approximate minimum degreeordering (AMD) is applied to A+A', followed by a postorder ofthe elimination tree of A+A'. UMFPACK attempts to performdiagonal pivoting during numerical factorization. No refinementof the column pre-ordering is performed during factorization.In the numerical factorization, a nonzero entry on the diagonalis selected as the pivot if its magnitude is >= Control[UMFPACK_SYM_PIVOT_TOLERANCE] (default 0.001) times the largestentry in its column. If this is not acceptable, then anoff-diagonal pivot is selected with magnitude >= Control[UMFPACK_PIVOT_TOLERANCE] (default 0.1) times the largest entryin its column.UMFPACK_STRATEGY_2BY2: a row permutation P2 is found that placeslarge entries on the diagonal. The matrix P2*A is thenfactorized using the symmetric strategy, described above.Refer to the User Guide for more information.Control [UMFPACK_DENSE_COL]:If COLAMD is used, columns with more thanmax (16, Control [UMFPACK_DENSE_COL] * 16 * sqrt (n_row)) entriesare placed placed last in the column pre-ordering. Default: 0.2.Control [UMFPACK_DENSE_ROW]:Rows with more than max (16, Control [UMFPACK_DENSE_ROW] * 16 *sqrt (n_col)) entries are treated differently in the COLAMDpre-ordering, and in the internal data structures during thesubsequent numeric factorization. Default: 0.2.Control [UMFPACK_AMD_DENSE]: rows/columns in A+A' with more thanmax (16, Control [UMFPACK_AMD_DENSE] * sqrt (n)) entries(where n = n_row = n_col) are ignored in the AMD pre-ordering.Default: 10.Control [UMFPACK_BLOCK_SIZE]: the block size to use for Level-3 BLASin the subsequent numerical factorization (umfpack_*_numeric).A value less than 1 is treated as 1. Default: 32. Modifying thisparameter affects when updates are applied to the working frontalmatrix, and can indirectly affect fill-in and operation count.As long as the block size is large enough (8 or so), this parameterhas a modest effect on performance.Control [UMFPACK_2BY2_TOLERANCE]: a diagonal entry S (k,k) isconsidered "small" if it is < tol * max (abs (S (:,k))), where S asubmatrix of the scaled input matrix, with pivots of zero Markowitzcost removed.Control [UMFPACK_SCALE]: See umfpack_numeric.h for a description.Only affects the 2-by-2 strategy. Default: UMFPACK_SCALE_SUM.Control [UMFPACK_FIXQ]: If > 0, then the pre-ordering Q is not modifiedduring numeric factorization. If < 0, then Q may be modified. Ifzero, then this is controlled automatically (the unsymmetricstrategy modifies Q, the others do not). Default: 0.Control [UMFPACK_AGGRESSIVE]: If nonzero, aggressive absorption is usedin COLAMD and AMD. Default: 1.double Info [UMFPACK_INFO] ; Output argument, not defined on input.Contains statistics about the symbolic analysis. If a (double *) NULLpointer is passed, then no statistics are returned in Info (this is notan error condition). The entire Info array is cleared (all entries setto -1) and then the following statistics are computed:Info [UMFPACK_STATUS]: status code. This is also the return value,whether or not Info is present.UMFPACK_OKEach column of the input matrix contained row indicesin increasing order, with no duplicates. Only in this casedoes umfpack_*_symbolic compute a valid symbolic factorization.For the other cases below, no Symbolic object is created(*Symbolic is (void *) NULL).UMFPACK_ERROR_n_nonpositiven is less than or equal to zero.UMFPACK_ERROR_invalid_matrixNumber of entries in the matrix is negative, Ap [0] is nonzero,a column has a negative number of entries, a row index is out ofbounds, or the columns of input matrix were jumbled (unsortedcolumns or duplicate entries).UMFPACK_ERROR_out_of_memoryInsufficient memory to perform the symbolic analysis. If theanalysis requires more than 2GB of memory and you are usingthe 32-bit ("int") version of UMFPACK, then you are guaranteedto run out of memory. Try using the 64-bit version of UMFPACK.UMFPACK_ERROR_argument_missingOne or more required arguments is missing.UMFPACK_ERROR_internal_errorSomething very serious went wrong. This is a bug.Please contact the author (davis@cise.ufl.edu).Info [UMFPACK_NROW]: the value of the input argument n_row.Info [UMFPACK_NCOL]: the value of the input argument n_col.Info [UMFPACK_NZ]: the number of entries in the input matrix(Ap [n_col]).Info [UMFPACK_SIZE_OF_UNIT]: the number of bytes in a Unit,for memory usage statistics below.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_POINTER]: the number of bytes in a void *pointer.Info [UMFPACK_SIZE_OF_ENTRY]: the number of bytes in a numerical entry.Info [UMFPACK_NDENSE_ROW]: number of "dense" rows in A. These rows areignored when the column pre-ordering is computed in COLAMD. Theyare also treated differently during numeric factorization. If > 0,then the matrix had to be re-analyzed by UMF_analyze, which doesnot ignore these rows.Info [UMFPACK_NEMPTY_ROW]: number of "empty" rows in A, as determinedThese are rows that either have no entries, or whose entries areall in pivot columns of zero-Markowitz-cost pivots.Info [UMFPACK_NDENSE_COL]: number of "dense" columns in A. COLAMDorders these columns are ordered last in the factorization, butbefore "empty" columns.Info [UMFPACK_NEMPTY_COL]: number of "empty" columns in A. These arecolumns that either have no entries, or whose entries are all inpivot rows of zero-Markowitz-cost pivots. These columns areordered last in the factorization, to the right of "dense" columns.Info [UMFPACK_SYMBOLIC_DEFRAG]: number of garbage collectionsperformed during ordering and symbolic pre-analysis.Info [UMFPACK_SYMBOLIC_PEAK_MEMORY]: the amount of memory (in Units)required for umfpack_*_symbolic to complete. This count includesthe size of the Symbolic object itself, which is also reported inInfo [UMFPACK_SYMBOLIC_SIZE].Info [UMFPACK_SYMBOLIC_SIZE]: the final size of the Symbolic object (inUnits). This is fairly small, roughly 2*n to 13*n integers,depending on the matrix.Info [UMFPACK_VARIABLE_INIT_ESTIMATE]: the Numeric object contains twoparts. The first is fixed in size (O (n_row+n_col)). Thesecond part holds the sparse LU factors and the contribution blocksfrom factorized frontal matrices. This part changes in size duringfactorization. Info [UMFPACK_VARIABLE_INIT_ESTIMATE] is the exactsize (in Units) required for this second variable-sized part inorder for the numerical factorization to start.Info [UMFPACK_VARIABLE_PEAK_ESTIMATE]: the estimated peak size (inUnits) of the variable-sized part of the Numeric object. This isusually an upper bound, but that is not guaranteed.Info [UMFPACK_VARIABLE_FINAL_ESTIMATE]: the estimated final size (inUnits) of the variable-sized part of the Numeric object. This isusually an upper bound, but that is not guaranteed. It holds justthe sparse LU factors.Info [UMFPACK_NUMERIC_SIZE_ESTIMATE]: an estimate of the final size (inUnits) of the entire Numeric object (both fixed-size and variable-sized parts), which holds the LU factorization (including the L, U,P and Q matrices).Info [UMFPACK_PEAK_MEMORY_ESTIMATE]: an estimate of the total amount ofmemory (in Units) required by umfpack_*_symbolic andumfpack_*_numeric to perform both the symbolic and numericfactorization. This is the larger of the amount of memory neededin umfpack_*_numeric itself, and the amount of memory needed inumfpack_*_symbolic (Info [UMFPACK_SYMBOLIC_PEAK_MEMORY]). Thecount includes the size of both the Symbolic and Numeric objectsthemselves. It can be a very loose upper bound, particularly whenthe symmetric or 2-by-2 strategies are used.Info [UMFPACK_FLOPS_ESTIMATE]: an estimate of the total floating-pointoperations required to factorize the matrix. This is a "true"theoretical estimate of the number of flops that would be performedby a flop-parsimonious sparse LU algorithm. It assumes that noextra flops are performed except for what is strictly required tocompute the LU factorization. It ignores, for example, the flopsperformed by umfpack_di_numeric to add contribution blocks offrontal matrices together. If L and U are the upper bound on thepattern of the factors, then this flop count estimate can berepresented in MATLAB (for real matrices, not complex) as:Lnz = full (sum (spones (L))) - 1 ; % nz in each col of LUnz = full (sum (spones (U')))' - 1 ; % nz in each row of Uflops = 2*Lnz*Unz + sum (Lnz) ;The actual "true flop" count found by umfpack_*_numeric will beless than this estimate.For the real version, only (+ - * /) are counted. For the complexversion, the following counts are used:operation flopsc = 1/b 6c = a*b 6c -= a*b 8Info [UMFPACK_LNZ_ESTIMATE]: an estimate of the number of nonzeros inL, including the diagonal. Since L is unit-diagonal, the diagonalof L is not stored. This estimate is a strict upper bound on theactual nonzeros in L to be computed by umfpack_*_numeric.Info [UMFPACK_UNZ_ESTIMATE]: an estimate of the number of nonzeros inU, including the diagonal. This estimate is a strict upper bound onthe actual nonzeros in U to be computed by umfpack_*_numeric.Info [UMFPACK_MAX_FRONT_SIZE_ESTIMATE]: estimate of the size of thelargest frontal matrix (# of entries), for arbitrary partialpivoting during numerical factorization.Info [UMFPACK_SYMBOLIC_TIME]: The CPU time taken, in seconds.Info [UMFPACK_SYMBOLIC_WALLTIME]: The wallclock time taken, in seconds.Info [UMFPACK_STRATEGY_USED]: The ordering strategy used:UMFPACK_STRATEGY_SYMMETRIC, UMFPACK_STRATEGY_UNSYMMETRIC, orUMFPACK_STRATEGY_2BY2.Info [UMFPACK_ORDERING_USED]: The ordering method used:UMFPACK_ORDERING_COLAMD or UMFPACK_ORDERING_AMD. It can beUMFPACK_ORDERING_GIVEN for umfpack_*_qsymbolic.Info [UMFPACK_QFIXED]: 1 if the column pre-ordering will be refinedduring numerical factorization, 0 if not.Info [UMFPACK_DIAG_PREFERED]: 1 if diagonal pivoting will be attempted,0 if not.Info [UMFPACK_COL_SINGLETONS]: the matrix A is analyzed by firsteliminating all pivots with zero Markowitz cost. This count is thenumber of these pivots with exactly one nonzero in their pivotcolumn.Info [UMFPACK_ROW_SINGLETONS]: the number of zero-Markowitz-costpivots with exactly one nonzero in their pivot row.Info [UMFPACK_PATTERN_SYMMETRY]: the symmetry of the pattern of S.Info [UMFPACK_NZ_A_PLUS_AT]: the number of off-diagonal entries in S+S'.Info [UMFPACK_NZDIAG]: the number of entries on the diagonal of S.Info [UMFPACK_N2]: if S is square, and nempty_row = nempty_col, thisis equal to n_row - n1 - nempty_row.Info [UMFPACK_S_SYMMETRIC]: 1 if S is square and its diagonal has beenpreserved, 0 otherwise.Info [UMFPACK_MAX_FRONT_NROWS_ESTIMATE]: estimate of the max number ofrows in any frontal matrix, for arbitrary partial pivoting.Info [UMFPACK_MAX_FRONT_NCOLS_ESTIMATE]: estimate of the max number ofcolumns in any frontal matrix, for arbitrary partial pivoting.------------------------------------------------------------------------The next four statistics are computed only if AMD is used:------------------------------------------------------------------------Info [UMFPACK_SYMMETRIC_LUNZ]: The number of nonzeros in L and U,assuming no pivoting during numerical factorization, and assuming azero-free diagonal of U. Excludes the entries on the diagonal ofL. If the matrix has a purely symmetric nonzero pattern, this isoften a lower bound on the nonzeros in the actual L and U computedin the numerical factorization, for matrices that fit the criteriafor the "symmetric" strategy.Info [UMFPACK_SYMMETRIC_FLOPS]: The floating-point operation count inthe numerical factorization phase, assuming no pivoting. If thepattern of the matrix is symmetric, this is normally a lower boundon the floating-point operation count in the actual numericalfactorization, for matrices that fit the criteria for the symmetricor 2-by-2 strategiesInfo [UMFPACK_SYMMETRIC_NDENSE]: The number of "dense" rows/columns ofS+S' that were ignored during the AMD ordering. These are placedlast in the output order. If > 0, then theInfo [UMFPACK_SYMMETRIC_*] statistics, above are rough upper bounds.Info [UMFPACK_SYMMETRIC_DMAX]: The maximum number of nonzeros in anycolumn of L, if no pivoting is performed during numericalfactorization. Excludes the part of the LU factorization forpivots with zero Markowitz cost.------------------------------------------------------------------------The following statistics are computed only if the 2-by-2 strategy isused or attempted:------------------------------------------------------------------------Info [UMFPACK_2BY2_NWEAK]: the number of small diagonal entries in S.Info [UMFPACK_2BY2_UNMATCHED]: the number of small diagonal entriesin P2*S.Info [UMFPACK_2BY2_PATTERN_SYMMETRY]: the symmetry of P2*S.Info [UMFPACK_2BY2_NZ_PA_PLUS_AT]: the number of off-diagonal entriesin (P2*S)+(P2*S)'.Info [UMFPACK_2BY2_NZDIAG]: the number of nonzero entries on thediagonal of P2*S.At the start of umfpack_*_symbolic, all of Info is set of -1, and thenafter that only the above listed Info [...] entries are accessed.Future versions might modify different parts of Info.*/