}
else
{
- dense = (Int) (alpha * sqrt ((double) n)) ;
+ dense = alpha * sqrt ((double) n) ;
}
dense = MAX (16, dense) ;
dense = MIN (n, dense) ;
-This directory is an almost identical copy of the UMFPACK 4.3
+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
+Jan. 28, 2005: v4.4 released
+
+ * bug fix: when Qinit is provided to umfpack_*_qsymbolic,
+ only the symmetric and unsymmetric strategies are now permitted.
+ The auto and 2-by-2 strategies are not allowed. In v4.3 and
+ earlier, providing Qinit and requesting the symmetric strategy
+ did not always work (you got the unsymmetric strategy instead).
+ This does not affect umfpack_*_symbolic, which computes its own
+ ordering and can use all 4 strategies (auto, symmetric, unsymmetric,
+ and 2-by-2).
+
+ * umfpack_get_determinant added.
+
+ * packed complex case added for all routines (previously only used in
+ umfpack_report_vector). This allows arrays of ANSI C/C++ complex
+ type to be passed directly to UMFPACK.
+
+ * added umf_multicomple.c to assist in the compilation of UMFPACK
+ in Microsoft Visual Studio, which does not have the required
+ flexibility of the Unix "make" command.
+
+ * local variable declarations reordered to encourage double-word
+ alignment of double's and Entry's, for better performance.
+
+ * note that with the exception of the behavior when a user-provided
+ ordering is passed to umfpack_*_qsymbolic, versions 4.1 through 4.4
+ have comparable performance (ordering quality, memory usage,
+ and run time). v4.1 is much better than v4.0 in performance.
+
+Jan. 11, 2005: v4.3.1 released
+
+ * bug fix in umf_solve. This bug is only the 4th one found in the C
+ versions of UMFPACK to date (Version 3.0 to 4.3.1, from March 2001 to
+ Jan. 2005, excluding workarounds for quirky compilers). No bugs have
+ been reported in the last Fortran version of UMFPACK (MA38, or UMFPACK
+ V2.2.1) since its release in Jan. 1998.
+
+ In Version 4.3, a bug in umf_solve caused iterative refinement
+ to be disabled when solving A'x=b or A.'x=b after factorizing A.
+ Modified the umfpack mexFunction to factorize A and then solve A'x=b
+ when performing the operation x=b/A (as "umfpack(b,'/',A). Note that
+ this has no effect on the use of UMFPACK in MATLAB itself, since MATLAB
+ does not use the umfpack mexFunction for x=b/A. When computing x=b/A,
+ MATLAB factorizes A' and computes x=(A'\b')' instead. The following
+ source code files changed:
+
+ UMFPACK/MATLAB/umfpackmex.c (see above)
+ UMFPACK/Source/umf_solve.c (see source code: 2 lines changed)
+ UMFPACK/Include/umfpack.h (version and date changed)
+ UMFPACK/MATLAB/umfpack_test.m (new file)
+
Jan. 16, 2004: v4.3 released.
* user interface of v4.3 is upwardly-compatible with v4.2 and v4.1.
* added umfpack_btf M-file.
* modified the BLAS update in the frontal matrix. If there are only
- a few pivots in remaining in the current front, then the BLAS3 update
- is delayed to include pivots in the next front.
+ a few pivots in remaining in the current front, then the BLAS3 update
+ is delayed to include pivots in the next front.
* Removed the special-case handling of dense columns from the numerical
- factorization (kept it in the colamd preordering). This improves the
- performance of UMFPACK on dense matrices by a factor of 5 or so, and
- simplifies the code.
+ factorization (kept it in the colamd preordering). This improves the
+ performance of UMFPACK on dense matrices by a factor of 5 or so, and
+ simplifies the code.
* Added a symmetric-preference pivoting option. The option slightly
- (but uniformly) improves the ordering when factorizing matrices with
- symmetric nonzero pattern. That class of matrix is better handled by
- the symmetric-pattern multifrontal method (MA41 in the Harwell
- Subroutine Library), however.
+ (but uniformly) improves the ordering when factorizing matrices with
+ symmetric nonzero pattern. That class of matrix is better handled by
+ the symmetric-pattern multifrontal method (MA41 in the Harwell
+ Subroutine Library), however.
* Fixed the detection of integer overflow. The 32-bit version cannot
- make use of more than 2GB of main memory (use the 64-bit version
- in that case, instead). The 32-bit version did not correctly detect
- when it was trying to factorize too large of a matrix.
+ make use of more than 2GB of main memory (use the 64-bit version
+ in that case, instead). The 32-bit version did not correctly detect
+ when it was trying to factorize too large of a matrix.
May 4, 2001:
* 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, and 4n for the permanent LU factors which was allocated
+ 12n integers (8n temporary workspace used during numerical factorization,
+ and 4n for the permanent LU factors which was allocated
at the beginning of factorization).
* Ported to the IBM RS 6000 and Compaq Alpha, with help from Anshul Gupta
-UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
+UMFPACK Version 4.4 (Jan. 28, 2005), Copyright (c) 2005 by Timothy A.
Davis. All Rights Reserved.
UMFPACK License:
# UMFPACK Makefile for compiling on Unix systems (for GNU or original make)
#-------------------------------------------------------------------------------
+# UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+# All Rights Reserved. See ../Doc/License for License.
+
all: dist
include ../Make/Make.include
UMFPACK = umfpack_col_to_triplet umfpack_defaults umfpack_free_numeric \
umfpack_free_symbolic umfpack_get_numeric umfpack_get_lunz \
+ umfpack_get_determinant \
umfpack_get_symbolic umfpack_numeric umfpack_qsymbolic \
umfpack_report_control umfpack_report_info umfpack_report_matrix \
umfpack_report_numeric umfpack_report_perm umfpack_report_status \
\author{Timothy A. Davis \\
Dept. of Computer and Information Science and Engineering \\
Univ. of Florida, Gainesville, FL}
-\title{UMFPACK Version 4.3 Quick Start Guide}
-\date{Jan. 16, 2004}
+\title{UMFPACK Version 4.4 Quick Start Guide}
+\date{Jan. 28, 2005}
\maketitle
%-------------------------------------------------------------------------------
\end{abstract}
%-------------------------------------------------------------------------------
-Technical Report TR-04-003
-
-UMFPACK Version 4.3 (Jan. 16, 2004), Copyright\copyright 2004 by Timothy A.
+UMFPACK Version 4.4 (Jan. 28, 2005), Copyright\copyright 2005 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
matrices $\m{A}$ can be used to solve $\m{Ax}=\m{b}$ or related systems.
Rectangular matrices can only be factorized.
-UMFPACK Version 4.0 is a built-in routine in MATLAB 6.5, used by the forward and
-backslash operator, and the {\tt lu} routine. The following is a short
+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.
+The following is a short
introduction to Unix users of the C interface of UMFPACK.
%-------------------------------------------------------------------------------
-The C-callable UMFPACK library consists of 31 user-callable routines and one
-include file. Twenty-seven of the routines come in four versions, with
+The C-callable UMFPACK library consists of 32 user-callable routines and one
+include file. Twenty-eight of the routines come in four versions, with
different sizes of integers and for real or complex floating-point numbers.
This Quick Start Guide assumes you are working with real matrices
(not complex) and with {\tt int}'s as integers (not {\tt long}'s).
long integer versions. The include file {\tt umfpack.h}
must be included in any C program that uses UMFPACK.
+For more details, see:
+{\em A column pre-ordering strategy for the unsymmetric-pattern multifrontal method},
+Davis, T. A.,
+ACM Trans. Math. Software, vol 30. no 2, 2004, pp. 165-195, and
+{\em Algorithm 832: {UMFPACK}, an unsymmetric-pattern multifrontal method},
+same issue, pp. 196-199.
+
%-------------------------------------------------------------------------------
\section{Primary routines, and a simple example}
%-------------------------------------------------------------------------------
Additional routines are available for passing a different column ordering
to UMFPACK, changing default parameters, manipulating sparse matrices,
getting the LU factors, save and loading the LU factors from a file,
+computing the determinant,
and reporting results. See the User Guide for more information.
\begin{itemize}
\label{Install}
%-------------------------------------------------------------------------------
-You will need to install both UMFPACK v4.3 and AMD v1.1 (or AMD v1.0) to use UMFPACK.
+You will need to install both UMFPACK v4.4 and AMD v1.1 (or AMD v1.0) to use UMFPACK.
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. You can edit the {\tt Make.include}
-files in those directories to customize the compilation. The default
+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
for Linux, Sun Solaris, SGI IRIX, IBM AIX, and the DEC/Compaq Alpha.
\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.
- This is normally off by default, except when the {\tt gcc}
- compiler is used.
+ This is off by default (speed preferred over accuracy) except when
+ compiling for MATLAB.
\end{itemize}
When you compile your program that uses the C-callable UMFPACK library,
UMFPACK_WARNING_singular_matrix
- A divide-by-zero occured. Your solution will contain Inf's
+ A divide-by-zero occurred. Your solution will contain Inf's
and/or NaN's. Some parts of the solution may be valid. For
example, solving Ax=b with
@article{AmestoyDavisDuff03,
author={Amestoy, P. R. and Davis, T. A. and Duff, I. S.},
- title={Algorithm 8xx: {AMD}, an approximate minimum degree ordering algorithm},
+ title={Algorithm 837: {AMD}, an approximate minimum degree ordering algorithm},
journal=TOMS,
- year={2003 (under submission)},
- note={Also TR-03-010 at www.cise.ufl.edu/tech-reports.}
- }
+ year={2004}
+ ,volume={30}
+ ,number={3}
+ ,pages={381-388}}
@techreport{AmestoyDavisDuff03_user,
author={Amestoy, P. R. and Davis, T. A. and Duff, I. S.},
author={Davis, T. A.},
title={A column pre-ordering strategy for the unsymmetric-pattern multifrontal method},
journal=TOMS,
- year={2003 (under submission)}
- ,note={Also TR-03-006 at www.cise.ufl.edu/tech-reports.}
- }
+ year={2004}
+ ,volume={30}
+ ,number={2}
+ ,pages={165-195}}
@article{Davis03_algo,
author={Davis, T. A.},
- title={Algorithm 8xx: {UMFPACK V4.3}, an unsymmetric-pattern multifrontal method},
+ title={Algorithm 832: {UMFPACK}, an unsymmetric-pattern multifrontal method},
journal=TOMS,
- year={2004 (under submission)}
- ,note={Also TR-04-004 at www.cise.ufl.edu/tech-reports.}
- }
+ year={2004}
+ ,volume={30}
+ ,number={2}
+ ,pages={196-199}}
@techreport{Davis03_umf,
author={Davis, T. A.},
- title={{UMFPACK} Version 4.3 User Guide},
+ title={{UMFPACK} Version 4.4 User Guide},
institution={Univ. of Florida, CISE Dept.},
year={2004}
,number={TR-04-003}
@techreport{Davis03_umfquick,
author={Davis, T. A.},
- title={{UMFPACK} Version 4.3 Quick Start Guide},
+ title={{UMFPACK} Version 4.4 Quick Start Guide},
institution={Univ. of Florida, CISE Dept.},
year={2004}
,number={TR-04-005}
,address={Gainesville, FL}
,note={www.cise.ufl.edu/tech-reports}}
-@techreport{DavisGilbertLarimoreNg00,
+@article{DavisGilbertLarimoreNg00,
author={Davis, T. A. and Gilbert, J. R. and Larimore, S. I. and Ng, E. G.},
title={A column approximate minimum degree ordering algorithm},
- institution={Univ. of Florida, CISE Dept.},
- year={2000}
- ,number={TR-00-005}
- ,address={Gainesville, FL}
- ,month={October}
- ,note={(www.cise.ufl.edu/tech-reports. Submitted to ACM Trans. Math. Softw.)}
- }
+ journal=TOMS,
+ year={2004}
+ ,volume={30}
+ ,number={3}
+ ,pages={353-376}}
-@techreport{DavisGilbertLarimoreNg00_algo,
+@article{DavisGilbertLarimoreNg00_algo,
author={Davis, T. A. and Gilbert, J. R. and Larimore, S. I. and Ng, E. G.},
- title={Algorithm 8xx: {COLAMD}, a column approximate minimum degree ordering algorithm},
- institution={Univ. of Florida, CISE Dept.},
- year={2000}
- ,number={TR-00-006}
- ,address={Gainesville, FL}
- ,month={October}
- ,note={(www.cise.ufl.edu/tech-reports. Submitted to ACM Trans. Math. Softw.)}
- }
-
+ title={Algorithm 836: {COLAMD}, a column approximate minimum degree ordering algorithm},
+ journal=TOMS,
+ year={2004}
+ ,volume={30}
+ ,number={3}
+ ,pages={377-380}}
@INCOLLECTION{GilbertNg93,
author = {J. R. Gilbert and E. G. Ng},
/INCLUDE umfpack_load_symbolic.h/r ../Include/umfpack_load_symbolic.h
/INCLUDE umfpack_save_numeric.h/r ../Include/umfpack_save_numeric.h
/INCLUDE umfpack_save_symbolic.h/r ../Include/umfpack_save_symbolic.h
+/INCLUDE umfpack_get_determinant.h/r ../Include/umfpack_get_determinant.h
\author{Timothy A. Davis \\
Dept. of Computer and Information Science and Engineering \\
Univ. of Florida, Gainesville, FL}
-\title{UMFPACK Version 4.3 User Guide}
-\date{Jan. 16, 2004}
+\title{UMFPACK Version 4.4 User Guide}
+\date{Jan. 28, 2005}
\maketitle
%-------------------------------------------------------------------------------
\end{abstract}
%-------------------------------------------------------------------------------
-Technical Report TR-04-003.
+Technical Report TR-04-003 (revised)
-UMFPACK Version 4.3 (Jan. 16, 2004), Copyright\copyright 2004 by Timothy A.
+UMFPACK Version 4.4 (Jan. 28, 2005), Copyright\copyright 2005 by Timothy A.
Davis. All Rights Reserved.
{\bf UMFPACK License:}
%-------------------------------------------------------------------------------
UMFPACK\footnote{Pronounced with two syllables: umph-pack}
-Version 4.3 is a set of routines for solving systems of linear
+Version 4.4 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
diagonal entry is too small.
More details of the method, including experimental results, are
-described in \cite{Davis03,Davis03}, available at
+described in \cite{Davis03,Davis03_algo}, available at
http://www.cise.ufl.edu/tech-reports.
%-------------------------------------------------------------------------------
%-------------------------------------------------------------------------------
In addition to appearing as a Collected Algorithm of the ACM,
-UMFPACK Version 4.3 is available at http://www.cise.ufl.edu/research/sparse.
-An earlier version (Version 4.0) is included as a built-in routine in MATLAB
-6.5. Version 4.0 does not have the symmetric or 2-by-2 strategies and it takes
+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)
+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.3 (and v4.2 and v4.1) tend to be much faster than Version 4.0,
+Version 4.4 (and v4.3 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
Subroutine Library.
%-------------------------------------------------------------------------------
-\section{Primary changes since Version 4.1}
+\section{Primary changes from prior versions}
+%-------------------------------------------------------------------------------
+
+A detailed list of changes is in the {\tt ChangeLog} file.
+
+%-------------------------------------------------------------------------------
+\subsection{Version 4.4}
+%-------------------------------------------------------------------------------
+
+Bug fix in strategy selection in {\tt umfpack\_*\_qsymbolic}.
+Added packed complex case for all complex input/output arguments.
+Added {\tt umfpack\_get\_determinant}.
+Added minimal support for Microsoft Visual Studio
+(the {\tt umf\_multicompile.c} file).
+
+%-------------------------------------------------------------------------------
+\subsection{Version 4.3.1}
+%-------------------------------------------------------------------------------
+
+Minor bug fix in the forward/backsolve. This bug had the effect of turning
+off iterative refinement when solving $\m{A}\tr\m{x}=\m{b}$ after factorizing
+$\m{A}$. UMFPACK mexFunction now factorizes $\m{A}\tr$ in its forward-slash
+operation.
+
+%-------------------------------------------------------------------------------
+\subsection{Version 4.3}
%-------------------------------------------------------------------------------
No changes are visible to the C or MATLAB user, except the presence of
The primary change is the addition of an (optional) drop tolerance.
%-------------------------------------------------------------------------------
-\section{Primary changes in Version 4.1 (since Version 4.0)}
+\subsection{Version 4.1}
%-------------------------------------------------------------------------------
-A detailed list of changes is in the {\tt ChangeLog} file. The following
-is a summary of the main changes that are visible to the C or MATLAB user:
+The following is a summary of the main changes that are visible to the C
+or MATLAB user:
\begin{enumerate}
\section{Using UMFPACK in MATLAB}
%-------------------------------------------------------------------------------
-The easiest way to use UMFPACK is within MATLAB. Version 4.0 is a built-in
-routine in MATLAB 6.5, and is used in {\tt x = A}$\backslash${\tt b} when
+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
{\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}.
An optional input argument can be used to modify the control parameters for
UMFPACK, and an optional output argument provides statistics on the
-factorization. UMFPACK will print these statistics if you turn
-on the sparse matrix monitor flag with {\tt spparms ('spumoni', 1)}.
-The UMFPACK printing level parameter described in Section~\ref{Reporting}
-is set to {\tt spumoni} plus 1. Type {\tt help umfpack} for more information.
+factorization.
Refer to the AMD User Guide for more details about the AMD mexFunction.
\hline
& & \\
\begin{minipage}[t]{1.5in}
-Solve $\m{Ax}=\m{b}$ using a different column pre-ordering.
+Solve $\m{Ax}=\m{b}$ using a different row and column pre-ordering
+(symmetric ordering).
\end{minipage}
&
\begin{minipage}[t]{2.2in}
\begin{verbatim}
S = spones (A) ;
Q = symamd (S+S') ;
-x = umfpack (A,Q,'\',b) ;
+Control = umfpack ;
+Control (6) = 3 ;
+x = umfpack (A,Q,'\',b,Control) ;
\end{verbatim}
\end{minipage}
&
spparms ('autommd',0) ;
S = spones (A) ;
Q = symamd (S+S') ;
-x = A (:,Q) \ b ;
+x = A (Q,Q) \ b (Q) ;
x (Q) = x ;
spparms ('autommd',1) ;
\end{verbatim}
\begin{verbatim}
x = umfpack (b,'/',A) ;
\end{verbatim}
+Note: $\m{A}$ is factorized.
\end{minipage}
&
\begin{minipage}[t]{2.2in}
\begin{verbatim}
x = b / A ;
\end{verbatim}
+Note: $\m{A}\tr$ is factorized.
\end{minipage}
\\
& & \\
}
\end{table}
-Note: in MATLAB 6.5, use {\tt spparms ('autoamd',0)} in addition to
+Note: in MATLAB 6.5 or later, use {\tt spparms ('autoamd',0)} in addition to
{\tt spparms ('autommd',0)}, in Table~\ref{matlab}, to turn off MATLAB's
default reordering.
backslash or forward slash. See {\tt umfpack\_solve} for an M-file that
removes this restriction.
This restriction does not apply to the built-in backslash operator
-in MATLAB 6.5, which uses UMFPACK v4.0 to factorize the matrix.
+in MATLAB 6.5 or later, which uses UMFPACK to factorize the matrix.
You can do this yourself in MATLAB:
{\footnotesize
To use the documented {\tt mxMalloc} routine instead, compile the
mexFunction with the {\tt -DNUTIL} flag enabled.
+To compute the determinant with UMFPACK:
+
+\begin{verbatim}
+ d = umfpack (A, 'det') ;
+ [d e] = umfpack (A, 'det') ;
+\end{verbatim}
+
+The first case is identical to MATLAB's {\tt det}.
+The second case returns the determinant in the form
+$d \times 10^e$, which avoids overflow if $e$ is large.
+
%-------------------------------------------------------------------------------
\section{Using UMFPACK in a C program}
\label{C}
%-------------------------------------------------------------------------------
-The C-callable UMFPACK library consists of 31 user-callable routines and one
-include file. Twenty-seven of the routines come in four versions, with
+The C-callable UMFPACK library consists of 32 user-callable routines and one
+include file. All but three of the routines come in four versions, with
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\_zi\_*}: complex double precision, {\tt int} integers.
\item {\tt umfpack\_zl\_*}: complex double precision, {\tt long} integers.
\end{enumerate}
-where {\tt *} denotes the specific name of one of the 27 routines.
+where {\tt *} denotes the specific name of one of the routines.
Routine names beginning with {\tt umf\_} are internal to the package,
and should not be called by the user. The include file {\tt umfpack.h}
must be included in any C program that uses UMFPACK.
Use only one version for any one problem; do not attempt to use one version
to analyze the matrix and another version to factorize the matrix, for example.
-The notation {\tt umfpack\_di\_*} refers to all 27 user-callable routines
+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
hold the real part of the matrices; and second double precision arrays hold
the imaginary part of the input and output matrices. Internally, complex
numbers are stored in arrays with their real and imaginary parts interleaved,
-as required by the BLAS.
+as required by the BLAS (``packed'' complex form).
+
+New to Version 4.4 is the option of providing input/output arguments
+in packed complex form.
%-------------------------------------------------------------------------------
\subsection{Primary routines, and a simple example}
\end{verbatim}
}
+Alternatively, if {\tt Az} is {\tt NULL},
+the real part of the $k$th entry is located in
+{\tt Ax[2*k]} and the imaginary part is located in
+{\tt Ax[2*k+1]}, and the {\tt Ax} array is of size {\tt 2*nz}.
+
All nonzeros are entries, but an entry may be numerically zero. The row indices
of entries in column {\tt j} are stored in
{\tt Ai[Ap[j]} \ldots {\tt Ap[j+1]-1]}.
The corresponding numerical values are stored in
{\tt Ax[Ap[j]} \ldots {\tt Ap[j+1]-1]}.
The imaginary part, for the complex versions, is stored in
- {\tt Az[Ap[j]} \ldots {\tt Ap[j+1]-1]}.
+ {\tt Az[Ap[j]} \ldots {\tt Ap[j+1]-1]}
+ (see above for the packed complex case).
No duplicate row indices may be present, and the row indices in any given
column must be sorted in ascending order. The first entry {\tt Ap[0]} must be
The triplets can be in any
order in the {\tt Ti}, {\tt Tj}, and {\tt Tx} arrays (and {\tt Tz} for
the complex versions), and duplicate entries may
-exist. Any duplicate entries are summed when the triplet form is converted to
+exist.
+If {\tt Tz} is NULL, then the array {\tt Tx} becomes of size {\tt 2*nz},
+and the real and imaginary parts of the
+{\tt k}-th triplet are located in {\tt Tx[2*k]} and {\tt Tx[2*k+1]},
+respectively.
+Any duplicate entries are summed when the triplet form is converted to
compressed column form. This is a convenient way to create a matrix arising in
finite-element methods, for example.
Applies the row scale factors to a user-provided vector. This is not
required to solve the sparse linear system $\m{Ax}=\m{b}$ or
$\m{A}\tr\m{x}=\m{b}$, since {\tt umfpack\_*\_solve} applies the scale
- factors for those systems. This routine is new to Version 4.1.
+ factors for those systems.
\end{itemize}
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
+can then be used in conjunction with UMFPACK.
+Watch my web page for details.
%-------------------------------------------------------------------------------
\subsection{Getting the contents of opaque objects}
are provided for copying their contents into user-provided arrays using simpler
data structures. Four routines are provided for saving and loading the
{\tt Numeric} and {\tt Symbolic} objects to/from binary files.
+An additional routine is provided that computes the determinant.
They are fully described in Section~\ref{Get}:
\begin{itemize}
preordering, supernodal column elimination tree, and information
about each frontal matrix) into arrays provided by the user.
+\item {\tt umfpack\_*\_get\_determinant}:
+
+ Computes the determinant from the diagonal of $\m{U}$ and the permutations
+ $\m{P}$ and $\m{Q}$. This is mostly of theoretical interest.
+ It is not a good test to determine if your matrix is singular or not.
+
\item {\tt umfpack\_*\_save\_numeric}:
Saves a copy of the {\tt Numeric} object to a file, in binary format.
UMFPACK itself does not make use of these routines;
they are provided solely for returning the contents of the opaque
{\tt Symbolic} and {\tt Numeric} objects to the user, and saving/loading
-them to/from a binary file.
+them to/from a binary file. None of them do any computation, except for
+{\tt umfpack\_*\_get\_determinant}.
%-------------------------------------------------------------------------------
\subsection{Reporting routines}
into the C-callable UMFPACK library than when used in the MATLAB mexFunction.
MATLAB stores its sparse matrices using the same compressed column data
structure discussed above, where row and column indices of an $m$-by-$n$
-matrix are in the range 0 to $m-1$ or $n-1$, respectively.
+matrix are in the range 0 to $m-1$ or $n-1$, respectively\footnote{Complex
+matrices in MATLAB use the split array form, with one {\tt double} array
+for the real part and another array for the imaginary part. UMFPACK
+supports that format, as well as the packed complex format (new to Version 4.4).}
It prints them as if they are in the range 1 to $m$ or $n$.
The UMFPACK mexFunction behaves the same way.
UMFPACK uses an optional {\tt double} array (currently of size 20)
to modify its control parameters. If you pass {\tt (double *) NULL} instead
-of a {\tt Control} array, then defaults are used.
+of a {\tt Control} array, then defaults are used. These defaults provide
+nearly optimal performance (both speed, memory usage, and numerical accuracy)
+for a wide range of matrices from real applications.
+
This array will almost certainly grow in size in future releases,
so be sure to dimension your {\tt Control} array to be of size
{\tt UMFPACK\_CONTROL}. That constant is currently defined to be 20,
-but will increase in future versions.
+but may increase in future versions, since all 20 entries are in use.
The contents of this array may be modified by the user
(see {\tt umfpack\_*\_defaults}). Each
Many of the routines return a {\tt status} value.
This is also returned as the first entry in the {\tt Info} array, for
those routines with that argument. The following list summarizes
-all of the error codes in UMFPACK v4.3. Each error code is given a
+all of the error codes in UMFPACK. Each error code is given a
specific name in the {\tt umfpack.h} include file, so you can use
those constants instead of hard-coded values in your program.
Future versions may report additional error codes.
A value of zero means everything was successful, and the matrix is
non-singular. A value greater than zero means the routine was successful,
-but a warning occurred. Currently, the only warning code is when the
-matrix is singular. A negative value means the routine was not successful.
+but a warning occurred.
+A negative value means the routine was not successful.
In this case, no {\tt Symbolic} or {\tt Numeric} object was created.
\begin{itemize}
\item {\tt UMFPACK\_WARNING\_singular\_matrix}, (1): Matrix is singular.
There are exact zeros on the diagonal of $\m{U}$.
+\item {\tt UMFPACK\_WARNING\_determinant\_underflow}, (2):
+ The determinant is nonzero, but smaller in magnitude than
+ the smallest positive floating-point number.
+
+\item {\tt UMFPACK\_WARNING\_determinant\_overflow}, (3):
+ The determinant is larger in magnitude than
+ the largest positive floating-point number (IEEE Inf).
+
\item {\tt UMFPACK\_ERROR\_out\_of\_memory}, (-1): Not enough memory.
The ANSI C {\tt malloc} or {\tt realloc} routine failed.
If you try to factorize a matrix using one version of UMFPACK and
then use the factors in another version, this error code will trigger as
well. You cannot factor your matrix using
- version 4.0 and then solve with version 4.1.
+ version 4.0 and then solve with version 4.1, for example.\footnote{
+ Exception: v4.3, v4.3.1, and v4.4 use identical data structures
+ for the {\tt Numeric} and {\tt Symbolic} objects}.
You cannot use different precisions of the same version
(real and complex, for example).
It is possible for the {\tt Numeric} object to be corrupted by your
Some arguments of some are optional (you can pass a {\tt NULL} pointer
instead of an array). This error code occurs if you pass a {\tt NULL}
pointer when that argument is required to be present.
- \item {\tt UMFPACK\_ERROR\_n\_nonpositive} (-6):
+
+\item {\tt UMFPACK\_ERROR\_n\_nonpositive} (-6):
The number of rows or columns of the matrix must be greater than zero.
- \item {\tt UMFPACK\_ERROR\_invalid\_matrix} (-8):
+
+\item {\tt UMFPACK\_ERROR\_invalid\_matrix} (-8):
The matrix is invalid. For the column-oriented input, this error
code will occur if the contents of {\tt Ap} and/or {\tt Ai} are invalid.
The {\tt sys} argument of {\tt umfpack\_*\_solve}
is an integer in the range 0 to 14 which defines which linear system is
-to be solved. Valid values are listed in Table~\ref{sys}.
+to be solved.
+\footnote{Integer values for {\tt sys} are used instead of strings (as in LINPACK
+and LAPACK) to avoid C-to-Fortran portability issues.}
+Valid values are listed in Table~\ref{sys}.
The notation $\m{A}\he$ refers to the matrix transpose, which is the
complex conjugate transpose for complex matrices ({\tt A'} in MATLAB).
The array transpose is $\m{A}\tr$, which is {\tt A.'} in MATLAB.
\hline
Value & & system \\
\hline
+& & \\
{\tt UMFPACK\_A} & (0) & $\m{Ax}=\m{b}$ \\
{\tt UMFPACK\_At} & (1) & $\m{A}\he\m{x}=\m{b}$ \\
{\tt UMFPACK\_Aat} & (2) & $\m{A}\tr\m{x}=\m{b}$ \\
+& & \\
\hline
+& & \\
{\tt UMFPACK\_Pt\_L} & (3) & $\m{P}\tr\m{Lx}=\m{b}$ \\
{\tt UMFPACK\_L} & (4) & $\m{Lx}=\m{b}$ \\
{\tt UMFPACK\_Lt\_P} & (5) & $\m{L}\he\m{Px}=\m{b}$ \\
{\tt UMFPACK\_Lat\_P} & (6) & $\m{L}\tr\m{Px}=\m{b}$ \\
{\tt UMFPACK\_Lt} & (7) & $\m{L}\he\m{x}=\m{b}$ \\
{\tt UMFPACK\_Lat} & (8) & $\m{L}\tr\m{x}=\m{b}$ \\
+& & \\
\hline
+& & \\
{\tt UMFPACK\_U\_Qt} & (9) & $\m{UQ}\tr\m{x}=\m{b}$ \\
{\tt UMFPACK\_U} & (10) & $\m{Ux}=\m{b}$ \\
{\tt UMFPACK\_Q\_Ut} & (11) & $\m{QU}\he\m{x}=\m{b}$ \\
{\tt UMFPACK\_Q\_Uat} & (12) & $\m{QU}\tr\m{x}=\m{b}$ \\
{\tt UMFPACK\_Ut} & (13) & $\m{U}\he\m{x}=\m{b}$ \\
{\tt UMFPACK\_Uat} & (14) & $\m{U}\tr\m{x}=\m{b}$ \\
+& & \\
\hline
\end{tabular}
}
{\footnotesize
\begin{verbatim}
int lnz, unz, Lp [m+1], Lj [lnz], Up [n+1], Ui [unz], do_recip ;
-double Lx [lnz], Ux [unz], D [min (m,n)], Rs [m] ;
+double Lx [lnz], Ux [unz], D [min (m,n)], Rs [m], Mx [1], Ex [1] ;
int nfr, nchains, P1 [m], Q1 [n], Front_npivcol [n+1], Front_parent [n+1], Front_1strow [n+1],
Front_leftmostdesc [n+1], Chain_start [n+1], Chain_maxrows [n+1], Chain_maxcols [n+1] ;
char filename [100] ;
status = umfpack_di_get_lunz (&lnz, &unz, &m, &n, &nz_udiag, Numeric) ;
-status = umfpack_di_get_numeric (Lp, Lj, Lx, Up, Ui, Ux, P, Q, D, &do_recip, Rs, Numeric) ;
+status = umfpack_di_get_numeric (Lp, Lj, Lx, Up, Ui, Ux, P, Q, D,
+ &do_recip, Rs, Numeric) ;
status = umfpack_di_get_symbolic (&m, &n, &n1, &nz, &nfr, &nchains, P1, Q1,
Front_npivcol, Front_parent, Front_1strow, Front_leftmostdesc,
Chain_start, Chain_maxrows, Chain_maxcols, Symbolic) ;
status = umfpack_di_save_numeric (Numeric, filename) ;
status = umfpack_di_load_symbolic (&Symbolic, filename) ;
status = umfpack_di_save_symbolic (Symbolic, filename) ;
+status = umfapck_di_get_determinant (Mx, Ex, Numeric, Info) ;
\end{verbatim}
}
\end{verbatim}
}
+The arrays {\tt Ax}, {\tt Bx}, and {\tt Xx} double in size if
+any imaginary argument ({\tt Az}, {\tt Xz}, or {\tt Bz}) is {\tt NULL}.
+
%-------------------------------------------------------------------------------
\subsection{Alternative routines: complex/{\tt int}}
%-------------------------------------------------------------------------------
\end{verbatim}
}
+The arrays {\tt Tx}, {\tt Rx}, {\tt Yx}, and {\tt Zx} double in size if
+any imaginary argument ({\tt Tz}, {\tt Rz}, {\tt Yz}, or {\tt Zz}) is {\tt NULL}.
+
%-------------------------------------------------------------------------------
\subsection{Getting the contents of opaque objects: complex/{\tt int}}
%-------------------------------------------------------------------------------
{\footnotesize
\begin{verbatim}
-double Lz [lnz], Uz [unz], Dx [min (m,n)], Dz [min (m,n)] ;
+double Lz [lnz], Uz [unz], Dx [min (m,n)], Dz [min (m,n)], Mz [1] ;
status = umfpack_zi_get_lunz (&lnz, &unz, &m, &n, &nz_udiag, Numeric) ;
status = umfpack_zi_get_numeric (Lp, Lj, Lx, Lz, Up, Ui, Ux, Uz, P, Q, Dx, Dz,
status = umfpack_zi_save_numeric (Numeric, filename) ;
status = umfpack_zi_load_symbolic (&Symbolic, filename) ;
status = umfpack_zi_save_symbolic (Symbolic, filename) ;
+status = umfapck_zi_get_determinant (Mx, Mz, Ex, Numeric, Info) ;
\end{verbatim}
}
+The arrays {\tt Lx}, {\tt Ux}, {\tt Dx}, and {\tt Mx} double in size if
+any imaginary argument ({\tt Lz}, {\tt Uz}, {\tt Dz}, or {\tt Mz}) is {\tt NULL}.
+
%-------------------------------------------------------------------------------
\subsection{Reporting routines: complex/{\tt int}}
%-------------------------------------------------------------------------------
\end{verbatim}
}
+The arrays {\tt Ax}, {\tt Rx}, {\tt Tx}, and {\tt Xx} double in size if
+any imaginary argument ({\tt Az}, {\tt Rz}, {\tt Tz}, or {\tt Xz}) is {\tt NULL}.
%-------------------------------------------------------------------------------
-\section{Synopsis of utility routines}
+\subsection{Utility routines}
%-------------------------------------------------------------------------------
These routines are the same in all four versions of UMFPACK.
}
%-------------------------------------------------------------------------------
-\section{Synopsis of AMD ordering routines}
+\subsection{AMD ordering routines}
%-------------------------------------------------------------------------------
UMFPACK makes use of the AMD ordering package for its symmetric ordering
\section{Using UMFPACK in a Fortran program}
%-------------------------------------------------------------------------------
-UMFPACK v4.3 includes a basic Fortran 77 interface to some of the C-callable
+UMFPACK includes a basic Fortran 77 interface to some of the C-callable
UMFPACK routines.
Since interfacing C and Fortran programs is not portable, this interface might
not work with all C and Fortran compilers. Refer to Section~\ref{Install} for
\end{verbatim}
}
+The Fortran interface does not support the packed complex case.
+
%-------------------------------------------------------------------------------
-\section{Installing the C library}
+\section{Installation}
\label{Install}
%-------------------------------------------------------------------------------
+%-------------------------------------------------------------------------------
+\subsection{Installing the C library}
+%-------------------------------------------------------------------------------
+
The following discussion assumes you have the {\tt make} program, either in
Unix, or in Windows with Cygwin\footnote{www.cygwin.com}.
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.3 and AMD v1.1 (or AMD v1.0) to use UMFPACK.
+You will need to install both UMFPACK v4.4 and AMD v1.1 (or AMD v1.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
program to read in the Fortran-formatted Harwell/Boeing matrices and
write them to a file which can be read by a C program.
+The {\tt umf\_multicompile.c} file has been added to assist in the
+compilation of UMFPACK in Microsoft Visual Studio, for Windows.
+
%-------------------------------------------------------------------------------
-\section{Installing the MATLAB interface}
+\subsection{Installing the MATLAB interface}
%-------------------------------------------------------------------------------
If all you want to do is use the UMFPACK mexFunction in MATLAB, you can skip
You can also type {\tt amd\_make} in the {\tt AMD/MATLAB} directory
to compile the stand-alone AMD mexFunction (this is not required to
compile the UMFPACK mexFunction). This works on any computer with MATLAB,
-including Windows. This method of creating the UMFPACK mexFunction
-has been tested with MATLAB 5.3, 6.1, and 6.5.
+including Windows.
You will be prompted to select several configuration options, including
whether or not to use the BLAS.
If you have MATLAB 6.5 or later, you can probably skip this step.
%-------------------------------------------------------------------------------
-\section{Installing the Fortran interface}
+\subsection{Installing the Fortran interface}
%-------------------------------------------------------------------------------
Once the 32-bit C-callable UMFPACK library is compiled, you can also compile
has not been tested.
%-------------------------------------------------------------------------------
-\section{Known Issues}
+\subsection{Known Issues}
%-------------------------------------------------------------------------------
The Microsoft C or C++ compilers on a Pentium badly break the IEEE 754 standard,
\label{Future}
%-------------------------------------------------------------------------------
-Here are a few features that are not in UMFPACK Version 4.3, in no particular
+Here are a few features that are not in UMFPACK Version 4.4, 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:
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.
+ 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
The method used in UMFPACK exploits super-columns, however, so this
bound is rarely reached.
-\item The complex versions could use ANSI C99 {\tt double \_Complex} arguments,
- and support the use of interleaved real/imaginary parts as input and output
- arguments. The \newline
- {\tt umfpack\_*\_report\_vector} routine is one example.
-
\item Other basic sparse matrix operations, such as sparse matrix
multiplication, could be included.
\end{verbatim}
}
+\newpage
+\subsection{umfpack\_*\_get\_determinant}
+
+{\footnotesize
+\begin{verbatim}
+INCLUDE umfpack_get_determinant.h via sed
+\end{verbatim}
+}
+
%-------------------------------------------------------------------------------
\newpage
\section{Reporting routines}
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* size of Info and Control arrays */
/* -------------------------------------------------------------------------- */
-#define UMFPACK_INFO 90 /* these might be larger in future versions */
+/* These might be larger in future versions, since there are only 3 unused
+ * entries in Info, and no unused entries in Control. */
+
+#define UMFPACK_INFO 90
#define UMFPACK_CONTROL 20
/* -------------------------------------------------------------------------- */
#include "umfpack_load_numeric.h"
#include "umfpack_save_symbolic.h"
#include "umfpack_load_symbolic.h"
+#include "umfpack_get_determinant.h"
/* Reporting routines (the above 14 routines print nothing): */
#include "umfpack_report_status.h"
/* Version, copyright, and license */
/* -------------------------------------------------------------------------- */
-#define UMFPACK_VERSION "UMFPACK V4.3 (Jan. 16, 2004)"
+#define UMFPACK_VERSION "UMFPACK V4.4 (Jan. 28, 2005)"
#define UMFPACK_COPYRIGHT \
-"UMFPACK: Copyright (c) 2004 by Timothy A. Davis. All Rights Reserved.\n"
+"UMFPACK: Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved.\n"
#define UMFPACK_LICENSE_PART1 \
"\nUMFPACK License:\n" \
/* contents of Info */
/* -------------------------------------------------------------------------- */
-/* Note that umfpack_report.m must coincide with these definitions. */
+/* Note that umfpack_report.m must coincide with these definitions. S is
+ * the submatrix of A after removing row/col singletons and empty rows/cols. */
/* returned by all routines that use Info: */
#define UMFPACK_STATUS 0 /* UMFPACK_OK, or other result */
#define UMFPACK_2BY2_NZDIAG 55 /* nz on diagonal of PS+(PS)' */
/* statistcs for singleton pruning */
-#define UMFPACK_COL_SINGLETONS 56
-#define UMFPACK_ROW_SINGLETONS 57
-#define UMFPACK_N2 58
-#define UMFPACK_S_SYMMETRIC 59
+#define UMFPACK_COL_SINGLETONS 56 /* # of column singletons */
+#define UMFPACK_ROW_SINGLETONS 57 /* # of row singletons */
+#define UMFPACK_N2 58 /* size of S */
+#define UMFPACK_S_SYMMETRIC 59 /* 1 if S square and symmetricly perm.*/
/* estimates computed in UMFPACK_*symbolic: */
#define UMFPACK_NUMERIC_SIZE_ESTIMATE 20 /* final size of Numeric->Memory */
#define UMFPACK_COMPILED_WITH_GETRUSAGE 10 /* uses getrusage timer, or not */
#define UMFPACK_COMPILED_IN_DEBUG_MODE 11 /* debugging enabled (very slow!) */
-#if 0
-/* No longer unused. These parameters are now used for the new symmetric and
- * 2-by-2 ordering strategies. See 5, 12, 13, and 14, above. */
-#define UMFPACK_RELAXED_AMALGAMATION 5 /* unused (was in v4.0) */
-#define UMFPACK_PIVOT_OPTION 12 /* unused (was in v3.2) */
-#define UMFPACK_RELAXED2_AMALGAMATION 13 /* unused (was in v4.0) */
-#define UMFPACK_RELAXED3_AMALGAMATION 14 /* unused (was in v4.0) */
-#endif
-
/* -------------------------------------------------------------------------- */
/* Control [UMFPACK_STRATEGY] is one of the following: */
/* default values of Control: */
/* -------------------------------------------------------------------------- */
-/* Note that the default block sized changed for Version 3.1 and following.
- * In Version 4.1, the relaxed amalgamation parameters were removed. These are
- * now fixed internally (see umf_local_search.c), and cannot be changed.
- * COLAMD aggressive absorption did not exist in v4.0. In v4.1, it is in
- * use by default (but can be turned off). Aggressive absorption is used by
- * default in AMD, also.
- *
- * Drop tolerance was added in V4.2.
- */
-
#define UMFPACK_DEFAULT_PRL 1
#define UMFPACK_DEFAULT_DENSE_ROW 0.2
#define UMFPACK_DEFAULT_DENSE_COL 0.2
#define UMFPACK_DEFAULT_AGGRESSIVE 1
#define UMFPACK_DEFAULT_DROPTOL 0
-#if 0
-/* no longer unused: for unsymmetric strategy (were used in v4.0) */
-#define UMFPACK_DEFAULT_RELAXED_AMALGAMATION 0.25 /* unused */
-#define UMFPACK_DEFAULT_RELAXED2_AMALGAMATION 0.1 /* unused */
-#define UMFPACK_DEFAULT_RELAXED3_AMALGAMATION 0.125 /* unused */
-#endif
-
/* default values of Control may change in future versions of UMFPACK. */
/* -------------------------------------------------------------------------- */
/* A Symbolic or Numeric object was still created. */
#define UMFPACK_WARNING_singular_matrix (1)
+/* The following warnings were added in umfpack_*_get_determinant */
+#define UMFPACK_WARNING_determinant_underflow (2)
+#define UMFPACK_WARNING_determinant_overflow (3)
+
/* status < 0 means an error, and the method was not successful. */
/* No Symbolic of Numeric object was created. */
#define UMFPACK_ERROR_out_of_memory (-1)
#define UMFPACK_ERROR_invalid_Symbolic_object (-4)
#define UMFPACK_ERROR_argument_missing (-5)
#define UMFPACK_ERROR_n_nonpositive (-6)
-#define UMFPACK_ERROR_invalid_matrix (-8) /* replaces errors -[7:10,12,14] */
+#define UMFPACK_ERROR_invalid_matrix (-8)
#define UMFPACK_ERROR_different_pattern (-11)
#define UMFPACK_ERROR_invalid_system (-13)
#define UMFPACK_ERROR_invalid_permutation (-15)
-#define UMFPACK_ERROR_internal_error (-911)
+#define UMFPACK_ERROR_internal_error (-911) /* yes, call me if you get this! */
#define UMFPACK_ERROR_file_IO (-17)
-/* The following error codes are no longer used. They are left in for
- * historical reasons. They appeared in Version 4.0. Most of them are combined
- * into the single UMFPACK_ERROR_invalid_matrix error code (-8). The last one,
- * UMFPACK_ERROR_problem_too_large, has been removed. This error can no longer
- * occur. */
-#define UMFPACK_ERROR_nz_negative (-7) /* unused */
-#define UMFPACK_ERROR_jumbled_matrix (-8) /* unused */
-#define UMFPACK_ERROR_Ap0_nonzero (-9) /* unused */
-#define UMFPACK_ERROR_row_index_out_of_bounds (-10) /* unused */
-#define UMFPACK_ERROR_col_length_negative (-12) /* unused */
-#define UMFPACK_ERROR_invalid_triplet (-14) /* unused */
-#define UMFPACK_ERROR_problem_too_large (-16) /* unused */
-
/* -------------------------------------------------------------------------- */
/* solve codes */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
Sets the default control parameter settings.
- NOTE: new control parameters have been added to the Control array for
- Version 4.1. These entries were unused in Version 4.0. The default block
- size for the BLAS has increased from 24 to 32. Some rarely used control
- parameters have been removed (those that controlled relaxed amalgamation).
-
Arguments:
double Control [UMFPACK_CONTROL] ; Output argument.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
--- /dev/null
+/* ========================================================================== */
+/* === UMFPACK_get_determinant ============================================== */
+/* ========================================================================== */
+
+/* -------------------------------------------------------------------------- */
+/* UMFPACK Version 4.4, 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_get_determinant
+(
+ double *Mx,
+ double *Ex,
+ void *NumericHandle,
+ double User_Info [UMFPACK_INFO]
+) ;
+
+long umfpack_dl_get_determinant
+(
+ double *Mx,
+ double *Ex,
+ void *NumericHandle,
+ double User_Info [UMFPACK_INFO]
+) ;
+
+int umfpack_zi_get_determinant
+(
+ double *Mx,
+ double *Mz,
+ double *Ex,
+ void *NumericHandle,
+ double User_Info [UMFPACK_INFO]
+) ;
+
+long umfpack_zl_get_determinant
+(
+ double *Mx,
+ double *Mz,
+ double *Ex,
+ void *NumericHandle,
+ double User_Info [UMFPACK_INFO]
+) ;
+
+/*
+double int Syntax:
+
+ #include "umfpack.h"
+ void *Numeric ;
+ int status ;
+ double Mx, Ex, Info [UMFPACK_INFO] ;
+ status = umfpack_di_get_determinant (&Mx, &Ex, Numeric, Info) ;
+
+double long Syntax:
+
+ #include "umfpack.h"
+ void *Numeric ;
+ long status ;
+ double Mx, Ex, Info [UMFPACK_INFO] ;
+ status = umfpack_dl_get_determinant (&Mx, &Ex, Numeric, Info) ;
+
+complex int Syntax:
+
+ #include "umfpack.h"
+ void *Numeric ;
+ int status ;
+ double Mx, Mz, Ex, Info [UMFPACK_INFO] ;
+ status = umfpack_zi_get_determinant (&Mx, &Mz, &Ex, Numeric, Info) ;
+
+complex int Syntax:
+
+ #include "umfpack.h"
+ void *Numeric ;
+ long status ;
+ double *Mx, *Mz, *Ex, Info [UMFPACK_INFO] ;
+ status = umfpack_zl_get_determinant (&Mx, &Mz, &Ex, Numeric, Info) ;
+
+packed complex int Syntax:
+
+ Same as above, except Mz is NULL.
+
+Purpose:
+
+ Using the LU factors and the permutation vectors contained in the Numeric
+ object, calculate the determinant of the matrix A.
+
+ The value of the determinant can be returned in two forms, depending on
+ whether Ex is NULL or not. If Ex is NULL then the value of the determinant
+ is returned on Mx and Mz for the real and imaginary parts. However, to
+ avoid over- or underflows, the determinant can be split into a mantissa
+ and exponent, and the parts returned separately, in which case Ex is not
+ NULL. The actual determinant is then given by
+
+ double det ;
+ det = Mx * pow (10.0, Ex) ;
+
+ for the double case, or
+
+ double det [2] ;
+ det [0] = Mx * pow (10.0, Ex) ; // real part
+ det [1] = Mz * pow (10.0, Ex) ; // imaginary part
+
+ for the complex case. Information on if the determinant will or has
+ over or under-flowed is given by Info [UMFPACK_STATUS].
+
+ In the "packed complex" syntax, Mx [0] holds the real part and Mx [1]
+ holds the imaginary part. Mz is not used (it is NULL).
+
+Returns:
+
+ Returns UMFPACK_OK if sucessful. Returns UMFPACK_ERROR_out_of_memory if
+ insufficient memory is available for the n_row integer workspace that
+ umfpack_*_get_determinant allocates to construct pivots from the
+ permutation vectors. Returns UMFPACK_ERROR_invalid_Numeric_object if the
+ Numeric object provided as input is invalid. Returns
+ UMFPACK_WARNING_singular_matrix if the determinant is zero. Returns
+ UMFPACK_WARNING_determinant_underflow or
+ UMFPACK_WARNING_determinant_overflow if the determinant has underflowed
+ overflowed (for the case when Ex is NULL), or will overflow if Ex is not
+ NULL and det is computed (see above) in the user program.
+
+Arguments:
+
+ double *Mx ; Output argument (array of size 1, or size 2 if Mz is NULL)
+ double *Mz ; Output argument (optional)
+ double *Ex ; Output argument (optional)
+
+ The determinant returned in mantissa/exponent form, as discussed above.
+ If Mz is NULL, then both the original and imaginary parts will be
+ returned in Mx. If Ex is NULL then the determinant is returned directly
+ in Mx and Mz (or Mx [0] and Mx [1] if Mz is NULL), rather than in
+ mantissa/exponent form.
+
+ void *Numeric ; Input argument, not modified.
+
+ Numeric must point to a valid Numeric object, computed by
+ umfpack_*_numeric.
+
+ double Info [UMFPACK_INFO] ; Output argument.
+
+ Contains information about the calculation of the determinant. If a
+ (double *) NULL pointer is passed, then no statistics are returned in
+ Info (this is not an error condition). The following statistics are
+ computed in umfpack_*_determinant:
+
+ Info [UMFPACK_STATUS]: status code. This is also the return value,
+ whether or not Info is present.
+
+ UMFPACK_OK
+
+ The determinant was successfully found.
+
+ UMFPACK_ERROR_out_of_memory
+
+ Insufficient memory to solve the linear system.
+
+ UMFPACK_ERROR_argument_missing
+
+ Mx is missing (NULL).
+
+ UMFPACK_ERROR_invalid_Numeric_object
+
+ The Numeric object is not valid.
+
+ UMFPACK_ERROR_invalid_system
+
+ The matrix is rectangular. Only square systems can be
+ handled.
+
+ UMFPACK_WARNING_singluar_matrix
+
+ The determinant is zero or NaN. The matrix is singular.
+
+ UMFPACK_WARNING_determinant_underflow
+
+ When passing from mantissa/exponent form to the determinant
+ an underflow has or will occur. If the mantissa/exponent from
+ of obtaining the determinant is used, the underflow will occur
+ in the user program. If the single argument method of
+ obtaining the determinant is used, the underflow has already
+ occurred.
+
+ UMFPACK_WARNING_determinant_overflow
+
+ When passing from mantissa/exponent form to the determinant
+ an overflow has or will occur. If the mantissa/exponent from
+ of obtaining the determinant is used, the overflow will occur
+ in the user program. If the single argument method of
+ obtaining the determinant is used, the overflow has already
+ occurred.
+
+*/
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
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:
+
+ Same as above, except Lz, Uz, and Dz are all NULL.
+
Purpose:
This routine copies the LU factors and permutation vectors from the Numeric
object into user-accessible arrays. This routine is not needed to solve a
linear system. Note that the output arrays Lp, Lj, Lx, Up, Ui, Ux, P, Q,
Dx, and Rs are not allocated by umfpack_*_get_numeric; they must exist on
- input. Similarly, Lz, Uz and Dz must exist on input for the complex
- versions.
+ input.
All output arguments are optional. If any of them are NULL
on input, then that part of the LU factorization is not copied. You can
Int Lp [n_row+1] ; Output argument.
Int Lj [lnz] ; Output argument.
- double Lx [lnz] ; Output argument.
+ double Lx [lnz] ; Output argument. Size 2*lnz for packed complex case.
double Lz [lnz] ; Output argument for complex versions.
The n_row-by-min(n_row,n_col) matrix L is returned in compressed-row
respectively. Each row is stored in sorted order, from low column
indices to higher. The last entry in each row is the diagonal, which
is numerically equal to one. The sizes of Lp, Lj, Lx, and Lz are
- returned by umfpack_*_get_lunz. If Lp, Lj, or Ux (or Uz for the
- complex version) are not present, then the matrix L is not returned.
- This is not an error condition. The L matrix can be printed if n_row,
- Lp, Lj, Lx (and Lz for the complex versions) are passed to
- umfpack_*_report_matrix (using the "row" form).
-
- Future complex version: if Lx is present and Lz is NULL, then both real
- and imaginary parts will be returned in Lx[0..2*lnz-1], with Lx[2*k]
+ returned by umfpack_*_get_lunz. If Lp, Lj, or Lx are not present,
+ then the matrix L is not returned. This is not an error condition.
+ The L matrix can be printed if n_row, Lp, Lj, Lx (and Lz for the split
+ complex case) are passed to umfpack_*_report_matrix (using the
+ "row" form).
+
+ If Lx is present and Lz is NULL, then both real
+ and imaginary parts are returned in Lx[0..2*lnz-1], with Lx[2*k]
and Lx[2*k+1] being the real and imaginary part of the kth entry.
Int Up [n_col+1] ; Output argument.
Int Ui [unz] ; Output argument.
- double Ux [unz] ; Output argument.
+ double Ux [unz] ; Output argument. Size 2*unz for packed complex case.
double Uz [unz] ; Output argument for complex versions.
The min(n_row,n_col)-by-n_col matrix U is returned in compressed-column
respectively. Each column is stored in sorted order, from low row
indices to higher. The last entry in each column is the diagonal
(assuming that it is nonzero). The sizes of Up, Ui, Ux, and Uz are
- returned by umfpack_*_get_lunz. If Up, Ui, or Ux (or Uz for the complex
- version) are not present, then the matrix U is not returned. This is
- not an error condition. The U matrix can be printed if n_col, Up, Ui,
- Ux (and Uz for the complex versions) are passed to
- umfpack_*_report_matrix (using the "column" form).
-
- Future complex version: if Ux is present and Uz is NULL, then both real
- and imaginary parts will be returned in Ux[0..2*unz-1], with Ux[2*k]
+ returned by umfpack_*_get_lunz. If Up, Ui, or Ux are not present,
+ then the matrix U is not returned. This is not an error condition.
+ The U matrix can be printed if n_col, Up, Ui, Ux (and Uz for the
+ split complex case) are passed to umfpack_*_report_matrix (using the
+ "column" form).
+
+ If Ux is present and Uz is NULL, then both real
+ and imaginary parts are returned in Ux[0..2*unz-1], with Ux[2*k]
and Ux[2*k+1] being the real and imaginary part of the kth entry.
Int P [n_row] ; Output argument.
the description of Qtree and Front_npivcol in umfpack_*_get_symbolic for
details.
- double Dx [min(n_row,n_col)] ; Output argument.
+ double Dx [min(n_row,n_col)] ; Output argument. Size 2*n for
+ the packed complex case.
double Dz [min(n_row,n_col)] ; Output argument for complex versions.
The diagonal of U is also returned in Dx and Dz. You can extract the
Dz for the complex version) and passing Up, Ui, and Ux as NULL. Dx is
the real part of the diagonal, and Dz is the imaginary part.
- Future complex version: if Dx is present and Dz is NULL, then both real
- and imaginary parts will be returned in Dx[0..2*min(n_row,n_col)-1],
+ If Dx is present and Dz is NULL, then both real
+ and imaginary parts are returned in Dx[0..2*min(n_row,n_col)-1],
with Dx[2*k] and Dx[2*k+1] being the real and imaginary part of the kth
entry.
built-in routine or as a mexFunction, then the NRECIPROCAL flag is
set, and do_recip will always be zero (false).
- NOTE: this argument is new to version 4.1.
-
double Rs [n_row] ; Output argument.
The row scale factors are returned in Rs [0..n_row-1]. Row i of A is
the complex version, an approximate absolute value is used
(|x_real|+|x_imag|).
- NOTE: this argument is new to version 4.1.
-
void *Numeric ; Input argument, not modified.
Numeric must point to a valid Numeric object, computed by
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
in the pivot row, or the pivot column, or both). These appear first in
the output permutations P and Q.
- NOTE: this argument is new to version 4.1.
-
Int *nz ; Output argument.
The number of nonzeros in A.
Front_1strow [k] is the row index of the first row in A (P,Q)
whose leftmost entry is in a pivot column for the kth front. This is
- necessary only to properly factorize singular matrices. It is new to
- Version 4.0. Rows in the range Front_1strow [k] to
- Front_1strow [k+1]-1 first become pivot row candidates at the kth front.
- Any rows not eliminated in the kth front may be selected as pivot rows
- in the parent of k (Front_parent [k]) and so on up the tree.
+ necessary only to properly factorize singular matrices. Rows in the
+ range Front_1strow [k] to Front_1strow [k+1]-1 first become pivot row
+ candidates at the kth front. Any rows not eliminated in the kth front
+ may be selected as pivot rows in the parent of k (Front_parent [k])
+ and so on up the tree.
Int Front_leftmostdesc [n_col+1] ; Output argument.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
void *Symbolic, *Numeric ;
long *Ap, *Ai, status ;
double *Ax, *Az, Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;
- status = umfpack_zl_numeric (Ap, Ai, Ax, Symbolic, &Numeric,
+ status = umfpack_zl_numeric (Ap, Ai, Ax, Az, Symbolic, &Numeric,
Control, Info) ;
+packed complex Syntax:
+
+ Same as above, except that Az is NULL.
+
Purpose:
Given a sparse matrix A in column-oriented form, and a symbolic analysis
This must be identical to the Ai array passed to umfpack_*_*symbolic.
double Ax [nz] ; Input argument, not modified, of size nz = Ap [n_col].
+ Size 2*nz for packed complex case.
The numerical values of the sparse matrix A. The nonzero pattern (row
indices) for column j is stored in Ai [(Ap [j]) ... (Ap [j+1]-1)], and
For the complex versions, this holds the imaginary part of A. The
imaginary part of column j is held in Az [(Ap [j]) ... (Ap [j+1]-1)].
- Future complex version: if Ax is present and Az is NULL, then both real
- and imaginary parts will be contained in Ax[0..2*nz-1], with Ax[2*k]
+ If Az is NULL, then both real
+ and 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.
void *Symbolic ; Input argument, not modified.
greater than or equal to Control [UMFPACK_PIVOT_TOLERANCE] times
the largest absolute value in the column. A value of 1.0 gives true
partial pivoting. If less than or equal to zero, then any nonzero
- entry is numerically acceptable as a pivot (this is changed from
- Version 4.0). Default: 0.1.
+ entry is numerically acceptable as a pivot. Default: 0.1.
Smaller values tend to lead to sparser LU factors, but the solution
to the linear system can become inaccurate. Larger values can lead
instead of the more expensive-to-compute exact absolute value
sqrt (a_real^2 + a_imag^2)).
- Control [UMFPACK_SYM_PIVOT_TOLERANCE]: This parameter is new to V4.1.
+ Control [UMFPACK_SYM_PIVOT_TOLERANCE]:
If diagonal pivoting is attempted (the symmetric or symmetric-2by2
strategies are used) then this parameter is used to control when the
diagonal entry is selected in a given pivot column. The absolute
In both cases, the symmetry of the Schur complement is preserved.
- Control [UMFPACK_SCALE]: This parameter is new to V4.1. Version 4.0
- did not scale the matrix. Note that the user's input matrix is
+ Control [UMFPACK_SCALE]: Note that the user's input matrix is
never modified, only an internal copy is scaled.
There are three valid settings for this parameter. If any other
Default: UMFPACK_SCALE_SUM.
- Control [UMFPACK_ALLOC_INIT]: This parameter has changed in V4.1.
+ Control [UMFPACK_ALLOC_INIT]:
When umfpack_*_numeric starts, it allocates memory for the Numeric
object. Part of this is of fixed size (approximately n double's +
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 (version 4.0) in MATLAB 6.5 uses utMalloc instead, which
+ 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
count. It has a small impact on run-time (the extra time required
to do the garbage collection and memory reallocation).
- Control [UMFPACK_FRONT_ALLOC_INIT]: This parameter is new to V4.1.
+ Control [UMFPACK_FRONT_ALLOC_INIT]:
When UMFPACK starts the factorization of each "chain" of frontal
matrices, it allocates a working array to hold the frontal matrices
Default: 0.5.
- Control [UMFPACK_DROPTOL]: This parameter is new to V4.2.
+ Control [UMFPACK_DROPTOL]:
Entries in L and U with absolute value less than or equal to the
drop tolerance are removed from the data structures (unless leaving
Info [UMFPACK_MAX_FRONT_SIZE]: the size of the
largest frontal matrix (number of entries).
- ------------------------------------------------------------------------
- The following statistics were added to Version 4.1:
- ------------------------------------------------------------------------
-
Info [UMFPACK_NUMERIC_WALLTIME]: The wallclock time taken, in seconds.
Info [UMFPACK_MAX_FRONT_NROWS]: the max number of
Info [UMFPACK_NOFF_DIAG]: number of off-diagonal pivots selected, if the
symmetric or 2-by-2 strategies are used.
- ------------------------------------------------------------------------
- The following statistics were added to Version 4.2:
- ------------------------------------------------------------------------
-
Info [UMFPACK_NZDROPPED]: the number of entries smaller in absolute
value than Control [UMFPACK_DROPTOL] that were dropped from L and U.
Note that entries on the diagonal of U are never dropped.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_qsymbolic (n_row, n_col, Ap, Ai, Ax, Az, Qinit,
&Symbolic, Control, Info) ;
+packed complex Syntax:
+
+ Same as above, except Az is NULL.
+
Purpose:
Given the nonzero pattern of a sparse matrix A in column-oriented form, and
column of the matrix A (:,Qinit) to be factorized. If Qinit is an
(Int *) NULL pointer, then COLAMD or AMD are called instead.
+ double Control [UMFPACK_CONTROL] ; Input argument, not modified.
+
+ If Qinit is not NULL, then only two strategies are recognized:
+ the unsymmetric strategy and the symmetric strategy.
+ If Control [UMFPACK_STRATEGY] is UMFPACK_STRATEGY_SYMMETRIC,
+ then the symmetric strategy is used. Otherwise the unsymmetric
+ strategy is used.
*/
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_report_matrix (n_row, n_col, Ap, Ai, Ax, Az, 0,
Control) ;
+packed complex Syntax:
+
+ Same as above, except Az is NULL.
+
Purpose:
Verifies and prints a row or column-oriented sparse matrix.
to n_col-1 (the matrix is 0-based).
double Ax [nz] ; Input argument, not modified, of size nz = Ap [n].
+ Size 2*nz for packed complex case.
The numerical values of the sparse matrix A.
for column j is stored in Ai [(Ap [j]) ... (Ap [j+1]-1)], and the
corresponding (real) numerical values are stored in
Ax [(Ap [j]) ... (Ap [j+1]-1)]. The imaginary parts are stored in
- Az [(Ap [j]) ... (Ap [j+1]-1)], for the complex versions.
+ Az [(Ap [j]) ... (Ap [j+1]-1)], for the complex versions
+ (see below if Az is NULL).
Otherwise, the nonzero pattern (column indices) for row j
is stored in Ai [(Ap [j]) ... (Ap [j+1]-1)], and the corresponding
(real) numerical values are stored in Ax [(Ap [j]) ... (Ap [j+1]-1)].
The imaginary parts are stored in Az [(Ap [j]) ... (Ap [j+1]-1)],
- for the complex versions.
+ for the complex versions (see below if Az is NULL).
- No numerical values are printed if Ax or Az are (double *) NULL.
+ No numerical values are printed if Ax is NULL.
double Az [nz] ; Input argument, not modified, for complex versions.
The imaginary values of the sparse matrix A. See the description
- of Ax, above. No numerical values are printed if Az is NULL.
+ of Ax, above.
- Future complex version: if Ax is present and Az is NULL, then both real
- and imaginary parts will be contained in Ax[0..2*nz-1], with Ax[2*k]
+ If Az is NULL, then both real
+ and 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.
Int col_form ; Input argument, not modified.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
0 or less: no output, even when an error occurs
1: error messages only
- 2 or more: print status, whether or not an error occured
+ 2 or more: print status, whether or not an error occurred
4 or more: also print the UMFPACK Copyright
6 or more: also print the UMFPACK License
Default: 1
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_report_triplet (n_row, n_col, nz, Ti, Tj, Tx, Tz,
Control) ;
+packed complex Syntax:
+
+ Same as above, except Tz is NULL.
+
Purpose:
Verifies and prints a matrix in triplet form.
Int Ti [nz] ; Input argument, not modified.
Int Tj [nz] ; Input argument, not modified.
double Tx [nz] ; Input argument, not modified.
+ Size 2*nz for packed complex case.
double Tz [nz] ; Input argument, not modified, for complex versions.
Ti, Tj, Tx (and Tz for complex versions) hold the "triplet" form of a
imaginary part of a_ij is Tz [k] (for complex versions). The row and
column indices i and j must be in the range 0 to n_row-1 or 0 to
n_col-1, respectively. Duplicate entries may be present. The
- "triplets" may be in any order. Tx and Tz are optional; if Tx or Tz are
- not present ((double *) NULL pointers), then the numerical values are
+ "triplets" may be in any order. Tx and Tz are optional; if Tx is
+ not present ((double *) NULL), then the numerical values are
not printed.
- Future complex version: if Tx is present and Tz is NULL, then both real
- and imaginary parts will be contained in Tx[0..2*nz-1], with Tx[2*k]
+ If Tx is present and Tz is NULL, then both real
+ and imaginary parts are contained in Tx[0..2*nz-1], with Tx[2*k]
and Tx[2*k+1] being the real and imaginary part of the kth entry.
double Control [UMFPACK_CONTROL] ; Input argument, not modified.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
UMFPACK_OK if Control [UMFPACK_PRL] <= 2 (the input is not checked).
Otherwise:
-
+
UMFPACK_OK if the vector is valid.
UMFPACK_ERROR_argument_missing if X or Xx is missing.
UMFPACK_ERROR_n_nonpositive if n <= 0.
when passed to umfpack_*_report_vector (this is untested, however).
This is the "merged" form of the complex vector X.
- Future work: all complex routines in UMFPACK could use this same
+ Note that all complex routines in UMFPACK V4.4 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 merged format is compatible with the intrinsic double _Complex
+ The packed format is compatible with the intrinsic double _Complex
type in ANSI C99, and is also compatible with SuperLU's method of
- storing complex matrices. In the current version, only
- umfpack_*_report_vector supports both formats.
+ storing complex matrices. In Version 4.3, this routine was the only
+ one that allowed for packed complex arguments.
double Control [UMFPACK_CONTROL] ; Input argument, not modified.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
Purpose:
Saves a Numeric object to a file, which can later be read by
- umfpack_*_load_numeric. The Numeric object is not modified. You need
- to call umfpack_*_free_numeric if you to delete the Numeric object after
- saving it to a file.
+ umfpack_*_load_numeric. The Numeric object is not modified.
Returns:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
Purpose:
Saves a Symbolic object to a file, which can later be read by
- umfpack_*_load_symbolic. The Symbolic object is not modified. You need
- to call umfpack_*_free_symbolic if you to delete the Symbolic object after
- saving it to a file.
+ umfpack_*_load_symbolic. The Symbolic object is not modified.
Returns:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
double *Bx, *Bz, *Xx, *Xz ;
status = umfpack_zl_scale (Xx, Xz, Bx, Bz, Numeric) ;
+packed complex Syntax:
+
+ Same as above, except both Xz and Bz are NULL.
+
Purpose:
Given LU factors computed by umfpack_*_numeric (PAQ=LU, PRAQ=LU, or
UMFPACK_ERROR_invalid_Numeric_object is returned in the Numeric
object is invalid. UMFPACK_ERROR_argument_missing is returned if
any of the input vectors are missing (X and B for the real version,
- and Xx, Xz, Bx, and Bz for the complex version).
+ and Xx and Bx for the complex version).
Arguments:
double X [n_row] ; Output argument.
or:
double Xx [n_row] ; Output argument, real part.
+ Size 2*n_row for packed complex case.
double Xz [n_row] ; Output argument, imaginary part.
- The output vector X.
+ The output vector X. If either Xz or Bz are NULL, the vector
+ X is in packed complex form, with the kth entry in Xx [2*k] and
+ Xx [2*k+1], and likewise for B.
double B [n_row] ; Input argument, not modified.
or:
double Bx [n_row] ; Input argument, not modified, real part.
+ Size 2*n_row for packed complex case.
double Bz [n_row] ; Input argument, not modified, imaginary part.
- The input vector B.
+ The input vector B. See above if either Xz or Bz are NULL.
void *Numeric ; Input argument, not modified.
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
Control, Info) ;
+packed complex Syntax:
+
+ Same as above, Xz, Bz, and Az are NULL.
+
Purpose:
Given LU factors computed by umfpack_*_numeric (PAQ=LU, PRAQ=LU, or
For the other values of the sys argument, iterative refinement is not
performed (Control [UMFPACK_IRSTEP], Ap, Ai, Ax, and Az are ignored).
- Earlier versions used a string argument for sys. It was changed to an
- integer to make it easier for a Fortran code to call UMFPACK.
-
Int Ap [n+1] ; Input argument, not modified.
Int Ai [nz] ; Input argument, not modified.
double Ax [nz] ; Input argument, not modified.
+ Size 2*nz for packed complex case.
double Az [nz] ; Input argument, not modified, for complex versions.
If iterative refinement is requested (Control [UMFPACK_IRSTEP] >= 1,
system other than Ax=b, A'x=b, or A.'x=b is being solved, or if A is
singular, since in each of these cases A is not accessed.
- Future complex version: if Ax is present and Az is NULL, then both real
- and imaginary parts will be contained in Ax[0..2*nz-1], with Ax[2*k]
+ If Az, Xz, or Bz are NULL, then both real
+ and 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.
double X [n] ; Output argument.
or:
- double Xx [n] ; Output argument, real part.
+ double Xx [n] ; Output argument, real part
+ Size 2*n for packed complex case.
double Xz [n] ; Output argument, imaginary part.
The solution to the linear system, where n = n_row = n_col is the
dimension of the matrices A, L, and U.
- Future complex version: if Xx is present and Xz is NULL, then both real
- and imaginary parts will be returned in Xx[0..2*n-1], with Xx[2*k] and
+ If Az, Xz, or Bz are NULL, then both real
+ and imaginary parts are returned in Xx[0..2*n-1], with Xx[2*k] and
Xx[2*k+1] being the real and imaginary part of the kth entry.
double B [n] ; Input argument, not modified.
or:
double Bx [n] ; Input argument, not modified, real part.
+ Size 2*n for packed complex case.
double Bz [n] ; Input argument, not modified, imaginary part.
The right-hand side vector, b, stored as a conventional array of size n
solve for multiple right-hand-sides, nor does it allow b to be stored in
a sparse-column form.
- Future complex version: if Bx is present and Bz is NULL, then both real
- and imaginary parts will be contained in Bx[0..2*n-1], with Bx[2*k]
+ If Az, Xz, or Bz are NULL, then both real
+ and imaginary parts are contained in Bx[0..2*n-1], with Bx[2*k]
and Bx[2*k+1] being the real and imaginary part of the kth entry.
void *Numeric ; Input argument, not modified.
UMFPACK_WARNING_singular_matrix
- A divide-by-zero occured. Your solution will contain Inf's
+ A divide-by-zero occurred. Your solution will contain Inf's
and/or NaN's. Some parts of the solution may be valid. For
example, solving Ax=b with
UMFPACK_ERROR_argument_missing
One or more required arguments are missing. The B, X, (or
- Bx, Bz, Xx and Xz for the complex versions) arguments
+ Bx and Xx for the complex versions) arguments
are always required. Info and Control are not required. Ap,
- Ai, Ax (and Az for complex versions) are required if Ax=b,
+ Ai, Ax are required if Ax=b,
A'x=b, A.'x=b is to be solved, the (default) iterative
refinement is requested, and the matrix A is nonsingular.
Info [UMFPACK_SOLVE_TIME]: The time taken, in seconds.
- ------------------------------------------------------------------------
- The following statistic was added to Version 4.1:
- ------------------------------------------------------------------------
-
Info [UMFPACK_SOLVE_WALLTIME]: The wallclock time taken, in seconds.
Only the above listed Info [...] entries are accessed. The remaining
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
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,
to 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 (row
indices) for column j is stored in Ai [(Ap [j]) ... (Ap [j+1]-1)], and
For the complex versions, this holds the imaginary part of A. The
imaginary part of column j is held in Az [(Ap [j]) ... (Ap [j+1]-1)].
- Future complex version: if Ax is present and Az is NULL, then both real
- and imaginary parts will be contained in Ax[0..2*nz-1], with Ax[2*k]
+ If Az is NULL, then both real
+ and 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.
Control [UMFPACK_STRATEGY]: This is the most important control
parameter. It determines what kind of ordering and pivoting
- strategy that UMFPACK should use. It is new to Version 4.1
- There are 4 options:
+ strategy that UMFPACK should use. There are 4 options:
UMFPACK_STRATEGY_AUTO: This is the default. The input matrix is
analyzed to determine how symmetric the nonzero pattern is, and
is used to order the columns of A, followed by a postorder of
the column elimination tree. No attempt is made to perform
diagonal pivoting. The column ordering is refined during
- factorization. This strategy was the only one provided with
- UMFPACK V4.0.
+ factorization.
In the numerical factorization, the
Control [UMFPACK_SYM_PIVOT_TOLERANCE] parameter is ignored. A
Control [UMFPACK_PIVOT_TOLERANCE] (default 0.1) times the
largest entry in its column.
- UMFPACK_STRATEGY_SYMMETRIC: Use the symmetric strategy (new to
- Version 4.1). In this method, the approximate minimum degree
+ UMFPACK_STRATEGY_SYMMETRIC: Use the symmetric strategy
+ In this method, the approximate minimum degree
ordering (AMD) is applied to A+A', followed by a postorder of
the elimination tree of A+A'. UMFPACK attempts to perform
diagonal pivoting during numerical factorization. No refinement
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
- has a modest effect on performance.
+ has a modest effect on performance.
Control [UMFPACK_2BY2_TOLERANCE]: a diagonal entry S (k,k) is
considered "small" if it is < tol * max (abs (S (:,k))), where S a
submatrix of the scaled input matrix, with pivots of zero Markowitz
cost removed.
- Control [UMFPACK_SCALE]: This parameter is new to V4.1. See
- umfpack_numeric.h for a description. Only affects the 2-by-2
- strategy. Default: UMFPACK_SCALE_SUM.
+ 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 modified
during numeric factorization. If < 0, then Q may be modified. If
Something very serious went wrong. This is a bug.
Please contact the author (davis@cise.ufl.edu).
- Note that the UMFPACK_ERROR_problem_too_large error code is no
- longer returned (it was in Version 4.0).
-
Info [UMFPACK_NROW]: the value of the input argument n_row.
Info [UMFPACK_NCOL]: the value of the input argument n_col.
Info [UMFPACK_VARIABLE_PEAK_ESTIMATE]: the estimated peak size (in
Units) of the variable-sized part of the Numeric object. This is
- usually an upper bound, but that is not guaranteed.
+ usually an upper bound, but that is not guaranteed.
Info [UMFPACK_VARIABLE_FINAL_ESTIMATE]: the estimated final size (in
Units) of the variable-sized part of the Numeric object. This is
Info [UMFPACK_SYMBOLIC_TIME]: The CPU time taken, in seconds.
- ------------------------------------------------------------------------
- The rest of the statistics are new to Version 4.1:
- ------------------------------------------------------------------------
-
Info [UMFPACK_SYMBOLIC_WALLTIME]: The wallclock time taken, in seconds.
Info [UMFPACK_STRATEGY_USED]: The ordering strategy used:
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
Returns the CPU time used by the process. Includes both "user" and "system"
time (the latter is time spent by the system on behalf of the process, and
is thus charged to the process). It does not return the wall clock time.
- This was the timer used internally in UMFPACK V4.0. See umfpack_tic and
- umfpack_toc (the file umfpack_tictoc.h) for the timer used internally by
- UMFPACK V4.1.
+ See umfpack_tic and umfpack_toc (the file umfpack_tictoc.h) for the timer
+ used internally by UMFPACK.
This routine uses the Unix getrusage routine, if available. It is less
subject to overflow than the ANSI C clock routine. If getrusage is not
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_transpose (n_row, n_col, Ap, Ai, Ax, Az, P, Q,
Rp, Ri, Rx, Rz, do_conjugate) ;
+packed complex Syntax:
+
+ Same as above, except Az are Rz are NULL.
+
Purpose:
Transposes and optionally permutes a sparse matrix in row or column-form,
A. Factorizing A' or A.' instead of A can be much better, particularly if
AA' is much sparser than A'A. You can still solve Ax=b if you factorize
A' or A.', by solving with the sys argument UMFPACK_At or UMFPACK_Aat,
- respectively, in umfpack_*_*solve. The umfpack mexFunction (umfpackmex.c)
- is one example. To compute x = A/b, it computes x = (A.'\b.').' instead,
- by factorizing A.'. It then uses the regular solve, since b.' and x.' are
- stored identically as b and x, respectively (both b.' and b are dense
- vectors). If b and x were arrays, the umfpack mexFunction would need to
- first compute b.' and then transpose the resulting solution.
+ respectively, in umfpack_*_*solve.
Returns:
Row indices must be in the range 0 to n_row-1 (the matrix is 0-based).
double Ax [nz] ; Input argument, not modified, of size nz = Ap [n_col].
+ Size 2*nz if Az or Rz are NULL.
double Az [nz] ; Input argument, not modified, for complex versions.
If present, these are the numerical values of the sparse matrix A.
Ai [(Ap [j]) ... (Ap [j+1]-1)], and the corresponding real numerical
values are stored in Ax [(Ap [j]) ... (Ap [j+1]-1)]. The imaginary
values are stored in Az [(Ap [j]) ... (Ap [j+1]-1)]. The values are
- transposed only if Ax and Rx are present (for the real version), and
- only if all four (Ax, Az, Rx, and Rz) are present for the complex
- version. These are not an error conditions; you are able to transpose
+ transposed only if Ax and Rx are present.
+ This is not an error conditions; you are able to transpose
and permute just the pattern of a matrix.
- Future complex version: if Ax is present and Az is NULL, then both real
- and imaginary parts will be contained in Ax[0..2*nz-1], with Ax[2*k]
+ If Az or Rz are NULL, then both real
+ and 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.
Int P [n_row] ; Input argument, not modified.
same form as the row indices Ai for the matrix A.
double Rx [nz] ; Output argument.
+ Size 2*nz if Az or Rz are NULL.
double Rz [nz] ; Output argument, imaginary part for complex versions.
If present, these are the numerical values of the sparse matrix R,
in the same form as the values Ax and Az of the matrix A.
- Future complex version: if Rx is present and Rz is NULL, then both real
- and imaginary parts will be contained in Rx[0..2*nz-1], with Rx[2*k]
+ If Az or Rz are NULL, then both real
+ and imaginary parts are contained in Rx[0..2*nz-1], with Rx[2*k]
and Rx[2*k+1] being the real and imaginary part of the kth entry.
Int do_conjugate ; Input argument for complex versions only.
- If true, and if Ax, Az, Rx, and Rz are all present, then the linear
+ If true, and if Ax and Rx are present, then the linear
algebraic transpose is computed (complex conjugate). If false, the
array transpose is computed instead.
*/
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_triplet_to_col (n_row, n_col, nz, Ti, Tj, Tx, Tz,
Ap, Ai, Ax, Az, Map) ;
+packed complex Syntax:
+
+ Same as above, except Tz and Az are NULL.
+
Purpose:
Converts a sparse matrix from "triplet" form to compressed-column form.
- Analogous to A = spconvert (Ti, Tj, Tx + Tx*1i) in MATLAB, except that
+ Analogous to A = spconvert (Ti, Tj, Tx + Tz*1i) in MATLAB, except that
zero entries present in the triplet form are present in A.
The triplet form of a matrix is a very simple data structure for basic
Int Ti [nz] ; Input argument, not modified.
Int Tj [nz] ; Input argument, not modified.
double Tx [nz] ; Input argument, not modified.
+ Size 2*nz if Tz or Az are NULL.
double Tz [nz] ; Input argument, not modified, for complex versions.
Ti, Tj, Tx, and Tz hold the "triplet" form of a sparse matrix. The kth
n_row-1 and 0 to n_col-1, respectively. Duplicate entries may be
present; they are summed in the output matrix. This is not an error
condition. The "triplets" may be in any order. Tx, Tz, Ax, and Az
- are optional. For the real version, Ax is computed only if both Ax
- and Tx are present (not (double *) NULL). For the complex version, Ax
- and Az are computed only if Tx, Tz, Ax, and Az are all present. These
- are not error conditions; the routine can create just the pattern of
- the output matrix from the pattern of the triplets.
-
- Future complex version: if Tx is present and Tz is NULL, then both real
- and imaginary parts will be contained in Tx[0..2*nz-1], with Tx[2*k]
+ are optional. Ax is computed only if both Ax and Tx are present
+ (not (double *) NULL). This is not error condition; the routine can
+ create just the pattern of the output matrix from the pattern of the
+ triplets.
+
+ If Az or Tz are NULL, then both real
+ and imaginary parts are contained in Tx[0..2*nz-1], with Tx[2*k]
and Tx[2*k+1] being the real and imaginary part of the kth entry.
Int Ap [n_col+1] ; Output argument.
are in ascending order, and no duplicate row indices are present.
Row indices are in the range 0 to n_col-1 (the matrix is 0-based).
- double Ax [nz] ; Output argument.
+ double Ax [nz] ; Output argument. Size 2*nz if Tz or Az are NULL.
double Az [nz] ; Output argument for complex versions.
Ax and Az (for the complex versions) are double arrays of size nz on
in both arrays.
Ax is optional; if Tx and/or Ax are not present (a (double *) NULL
- pointer), then Ax is not computed. Az is also optional; if Tz and/or
- Az are not present, then Az is not computed. If present, Ax holds the
+ pointer), then Ax is not computed. If present, Ax holds the
numerical values of the the real part of the sparse matrix A and Az
holds the imaginary parts. The nonzero pattern (row indices) for
column j is stored in Ai [(Ap [j]) ... (Ap [j+1]-1)], and the
Ax [(Ap [j]) ... (Ap [j+1]-1)]. The imaginary parts are stored in
Az [(Ap [j]) ... (Ap [j+1]-1)], for the complex versions.
- Future complex version: if Ax is present and Az is NULL, then both real
- and imaginary parts will be returned in Ax[0..2*nz2-1], with Ax[2*k]
+ If Az or Tz are NULL, then both real
+ and imaginary parts are returned in Ax[0..2*nz2-1], with Ax[2*k]
and Ax[2*k+1] being the real and imaginary part of the kth entry.
int Map [nz] ; Optional output argument.
first one, without calling this routine. If Ti and Tj do not change,
then Ap, and Ai can be reused from the prior call to
umfpack_*_triplet_to_col. You only need to recompute Ax (and Az for the
- complex version). This code excerpt properly sums up all duplicate
- values (for the real version):
+ split complex version). This code excerpt properly sums up all
+ duplicate values (for the real version):
for (p = 0 ; p < Ap [n_col] ; p++) Ax [p] = 0 ;
for (k = 0 ; k < nz ; k++) Ax [Map [k]] += Tx [k] ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
status = umfpack_zl_wsolve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
Control, Info, Wi, W) ;
+packed complex Syntax:
+
+ Same as above, except Az, Xz, and Bz are NULL.
+
Purpose:
Given LU factors computed by umfpack_*_numeric (PAQ=LU) and the
Int Ap [n+1] ; Input argument, not modified.
Int Ai [nz] ; Input argument, not modified.
double Ax [nz] ; Input argument, not modified.
+ Size 2*nz in packed complex case.
double X [n] ; Output argument.
double B [n] ; Input argument, not modified.
void *Numeric ; Input argument, not modified.
for complex versions:
double Az [nz] ; Input argument, not modified, imaginary part
double Xx [n] ; Output argument, real part.
+ Size 2*n in packed complex case.
double Xz [n] ; Output argument, imaginary part
- double Bx [n] ; Input argument, not modified, real part
+ double Bx [n] ; Input argument, not modified, real part.
+ Size 2*n in packed complex case.
double Bz [n] ; Input argument, not modified, imaginary part
The above arguments are identical to umfpack_*_solve, except that the
% 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
+% 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)
%
% See also:
% amd symmetric minimum degree ordering
% colamd unsymmetric column approx minimum degree ordering
% symamd symmetric approx minimum degree ordering, based on colamd
%
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
help Contents
# UMFPACK GNUmakefile for the UMFPACK MATLAB mexFunction (GNU "make" only)
#-------------------------------------------------------------------------------
-# UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-# Davis. All Rights Reserved. See ../README for License.
-
all: umfpack luflop
include ../Make/Make.include
# non-user-callable and user-callable amd_*.[ch] files (int/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_order amd_control amd_info amd_valid amd_preprocess
# 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:
# user-callable umfpack_*.[ch] files (int/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_numeric umfpack_qsymbolic \
- umfpack_report_control umfpack_report_info umfpack_report_matrix \
- umfpack_report_numeric umfpack_report_perm umfpack_report_status \
- umfpack_report_symbolic umfpack_report_triplet \
+ umfpack_get_symbolic umfpack_get_determinant umfpack_numeric \
+ umfpack_qsymbolic umfpack_report_control umfpack_report_info \
+ umfpack_report_matrix umfpack_report_numeric umfpack_report_perm \
+ umfpack_report_status umfpack_report_symbolic umfpack_report_triplet \
umfpack_report_vector umfpack_solve umfpack_symbolic \
umfpack_transpose umfpack_triplet_to_col umfpack_scale \
umfpack_load_numeric umfpack_save_numeric \
# UMFPACK Makefile for the UMFPACK MATLAB mexFunction (old "make" only)
#-------------------------------------------------------------------------------
-# UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-# Davis. All Rights Reserved. See ../README for License.
-
# 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
$(MV) -f umfpack_get_lunz.o umfpack_md_get_lunz.o
$(MX) -DDINT -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
+ $(MV) -f umfpack_get_determinant.o umfpack_md_get_determinant.o
$(MX) -DDINT -c ../Source/umfpack_numeric.c
$(MV) -f umfpack_numeric.o umfpack_md_numeric.o
$(MX) -DDINT -c ../Source/umfpack_qsymbolic.c
$(MV) -f umfpack_get_lunz.o umfpack_mz_get_lunz.o
$(MX) -DZINT -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
+ $(MV) -f umfpack_get_determinant.o umfpack_mz_get_determinant.o
$(MX) -DZINT -c ../Source/umfpack_numeric.c
$(MV) -f umfpack_numeric.o umfpack_mz_numeric.o
$(MX) -DZINT -c ../Source/umfpack_qsymbolic.c
umfpack_md_col_to_triplet.o umfpack_md_defaults.o \
umfpack_md_free_numeric.o umfpack_md_free_symbolic.o \
umfpack_md_get_numeric.o umfpack_md_get_lunz.o \
- umfpack_md_get_symbolic.o umfpack_md_numeric.o \
+ umfpack_md_get_symbolic.o umfpack_md_get_determinant.o \
+ umfpack_md_numeric.o \
umfpack_md_qsymbolic.o umfpack_md_report_control.o \
umfpack_md_report_info.o umfpack_md_report_matrix.o \
umfpack_md_report_numeric.o umfpack_md_report_perm.o \
umfpack_mz_col_to_triplet.o umfpack_mz_defaults.o \
umfpack_mz_free_numeric.o umfpack_mz_free_symbolic.o \
umfpack_mz_get_numeric.o umfpack_mz_get_lunz.o \
- umfpack_mz_get_symbolic.o umfpack_mz_numeric.o \
+ umfpack_mz_get_symbolic.o umfpack_mz_get_determinant.o \
+ umfpack_mz_numeric.o \
umfpack_mz_qsymbolic.o umfpack_mz_report_control.o \
umfpack_mz_report_info.o umfpack_mz_report_matrix.o \
umfpack_mz_report_numeric.o umfpack_mz_report_perm.o \
%
% which estimates the computation of the 1-norm:
%
-% rho = norm (A-L*U, 1)
+% rho = norm (A-L*U, 1)
%
% Authors: William W. Hager, Math Dept., Univ. of Florida
% Timothy A. Davis, CISE Dept., Univ. of Florida
% Gainesville, FL, 32611, USA.
% based on normest1, contributed on November, 1997
%
-% This code can be quite easily adapted to estimate the 1-norm of any
+% This code can be quite easily adapted to estimate the 1-norm of any
% matrix E, where E itself is dense or not explicitly represented, but the
% computation of E (and E') times a vector is easy. In this case, our matrix
% of interest is:
% L and U must be sparse.
%
% Note: the above expression has a subtle undercount when exact numerical
-% cancelation occurs. Try [L,U,P] = lu (sparse (ones (10))) and then
+% cancelation occurs. Try [L,U,P] = lu (sparse (ones (10))) and then
% luflop (L,U).
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
help luflop
error ('luflop mexFunction not found! Use umfpack_make to compile luflop.') ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ double flop_count ;
+ double *pflop ;
int *Lp, *Li, *Up, *Ui, *Unz, n, k, row, col, p, Lnz_k, Unz_k ;
mxArray *Lmatrix, *Umatrix ;
- double flop_count, *pflop ;
/* ---------------------------------------------------------------------- */
/* get inputs L, U */
function [out1, out2, out3, out4, out5] = umfpack (in1, in2, in3, in4, in5)
-% UMFPACK v4.3 is a MATLAB mexFunction for solving sparse linear systems.
+% UMFPACK v4.4 is a MATLAB mexFunction for solving sparse linear systems.
%
-% UMFPACK v4.3: | MATLAB approximate equivalent:
+% UMFPACK v4.4: | MATLAB approximate equivalent:
% ---------------------------------------------------------------------
% x = umfpack (A, '\', b) ; | x = A \ b
% |
% | 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] = umfpack (A, 'symbolic') | [m,n] = size (A) ;
% | I = speye (n) ;
% | Q = I (:, colamd (A)) ;
% | [count,h,parent,post] = ...
% See also: lu_normest, colamd, amd.
% To use UMFPACK for an arbitrary b, see umfpack_solve.
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
help umfpack
error ('umfpack mexFunction not found! Use umfpack_make to compile umfpack.') ;
%
% See also: umfpack, umfpack_factorize, umfpack_details, dmperm
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
if (nargin < 2)
help umfpack_btf
% See also umfpack, umfpack_make, umfpack_details, umfpack_report,
% and umfpack_simple.
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
%-------------------------------------------------------------------------------
% get default control parameters
fprintf ('Difference between UMFPACK and MATLAB solution: %g\n', ...
norm (XU - XM, Inf)) ;
+
+%-------------------------------------------------------------------------------
+% compute the determinant
+%-------------------------------------------------------------------------------
+
+fprintf ('\n--------------------------------------------------------------\n') ;
+fprintf ('det(A): %g UMFPACK determinant: %g\n', det (A), umfpack (A, 'det')) ;
Factor and solve a small system, Ax=b, using default parameters
Solving Ax=b via UMFPACK:
Solving Ax=b via MATLAB:
-Difference between UMFPACK and MATLAB solution: 1.24345e-14
+Difference between UMFPACK and MATLAB solution: 0
--------------------------------------------------------------
Factorizing [L, U, P, Q, R] = umfpack (A)
P * (R\A) * Q - L*U should be zero:
-norm (P*(R\A)*Q - L*U, 1) = 4.2068e-16 (exact) 3.74627e-16 (estimated)
+norm (P*(R\A)*Q - L*U, 1) = 6.80012e-16 (exact) 6.80012e-16 (estimated)
Solution to Ax=b via UMFPACK factorization:
x = Q * (U \ (L \ (P * (R \ b))))
-UMFPACK flop count: 2362
+UMFPACK flop count: 2354
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: 1.37668e-14
+Difference between UMFPACK and MATLAB solution: 7.10543e-15
MATLAB LU flop count: 3164
Solve A'x=b:
Solving A'x=b via UMFPACK:
Solving A'x=b via MATLAB:
-Difference between UMFPACK and MATLAB solution: 3.10862e-15
+Difference between UMFPACK and MATLAB solution: 2.66454e-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.31839e-16 (exact) 6.41848e-17 (estimated)
+norm (P*(R\C)*Q - L*U, 1) = 1.94289e-16 (exact) 5.55112e-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: 1.77636e-14
+Difference between UMFPACK and MATLAB solution: 7.10543e-15
--------------------------------------------------------------
Solve AX=B, where B is n-by-10, and sparse
-Difference between UMFPACK and MATLAB solution: 2.88198e-14
+Difference between UMFPACK and MATLAB solution: 6.72949e-14
--------------------------------------------------------------
Solve AX=B, where B is n-by-10, and sparse, using umfpack_btf
-Difference between UMFPACK and MATLAB solution: 9.79736e-14
+Difference between UMFPACK and MATLAB solution: 8.51541e-14
--------------------------------------------------------------
Solve A'X=B, where B is n-by-10, and sparse
-Difference between UMFPACK and MATLAB solution: 1.05244e-13
+Difference between UMFPACK and MATLAB solution: 7.99291e-14
+
+--------------------------------------------------------------
+det(A): -4.07453e-05 UMFPACK determinant: -4.07453e-05
+>>
>> diary off
function [out1, out2, out3, out4, out5] = umfpack (in1, in2, in3, in4, in5)
-% UMFPACK v4.3: details on each usage.
+% UMFPACK v4.4: details on each usage.
%
% 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.
%
% Prints the current Control settings, and Info
%
+% det = umfpack (A, 'det') ;
+% [det dexp] = umfpack (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.
+%
% 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
% or amd are used instead. If present, Control is a user-supplied 20-by-1
% array. Control and Info are optional; if Control is not present, defaults
% are used. If a Control entry is NaN, then the default is used for that entry.
%
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved.
-%
+%
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
+%
% 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
% 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_make, umfpack_report,
%
% Compiles the UMFPACK mexFunction and then runs a simple demo.
%
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
-%
% See also: umfpack, umfpack_details, umfpack_report, umfpack_demo, and
% umfpack_simple.
+%
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
help umfpack_make
% 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' } ;
+ 'order', 'control', 'info', 'valid', 'preprocess' } ;
% user-callable umfpack_*.[ch] files (real/complex):
user = { 'col_to_triplet', 'defaults', 'free_numeric', ...
'free_symbolic', 'get_numeric', 'get_lunz', ...
- 'get_symbolic', 'numeric', 'qsymbolic', ...
+ 'get_symbolic', 'get_determinant', 'numeric', 'qsymbolic', ...
'report_control', 'report_info', 'report_matrix', ...
'report_numeric', 'report_perm', 'report_status', ...
'report_symbolic', 'report_triplet', ...
rules = { [mx ' -DDINT'] , [mx ' -DZINT'] } ;
kinds = { 'md', 'mz' } ;
-for what = 1:2
+for what = 1:2
rule = rules {what} ;
kind = kinds {what} ;
% See also umfpack, umfpack_make, umfpack_details,
% umfpack_demo, and umfpack_simple.
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. See ../README for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
%-------------------------------------------------------------------------------
% get inputs, use defaults if input arguments not present
% control settings
%-------------------------------------------------------------------------------
-fprintf ('\nUMFPACK Version 4.3: Control settings:\n\n') ;
+fprintf ('\nUMFPACK Version 4.4: 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)) ;
% umfpack_simple: a simple demo of UMFPACK
%
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved.
-%
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
+%
% 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
% 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
>> umfpack_simple
-
umfpack_simple: a simple demo of UMFPACK
- UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
- Davis. All Rights Reserved.
-
+ UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+ All Rights Reserved. Type umfpack_details for License.
+
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
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 =
% See also umfpack, umfpack_make, umfpack_details, umfpack_report,
% and umfpack_simple.
-% UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A.
-% Davis. All Rights Reserved. Type umfpack_details for License.
+% UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
%-------------------------------------------------------------------------------
% check inputs and get default control parameters
else
- % factorize with UMFPACK and do the forward/back solves in MATLAB
+ % factorize with UMFPACK and do the forward/back solves in MATLAB
[L, U, P, Q, R] = umfpack (A, Control) ;
x = Q * (U \ (L \ (P * (R \ b)))) ;
--- /dev/null
+% 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 Version 4.4, Copyright (c) 2005 by Timothy A. Davis.
+% All Rights Reserved. Type umfpack_details for License.
+
+index = UFget ;
+
+f = find (index.nrows == index.ncols) ;
+[ignore, i] = sort (index.nrows (f)) ;
+f = f (i) ;
+
+Control = umfpack ;
+Control (1) = 0 ;
+
+warning ('off', 'all') ;
+figure (1)
+clf
+
+
+for i = f
+
+ fprintf ('\nmatrix: %s %s %d\n', index.Group{i}, index.Name{i}, index.nrows(i)) ;
+
+ Prob = UFget (i) ;
+ A = Prob.A ;
+ n = size (A,1) ;
+
+ b = rand (1,n) ;
+ c = b' ;
+
+ try
+
+ %-----------------------------------------------------------------------
+ % symbolic factorization
+ %-----------------------------------------------------------------------
+
+ [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ;
+ subplot (2,2,1)
+ spy (A)
+ title ('A')
+
+ subplot (2,2,2)
+ treeplot (Fr (1:end-1,2)') ;
+ title ('supercolumn etree')
+
+ %-----------------------------------------------------------------------
+ % P(R\A)Q = LU
+ %-----------------------------------------------------------------------
+
+ [L,U,P,Q,R,Info] = umfpack (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)) ;
+
+ subplot (2,2,3)
+ spy (P*A*Q)
+ title ('PAQ') ;
+
+ cs = Info (57) ;
+ rs = Info (58) ;
+
+ subplot (2,2,4)
+ hold off
+ spy (L|U)
+ hold on
+ if (cs > 0)
+ plot ([0 cs n n 0] + .5, [0 cs cs 0 0]+.5, 'c') ;
+ end
+ if (rs > 0)
+ plot ([0 rs rs 0 0] + cs +.5, [cs cs+rs n n cs]+.5, 'r') ;
+ end
+
+ title ('LU factors')
+ drawnow
+
+ %-----------------------------------------------------------------------
+ % PAQ = LU
+ %-----------------------------------------------------------------------
+
+ [L,U,P,Q] = umfpack (A) ;
+ err = lu_normest (P*A*Q, L, U) ;
+ fprintf ('norm est PAQ-LU: %g relative: %g\n', ...
+ err, err / norm (A,1)) ;
+
+ %-----------------------------------------------------------------------
+ % solve
+ %-----------------------------------------------------------------------
+
+ x1 = b/A ;
+ y1 = A\c ;
+ m1 = norm (b-x1*A) ;
+ m2 = norm (A*y1-c) ;
+
+ % factor the transpose
+ Control (8) = 2 ;
+ [x, info] = umfpack (A', '\', c, Control) ;
+ lunz0 = info (44) + info (45) - info (67) ;
+ r = norm (A'*x-c) ;
+
+ fprintf (':: %8.2e matlab: %8.2e %8.2e\n', r, m1, m2) ;
+
+ % factor the original matrix and solve xA=b
+ for ir = 0:4
+ Control (8) = ir ;
+ [x, info] = umfpack (b, '/', A, Control) ;
+ r = norm (b-x*A) ;
+ if (ir == 0)
+ lunz1 = info (44) + info (45) - info (67) ;
+ end
+ fprintf ('%d: %8.2e %d %d\n', ir, r, info (81), info (82)) ;
+ end
+
+ % factor the original matrix and solve Ax=b
+ for ir = 0:4
+ Control (8) = ir ;
+ [x, info] = umfpack (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', ...
+ lunz0, lunz1, lunz0 / lunz1) ;
+
+ %-----------------------------------------------------------------------
+ % get the determinant
+ %-----------------------------------------------------------------------
+
+ det1 = det (A) ;
+ det2 = umfpack (A, 'det') ;
+ [det3 dexp3] = umfpack (A, 'det') ;
+ err = abs (det1-det2) ;
+ err3 = abs (det1 - (det3 * 10^dexp3)) ;
+ denom = det1 ;
+ if (denom == 0)
+ denom = 1 ;
+ 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 ('diff %g %g\n', err, err3) ;
+
+ catch
+ fprintf ('failed\n') ;
+ end
+
+% pause
+
+end
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
-/* Minor revision, Aug 13, 2003 (version 4.1.1). Removed call to spparms. */
-/* -------------------------------------------------------------------------- */
/*
MATLAB interface for umfpack.
L is unit lower triangular, U is upper triangular, and R is diagonal.
P and Q are permutation matrices (permutations of an identity matrix).
- This has changed since v4.0. The outputs P and Q are returned as
- permutation matrices instead of permutation vectors, and the row scale
- factor r is also returned. v4.0 did not scale the matrix.
-
The matrix A is scaled, by default. Each row i is divided by r (i), where
r (i) is the sum of the absolute values of the entries in that row. The
scaled matrix has an infinity norm of 1. The scale factors r (i) are
returns LU factors such that L*U = P*A*Q, with no scaling.
- See umfpack.m and umfpack.h for details.
+ See umfpack.m, umfpack_details.m, and umfpack.h for details.
Note that this mexFunction accesses only the user-callable UMFPACK routines.
Thus, is also provides another example of how user C code can access
factorizing A, and then solving via the transposed L and U matrices.
The solution is still x = (A.'\b.').', except that A is factorized instead
of A.'.
+
+ 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.
*/
+#define NO_TRANSPOSE_FORWARD_SLASH /* default has changed for v4.3.1 */
#include "umfpack.h"
#include "mex.h"
/* local variables */
/* ---------------------------------------------------------------------- */
+ 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 ;
void *Symbolic, *Numeric ;
int *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,
nfronts, nchains, *Ltp, *Ltj, *Qinit, print_level, status2, no_scale,
*Front_1strow, *Front_leftmostdesc, n_row, n_col, n_inner, sys,
ignore1, ignore2, ignore3, A_is_complex, B_is_complex, X_is_complex,
- *Pp, *Pi, *Qp, *Qi, do_recip ;
- double *Lx, *Lz, *Ux, *Uz, *Ax, *Az, *Bx, *Bz, *Xx, *Xz, *User_Control,
- *p, *q, Info [UMFPACK_INFO], Control [UMFPACK_CONTROL], *OutInfo,
- *p1, *p2, *p3, *p4, *Ltx, *Ltz, *Rs, *Px, *Qx ;
+ *Pp, *Pi, *Qp, *Qi, do_recip, do_det ;
mxArray *Amatrix, *Bmatrix, *User_Control_matrix, *User_Qinit ;
char *operator, *operation ;
mxComplexity Atype, Xtype ;
do_numeric = TRUE ;
transpose = FALSE ;
no_scale = FALSE ;
+ do_det = FALSE ;
/* find the operator */
op = 0 ;
mexErrMsgTxt ("wrong number of arguments") ;
}
+ }
+ else if (STRING_MATCH (operator, "det"))
+ {
+
+ /* -------------------------------------------------------------- */
+ /* compute the determinant */
+ /* -------------------------------------------------------------- */
+
+ /*
+ * [det] = umfpack (A, 'det') ;
+ * [dmantissa dexp] = umfpack (A, 'det') ;
+ */
+
+ operation = "determinant" ;
+ do_det = TRUE ;
+ Amatrix = (mxArray *) pargin [0] ;
+ if (nargin > 2 || nargout > 2)
+ {
+ mexErrMsgTxt ("wrong number of arguments") ;
+ }
+
}
else
{
}
/* ------------------------------------------------------------------ */
- /* return the solution or the factorization */
+ /* return the solution, determinant, or the factorization */
/* ------------------------------------------------------------------ */
if (do_solve)
}
}
+ }
+ else if (do_det)
+ {
+
+ /* -------------------------------------------------------------- */
+ /* get the determinant */
+ /* -------------------------------------------------------------- */
+
+ if (nargout == 2)
+ {
+ /* [det dexp] = umfpack (A, 'det') ;
+ * return determinant in the form det * 10^dexp */
+ p = &dexp ;
+ }
+ else
+ {
+ /* [det] = umfpack (A, 'det') ;
+ * return determinant as a single scalar (overflow or
+ * underflow is much more likely) */
+ p = (double *) NULL ;
+ }
+ if (A_is_complex)
+ {
+ status = umfpack_zi_get_determinant (&dx, &dz, p,
+ Numeric, Info) ;
+ umfpack_zi_free_numeric (&Numeric) ;
+ }
+ else
+ {
+ status = umfpack_di_get_determinant (&dx, p,
+ Numeric, Info) ;
+ umfpack_di_free_numeric (&Numeric) ;
+ dz = 0 ;
+ }
+ if (status < 0)
+ {
+ error ("extracting LU factors failed", A_is_complex, nargout,
+ pargout, Control, Info, status, do_info) ;
+ }
+ if (A_is_complex)
+ {
+ pargout [0] = mxCreateDoubleMatrix (1, 1, mxCOMPLEX) ;
+ p = mxGetPr (pargout [0]) ;
+ *p = dx ;
+ p = mxGetPi (pargout [0]) ;
+ *p = dz ;
+ }
+ else
+ {
+ pargout [0] = mxCreateDoubleMatrix (1, 1, mxREAL) ;
+ p = mxGetPr (pargout [0]) ;
+ *p = dx ;
+ }
+ if (nargout == 2)
+ {
+ pargout [1] = mxCreateDoubleMatrix (1, 1, mxREAL) ;
+ p = mxGetPr (pargout [1]) ;
+ *p = dexp ;
+ }
+
}
else
{
-UMFPACK Version 4.3: a set of routines solving sparse linear systems via LU
+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
--------------------------------------------------------------------------------
-UMFPACK Version 4.3 (Jan. 16, 2003), Copyright (c) 2003 by Timothy A.
+UMFPACK Version 4.4 (Jan. 28, 2005), Copyright (c) 2005 by Timothy A.
Davis. All Rights Reserved.
UMFPACK License:
(http://www.mathworks.com). COLAMD V1.0 appears as a column-preordering
in SuperLU (SuperLU is available at http://www.netlib.org).
UMFPACK v4.0 is a built-in routine in MATLAB 6.5.
+ UMFPACK v4.3 is a built-in routine in MATLAB 7.1.
--------------------------------------------------------------------------------
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.3 can use either AMD v1.0 or v1.1.
+UMFPACK v4.4 can use either AMD v1.0 or v1.1.
--------------------------------------------------------------------------------
-This is the UMFPACK README file. It is a terse overview of UMFPACK.
+This is the UMFPACK README.txt file. It is a terse overview of UMFPACK.
Refer to the User Guide (Doc/UserGuide.pdf) for how to install and use UMFPACK,
or to the Quick Start Guide, QuickStart.pdf.
Anderson also incorporated UMFPACK v4.0 into MATLAB, for lu, backslash (\),
and forward slash (/).
+ David Bateman (Motorola) wrote the initial version of the packed complex
+ input option, and umfpack_get_determinant.
+
--------------------------------------------------------------------------------
Files and directories in the UMFPACK distribution:
--------------------------------------------------------------------------------
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
umfpack_defaults.c set Control defaults
umfpack_free_numeric.c free Numeric object
umfpack_free_symbolic.c free Symbolic object
+ umfpack_get_determinant.c compute determinant from Numeric object
umfpack_get_lunz.c get nz's in L and U
umfpack_get_numeric.c get Numeric object
umfpack_get_symbolic.c get Symbolic object
+ umfpack_load_numeric.c load Numeric object from file
+ umfpack_load_symbolic.c load Symbolic object from file
umfpack_numeric.c numeric factorization
umfpack_qsymbolic.c symbolic factorization, user Q
umfpack_report_control.c print Control settings
umfpack_report_symbolic.c print Symbolic object
umfpack_report_triplet.c print triplet matrix
umfpack_report_vector.c print dense vector
+ umfpack_save_numeric.c save Numeric object to file
+ umfpack_save_symbolic.c save Symbolic object to file
umfpack_scale.c scale a vector
umfpack_solve.c solve a linear system
umfpack_symbolic.c symbolic factorization
umfpack_defaults.h
umfpack_free_numeric.h
umfpack_free_symbolic.h
+ umfpack_get_determinant.h
umfpack_get_lunz.h
umfpack_get_numeric.h
umfpack_get_symbolic.h
+ umfpack_load_numeric.h
+ umfpack_load_symbolic.h
umfpack_numeric.h
umfpack_qsymbolic.h
umfpack_report_control.h
umfpack_report_symbolic.h
umfpack_report_triplet.h
umfpack_report_vector.h
+ umfpack_save_numeric.h
+ umfpack_save_symbolic.h
umfpack_scale.h
umfpack_solve.h
umfpack_symbolic.h
umfpack_timer.h
umfpack_transpose.h
umfpack_triplet_to_col.h
+
umfpack_wsolve.h note that there is no umfpack_wsolve.c. The
umfpack_*_wsolve routines are created from the
umfpack_solve.c file.
umf4_f77zwrapper.c a simple FORTRAN interface for the complex
UMFPACK routines. compile with "make fortran"
umf4zhb.f a demo of the FORTRAN interface (complex)
- umf4zhb.out output of umf4zhb with Bai/qc324.cua, which is
- not included in this distribution, see
- http://www.cise.ufl.edu/research/sparse/matrices
+ umf4zhb.out output of umf4zhb with HB/qc324.cua
umf4hb64.f 64-bit version of umf4hb.f
+ simple_compile a single command that compiles the double/int
+ version of UMFPACK (useful prototype for
+ Microsoft Visual Studio project)
+
----------------------------------------------------------------------------
MATLAB directory:
----------------------------------------------------------------------------
GNUmakefile a nice Makefile, for GNU make
Makefile an ugly Unix Makefile (for older make's)
+ lu_normest.m 1-norm estimate of A-L*U (by Hager & Davis).
luflop.m for "help luflop"
luflopmex.c luflop mexFunction, for computing LU flop count
- lu_normest.m 1-norm estimate of A-L*U (by Hager & Davis).
+ umfpack.m for "help umfpack"
umfpack_btf.m solve Ax=b using umfpack and dmperm
umfpack_demo.m a full umfpack demo
umfpack_details.m the details of how to use umfpack
- umfpack.m for "help umfpack"
umfpack_make.m compile the umfpack mexFunction within MATLAB
- umfpackmex.c the umfpack mexFunction
umfpack_report.m report statistics
umfpack_simple.m a simple umfpack demo
umfpack_solve.m x=A\b or b/A for arbitrary b
+ umfpack_test.m extensive test, requires UF sparse matrices
+ umfpackmex.c the umfpack mexFunction
west0067.mat sparse matrix for umfpack_demo.m
umfpack_demo.m.out output of umfpack_demo.m
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry aij ;
+ double cmax, value, rs, ctol, dvalue ;
Int k, p, row, col, do_values, do_sum, do_max, do_scale, nweak, weak,
p1, p2, dfound, unmatched, n2, oldrow, newrow, oldcol, newcol, pp ;
-
- double cmax, value, rs, ctol, dvalue ;
- Entry aij ;
-
+#ifdef COMPLEX
+ Int split = SPLIT (Az) ;
+#endif
#ifndef NRECIPROCAL
Int do_recip = FALSE ;
#endif
/* use the values, but only if they are present */
/* ignore the values if tol <= 0 */
- do_values = (tol > 0)
- && (Ax != (double *) NULL)
-#ifdef COMPLEX
- && (Az != (double *) NULL)
-#endif
- ;
+ do_values = (tol > 0) && (Ax != (double *) NULL) ;
if (do_values && (Rs != (double *) NULL))
{
do_sum = (scale == UMFPACK_SCALE_SUM) ;
for (p = Ap [col] ; p < p2 ; p++)
{
row = Ai [p] ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
rs = Rs [row] ;
if (!SCALAR_IS_NAN (rs))
newrow = InvRperm1 [oldrow] - n1 ;
ASSERT (newrow >= -n1 && newrow < n2) ;
if (newrow < 0) continue ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
/* if either cmax or value is NaN, define cmax as NaN */
if (!SCALAR_IS_NAN (cmax))
newrow = InvRperm1 [oldrow] - n1 ;
ASSERT (newrow >= -n1 && newrow < n2) ;
if (newrow < 0) continue ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
value *= Rs [oldrow] ;
/* if either cmax or value is NaN, define cmax as NaN */
newrow = InvRperm1 [oldrow] - n1 ;
ASSERT (newrow >= -n1 && newrow < n2) ;
if (newrow < 0) continue ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
value /= Rs [oldrow] ;
/* if either cmax or value is NaN, define cmax as NaN */
oldrow = Ai [p] ;
newrow = InvRperm1 [oldrow] - n1 ;
if (newrow < 0) continue ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
weak = WEAK (value, ctol) ;
if (!weak)
oldrow = Ai [p] ;
newrow = InvRperm1 [oldrow] - n1 ;
if (newrow < 0) continue ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
value *= Rs [oldrow] ;
weak = WEAK (value, ctol) ;
oldrow = Ai [p] ;
newrow = InvRperm1 [oldrow] - n1 ;
if (newrow < 0) continue ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
value /= Rs [oldrow] ;
weak = WEAK (value, ctol) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#include "umf_internal.h"
#include "umf_apply_order.h"
-#include "umf_malloc.h"
-#include "umf_free.h"
#include "umf_fsize.h"
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
)
{
+ Entry *S, *Fcblock, *Frow ;
Int tpi, e, *E, *Fcpos, *Frpos, *Row_degree, *Row_tuples, *Row_tlen, rdeg0,
f, nrows, ncols, *Rows, *Cols, col, ncolsleft, j ;
Tuple *tp, *tp1, *tp2, *tpend ;
Unit *Memory, *p ;
Element *ep ;
- Entry *S, *Fcblock, *Frow ;
#ifndef FIXQ
Int *Col_degree ;
)
{
+ Entry *S, *Fcblock, *Fcol ;
Int tpi, e, *E, *Fcpos, *Frpos, *Row_degree, *Col_tuples, *Col_tlen, cdeg0,
f, nrows, ncols, *Rows, *Cols, row, nrowsleft, i ;
Tuple *tp, *tp1, *tp2, *tpend ;
Unit *Memory, *p ;
Element *ep ;
- Entry *S, *Fcblock, *Fcol ;
#if !defined (FIXQ) || !defined (NDEBUG)
Int *Col_degree ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
about 36 minutes. BE CAREFUL: if you compare the run time of UMFPACK with
other sparse matrix packages, be sure to use the same timer. See
umfpack_tictoc.c for the timer used internally by UMFPACK. See also
- umfpack_timer.c for the timer used in an earlier version of UMFPACK (V4.0).
+ umfpack_timer.c for the timer used in an earlier version of UMFPACK.
That timer is still available as a user-callable routine, but it is no
longer used internally by UMFPACK.
*/
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 check_degree /* true if degree is to be checked */
)
{
+ Entry value ;
+ Entry *C ;
Int f, nrows, j, jj, len, e, deg, index, n_row, n_col, *Cols, *Rows, nn,
dumpdeg, ncols, preve, *E, tpi, *Pattern, approx_deg, not_in_use ;
Tuple *tp, *tend ;
Element *ep ;
Int *Row_tuples, *Row_degree, *Row_tlen ;
Int *Col_tuples, *Col_degree, *Col_tlen ;
- Entry value, *C ;
Unit *p ;
Int is_there ;
)
{
Int col, p, p1, p2, row ;
+#ifdef COMPLEX
+ Int split = SPLIT (Az) ;
+#endif
+
if (!Ai || !Ap) return ;
DEBUG6 (("============================================ COLUMN FORM:\n")) ;
-
ASSERT (n_col >= 0) ;
nz = Ap [n_col] ;
DEBUG2 (("UMF_dump_col: nz "ID"\n", nz)) ;
if (Ax != (double *) NULL)
{
#ifdef COMPLEX
- if (Az != (double *) NULL)
+ if (split)
{
DEBUG6 ((" (%e+%ei) ", Ax [p], Az [p])) ;
}
else
{
- DEBUG6 ((" %e", Ax [p])) ;
+ DEBUG6 ((" (%e+%ei) ", Ax [2*p], Ax [2*p+1])) ;
}
#else
DEBUG6 ((" %e", Ax [p])) ;
{
FILE *ff ;
+ AMD_debug_init ("from umfpack") ;
+
/* get the debug print level from the "debug.umf" file, if it exists */
UMF_debug = -999 ;
ff = fopen ("debug.umf", "r") ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
if (Work->do_grow)
{
- fnr2 = (Int) (UMF_FRONTAL_GROWTH * Work->fnrows_new + 2) ;
- fnc2 = (Int) (UMF_FRONTAL_GROWTH * Work->fncols_new + 2) ;
+ fnr2 = UMF_FRONTAL_GROWTH * Work->fnrows_new + 2 ;
+ fnc2 = UMF_FRONTAL_GROWTH * Work->fncols_new + 2 ;
if (!UMF_grow_front (Numeric, fnr2, fnc2, Work, 1))
{
DEBUGm4 (("out of memory: extend front\n")) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 do_Fcpos
)
{
+ double nsize, bsize, tsize ;
Int i, minsize, newsize, newmem, costly, row, col, *Row_tlen, *Col_tlen,
n_row, n_col, *Row_degree, *Col_degree ;
Unit *mnew, *p ;
- double nsize, bsize, tsize ;
/* ---------------------------------------------------------------------- */
/* get and check parameters */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* Current frontal matrix is too small. Make it bigger. */
#include "umf_internal.h"
-#include "umf_realloc.h"
#include "umf_mem_free_tail_block.h"
#include "umf_mem_alloc_tail_block.h"
#include "umf_get_memory.h"
/* local variables */
/* ---------------------------------------------------------------------- */
+ double s ;
Entry *Fcold, *Fcnew ;
Int j, i, col, *Fcpos, *Fcols, fnrows_max, fncols_max, fnr_curr, nb,
fnrows_new, fncols_new, fnr_min, fnc_min, minsize,
newsize, fnrows, fncols, *E, eloc ;
- double s ;
/* ---------------------------------------------------------------------- */
/* get parameters */
/* the desired front size is bigger than the integer maximum */
/* compute a such that a*a*s < Int_MAX / sizeof (Entry) */
double a = 0.9 * sqrt ((Int_MAX / sizeof (Entry)) / s) ;
- fnr2 = (Int) MAX (fnr_min, a * fnr2) ;
- fnc2 = (Int) MAX (fnc_min, a * fnc2) ;
+ fnr2 = MAX (fnr_min, a * fnr2) ;
+ fnc2 = MAX (fnc_min, a * fnc2) ;
/* the new frontal size is a*r*a*c = a*a*s */
newsize = fnr2 * fnc2 ;
ASSERT (fnr2 >= 0) ;
/* try again with something smaller */
while ((fnr2 != fnr_min || fnc2 != fnc_min) && !eloc)
{
- fnr2 = (Int) MIN (fnr2 - 2, fnr2 * UMF_REALLOC_REDUCTION) ;
- fnc2 = (Int) MIN (fnc2 - 2, fnc2 * UMF_REALLOC_REDUCTION) ;
+ fnr2 = MIN (fnr2 - 2, fnr2 * UMF_REALLOC_REDUCTION) ;
+ fnc2 = MIN (fnc2 - 2, fnc2 * UMF_REALLOC_REDUCTION) ;
ASSERT (fnr_min >= 0) ;
ASSERT (fnr_min % 2 == 1) ;
fnr2 = MAX (fnr_min, fnr2) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#endif
if (Work->do_grow)
{
- fnr2 = (Int) (UMF_FRONTAL_GROWTH * Work->fnrows_new + 2) ;
- fnc2 = (Int) (UMF_FRONTAL_GROWTH * Work->fncols_new + 2) ;
+ fnr2 = UMF_FRONTAL_GROWTH * Work->fnrows_new + 2 ;
+ fnc2 = UMF_FRONTAL_GROWTH * Work->fncols_new + 2 ;
if (!UMF_grow_front (Numeric, fnr2, fnc2, Work,
Work->pivrow_in_front ? 2 : 0))
{
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
file names and routine names all start with "umf_".
*/
+#ifndef _UMF_INTERNAL
+#define _UMF_INTERNAL
+
/* -------------------------------------------------------------------------- */
/* ANSI standard include files */
/* -------------------------------------------------------------------------- */
/* 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 ;
+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
#endif
+
+#endif
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#include "umf_mem_alloc_head_block.h"
#include "umf_mem_alloc_tail_block.h"
#include "umf_mem_free_tail_block.h"
-#include "umf_free.h"
#include "umf_scale.h"
/* ========================================================================== */
Unit *Memory /* contains the sparse vector on input and output */
)
{
- Entry x, *Bx, *Bx2 ;
- Int p, i, len, len_new, *Bi, *Bi2 ;
+ Entry x ;
double s ;
+ Entry *Bx, *Bx2 ;
+ Int p, i, len, len_new, *Bi, *Bi2 ;
/* get the pointers to the sparse vector, and its length */
p = *p_p ;
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry x, pivot_value ;
+ double unused = 0, rsmin, rsmax, rs, droptol ;
+ Entry *D, *C, *Lval, **Rpx ;
+ double *Rs ;
Int row, k, oldcol, size, e, p1, p2, p, nz, *Rows, *Cols, *E, i, *Upos,
*Lpos, n_row, n_col, *Wp, *Cperm_init, *Frpos, *Fcpos, *Row_degree, nn,
*Row_tlen, *Col_degree, *Col_tlen, oldrow, newrow, ilast, *Wrp,
*Lip, *Uip, *Lilen, *Uilen, llen, pa, *Cdeg, *Rdeg, n1, clen, do_scale,
lnz, unz, lip, uip, k1, *Rperm, *Cperm, pivcol, *Li, lilen, drop,
**Rpi, nempty_row, dense_row_threshold, empty_elements, rpi, rpx ;
- double unused = 0, *Rs, rsmin, rsmax, rs, droptol ;
- Entry *D, *C, x, *Lval, pivot_value, **Rpx ;
Element *ep ;
Unit *Memory ;
-
+#ifdef COMPLEX
+ Int split = SPLIT (Az) ;
+#endif
#ifndef NRECIPROCAL
Int do_recip = FALSE ;
#endif
}
for (p = p1 ; p < p2 ; p++)
{
- double value ;
Entry aij ;
+ double value ;
row = Ai [p] ;
if (row <= ilast || row >= n_row)
{
DEBUGm4 (("invalid matrix (Ai)\n")) ;
return (FALSE) ;
}
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
APPROX_ABS (value, aij) ;
rs = Rs [row] ;
if (!SCALAR_IS_NAN (rs))
{
oldrow = Ai [pa] ;
newrow = Frpos [oldrow] ;
- ASSIGN (x, Ax [pa], Az [pa]) ;
+ ASSIGN (x, Ax, Az, pa, split) ;
/* scale the value using the scale factors, Rs */
if (do_scale)
#ifndef NRECIPROCAL
if (do_recip)
{
- SCALE_RECIP (x, Rs [oldrow]) ;
+ SCALE (x, Rs [oldrow]) ;
}
else
#endif
{
oldrow = Ai [pa] ;
newrow = Frpos [oldrow] ;
- ASSIGN (x, Ax [pa], Az [pa]) ;
+ ASSIGN (x, Ax, Az, pa, split) ;
/* scale the value using the scale factors, Rs */
if (do_scale)
if (do_recip)
{
/* multiply by the reciprocal */
- SCALE_RECIP (x, Rs [oldrow]) ;
+ SCALE (x, Rs [oldrow]) ;
}
else
#endif
{
/* :: pattern change (dense row too short) :: */
DEBUGm4 (("bad dense row (too short)\n")) ;
- return (FALSE) ;
+ return (FALSE) ; /* pattern changed */
}
}
#ifndef NDEBUG
if (prefer_diagonal)
{
- Int *InvCperm, newcol ;
Entry aij ;
+ Int *InvCperm, newcol ;
UMF_dump_diagonal_map (Diagonal_map, Diagonal_imap, n1, nn, nempty) ;
InvCperm = (Int *) malloc (n_col * sizeof (Int)) ;
ASSERT (InvCperm != (Int *) NULL) ;
{
oldrow = Ai [p] ;
newrow = Frpos [oldrow] ;
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
if (newrow == Diagonal_map [newcol])
{
DEBUG0 (("old row "ID" col "ID" new row "ID" col "ID,
#ifndef NRECIPROCAL
if (do_recip)
{
- SCALE_RECIP (aij, Rs [oldrow]) ;
+ SCALE (aij, Rs [oldrow]) ;
}
else
#endif
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry pivot_value ;
+ double d ;
+ Entry *D ;
Int i, k, col, row, llen, ulen, *ip, *Rperm, *Cperm, *Lilen, npiv, lp,
*Uilen, *Lip, *Uip, *Cperm_init, up, pivrow, pivcol, *Lpos, *Upos, *Wr,
*Wc, *Wp, *Frpos, *Fcpos, *Row_degree, *Col_degree, *Rperm_init,
n_row, n_col, n_inner, zero_pivot, nan_pivot, n1 ;
- Entry *D, pivot_value ;
- double d ;
#ifndef NDEBUG
UMF_dump_matrix (Numeric, Work, FALSE) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#include "umf_row_search.h"
#include "umf_mem_free_tail_block.h"
-/* Version 4.1: relaxed amalgamation control parameters are now fixed, and
- * cannot be changed via Control [..] settings, as they could in Version 4.0. */
-#define RELAX1 0.25 /* this was UMFPACK_DEFAULT_RELAXED_AMALGAMATION */
-#define SYM_RELAX1 0.0 /* this is new to Version 4.1 */
-#define RELAX2 0.1 /* this was UMFPACK_DEFAULT_RELAXED2_AMALGAMATION */
-#define RELAX3 0.125 /* this was UMFPACK_DEFAULT_RELAXED3_AMALGAMATION */
+/* relaxed amalgamation control parameters are fixed at compile time */
+#define RELAX1 0.25
+#define SYM_RELAX1 0.0
+#define RELAX2 0.1
+#define RELAX3 0.125
/* ========================================================================== */
/* === remove_candidate ===================================================== */
/* local variables */
/* ---------------------------------------------------------------------- */
+ double relax1 ;
Entry *Flblock, *Fublock, *Fs, *Fcblock, *C, *Wx, *Wy, *Fu, *Flublock,
*Flu ;
- double relax1 ;
Int pos, nrows, *Cols, *Rows, e, f, status, max_cdeg, fnzeros, nb, j, col,
i, row, cdeg_in, rdeg [2][2], fnpiv, nothing [2], new_LUsize,
pivrow [2][2], pivcol [2], *Wp, *Fcpos, *Frpos, new_fnzeros, cdeg_out,
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 Pattern [ ] /* a work array of size n */
)
{
+ Entry xk ;
+ Entry *xp, *Lval ;
Int k, deg, *ip, j, row, *Lpos, *Lilen, *Lip, llen, lp, newLchain,
pos, npiv, n1, *Li ;
- Entry *xp, xk, *Lval ;
/* ---------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 Pattern [ ] /* a work array of size n */
)
{
+ Entry xk ;
+ Entry *xp, *Lval ;
Int k, deg, *ip, j, row, *Lpos, *Lilen, kstart, kend, *Lip, llen,
lp, pos, npiv, n1, *Li ;
- Entry *xp, xk, *Lval ;
/* ---------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#ifdef UMF_TCOV_TEST
/* For exhaustive statement coverage testing only! */
-GLOBAL Int umf_fail, umf_fail_lo, umf_fail_hi ;
-GLOBAL Int umf_realloc_fail, umf_realloc_lo, umf_realloc_hi ;
+GLOBAL int umf_fail, umf_fail_lo, umf_fail_hi ;
+GLOBAL int umf_realloc_fail, umf_realloc_lo, umf_realloc_hi ;
#endif
GLOBAL void *UMF_malloc
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
+#ifndef _UMF_MALLOC
+#define _UMF_MALLOC
+
#if defined (UMF_MALLOC_COUNT) || !defined (NDEBUG)
GLOBAL extern Int UMF_malloc_count ;
#endif
Int n_objects,
size_t size_of_object
) ;
+
+#endif
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
--- /dev/null
+/* ========================================================================== */
+/* === UMF_multicompile ===================================================== */
+/* ========================================================================== */
+
+/* -------------------------------------------------------------------------- */
+/* UMFPACK Version 4.4, 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 */
+/* -------------------------------------------------------------------------- */
+
+/* This file is not needed if you have the Unix/Linux "make" command for
+ * compiling UMFPACK. Microsoft Visual Studio cannot be configured to compile
+ * one file multiple times, with different -D flags. In this case, you can
+ * use this file instead. To use this file, see the Demo/simple_compile file.
+ *
+ * This file includes the following source files:
+ *
+ * umf_ltsolve.c
+ * umf_utsolve.c
+ * umf_triplet.c
+ * umf_assemble.c
+ * umf_store_lu.c
+ * umfpack_solve.c
+ *
+ * This file simply compiles the above files with different pre-#define'd flags,
+ * by defining the flags and then #include'ing the source files themselves.
+ * This is a rather unconventional approach, since by convention #include is
+ * supposed to be used with *.h files not *.c. However, it is one way of
+ * working around the limitations of Microsoft Visual Studio.
+ *
+ * You still need to compile all files separately as well, with none of the
+ * pre-#define'd terms listed below.
+ */
+
+/* compile the complex conjugate forward/backsolves */
+#define CONJUGATE_SOLVE
+#include "umf_ltsolve.c"
+#include "umf_utsolve.c"
+
+/* compile umf_triplet with DO_MAP, DO_VALUES and DO_MAP, and just DO_VALUES */
+#define DO_MAP
+#include "umf_triplet.c"
+#define DO_VALUES
+#include "umf_triplet.c"
+#undef DO_MAP
+#include "umf_triplet.c"
+
+/* compile the FIXQ version of umf_assemble */
+#define FIXQ
+#include "umf_assemble.c"
+
+/* compile the DROP version of umf_store_lu */
+#define DROP
+#include "umf_store_lu.c"
+
+/* compile umfpack_wsolve */
+#define WSOLVE
+#include "umfpack_solve.c"
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 i,
const double Xx [ ],
- const double Xz [ ],
+ const double Xz [ ], /* used for complex case only */
Int scalar /* if true, then print real part only */
)
{
- Entry *X, xi ;
+ Entry xi ;
/* if Xz is null, then X is in "merged" format (compatible with Entry, */
/* and ANSI C99 double _Complex type). */
- X = (Entry *) Xx ;
PRINTF ((" "ID" :", INDEX (i))) ;
if (scalar)
{
}
else
{
- if (Xz != (double *) NULL)
- {
- ASSIGN (xi, Xx [i], Xz [i]) ;
- }
- else
- {
- xi = X [i] ;
- }
+ ASSIGN (xi, Xx, Xz, i, SPLIT (Xz)) ;
PRINT_ENTRY (xi) ;
}
PRINTF (("\n")) ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
Entry X [ ]
)
{
- Int i ;
Entry x ;
double s ;
+ Int i ;
/* ---------------------------------------------------------------------- */
/* compute the approximate absolute value of the pivot, and select method */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry pivot_value ;
+ Entry *Fcol, *Flublock, *Flblock, *Fublock, *Fcblock ;
Int k, k1, fnr_curr, fnrows, fncols, *Frpos, *Fcpos, pivrow, pivcol,
*Frows, *Fcols, fnc_curr, fnpiv, *Row_tuples, nb,
*Col_tuples, *Rperm, *Cperm, fspos, col2, row2 ;
- Entry pivot_value, *Fcol,
- *Flublock, *Flblock, *Fublock, *Fcblock ;
#ifndef NDEBUG
Int *Col_degree, *Row_degree ;
#endif
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
{
/* this row/col is empty in the pruned submatrix */
ASSERT (s < nx - nempty) ;
+ DEBUG0 (("empty k "ID"\n", k)) ;
nempty++ ;
Xperm [nx - nempty] = x ;
}
const Int Ap [ ], /* size n_col+1 */
const Int Ai [ ], /* size nz = Ap [n_col] */
const Int Quser [ ], /* size n_col if present */
+ Int strategy, /* strategy requested by user */
/* output, not defined on input: */
Int Cdeg [ ], /* size n_col */
if (Quser != (Int *) NULL)
{
- /* look for singletons, but respect the user's input permutation */
- n1 = find_user_singletons (n_row, n_col, Ap, Ai, Quser,
- Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W) ;
+ /* user has provided an input column ordering */
+ if (strategy == UMFPACK_STRATEGY_UNSYMMETRIC)
+ {
+ /* look for singletons, but respect the user's input permutation */
+ n1 = find_user_singletons (n_row, n_col, Ap, Ai, Quser,
+ Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W) ;
+ }
+ else
+ {
+ /* do not look for singletons if Quser given and strategy is
+ * not unsymmetric */
+ n1 = 0 ;
+ n1r = 0 ;
+ n1c = 0 ;
+ }
}
else
{
/* eliminate empty rows and complete the row permutation */
/* ---------------------------------------------------------------------- */
- nempty_row = finish_permutation (n1, n_row, Rdeg, (Int *) NULL, Rperm,
- &max_rdeg) ;
+ if (Quser != (Int *) NULL && strategy == UMFPACK_STRATEGY_SYMMETRIC)
+ {
+ /* rows should be symmetrically permuted according to Quser */
+ ASSERT (n_row == n_col) ;
+ nempty_row = finish_permutation (n1, n_row, Rdeg, Quser, Rperm,
+ &max_rdeg) ;
+ }
+ else
+ {
+ /* rows should not be symmetrically permuted according to Quser */
+ nempty_row = finish_permutation (n1, n_row, Rdeg, (Int *) NULL, Rperm,
+ &max_rdeg) ;
+ }
/* ---------------------------------------------------------------------- */
/* compute the inverse of Rperm */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
const Int Ap [ ],
const Int Ai [ ],
const Int Quser [ ],
+ Int strategy,
Int Cdeg [ ],
Int Cperm [ ],
Int Rdeg [ ],
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry axx, wi, xj, zi, xi, aij, bi ;
+ double omega [3], d, z2i, yi, flops ;
+ Entry *W, *Z, *S, *X ;
+ double *Z2, *Y, *B2, *Rs ;
Int *Rperm, *Cperm, i, n, p, step, j, nz, status, p2, do_scale ;
- Entry axx, wi, xj, zi, xi, aij, *W, *Z, *S, *X, bi ;
- double omega [3], d, *Z2, *Y, z2i, yi, *B2, *Rs, flops ;
-
+#ifdef COMPLEX
+ Int split ;
+#endif
#ifndef NRECIPROCAL
Int do_recip = Numeric->do_recip ;
#endif
#ifndef NDEBUG
UMF_dump_lu (Numeric) ;
ASSERT (Numeric && Xx && Bx && Pattern && SolveWork && Info) ;
-#ifdef COMPLEX
- ASSERT (Xz && Bz) ;
-#endif
#endif
nz = 0 ;
B2 = (double *) NULL ;
#ifdef COMPLEX
- X = (Entry *) (SolveWork + 2*n) ; /* Entry X [0..n-1] */
if (irstep > 0)
{
- if (!Ap || !Ai || !Ax || !Az)
+ if (!Ap || !Ai || !Ax)
{
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) ;
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] */
B2 = (double *) (SolveWork + 9*n) ; /* double B2 [0..n-1] */
Z2 = (double *) Z ; /* double Z2 [0..n-1], equiv. to Z */
}
+ else
+ {
+ /* A is ignored, only look at X and B for split/packed cases */
+ split = SPLIT (Bz) && SPLIT (Xz) ;
+ }
+ if (split)
+ {
+ X = (Entry *) (SolveWork + 2*n) ; /* Entry X [0..n-1] */
+ }
+ else
+ {
+ X = (Entry *) Xx ; /* Entry X [0..n-1] */
+ }
#else
X = (Entry *) Xx ; /* Entry X [0..n-1] */
if (irstep > 0)
for (p = 0 ; p < p2 ; p++)
{
/* Y [Ai [p]] += ABS (Ax [p]) ; */
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
ABS (d, aij) ;
Y [Ai [p]] += d ;
}
for (i = 0 ; i < n ; i++)
{
/* B2 [i] = ABS (B [i]) ; */
- ASSIGN (bi, Bx [i], Bz [i]) ;
+ ASSIGN (bi, Bx, Bz, i, split) ;
ABS (B2 [i], bi) ;
}
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- ASSIGN (X [i], Bx [i], Bz [i]) ;
- SCALE_RECIP (X [i], Rs [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
+ SCALE (X [i], Rs [i]) ;
}
}
else
/* divide by the scale factors */
for (i = 0 ; i < n ; i++)
{
- ASSIGN (X [i], Bx [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
SCALE_DIV (X [i], Rs [i]) ;
}
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [Rperm [i]] ; */
- ASSIGN (W [i], Bx [Rperm [i]], Bz [Rperm [i]]) ;
+ ASSIGN (W [i], Bx, Bz, Rperm [i], split) ;
}
}
}
for (i = 0 ; i < n ; i++)
{
/* Z [i] = B [i] ; */
- ASSIGN (Z [i], Bx [i], Bz [i]) ;
+ ASSIGN (Z [i], Bx, Bz, i, split) ;
}
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
MULT_SUB (Z [Ai [p]], aij, xi) ;
}
}
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- SCALE_RECIP (Z [i], Rs [i]) ;
+ SCALE (Z [i], Rs [i]) ;
}
}
else
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx [i], Bz [i]) ;
+ ASSIGN (W [i], Bx, Bz, i, split) ;
Z2 [i] = 0. ;
}
flops += (MULT_FLOPS + DECREMENT_FLOPS + ABS_FLOPS + 1) * nz ;
i = Ai [p] ;
/* axx = Ax [p] * xj ; */
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
MULT (axx, aij, xj) ;
/* W [i] -= axx ; */
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- SCALE_RECIP (W [i], Rs [i]) ;
+ SCALE (W [i], Rs [i]) ;
Z2 [i] *= Rs [i] ;
}
}
/* yi += ABS (Ax [p]) * Rs [Ai [p]] ; */
/* note that abs (aij) is the same as
* abs (conj (aij)) */
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
ABS (d, aij) ;
yi += d ;
}
for (i = 0 ; i < n ; i++)
{
/* B2 [i] = ABS (B [i]) ; */
- ASSIGN (bi, Bx [i], Bz [i]) ;
+ ASSIGN (bi, Bx, Bz, i, split) ;
ABS (B2 [i], bi) ;
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [Cperm [i]] ; */
- ASSIGN (W [i], Bx [Cperm [i]], Bz [Cperm [i]]) ;
+ ASSIGN (W [i], Bx, Bz, Cperm [i], split) ;
}
}
else
for (i = 0 ; i < n ; i++)
{
/* Z [i] = B [i] ; */
- ASSIGN (Z [i], Bx [i], Bz [i]) ;
+ ASSIGN (Z [i], Bx, Bz, i, split) ;
}
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
MULT_SUB_CONJ (zi, X [Ai [p]], aij) ;
}
Z [i] = zi ;
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- SCALE_RECIP (X [i], Rs [i]) ;
+ SCALE (X [i], Rs [i]) ;
}
}
else
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- SCALE_RECIP (Z [i], Rs [i]) ;
+ SCALE (Z [i], Rs [i]) ;
}
}
else
/* X += Z */
for (i = 0 ; i < n ; i++)
{
- /* X [i] += W [i] ; */
- ASSEMBLE (X [i], W [i]) ;
+ /* X [i] += Z [i] ; was +=W[i] in v4.3, which is wrong */
+ ASSEMBLE (X [i], Z [i]) ; /* bug fix, v4.3.1 */
}
}
for (i = 0 ; i < n ; i++)
{
/* wi = B [i] ; */
- ASSIGN (wi, Bx [i], Bz [i]) ;
+ ASSIGN (wi, Bx, Bz, i, split) ;
z2i = 0. ;
p2 = Ap [i+1] ;
for (p = Ap [i] ; p < p2 ; p++)
{
/* axx = conjugate (Ax [p]) * X [Ai [p]] ; */
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
ABS (d, aij) ;
yi += d ;
}
for (i = 0 ; i < n ; i++)
{
/* B2 [i] = ABS (B [i]) ; */
- ASSIGN (bi, Bx [i], Bz [i]) ;
+ ASSIGN (bi, Bx, Bz, i, split) ;
ABS (B2 [i], bi) ;
}
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [Cperm [i]] ; */
- ASSIGN (W [i], Bx [Cperm [i]], Bz [Cperm [i]]) ;
+ ASSIGN (W [i], Bx, Bz, Cperm [i], split) ;
}
}
else
for (i = 0 ; i < n ; i++)
{
/* Z [i] = B [i] ; */
- ASSIGN (Z [i], Bx [i], Bz [i]) ;
+ ASSIGN (Z [i], Bx, Bz, i, split) ;
}
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 [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
MULT_SUB (zi, aij, X [Ai [p]]) ;
}
Z [i] = zi ;
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- SCALE_RECIP (X [i], Rs [i]) ;
+ SCALE (X [i], Rs [i]) ;
}
}
else
/* multiply by the scale factors */
for (i = 0 ; i < n ; i++)
{
- SCALE_RECIP (Z [i], Rs [i]) ;
+ SCALE (Z [i], Rs [i]) ;
}
}
else
/* X += Z */
for (i = 0 ; i < n ; i++)
{
- /* X [i] += W [i] ; */
- ASSEMBLE (X [i], W [i]) ;
+ /* X [i] += Z [i] ; was +=W[i] in v4.3, which is wrong */
+ ASSEMBLE (X [i], Z [i]) ; /* bug fix, v4.3.1 */
}
}
for (i = 0 ; i < n ; i++)
{
/* wi = B [i] ; */
- ASSIGN (wi, Bx [i], Bz [i]) ;
+ ASSIGN (wi, Bx, Bz, i, split) ;
z2i = 0. ;
p2 = Ap [i+1] ;
for (p = Ap [i] ; p < p2 ; p++)
{
/* axx = Ax [p] * X [Ai [p]] ; */
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, split) ;
MULT (axx, aij, X [Ai [p]]) ;
/* wi -= axx ; */
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [Rperm [i]] ; */
- ASSIGN (X [i], Bx [Rperm [i]], Bz [Rperm [i]]) ;
+ ASSIGN (X [i], Bx, Bz, Rperm [i], split) ;
}
flops = UMF_lsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
}
flops = UMF_lsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx [i], Bz [i]) ;
+ ASSIGN (W [i], Bx, Bz, i, split) ;
}
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 [i], Bz [i]) ;
+ ASSIGN (W [i], Bx, Bz, i, split) ;
}
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 [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
}
flops = UMF_lhsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
}
flops = UMF_ltsolve (Numeric, X, Pattern) ;
status = UMFPACK_OK ;
for (i = 0 ; i < n ; i++)
{
/* W [i] = B [i] ; */
- ASSIGN (W [i], Bx [i], Bz [i]) ;
+ ASSIGN (W [i], Bx, Bz, i, split) ;
}
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 [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
}
flops = UMF_usolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [Cperm [i]] ; */
- ASSIGN (X [i], Bx [Cperm [i]], Bz [Cperm [i]]) ;
+ ASSIGN (X [i], Bx, Bz, Cperm [i], split) ;
}
flops = UMF_uhsolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [Cperm [i]] ; */
- ASSIGN (X [i], Bx [Cperm [i]], Bz [Cperm [i]]) ;
+ ASSIGN (X [i], Bx, Bz, Cperm [i], split) ;
}
flops = UMF_utsolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
}
flops = UMF_uhsolve (Numeric, X, Pattern) ;
for (i = 0 ; i < n ; i++)
{
/* X [i] = B [i] ; */
- ASSIGN (X [i], Bx [i], Bz [i]) ;
+ ASSIGN (X [i], Bx, Bz, i, split) ;
}
flops = UMF_utsolve (Numeric, X, Pattern) ;
#ifdef COMPLEX
/* copy the solution back, from Entry X [ ] to double Xx [ ] and Xz [ ] */
- for (i = 0 ; i < n ; i++)
+ if (split)
{
- Xx [i] = REAL_COMPONENT (X [i]) ;
- Xz [i] = IMAG_COMPONENT (X [i]) ;
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [i] = REAL_COMPONENT (X [i]) ;
+ Xz [i] = IMAG_COMPONENT (X [i]) ;
+ }
}
#endif
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
SymbolicType *Symbolic
)
{
+ double maxbytes ;
Int fnrows_max, fncols_max, fnr2, fnc2, fsize, fcurr_size, maxfrsize,
overflow, nb, f, cdeg ;
- double maxbytes ;
nb = Symbolic->nb ;
fnrows_max = Symbolic->Chain_maxrows [chain] ;
if (Numeric->front_alloc_init < 0)
{
/* allocate a front of -Numeric->front_alloc_init entries */
- fsize = (Int) -Numeric->front_alloc_init ;
+ fsize = -Numeric->front_alloc_init ;
fsize = MAX (1, fsize) ;
}
else
}
else
{
- fsize = (Int) (Numeric->front_alloc_init * maxfrsize) ;
+ fsize = Numeric->front_alloc_init * maxfrsize ;
}
if (cdeg > 0)
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#include "umf_internal.h"
#include "umf_mem_alloc_head_block.h"
-#include "umf_mem_free_tail_block.h"
#include "umf_get_memory.h"
/* ========================================================================== */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry pivot_value ;
+#ifdef DROP
+ double droptol ;
+#endif
+ Entry *D, *Lval, *Uval, *Fl1, *Fl2, *Fu1, *Fu2,
+ *Flublock, *Flblock, *Fublock ;
Int i, k, fnr_curr, fnrows, fncols, row, col, pivrow, pivcol, *Frows,
*Fcols, *Lpattern, *Upattern, *Lpos, *Upos, llen, ulen, fnc_curr, fnpiv,
uilen, lnz, unz, nb, *Lilen,
pivrow_position, p, size, lip, uip, lnzi, lnzx, unzx, lnz2i, lnz2x,
unz2i, unz2x, zero_pivot, *Pivrow, *Pivcol, kk,
Lnz [MAXNB] ;
- Entry *D, pivot_value, *Lval, *Uval, *Fl1, *Fl2, *Fu1, *Fu2,
- *Flublock, *Flblock, *Fublock ;
#ifndef NDEBUG
Int *Col_degree, *Row_degree ;
#ifdef DROP
Int all_lnz, all_unz ;
- double droptol ;
droptol = Numeric->droptol ;
#endif
nb = Work->nb ;
#ifndef NDEBUG
- DEBUG1 (("\n##################################### STORE LU: fnrows "ID
+ DEBUG1 (("\nSTORE LU: fnrows "ID
" fncols "ID"\n", fnrows, fncols)) ;
DEBUG2 (("\nFrontal matrix, including all space:\n"
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
double s ;
- Entry x = Fl1 [i] ;
+ x = Fl1 [i] ;
if (IS_ZERO (x)) continue ;
all_lnz++ ;
APPROX_ABS (s, x) ;
for (i = 0 ; i < fnrows ; i++)
{
+ Entry x ;
double s ;
- Entry x = Fl2 [i] ;
+ x = Fl2 [i] ;
if (IS_ZERO (x)) continue ;
all_lnz++ ;
APPROX_ABS (s, x) ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
double s ;
Int row2, pos ;
- Entry x = Fl1 [i] ;
+ x = Fl1 [i] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
row2 = Pivrow [i] ;
for (i = 0 ; i < fnrows ; i++)
{
+ Entry x ;
double s ;
Int row2, pos ;
- Entry x = Fl2 [i] ;
+ x = Fl2 [i] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
row2 = Frows [i] ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
Int row2, pos ;
- Entry x = Fl1 [i] ;
+ x = Fl1 [i] ;
if (IS_ZERO (x)) continue ;
row2 = Pivrow [i] ;
pos = llen++ ;
for (i = 0 ; i < fnrows ; i++)
{
+ Entry x ;
Int row2, pos ;
- Entry x = Fl2 [i] ;
+ x = Fl2 [i] ;
if (IS_ZERO (x)) continue ;
row2 = Frows [i] ;
pos = llen++ ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
double s ;
Int row2, pos ;
- Entry x = Fl1 [i] ;
+ x = Fl1 [i] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
row2 = Pivrow [i] ;
for (i = 0 ; i < fnrows ; i++)
{
+ Entry x ;
double s ;
Int row2, pos ;
- Entry x = Fl2 [i] ;
+ x = Fl2 [i] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
row2 = Frows [i] ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
Int row2, pos ;
- Entry x = Fl1 [i] ;
+ x = Fl1 [i] ;
if (IS_ZERO (x)) continue ;
row2 = Pivrow [i] ;
pos = Lpos [row2] ;
for (i = 0 ; i < fnrows ; i++)
{
+ Entry x ;
Int row2, pos ;
- Entry x = Fl2 [i] ;
+ x = Fl2 [i] ;
if (IS_ZERO (x)) continue ;
row2 = Frows [i] ;
pos = Lpos [row2] ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
double s ;
- Entry x = Fu1 [i*nb] ;
+ x = Fu1 [i*nb] ;
if (IS_ZERO (x)) continue ;
all_unz++ ;
APPROX_ABS (s, x) ;
for (i = 0 ; i < fncols ; i++)
{
+ Entry x ;
double s ;
- Entry x = Fu2 [i] ;
+ x = Fu2 [i] ;
if (IS_ZERO (x)) continue ;
all_unz++ ;
APPROX_ABS (s, x) ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
double s ;
Int col2, pos ;
- Entry x = Fu1 [i*nb] ;
+ x = Fu1 [i*nb] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
col2 = Pivcol [i] ;
for (i = 0 ; i < fncols ; i++)
{
+ Entry x ;
double s ;
Int col2, pos ;
- Entry x = Fu2 [i] ;
+ x = Fu2 [i] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
col2 = Fcols [i] ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
Int col2, pos ;
- Entry x = Fu1 [i*nb] ;
+ x = Fu1 [i*nb] ;
if (IS_ZERO (x)) continue ;
col2 = Pivcol [i] ;
pos = ulen++ ;
for (i = 0 ; i < fncols ; i++)
{
+ Entry x ;
Int col2, pos ;
- Entry x = Fu2 [i] ;
+ x = Fu2 [i] ;
if (IS_ZERO (x)) continue ;
col2 = Fcols [i] ;
pos = ulen++ ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
double s ;
Int col2, pos ;
- Entry x = Fu1 [i*nb] ;
+ x = Fu1 [i*nb] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
col2 = Pivcol [i] ;
for (i = 0 ; i < fncols ; i++)
{
+ Entry x ;
double s ;
Int col2, pos ;
- Entry x = Fu2 [i] ;
+ x = Fu2 [i] ;
APPROX_ABS (s, x) ;
if (s <= droptol) continue ;
col2 = Fcols [i] ;
for (i = kk + 1 ; i < fnpiv ; i++)
{
+ Entry x ;
Int col2, pos ;
- Entry x = Fu1 [i*nb] ;
+ x = Fu1 [i*nb] ;
if (IS_ZERO (x)) continue ;
col2 = Pivcol [i] ;
pos = Upos [col2] ;
for (i = 0 ; i < fncols ; i++)
{
+ Entry x ;
Int col2, pos ;
- Entry x = Fu2 [i] ;
+ x = Fu2 [i] ;
if (IS_ZERO (x)) continue ;
col2 = Fcols [i] ;
pos = Upos [col2] ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 i, j, k, p, bp, newj, do_values ;
+#ifdef COMPLEX
+ Int split ;
+#endif
/* ---------------------------------------------------------------------- */
/* check inputs */
/* ---------------------------------------------------------------------- */
do_values = Ax && Rx ;
-#ifdef COMPLEX
- do_values = do_values && Az && Rz ;
-#endif
#ifdef COMPLEX
+ split = SPLIT (Az) && SPLIT (Rz) ;
+
if (do_conjugate && do_values)
{
if (Q != (Int *) NULL)
{
-
+ if (split)
+ {
/* R = A (P,Q)' */
for (newj = 0 ; newj < nq ; newj++)
{
Rz [bp] = -Az [p] ;
}
}
-
+ }
+ else
+ {
+ /* R = A (P,Q)' (merged complex values) */
+ for (newj = 0 ; newj < nq ; newj++)
+ {
+ j = Q [newj] ;
+ ASSERT (j >= 0 && j < n_col) ;
+ for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ {
+ bp = W [Ai [p]]++ ;
+ Ri [bp] = newj ;
+ Rx [2*bp] = Ax [2*p] ;
+ Rx [2*bp+1] = -Ax [2*p+1] ;
+ }
+ }
+ }
}
else
{
-
+ if (split)
+ {
/* R = A (P,:)' */
for (j = 0 ; j < n_col ; j++)
{
Rz [bp] = -Az [p] ;
}
}
-
+ }
+ else
+ {
+ /* R = A (P,:)' (merged complex values) */
+ for (j = 0 ; j < n_col ; j++)
+ {
+ for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ {
+ bp = W [Ai [p]]++ ;
+ Ri [bp] = j ;
+ Rx [2*bp] = Ax [2*p] ;
+ Rx [2*bp+1] = -Ax [2*p+1] ;
+ }
+ }
+ }
}
}
else
{
if (do_values)
{
-
- /* R = A (P,Q).' */
- for (newj = 0 ; newj < nq ; newj++)
+#ifdef COMPLEX
+ if (split)
+#endif
{
- j = Q [newj] ;
- ASSERT (j >= 0 && j < n_col) ;
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ /* R = A (P,Q).' */
+ for (newj = 0 ; newj < nq ; newj++)
{
- bp = W [Ai [p]]++ ;
- Ri [bp] = newj ;
- Rx [bp] = Ax [p] ;
+ j = Q [newj] ;
+ ASSERT (j >= 0 && j < n_col) ;
+ for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ {
+ bp = W [Ai [p]]++ ;
+ Ri [bp] = newj ;
+ Rx [bp] = Ax [p] ;
#ifdef COMPLEX
- Rz [bp] = Az [p] ;
+ Rz [bp] = Az [p] ;
#endif
+ }
}
}
-
+#ifdef COMPLEX
+ else
+ {
+ /* R = A (P,Q).' (merged complex values) */
+ for (newj = 0 ; newj < nq ; newj++)
+ {
+ j = Q [newj] ;
+ ASSERT (j >= 0 && j < n_col) ;
+ for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ {
+ bp = W [Ai [p]]++ ;
+ Ri [bp] = newj ;
+ Rx [2*bp] = Ax [2*p] ;
+ Rx [2*bp+1] = Ax [2*p+1] ;
+ }
+ }
+ }
+#endif
}
else
{
-
/* R = pattern of A (P,Q).' */
for (newj = 0 ; newj < nq ; newj++)
{
Ri [W [Ai [p]]++] = newj ;
}
}
-
}
}
else
{
if (do_values)
{
-
- /* R = A (P,:).' */
- for (j = 0 ; j < n_col ; j++)
+#ifdef COMPLEX
+ if (split)
+#endif
{
- for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ /* R = A (P,:).' */
+ for (j = 0 ; j < n_col ; j++)
{
- bp = W [Ai [p]]++ ;
- Ri [bp] = j ;
- Rx [bp] = Ax [p] ;
+ for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ {
+ bp = W [Ai [p]]++ ;
+ Ri [bp] = j ;
+ Rx [bp] = Ax [p] ;
#ifdef COMPLEX
- Rz [bp] = Az [p] ;
+ Rz [bp] = Az [p] ;
#endif
+ }
}
}
-
+#ifdef COMPLEX
+ else
+ {
+ /* R = A (P,:).' (merged complex values) */
+ for (j = 0 ; j < n_col ; j++)
+ {
+ for (p = Ap [j] ; p < Ap [j+1] ; p++)
+ {
+ bp = W [Ai [p]]++ ;
+ Ri [bp] = j ;
+ Rx [2*bp] = Ax [2*p] ;
+ Rx [2*bp+1] = Ax [2*p+1] ;
+ }
+ }
+ }
+#endif
}
else
{
-
/* R = pattern of A (P,:).' */
for (j = 0 ; j < n_col ; j++)
{
Ri [W [Ai [p]]++] = j ;
}
}
-
}
}
-
}
#ifndef NDEBUG
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
Not user callable. Converts triplet input to column-oriented form.
Duplicate entries may exist (they are summed in the output). The columns
of the column-oriented form are in sorted order. The input is not modified.
- Returns 1 if OK, 0 if an error occured.
+ Returns 1 if OK, 0 if an error occurred.
Compiled into four different routines for each version (di, dl, zi, zl),
for a total of 16 different routines.
*/
#include "umf_internal.h"
-#include "umf_malloc.h"
-#include "umf_free.h"
#ifdef DO_MAP
#ifdef DO_VALUES
Int i, j, k, p, cp, p1, p2, pdest, pj ;
#ifdef DO_MAP
Int duplicates ;
+#endif
+#ifdef DO_VALUES
+#ifdef COMPLEX
+ Int split = SPLIT (Tz) && SPLIT (Az) && SPLIT (Rz) ;
+#endif
#endif
/* ---------------------------------------------------------------------- */
#ifdef DO_VALUES
{
Entry tt ;
- ASSIGN (tt, Tx [k], Tz [k]) ;
+ ASSIGN (tt, Tx, Tz, k, split) ;
EDEBUG2 (tt) ;
DEBUG1 (("\n")) ;
}
#endif
Rj [p] = Tj [k] ;
#ifdef DO_VALUES
- Rx [p] = Tx [k] ;
#ifdef COMPLEX
- Rz [p] = Tz [k] ;
+ if (split)
+ {
+ Rx [p] = Tx [k] ;
+ Rz [p] = Tz [k] ;
+ }
+ else
+ {
+ Rx [2*p ] = Tx [2*k ] ;
+ Rx [2*p+1] = Tx [2*k+1] ;
+ }
+#else
+ Rx [p] = Tx [k] ;
#endif
#endif
}
#endif
#ifdef DO_VALUES
/* sum the entry */
- Rx [pj] += Rx [p] ;
#ifdef COMPLEX
- Rz [pj] += Rz [p] ;
+ if (split)
+ {
+ Rx [pj] += Rx [p] ;
+ Rz [pj] += Rz [p] ;
+ }
+ else
+ {
+ Rx[2*pj ] += Rx[2*p ] ;
+ Rx[2*pj+1] += Rx[2*p+1] ;
+ }
+#else
+ Rx [pj] += Rx [p] ;
#endif
#endif
}
{
Rj [pdest] = j ;
#ifdef DO_VALUES
- Rx [pdest] = Rx [p] ;
#ifdef COMPLEX
- Rz [pdest] = Rz [p] ;
+ if (split)
+ {
+ Rx [pdest] = Rx [p] ;
+ Rz [pdest] = Rz [p] ;
+ }
+ else
+ {
+ Rx [2*pdest ] = Rx [2*p ] ;
+ Rx [2*pdest+1] = Rx [2*p+1] ;
+ }
+#else
+ Rx [pdest] = Rx [p] ;
#endif
#endif
}
#endif
Ai [cp] = i ;
#ifdef DO_VALUES
- Ax [cp] = Rx [p] ;
#ifdef COMPLEX
- Az [cp] = Rz [p] ;
+ if (split)
+ {
+ Ax [cp] = Rx [p] ;
+ Az [cp] = Rz [p] ;
+ }
+ else
+ {
+ Ax [2*cp ] = Rx [2*p ] ;
+ Ax [2*cp+1] = Rx [2*p+1] ;
+ }
+#else
+ Ax [cp] = Rx [p] ;
#endif
#endif
}
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ double dusage ;
Int e, nrows, ncols, nel, i, *Rows, *Cols, row, col, n_row, n_col, *E,
*Row_degree, *Row_tlen, *Col_degree, *Col_tlen, usage, n1 ;
- double dusage ;
Element *ep ;
Unit *p ;
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry xk ;
+ Entry *xp, *D, *Uval ;
Int k, deg, j, *ip, col, *Upos, *Uilen, pos,
*Uip, n, ulen, up, newUchain, npiv, n1, *Ui ;
- Entry *xp, xk, *D, *Uval ;
/* ---------------------------------------------------------------------- */
/* get parameters */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry xk ;
+ Entry *xp, *D, *Uval ;
Int k, deg, j, *ip, col, *Upos, *Uilen, kstart, kend, up,
*Uip, n, uhead, ulen, pos, npiv, n1, *Ui ;
- Entry *xp, xk, *D, *Uval ;
/* ---------------------------------------------------------------------- */
/* get parameters */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
#define Entry double
-#define REAL_COMPONENT(c) (c)
-#define IMAG_COMPONENT(c) (0.)
-#define ASSIGN(c,s1,s2) { (c) = (s1) ; }
+#define SPLIT(s) (1)
+#define REAL_COMPONENT(c) (c)
+#define IMAG_COMPONENT(c) (0.)
+#define ASSIGN(c,s1,s2,p,split) { (c) = (s1)[p] ; }
#define CLEAR(c) { (c) = 0. ; }
#define CLEAR_AND_INCREMENT(p) { *p++ = 0. ; }
#define IS_NAN(a) SCALAR_IS_NAN (a)
#define IS_ZERO(a) SCALAR_IS_ZERO (a)
#define IS_NONZERO(a) SCALAR_IS_NONZERO (a)
#define SCALE_DIV(c,s) { (c) /= (s) ; }
-#ifndef NRECIPROCAL
-#define SCALE_RECIP(c,s) { (c) *= (s) ; }
-#endif
+#define SCALE(c,s) { (c) *= (s) ; }
#define ASSEMBLE(c,a) { (c) += (a) ; }
#define ASSEMBLE_AND_INCREMENT(c,p) { (c) += *p++ ; }
#define DECREMENT(c,a) { (c) -= (a) ; }
/* -------------------------------------------------------------------------- */
-/* c = (s1) + (s2)i */
-#define ASSIGN(c,s1,s2) \
+/* Return TRUE if a complex number is in split form, FALSE if in packed form */
+#define SPLIT(sz) ((sz) != (double *) NULL)
+
+/* -------------------------------------------------------------------------- */
+
+/* c = (s1) + (s2)*i, if s2 is null, then X is in "packed" format (compatible
+ * with Entry and ANSI C99 double _Complex type). */
+#define ASSIGN(c,s1,s2,p,split) \
{ \
- (c).Real = (s1) ; \
- (c).Imag = (s2) ; \
+ if (split) \
+ { \
+ (c).Real = (s1)[p] ; \
+ (c).Imag = (s2)[p] ; \
+ } \
+ else \
+ { \
+ (c) = ((Entry *)(s1))[p] ; \
+ } \
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
-/* c *= s, where s is the reciprocal scale factor. Not used if
- * NRECIPROCAL is defined at compile time. */
-#ifndef NRECIPROCAL
-#define SCALE_RECIP(c,s) \
+/* c *= s */
+#define SCALE(c,s) \
{ \
(c).Real *= (s) ; \
(c).Imag *= (s) ; \
}
-#endif
/* -------------------------------------------------------------------------- */
#define UMFPACK_get_lunz umfpack_di_get_lunz
#define UMFPACK_get_numeric umfpack_di_get_numeric
#define UMFPACK_get_symbolic umfpack_di_get_symbolic
+#define UMFPACK_get_determinant umfpack_di_get_determinant
#define UMFPACK_numeric umfpack_di_numeric
#define UMFPACK_qsymbolic umfpack_di_qsymbolic
#define UMFPACK_report_control umfpack_di_report_control
#define UMFPACK_get_lunz umfpack_dl_get_lunz
#define UMFPACK_get_numeric umfpack_dl_get_numeric
#define UMFPACK_get_symbolic umfpack_dl_get_symbolic
+#define UMFPACK_get_determinant umfpack_dl_get_determinant
#define UMFPACK_numeric umfpack_dl_numeric
#define UMFPACK_qsymbolic umfpack_dl_qsymbolic
#define UMFPACK_report_control umfpack_dl_report_control
#define UMFPACK_get_lunz umfpack_zi_get_lunz
#define UMFPACK_get_numeric umfpack_zi_get_numeric
#define UMFPACK_get_symbolic umfpack_zi_get_symbolic
+#define UMFPACK_get_determinant umfpack_zi_get_determinant
#define UMFPACK_numeric umfpack_zi_numeric
#define UMFPACK_qsymbolic umfpack_zi_qsymbolic
#define UMFPACK_report_control umfpack_zi_report_control
#define UMFPACK_get_lunz umfpack_zl_get_lunz
#define UMFPACK_get_numeric umfpack_zl_get_numeric
#define UMFPACK_get_symbolic umfpack_zl_get_symbolic
+#define UMFPACK_get_determinant umfpack_zl_get_determinant
#define UMFPACK_numeric umfpack_zl_numeric
#define UMFPACK_qsymbolic umfpack_zl_qsymbolic
#define UMFPACK_report_control umfpack_zl_report_control
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
--- /dev/null
+/* ========================================================================== */
+/* === UMFPACK_get_determinant ============================================== */
+/* ========================================================================== */
+
+/* -------------------------------------------------------------------------- */
+/* UMFPACK Version 4.4, 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 */
+/* -------------------------------------------------------------------------- */
+
+/*
+ User-callable. From the LU factors, scale factor, and permutation vectors
+ held in the Numeric object, calculates the determinant of the matrix A.
+ See umfpack_get_determinant.h for a more detailed description.
+
+ Dynamic memory usage: calls UMF_malloc once, for a total space of
+ n integers, and then frees all of it via UMF_free when done.
+
+ Contributed by David Bateman, Motorola, Nov. 2004.
+ Modified for V4.4, Jan. 2005.
+*/
+
+#include "umf_internal.h"
+#include "umf_valid_numeric.h"
+#include "umf_malloc.h"
+#include "umf_free.h"
+
+/* ========================================================================== */
+/* === rescale_determinant ================================================== */
+/* ========================================================================== */
+
+/* If the mantissa is too big or too small, rescale it and change exponent */
+
+PRIVATE Int rescale_determinant
+(
+ Entry *d_mantissa,
+ double *d_exponent
+)
+{
+ double d_abs ;
+
+ ABS (d_abs, *d_mantissa) ;
+
+ if (SCALAR_IS_ZERO (d_abs))
+ {
+ /* the determinant is zero */
+ *d_exponent = 0 ;
+ return (FALSE) ;
+ }
+
+ if (SCALAR_IS_NAN (d_abs))
+ {
+ /* the determinant is NaN */
+ return (FALSE) ;
+ }
+
+ while (d_abs < 1.)
+ {
+ SCALE (*d_mantissa, 10.0) ;
+ *d_exponent = *d_exponent - 1.0 ;
+ ABS (d_abs, *d_mantissa) ;
+ }
+
+ while (d_abs >= 10.)
+ {
+ SCALE (*d_mantissa, 0.1) ;
+ *d_exponent = *d_exponent + 1.0 ;
+ ABS (d_abs, *d_mantissa) ;
+ }
+
+ return (TRUE) ;
+}
+
+/* ========================================================================== */
+/* === UMFPACK_get_determinant ============================================== */
+/* ========================================================================== */
+
+GLOBAL Int UMFPACK_get_determinant
+(
+ double *Mx,
+#ifdef COMPLEX
+ double *Mz,
+#endif
+ double *Ex,
+ void *NumericHandle,
+ double User_Info [UMFPACK_INFO]
+)
+{
+ /* ---------------------------------------------------------------------- */
+ /* local variables */
+ /* ---------------------------------------------------------------------- */
+
+ Entry d_mantissa, d_tmp ;
+ double d_exponent, Info2 [UMFPACK_INFO], one [2] = {1.0, 0.0}, d_sign ;
+ Entry *D ;
+ double *Info, *Rs ;
+ NumericType *Numeric ;
+ Int i, n, itmp, npiv, *Wi, *Rperm, *Cperm, do_scale ;
+
+#ifndef NRECIPROCAL
+ Int do_recip ;
+#endif
+
+ /* ---------------------------------------------------------------------- */
+ /* check input parameters */
+ /* ---------------------------------------------------------------------- */
+
+ if (User_Info != (double *) NULL)
+ {
+ /* return Info in user's array */
+ Info = User_Info ;
+ }
+ else
+ {
+ /* no Info array passed - use local one instead */
+ Info = Info2 ;
+ for (i = 0 ; i < UMFPACK_INFO ; i++)
+ {
+ Info [i] = EMPTY ;
+ }
+ }
+
+ Info [UMFPACK_STATUS] = UMFPACK_OK ;
+
+ Numeric = (NumericType *) NumericHandle ;
+ if (!UMF_valid_numeric (Numeric))
+ {
+ Info [UMFPACK_STATUS] = UMFPACK_ERROR_invalid_Numeric_object ;
+ return (UMFPACK_ERROR_invalid_Numeric_object) ;
+ }
+
+ if (Numeric->n_row != Numeric->n_col)
+ {
+ /* only square systems can be handled */
+ Info [UMFPACK_STATUS] = UMFPACK_ERROR_invalid_system ;
+ return (UMFPACK_ERROR_invalid_system) ;
+ }
+
+ if (Mx == (double *) NULL)
+ {
+ Info [UMFPACK_STATUS] = UMFPACK_ERROR_argument_missing ;
+ return (UMFPACK_ERROR_argument_missing) ;
+ }
+
+ n = Numeric->n_row ;
+
+ /* ---------------------------------------------------------------------- */
+ /* allocate workspace */
+ /* ---------------------------------------------------------------------- */
+
+ Wi = (Int *) UMF_malloc (n, sizeof (Int)) ;
+
+ if (!Wi)
+ {
+ DEBUGm4 (("out of memory: get determinant\n")) ;
+ Info [UMFPACK_STATUS] = UMFPACK_ERROR_out_of_memory ;
+ return (UMFPACK_ERROR_out_of_memory) ;
+ }
+
+ /* ---------------------------------------------------------------------- */
+ /* compute the determinant */
+ /* ---------------------------------------------------------------------- */
+
+ Rs = Numeric->Rs ; /* row scale factors */
+ do_scale = (Rs != (double *) NULL) ;
+
+#ifndef NRECIPROCAL
+ do_recip = Numeric->do_recip ;
+#endif
+
+ d_mantissa = ((Entry *) one) [0] ;
+ d_exponent = 0.0 ;
+ D = Numeric->D ;
+
+ /* compute product of diagonal entries of U */
+ for (i = 0 ; i < n ; i++)
+ {
+ MULT (d_tmp, d_mantissa, D [i]) ;
+ d_mantissa = d_tmp ;
+
+ if (!rescale_determinant (&d_mantissa, &d_exponent))
+ {
+ /* the determinant is zero or NaN */
+ Info [UMFPACK_STATUS] = UMFPACK_WARNING_singular_matrix ;
+ /* no need to compute the determinant of R */
+ do_scale = FALSE ;
+ break ;
+ }
+ }
+
+ /* compute product of diagonal entries of R (or its inverse) */
+ if (do_scale)
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+#ifndef NRECIPROCAL
+ if (do_recip)
+ {
+ /* compute determinant of R inverse */
+ SCALE_DIV (d_mantissa, Rs [i]) ;
+ }
+ else
+#endif
+ {
+ /* compute determinant of R */
+ SCALE (d_mantissa, Rs [i]) ;
+ }
+ if (!rescale_determinant (&d_mantissa, &d_exponent))
+ {
+ /* the determinant is zero or NaN. This is very unlikey to
+ * occur here, since the scale factors for a tiny or zero row
+ * are set to 1. */
+ Info [UMFPACK_STATUS] = UMFPACK_WARNING_singular_matrix ;
+ break ;
+ }
+ }
+ }
+
+ /* ---------------------------------------------------------------------- */
+ /* determine if P and Q are odd or even permutations */
+ /* ---------------------------------------------------------------------- */
+
+ npiv = 0 ;
+ Rperm = Numeric->Rperm ;
+
+ for (i = 0 ; i < n ; i++)
+ {
+ Wi [i] = Rperm [i] ;
+ }
+
+ for (i = 0 ; i < n ; i++)
+ {
+ while (Wi [i] != i)
+ {
+ itmp = Wi [Wi [i]] ;
+ Wi [Wi [i]] = Wi [i] ;
+ Wi [i] = itmp ;
+ npiv++ ;
+ }
+ }
+
+ Cperm = Numeric->Cperm ;
+
+ for (i = 0 ; i < n ; i++)
+ {
+ Wi [i] = Cperm [i] ;
+ }
+
+ for (i = 0 ; i < n ; i++)
+ {
+ while (Wi [i] != i)
+ {
+ itmp = Wi [Wi [i]] ;
+ Wi [Wi [i]] = Wi [i] ;
+ Wi [i] = itmp ;
+ npiv++ ;
+ }
+ }
+
+ /* if npiv is odd, the sign is -1. if it is even, the sign is +1 */
+ d_sign = (npiv % 2) ? -1. : 1. ;
+
+ /* ---------------------------------------------------------------------- */
+ /* free workspace */
+ /* ---------------------------------------------------------------------- */
+
+ (void) UMF_free ((void *) Wi) ;
+
+ /* ---------------------------------------------------------------------- */
+ /* compute the magnitude and exponent of the determinant */
+ /* ---------------------------------------------------------------------- */
+
+ if (Ex == (double *) NULL)
+ {
+ /* Ex is not provided, so return the entire determinant in d_mantissa */
+ SCALE (d_mantissa, pow (10.0, d_exponent)) ;
+ }
+ else
+ {
+ Ex [0] = d_exponent ;
+ }
+
+ Mx [0] = d_sign * REAL_COMPONENT (d_mantissa) ;
+
+#ifdef COMPLEX
+ if (SPLIT (Mz))
+ {
+ Mz [0] = d_sign * IMAG_COMPONENT (d_mantissa) ;
+ }
+ else
+ {
+ Mx [1] = d_sign * IMAG_COMPONENT (d_mantissa) ;
+ }
+#endif
+
+ /* determine if the determinant has (or will) overflow or underflow */
+ if (d_exponent + 1.0 > log10 (DBL_MAX))
+ {
+ Info [UMFPACK_STATUS] = UMFPACK_WARNING_determinant_overflow ;
+ }
+ else if (d_exponent - 1.0 < log10 (DBL_MIN))
+ {
+ Info [UMFPACK_STATUS] = UMFPACK_WARNING_determinant_underflow ;
+ }
+
+ return (UMFPACK_OK) ;
+}
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* allocate workspace */
/* ---------------------------------------------------------------------- */
-#ifdef COMPLEX
- getL = Lp && Lj && Lx && Lz ;
- getU = Up && Ui && Ux && Uz ;
-#else
getL = Lp && Lj && Lx ;
getU = Up && Ui && Ux ;
-#endif
if (getL || getU)
{
if (Dx != (double *) NULL)
{
D = Numeric->D ;
- for (k = 0 ; k < n_inner ; k++)
+#ifdef COMPLEX
+ if (SPLIT (Dz))
{
- Dx [k] = REAL_COMPONENT (D [k]) ;
+ for (k = 0 ; k < n_inner ; k++)
+ {
+ Dx [k] = REAL_COMPONENT (D [k]) ;
+ Dz [k] = IMAG_COMPONENT (D [k]) ;
+ }
}
- }
-
-#ifdef COMPLEX
- if (Dz != (double *) NULL)
- {
- D = Numeric->D ;
- for (k = 0 ; k < n_inner ; k++)
+ else
{
- Dz [k] = IMAG_COMPONENT (D [k]) ;
+ for (k = 0 ; k < n_inner ; k++)
+ {
+ Dx [2*k ] = REAL_COMPONENT (D [k]) ;
+ Dx [2*k+1] = IMAG_COMPONENT (D [k]) ;
+ }
+ }
+#else
+ {
+ D = Numeric->D ;
+ for (k = 0 ; k < n_inner ; k++)
+ {
+ Dx [k] = D [k] ;
+ }
}
- }
#endif
+ }
/* return the flag stating whether the scale factors are to be multiplied,
* or divided. If do_recip is TRUE, multiply. Otherwise, divided.
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry value ;
+ Entry *xp, *Lval ;
Int deg, *ip, j, row, n_row, n_col, n_inner, *Lpos, *Lilen, *Lip, p, llen,
- lnz2, lp, newLchain, k, pos, npiv, *Li, n1 ;
- Entry *xp, value, *Lval ;
+ lnz2, lp, newLchain, k, pos, npiv, *Li, n1 ;
+#ifdef COMPLEX
+ Int split = SPLIT (Lz) ;
+#endif
/* ---------------------------------------------------------------------- */
/* get parameters */
{
p = Wi [row]++ ;
Lj [p] = k ;
- Lx [p] = REAL_COMPONENT (value) ;
#ifdef COMPLEX
- Lz [p] = IMAG_COMPONENT (value) ;
+ if (split)
+ {
+
+ Lx [p] = REAL_COMPONENT (value) ;
+ Lz [p] = IMAG_COMPONENT (value) ;
+ }
+ else
+ {
+ Lx [2*p ] = REAL_COMPONENT (value) ;
+ Lx [2*p+1] = IMAG_COMPONENT (value) ;
+ }
+#else
+ Lx [p] = value ;
#endif
}
}
{
p = Wi [row]++ ;
Lj [p] = k ;
- Lx [p] = REAL_COMPONENT (value) ;
#ifdef COMPLEX
- Lz [p] = IMAG_COMPONENT (value) ;
+ if (split)
+ {
+ Lx [p] = REAL_COMPONENT (value) ;
+ Lz [p] = IMAG_COMPONENT (value) ;
+ }
+ else
+ {
+ Lx [2*p ] = REAL_COMPONENT (value) ;
+ Lx [2*p+1] = IMAG_COMPONENT (value) ;
+ }
+#else
+ Lx [p] = value ;
#endif
}
}
{
p = Wi [row]++ ;
Lj [p] = row ;
- Lx [p] = 1. ;
+
#ifdef COMPLEX
- Lz [p] = 0. ;
+ if (split)
+ {
+ Lx [p] = 1. ;
+ Lz [p] = 0. ;
+ }
+ else
+ {
+ Lx [2*p ] = 1. ;
+ Lx [2*p+1] = 0. ;
+ }
+#else
+ Lx [p] = 1. ;
#endif
+
ASSERT (Wi [row] == Lp [row+1]) ;
}
/* local variables */
/* ---------------------------------------------------------------------- */
+ Entry value ;
+ Entry *xp, *D, *Uval ;
Int deg, j, *ip, col, *Upos, *Uilen, *Uip, n_col, ulen, *Usi,
- unz2, p, k, up, newUchain, pos, npiv, n1 ;
- Entry *xp, *D, value, *Uval ;
-
+ unz2, p, k, up, newUchain, pos, npiv, n1 ;
+#ifdef COMPLEX
+ Int split = SPLIT (Uz) ;
+#endif
#ifndef NDEBUG
Int nnzpiv = 0 ;
#endif
{
p = --(Wi [col]) ;
Ui [p] = col ;
- Ux [p] = REAL_COMPONENT (D [col]) ;
#ifdef COMPLEX
- Uz [p] = IMAG_COMPONENT (D [col]) ;
+ if (split)
+ {
+
+ Ux [p] = REAL_COMPONENT (D [col]) ;
+ Uz [p] = IMAG_COMPONENT (D [col]) ;
+ }
+ else
+ {
+ Ux [2*p ] = REAL_COMPONENT (D [col]) ;
+ Ux [2*p+1] = IMAG_COMPONENT (D [col]) ;
+ }
+#else
+ Ux [p] = D [col] ;
#endif
}
}
{
p = --(Wi [col]) ;
Ui [p] = k ;
- Ux [p] = REAL_COMPONENT (value) ;
#ifdef COMPLEX
- Uz [p] = IMAG_COMPONENT (value) ;
+ if (split)
+ {
+ Ux [p] = REAL_COMPONENT (value) ;
+ Uz [p] = IMAG_COMPONENT (value) ;
+ }
+ else
+ {
+ Ux [2*p ] = REAL_COMPONENT (value) ;
+ Ux [2*p+1] = IMAG_COMPONENT (value) ;
+ }
+#else
+ Ux [p] = value ;
#endif
+
}
}
{
p = --(Wi [col]) ;
Ui [p] = k ;
- Ux [p] = REAL_COMPONENT (value) ;
#ifdef COMPLEX
- Uz [p] = IMAG_COMPONENT (value) ;
+ if (split)
+ {
+ Ux [p] = REAL_COMPONENT (value) ;
+ Uz [p] = IMAG_COMPONENT (value) ;
+ }
+ else
+ {
+ Ux [2*p ] = REAL_COMPONENT (value) ;
+ Ux [2*p+1] = IMAG_COMPONENT (value) ;
+ }
+#else
+ Ux [p] = value ;
#endif
}
}
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ double Info2 [UMFPACK_INFO], alloc_init, relpt, relpt2, droptol,
+ front_alloc_init, stats [2] ;
+ double *Info ;
+ WorkType WorkSpace, *Work ;
NumericType *Numeric ;
SymbolicType *Symbolic ;
- WorkType WorkSpace, *Work ;
Int n_row, n_col, n_inner, newsize, i, status, *inew, npiv, ulen, scale ;
Unit *mnew ;
- double Info2 [UMFPACK_INFO], *Info, alloc_init, relpt, relpt2, droptol,
- front_alloc_init, stats [2] ;
/* ---------------------------------------------------------------------- */
/* get the amount of time used by the process so far */
alloc_init = GET_CONTROL (UMFPACK_ALLOC_INIT, UMFPACK_DEFAULT_ALLOC_INIT) ;
front_alloc_init = GET_CONTROL (UMFPACK_FRONT_ALLOC_INIT,
UMFPACK_DEFAULT_FRONT_ALLOC_INIT) ;
- scale = (Int) GET_CONTROL (UMFPACK_SCALE, UMFPACK_DEFAULT_SCALE) ;
+ scale = GET_CONTROL (UMFPACK_SCALE, UMFPACK_DEFAULT_SCALE) ;
droptol = GET_CONTROL (UMFPACK_DROPTOL, UMFPACK_DEFAULT_DROPTOL) ;
relpt = MAX (0.0, MIN (relpt, 1.0)) ;
Info [UMFPACK_NCOL] = n_col ;
Info [UMFPACK_SIZE_OF_UNIT] = (double) (sizeof (Unit)) ;
- if (!Ap || !Ai || !Ax || !NumericHandle
-#ifdef COMPLEX
- || !Az
-#endif
- )
+ if (!Ap || !Ai || !Ax || !NumericHandle)
{
Info [UMFPACK_STATUS] = UMFPACK_ERROR_argument_missing ;
return (UMFPACK_ERROR_argument_missing) ;
Int scale
)
{
+ double nsize, bsize ;
Int n_row, n_col, n_inner, min_usage, trying ;
NumericType *Numeric ;
- double nsize, bsize ;
DEBUG0 (("numeric alloc:\n")) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
AMD_1 (n, Ap, Ai, Q, Qinv, Sdeg, Clen, Ci, amd_Control, amd_Info) ;
/* return estimates computed from AMD on PA+PA' */
- Symbolic->amd_dmax = (Int) amd_Info [AMD_DMAX] ;
+ Symbolic->amd_dmax = amd_Info [AMD_DMAX] ;
Symbolic->amd_lunz = 2 * amd_Info [AMD_LNZ] + n ;
Info [UMFPACK_SYMMETRIC_LUNZ] = Symbolic->amd_lunz ;
Info [UMFPACK_SYMMETRIC_FLOPS] = DIV_FLOPS * amd_Info [AMD_NDIV] +
)
{
Int row, k, pp, p, oldcol, newcol, newrow, nzdiag, do_nzdiag ;
-
- nzdiag = 0 ;
- do_nzdiag = (Ax != (double *) NULL)
#ifdef COMPLEX
- && (Az != (double *) NULL)
+ Int split = SPLIT (Az) ;
#endif
- ;
+
+ nzdiag = 0 ;
+ do_nzdiag = (Ax != (double *) NULL) ;
#ifndef NDEBUG
DEBUGm4 (("Prune : S = A (Cperm1 (n1+1:end), Rperm1 (n1+1:end))\n")) ;
if (newrow == newcol)
{
/* this is the diagonal entry */
- if (SCALAR_IS_NONZERO (Ax [p])
#ifdef COMPLEX
- || SCALAR_IS_NONZERO (Az [p])
-#endif
- )
+ if (split)
+ {
+ if (SCALAR_IS_NONZERO (Ax [p]) ||
+ SCALAR_IS_NONZERO (Az [p]))
+ {
+ nzdiag++ ;
+ }
+ }
+ else
+ {
+ if (SCALAR_IS_NONZERO (Ax [2*p ]) ||
+ SCALAR_IS_NONZERO (Ax [2*p+1]))
+ {
+ nzdiag++ ;
+ }
+ }
+#else
+ if (SCALAR_IS_NONZERO (Ax [p]))
{
nzdiag++ ;
}
+#endif
}
}
}
}
Sp [n_col - n1] = pp ;
- ASSERT (AMD_valid (n_row - n1, n_col - n1, Sp, Si)) ;
return (nzdiag) ;
}
/* local variables */
/* ---------------------------------------------------------------------- */
+ double knobs [COLAMD_KNOBS], flops, f, r, c, force_fixQ,
+ Info2 [UMFPACK_INFO], drow, dcol, dtail_usage, dlf, duf, dmax_usage,
+ dhead_usage, dlnz, dunz, dmaxfrsize, dClen, dClen_analyze, sym,
+ amd_Info [AMD_INFO], dClen_amd, dr, dc, cr, cc, cp,
+ amd_Control [AMD_CONTROL], stats [2], tol ;
+ double *Info ;
Int i, nz, j, newj, status, f1, f2, maxnrows, maxncols, nfr, col,
nchains, maxrows, maxcols, p, nb, nn, *Chain_start, *Chain_maxrows,
*Chain_maxcols, *Front_npivcol, *Ci, Clen, colamd_stats [COLAMD_STATS],
*Fr_cols, nempty_row, nempty_col, user_auto_strategy, fail, max_rdeg,
head_usage, tail_usage, lnz, unz, esize, *Esize, rdeg, *Cdeg, *Rdeg,
*Cperm1, *Rperm1, n1, oldcol, newcol, n1c, n1r, *Rperm_2by2, oldrow,
- dense_row_threshold, tlen, aggressive ;
- double knobs [COLAMD_KNOBS], flops, f, r, c, *Info, force_fixQ,
- Info2 [UMFPACK_INFO], drow, dcol, dtail_usage, dlf, duf, dmax_usage,
- dhead_usage, dlnz, dunz, dmaxfrsize, dClen, dClen_analyze, sym,
- amd_Info [AMD_INFO], dClen_amd, dr, dc, cr, cc, cp,
- amd_Control [AMD_CONTROL], stats [2], tol, scale ;
+ dense_row_threshold, tlen, aggressive, scale, *Rp, *Ri ;
+
SymbolicType *Symbolic ;
SWType SWspace, *SW ;
drow = GET_CONTROL (UMFPACK_DENSE_ROW, UMFPACK_DEFAULT_DENSE_ROW) ;
dcol = GET_CONTROL (UMFPACK_DENSE_COL, UMFPACK_DEFAULT_DENSE_COL) ;
- nb = (Int) GET_CONTROL (UMFPACK_BLOCK_SIZE, UMFPACK_DEFAULT_BLOCK_SIZE) ;
- strategy = (Int) GET_CONTROL (UMFPACK_STRATEGY, UMFPACK_DEFAULT_STRATEGY) ;
+ nb = GET_CONTROL (UMFPACK_BLOCK_SIZE, UMFPACK_DEFAULT_BLOCK_SIZE) ;
+ strategy = GET_CONTROL (UMFPACK_STRATEGY, UMFPACK_DEFAULT_STRATEGY) ;
tol = GET_CONTROL (UMFPACK_2BY2_TOLERANCE, UMFPACK_DEFAULT_2BY2_TOLERANCE) ;
scale = GET_CONTROL (UMFPACK_SCALE, UMFPACK_DEFAULT_SCALE) ;
force_fixQ = GET_CONTROL (UMFPACK_FIXQ, UMFPACK_DEFAULT_FIXQ) ;
strategy = UMFPACK_STRATEGY_AUTO ;
}
+ if (Quser != (Int *) NULL)
+ {
+ /* when the user provides Q, only symmetric and unsymmetric strategies
+ * are available */
+ if (strategy == UMFPACK_STRATEGY_2BY2)
+ {
+ strategy = UMFPACK_STRATEGY_SYMMETRIC ;
+ }
+ if (strategy != UMFPACK_STRATEGY_SYMMETRIC)
+ {
+ strategy = UMFPACK_STRATEGY_UNSYMMETRIC ;
+ }
+ }
+
user_auto_strategy = (strategy == UMFPACK_STRATEGY_AUTO) ;
/* ---------------------------------------------------------------------- */
Clen = UMF_COLAMD_RECOMMENDED (nz, n_row, n_col) ;
Clen_analyze = UMF_ANALYZE_CLEN (nz, n_row, n_col, nn) ;
Clen = MAX (Clen, Clen_analyze) ;
- Clen_amd = (Int) (2.4 * nz + 8 * n_inner) ;
+ Clen_amd = 2.4 * nz + 8 * n_inner ;
Clen_amd += MAX (nn, nz) ; /* for Ri, in UMF_2by2 */
Clen = MAX (Clen, Clen_amd) ;
* and use Rperm_init as workspace */
ASSERT (Clen >= nz + n_row + MAX (n_row, n_col)) ;
- status = UMF_singletons (n_row, n_col, Ap, Ai, Quser, Cdeg, Cperm1, Rdeg,
+ status = UMF_singletons (n_row, n_col, Ap, Ai, Quser, strategy,
+ Cdeg, Cperm1, Rdeg,
Rperm1, InvRperm1, &n1, &n1c, &n1r, &nempty_col, &nempty_row, &is_sym,
&max_rdeg, /* workspace: */ Rperm_init, Ci, Ci + nz, Ci + nz + n_row) ;
{
/* either the pruned submatrix rectangular, or it is square and
* Rperm [n1 .. n-nempty-1] is not the same as Cperm [n1 .. n-nempty-1].
- * For the auto strategy, switch to the unsymmetric strategy.
- * Otherwise, if the strategy selected by the user is symmetric or
- * 2-by-2, then the singletons will be discarded. */
+ * Switch to the unsymmetric strategy, ignoring user-requested
+ * strategy. */
strategy = UMFPACK_STRATEGY_UNSYMMETRIC ;
DEBUGm4 (("Strategy: Unsymmetric singletons\n")) ;
}
, Rperm1, nn
#endif
) ;
- nzaat = AMD_aat (n2, Sp, Si, Sdeg, Wq, amd_Info) ;
+
+ /* use Ci as workspace to sort S into R, if needed [ */
+ if (Quser != (Int *) NULL)
+ {
+ /* need to sort the columns of S first */
+ Rp = Ci ;
+ Ri = Ci + (n_row) + 1 ;
+ (void) UMF_transpose (n2, n2, Sp, Si, (double *) NULL,
+ (Int *) NULL, (Int *) NULL, 0,
+ Rp, Ri, (double *) NULL, Wq, FALSE
+#ifdef COMPLEX
+ , (double *) NULL, (double *) NULL, FALSE
+#endif
+ ) ;
+ }
+ else
+ {
+ /* S already has sorted columns */
+ Rp = Sp ;
+ Ri = Si ;
+ }
+ ASSERT (AMD_valid (n2, n2, Rp, Ri)) ;
+
+ nzaat = AMD_aat (n2, Rp, Ri, Sdeg, Wq, amd_Info) ;
sym = amd_Info [AMD_SYMMETRY] ;
Info [UMFPACK_N2] = n2 ;
/* nzdiag = amd_Info [AMD_NZDIAG] counts the zero entries of S too */
+ /* done using Ci as workspace to sort S into R ] */
+
#ifndef NDEBUG
for (k = 0 ; k < n2 ; k++)
{
ASSERT (Sp [n2] - n2 <= nzaat && nzaat <= 2 * Sp [n2]) ;
DEBUG0 (("Explicit zeros: "ID" %g\n", nzdiag, amd_Info [AMD_NZDIAG])) ;
#endif
+
}
/* get statistics from amd_aat, if computed */
if (strategy == UMFPACK_STRATEGY_2BY2)
{
- Int *Rp, *Ri, *Blen, *W, nz_papat, nzd2, nweak, unmatched,
- Clen3 ;
double sym2 ;
+ Int *Blen, *W, nz_papat, nzd2, nweak, unmatched, Clen3 ;
/* ------------------------------------------------------------------ */
/* get workspace for UMF_2by2 */
#ifdef COMPLEX
Az,
#endif
- tol, (Int) scale, Cperm1,
+ tol, scale, Cperm1,
#ifndef NDEBUG
Rperm1,
#endif
}
nz_papat = AMD_aat (n2, Rp, Ri, Sdeg, Wq, amd_Info) ;
sym2 = amd_Info [AMD_SYMMETRY] ;
- nzd2 = (Int) amd_Info [AMD_NZDIAG] ;
+ nzd2 = amd_Info [AMD_NZDIAG] ;
Info [UMFPACK_2BY2_PATTERN_SYMMETRY] = sym2 ;
Info [UMFPACK_2BY2_NZ_PA_PLUS_PAT] = nz_papat ;
/* empty rows go to dummy front nfr */
for (row = 0 ; row < n_row ; row++)
{
- InFront [row] = nfr ;
+ InFront [row] = nfr ;
}
/* assign the singleton pivot rows to the "empty" front */
for (k = 0 ; k < n1 ; k++)
Entry aij ;
oldrow = Ai [p] ;
newrow = Ci [oldrow] ;
- if (Ax != (double *) NULL
-#ifdef COMPLEX
- && Az != (double *) NULL
-#endif
- )
+ if (Ax != (double *) NULL)
{
- ASSIGN (aij, Ax [p], Az [p]) ;
+ ASSIGN (aij, Ax, Az, p, SPLIT (Az)) ;
}
if (oldrow == oldcol)
{
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
)
{
- Int prl, nb, irstep, strategy, scale, s ;
double drow, dcol, relpt, relpt2, alloc_init, front_alloc_init, amd_alpha,
tol, force_fixQ, droptol, aggr ;
+ Int prl, nb, irstep, strategy, scale, s ;
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl < 2)
{
/* block size */
/* ---------------------------------------------------------------------- */
- nb = (Int) GET_CONTROL (UMFPACK_BLOCK_SIZE, UMFPACK_DEFAULT_BLOCK_SIZE) ;
+ nb = GET_CONTROL (UMFPACK_BLOCK_SIZE, UMFPACK_DEFAULT_BLOCK_SIZE) ;
nb = MAX (1, nb) ;
PRINTF ((" "ID": block size for dense matrix kernels: "ID"\n",
(Int) INDEX (UMFPACK_BLOCK_SIZE), nb)) ;
/* strategy */
/* ---------------------------------------------------------------------- */
- strategy = (Int) GET_CONTROL (UMFPACK_STRATEGY, UMFPACK_DEFAULT_STRATEGY) ;
+ strategy = GET_CONTROL (UMFPACK_STRATEGY, UMFPACK_DEFAULT_STRATEGY) ;
if (strategy < UMFPACK_STRATEGY_AUTO
|| strategy > UMFPACK_STRATEGY_SYMMETRIC)
{
}
else
{
- s =(Int) -alloc_init ;
+ s = -alloc_init ;
s = MAX (1, s) ;
PRINTF ((" "ID": initial allocation (in Units): "ID"\n",
(Int) INDEX (UMFPACK_ALLOC_INIT), s)) ;
/* maximum iterative refinement steps */
/* ---------------------------------------------------------------------- */
- irstep = (Int) GET_CONTROL (UMFPACK_IRSTEP, UMFPACK_DEFAULT_IRSTEP) ;
+ irstep = GET_CONTROL (UMFPACK_IRSTEP, UMFPACK_DEFAULT_IRSTEP) ;
irstep = MAX (0, irstep) ;
PRINTF ((" "ID": max iterative refinement steps: "ID"\n",
(Int) INDEX (UMFPACK_IRSTEP), irstep)) ;
/* scaling */
/* ---------------------------------------------------------------------- */
- scale = (Int) GET_CONTROL (UMFPACK_SCALE, UMFPACK_DEFAULT_SCALE) ;
+ scale = GET_CONTROL (UMFPACK_SCALE, UMFPACK_DEFAULT_SCALE) ;
if (scale != UMFPACK_SCALE_NONE && scale != UMFPACK_SCALE_MAX)
{
scale = UMFPACK_DEFAULT_SCALE ;
}
else
{
- s = (Int) -front_alloc_init ;
+ s = -front_alloc_init ;
s = MAX (1, s) ;
PRINTF ((" "ID": initial frontal matrix size (# of Entry's): "ID"\n",
(Int) INDEX (UMFPACK_FRONT_ALLOC_INIT), s)) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* get control settings and status to determine what to print */
/* ---------------------------------------------------------------------- */
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (!Info || prl < 2)
{
Info [UMFPACK_NEMPTY_ROW]) ;
PRINT_INFO (" number of empty columns %.0f\n",
Info [UMFPACK_NEMPTY_COL]) ;
- is_sym = (Int) Info [UMFPACK_S_SYMMETRIC] ;
+ is_sym = Info [UMFPACK_S_SYMMETRIC] ;
if (is_sym > 0)
{
PRINTF ((" submatrix S square and diagonal preserved\n")) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
*/
#include "umf_internal.h"
-#include "umf_malloc.h"
-#include "umf_free.h"
GLOBAL Int UMFPACK_report_matrix
(
const double Control [UMFPACK_CONTROL]
)
{
+ Entry a ;
Int prl, i, k, length, ilast, p, nz, prl1, p1, p2, n, n_i, do_values ;
char *vector, *index ;
- Entry a ;
+#ifdef COMPLEX
+ Int split = SPLIT (Az) ;
+#endif
/* ---------------------------------------------------------------------- */
/* determine the form, and check if inputs exist */
/* ---------------------------------------------------------------------- */
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl <= 2)
{
return (UMFPACK_ERROR_argument_missing) ;
}
-#ifdef COMPLEX
- do_values = Ax && Az ;
-#else
do_values = Ax != (double *) NULL ;
-#endif
PRINTF4 (("\n")) ;
if (do_values && prl >= 4)
{
PRINTF ((":")) ;
- ASSIGN (a, Ax [p], Az [p]) ;
+ ASSIGN (a, Ax, Az, p, split) ;
PRINT_ENTRY (a) ;
}
if (i < 0 || i >= n_i)
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
npiv ;
NumericType *Numeric ;
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl <= 2)
{
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 prl, *W, status ;
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl <= 2)
{
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* get control settings and status to determine what to print */
/* ---------------------------------------------------------------------- */
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl < 1)
{
if (status == UMFPACK_OK && prl <= 1)
{
- /* no output generated if prl is 1 or less and no error occured. */
+ /* no output generated if prl is 1 or less and no error occurred. */
/* note that the default printing level is 1. */
return ;
}
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
*Front_leftmostdesc, *Front_parent, done, status1, status2 ;
SymbolicType *Symbolic ;
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl <= 2)
{
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
const double Control [UMFPACK_CONTROL]
)
{
- Int prl, prl1, k, i, j, do_values ;
Entry t ;
+ Int prl, prl1, k, i, j, do_values ;
+#ifdef COMPLEX
+ Int split = SPLIT (Tz) ;
+#endif
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl <= 2)
{
PRINTF4 (("\n")) ;
-#ifdef COMPLEX
- do_values = Tx && Tz ;
-#else
do_values = Tx != (double *) NULL ;
-#endif
prl1 = prl ;
for (k = 0 ; k < nz ; k++)
PRINTF4 ((" "ID" : "ID" "ID" ", INDEX (k), INDEX (i), INDEX (j))) ;
if (do_values && prl >= 4)
{
- ASSIGN (t, Tx [k], Tz [k]) ;
+ ASSIGN (t, Tx, Tz, k, split) ;
PRINT_ENTRY (t) ;
}
PRINTF4 (("\n")) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
double *Xz = (double *) NULL ;
#endif
- prl = (Int) GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
+ prl = GET_CONTROL (UMFPACK_PRL, UMFPACK_DEFAULT_PRL) ;
if (prl <= 2)
{
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
NumericType *Numeric ;
Int n, i ;
double *Rs ;
+#ifdef COMPLEX
+ Int split = SPLIT (Xz) && SPLIT (Bz) ;
+#endif
Numeric = (NumericType *) NumericHandle ;
if (!UMF_valid_numeric (Numeric))
n = Numeric->n_row ;
Rs = Numeric->Rs ;
- if (!Xx || !Bx
-#ifdef COMPLEX
- || !Xz || !Bz
-#endif
- )
+ if (!Xx || !Bx)
{
return (UMFPACK_ERROR_argument_missing) ;
}
if (Numeric->do_recip)
{
/* multiply by the scale factors */
+#ifdef COMPLEX
+ if (split)
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [i] = Bx [i] * Rs [i] ;
+ Xz [i] = Bz [i] * Rs [i] ;
+ }
+ }
+ else
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [2*i ] = Bx [2*i ] * Rs [i] ;
+ Xx [2*i+1] = Bx [2*i+1] * Rs [i] ;
+ }
+ }
+#else
for (i = 0 ; i < n ; i++)
{
Xx [i] = Bx [i] * Rs [i] ;
-#ifdef COMPLEX
- Xz [i] = Bz [i] * Rs [i] ;
-#endif
}
+#endif
}
else
#endif
{
/* divide by the scale factors */
+#ifdef COMPLEX
+ if (split)
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [i] = Bx [i] / Rs [i] ;
+ Xz [i] = Bz [i] / Rs [i] ;
+ }
+ }
+ else
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [2*i ] = Bx [2*i ] / Rs [i] ;
+ Xx [2*i+1] = Bx [2*i+1] / Rs [i] ;
+ }
+ }
+#else
for (i = 0 ; i < n ; i++)
{
Xx [i] = Bx [i] / Rs [i] ;
-#ifdef COMPLEX
- Xz [i] = Bz [i] / Rs [i] ;
-#endif
}
+#endif
}
}
else
{
/* no scale factors, just copy B into X */
+#ifdef COMPLEX
+ if (split)
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [i] = Bx [i] ;
+ Xz [i] = Bz [i] ;
+ }
+ }
+ else
+ {
+ for (i = 0 ; i < n ; i++)
+ {
+ Xx [2*i ] = Bx [2*i ] ;
+ Xx [2*i+1] = Bx [2*i+1] ;
+ }
+ }
+#else
for (i = 0 ; i < n ; i++)
{
Xx [i] = Bx [i] ;
-#ifdef COMPLEX
- Xz [i] = Bz [i] ;
-#endif
}
+#endif
}
return (UMFPACK_OK) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* local variables */
/* ---------------------------------------------------------------------- */
+ double Info2 [UMFPACK_INFO], stats [2] ;
+ double *Info ;
NumericType *Numeric ;
Int n, i, irstep, status ;
- double Info2 [UMFPACK_INFO], *Info, /* tstart, tend */ stats [2] ;
#ifndef WSOLVE
Int *Pattern, wsize ;
double *W ;
/* get parameters */
/* ---------------------------------------------------------------------- */
- irstep = (Int) GET_CONTROL (UMFPACK_IRSTEP, UMFPACK_DEFAULT_IRSTEP) ;
+ irstep = GET_CONTROL (UMFPACK_IRSTEP, UMFPACK_DEFAULT_IRSTEP) ;
if (User_Info != (double *) NULL)
{
irstep = 0 ;
}
- if (!Xx || !Bx
-#ifdef COMPLEX
- || !Xz || !Bz
-#endif
- )
+ if (!Xx || !Bx)
{
Info [UMFPACK_STATUS] = UMFPACK_ERROR_argument_missing ;
return (UMFPACK_ERROR_argument_missing) ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* stats [0]: current wallclock time, in seconds */
/* stats [1]: user + system time for the process, in seconds */
- struct tms t ;
double ticks ;
+ struct tms t ;
ticks = (double) sysconf (_SC_CLK_TCK) ;
stats [0] = (double) times (&t) / ticks ;
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
User-callable. Returns the time in seconds used by the process. BE
CAREFUL: if you compare the run time of UMFPACK with other sparse matrix
packages, be sure to use the same timer. See umfpack_timer.h for details.
- This was the timer used internally by UMFPACK Version 4.0. See
- umfpack_tictoc.h, which is the timer now used internally by UMFPACK V4.1.
+ See umfpack_tictoc.h, which is the timer used internally by UMFPACK.
*/
#ifdef NO_TIMER
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
-/* UMFPACK Version 4.3 (Jan. 16, 2004), Copyright (c) 2004 by Timothy A. */
-/* Davis. All Rights Reserved. See ../README for License. */
-/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
+/* UMFPACK Version 4.4, 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 */
/* -------------------------------------------------------------------------- */
User callable. Converts triplet input to column-oriented form. Duplicate
entries may exist (they are summed in the output). The columns of the
column-oriented form are in sorted order. The input is not modified.
- Returns 1 if OK, 0 if an error occured. See umfpack_triplet_to_col.h for
+ Returns 1 if OK, 0 if an error occurred. See umfpack_triplet_to_col.h for
details.
If Map is present (a non-NULL pointer to an Int array of size nz), then on
/* ---------------------------------------------------------------------- */
Int *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
- double *Rx, *Rz ;
+ double *Rx ;
+#ifdef COMPLEX
+ double *Rz ;
+ Int split ;
+#endif
#ifndef NDEBUG
UMF_dump_start ( ) ;
/* ---------------------------------------------------------------------- */
Rx = (double *) NULL ;
- Rz = (double *) NULL ;
-#ifdef COMPLEX
- do_values = Ax && Tx && Az && Tz ;
+ do_values = Ax && Tx ;
+
if (do_values)
{
- Rx = (double *) UMF_malloc (nz+1, sizeof (double)) ;
- Rz = (double *) UMF_malloc (nz+1, sizeof (double)) ;
- if (!Rx || !Rz)
+#ifdef COMPLEX
+ Rx = (double *) UMF_malloc (2*nz+2, sizeof (double)) ;
+ split = SPLIT (Tz) && SPLIT (Az) ;
+ if (split)
{
- DEBUGm4 (("out of memory: triplet work (complex)\n")) ;
- (void) UMF_free ((void *) Rx) ;
- (void) UMF_free ((void *) Rz) ;
- ASSERT (UMF_malloc_count == init_count) ;
- return (UMFPACK_ERROR_out_of_memory) ;
+ Rz = Rx + nz ;
+ }
+ else
+ {
+ Rz = (double *) NULL ;
}
- }
#else
- do_values = Ax && Tx ;
- if (do_values)
- {
Rx = (double *) UMF_malloc (nz+1, sizeof (double)) ;
+#endif
if (!Rx)
{
- DEBUGm4 (("out of memory: triplet work (real)\n")) ;
+ DEBUGm4 (("out of memory: triplet work \n")) ;
ASSERT (UMF_malloc_count == init_count) ;
return (UMFPACK_ERROR_out_of_memory) ;
}
}
-#endif
do_map = (Map != (Int *) NULL) ;
Map2 = (Int *) NULL ;
{
DEBUGm4 (("out of memory: triplet map\n")) ;
(void) UMF_free ((void *) Rx) ;
- (void) UMF_free ((void *) Rz) ;
ASSERT (UMF_malloc_count == init_count) ;
return (UMFPACK_ERROR_out_of_memory) ;
}
{
DEBUGm4 (("out of memory: triplet work (int)\n")) ;
(void) UMF_free ((void *) Rx) ;
- (void) UMF_free ((void *) Rz) ;
(void) UMF_free ((void *) Map2) ;
(void) UMF_free ((void *) Rp) ;
(void) UMF_free ((void *) Rj) ;
}
ASSERT (UMF_malloc_count == init_count + 4 +
- (Rx != (double *) NULL) + (Rz != (double *) NULL) + do_map) ;
+ (Rx != (double *) NULL) + do_map) ;
/* ---------------------------------------------------------------------- */
/* convert from triplet to column form */
/* ---------------------------------------------------------------------- */
(void) UMF_free ((void *) Rx) ;
- (void) UMF_free ((void *) Rz) ;
(void) UMF_free ((void *) Map2) ;
(void) UMF_free ((void *) Rp) ;
(void) UMF_free ((void *) Rj) ;