NAG CL Interface
f11mec (direct_real_gen_lu)
1
Purpose
f11mec computes the
factorization of a real sparse matrix in compressed column (Harwell–Boeing), column-permuted format.
2
Specification
void |
f11mec (Integer n,
const Integer irowix[],
const double a[],
Integer iprm[],
double thresh,
Integer nzlmx,
Integer *nzlumx,
Integer nzumx,
Integer il[],
double lval[],
Integer iu[],
double uval[],
Integer *nnzl,
Integer *nnzu,
double *flop,
NagError *fail) |
|
The function may be called by the names: f11mec, nag_sparse_direct_real_gen_lu or nag_superlu_lu_factorize.
3
Description
Given a real sparse matrix
,
f11mec computes an
factorization of
with partial pivoting,
, where
is a row permutation matrix (computed by
f11mec),
is a (supplied) column permutation matrix,
is unit lower triangular and
is upper triangular. The column permutation matrix,
, must be computed by a prior call to
f11mdc. The matrix
must be presented in the column permuted, compressed column (Harwell–Boeing) format.
The
factorization is output in the form of four one-dimensional arrays: integer arrays
il and
iu and real-valued arrays
lval and
uval. These describe the sparsity pattern and numerical values in the
and
matrices. The minimum required dimensions of these arrays cannot be given as a simple function of the size arguments (order and number of nonzero values) of the matrix
. This is due to unpredictable fill-in created by partial pivoting.
f11mec will, on return, indicate which dimensions of these arrays were not adequate for the computation or (in the case of one of them) give a firm bound. You should then allocate more storage and try again.
4
References
Demmel J W, Eisenstat S C, Gilbert J R, Li X S and Li J W H (1999) A supernodal approach to sparse partial pivoting SIAM J. Matrix Anal. Appl. 20 720–755
Demmel J W, Gilbert J R and Li X S (1999) An asynchronous parallel supernodal algorithm for sparse gaussian elimination SIAM J. Matrix Anal. Appl. 20 915–952
5
Arguments
-
1:
– Integer
Input
-
On entry: , the order of the matrix .
Constraint:
.
-
2:
– const Integer
Input
-
Note: the dimension,
dim, of the array
irowix
must be at least
, the number of nonzeros of the sparse matrix
.
On entry: the row index array of sparse matrix .
-
3:
– const double
Input
-
Note: the dimension,
dim, of the array
a
must be at least
, the number of nonzeros of the sparse matrix
.
On entry: the array of nonzero values in the sparse matrix .
-
4:
– Integer
Input/Output
-
On entry: contains the column permutation which defines the permutation
and associated data structures as computed by function
f11mdc.
On exit: part of the array is modified to record the row permutation determined by pivoting.
-
5:
– double
Input
-
On entry: the diagonal pivoting threshold, . At step of the Gaussian elimination, if , use as a pivot, otherwise use . A value of corresponds to partial pivoting, a value of corresponds to always choosing the pivot on the diagonal (unless it is zero).
Suggested value:
. Smaller values may result in a faster factorization, but the benefits are likely to be small in most cases. It might be possible to use if you are confident about the stability of the factorization, for example, if is diagonally dominant.
Constraint:
.
-
6:
– Integer
Input
-
On entry: indicates the available size of array
il. The dimension of
il should be at least
. A good range for
nzlmx that works for many problems is
to
, where
is the number of nonzeros in the sparse matrix
. If, on exit,
NE_NZLMX_TOO_SMALL, the given
nzlmx was too small and you should attempt to provide more storage and call the function again.
Constraint:
.
-
7:
– Integer *
Input/Output
-
On entry: indicates the available size of array
lval. The dimension of
lval should be at least
nzlumx.
Constraint:
.
On exit: if
NE_NZLUMX_TOO_SMALL, the given
nzlumx was too small and is reset to a value that will be sufficient. You should then provide the indicated storage and call the function again.
-
8:
– Integer
Input
-
On entry: indicates the available sizes of arrays
iu and
uval. The dimension of
iu should be at least
and the dimension of
uval should be at least
nzumx. A good range for
nzumx that works for many problems is
to
, where
is the number of nonzeros in the sparse matrix
. If, on exit,
NE_NZUMX_TOO_SMALL, the given
nzumx was too small and you should attempt to provide more storage and call the function again.
Constraint:
.
-
9:
– Integer
Output
-
On exit: encapsulates the sparsity pattern of matrix .
-
10:
– double
Output
-
On exit: records the nonzero values of matrix and some of the nonzero values of matrix .
-
11:
– Integer
Output
-
On exit: encapsulates the sparsity pattern of matrix .
-
12:
– double
Output
-
On exit: records some of the nonzero values of matrix .
-
13:
– Integer *
Output
-
On exit: the number of nonzero values in the matrix .
-
14:
– Integer *
Output
-
On exit: the number of nonzero values in the matrix .
-
15:
– double *
Output
-
On exit: the number of floating-point operations performed.
-
16:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_NZLMX_TOO_SMALL
-
- NE_NZLUMX_TOO_SMALL
-
- NE_NZUMX_TOO_SMALL
-
- NE_REAL
-
On entry, .
Constraint: .
- NE_SINGULAR_MATRIX
-
The matrix is singular – no factorization possible.
7
Accuracy
The computed factors
and
are the exact factors of a perturbed matrix
, where
is a modest linear function of
, and
is the
machine precision, when partial pivoting is used. If no partial pivoting is used, the factorization accuracy can be considerably worse. A call to
f11mmc after
f11mec can help determine the quality of the factorization.
8
Parallelism and Performance
f11mec is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f11mec makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The total number of floating-point operations depends on the sparsity pattern of the matrix .
A call to
f11mec may be followed by calls to the functions:
- f11mfc to solve or ;
- f11mgc to estimate the condition number of ;
- f11mmc to estimate the reciprocal pivot growth of the factorization.
10
Example
This example computes the
factorization of the matrix
, where
10.1
Program Text
10.2
Program Data
10.3
Program Results