NAG Library Routine Document
F01LHF factorizes a real almost block diagonal matrix.
||N, NBLOKS, BLKSTR(3,NBLOKS), LENA, PIVOT(N), KPIVOT, IFAIL
F01LHF factorizes a real almost block diagonal matrix,
, by row elimination with alternate row and column pivoting such that no ‘fill-in’ is produced. The code, which is derived from ARCECO described in Diaz et al. (1983)
, uses Level 1 and Level 2 BLAS. No three successive diagonal blocks may have columns in common and therefore the almost block diagonal matrix must have the form shown in the following diagram:
This routine may be followed by F04LHF
, which is designed to solve sets of linear equations
Diaz J C, Fairweather G and Keast P (1983) Fortran packages for solving certain almost block diagonal linear systems by modified alternate row and column elimination ACM Trans. Math. Software 9 358–375
- 1: N – INTEGERInput
On entry: , the order of the matrix .
- 2: NBLOKS – INTEGERInput
On entry: , the total number of blocks of the matrix .
- 3: BLKSTR(,NBLOKS) – INTEGER arrayInput
: information which describes the block structure of
- must contain the number of rows in the th block, ;
- must contain the number of columns in the th block, ;
- must contain the number of columns of overlap between the th and th blocks, . need not be set.
The following conditions delimit the structure of
(there must be at least one column and one row in each block and a non-negative number of columns of overlap);
(the total number of columns in overlaps in each block must not exceed the number of columns in that block);
- , ,
(the index of the first column of the overlap between the
th blocks must be
the index of the last row of the
th block, and the index of the last column of overlap must be
the index of the last row of the
(both the number of rows and the number of columns of
- 4: A(LENA) – REAL (KIND=nag_wp) arrayInput/Output
: the elements of the almost block diagonal matrix stored block by block, with each block stored column by column. The sizes of the blocks and the overlaps are defined by the parameter BLKSTR
is the first element in the
th block, then an arbitrary element
th block must be stored in the array element:
is the base address of the
th block, and
is the number of rows of the
See Section 8
for comments on scaling.
On exit: the factorized form of the matrix.
- 5: LENA – INTEGERInput
: the dimension of the array A
as declared in the (sub)program from which F01LHF is called.
- 6: PIVOT(N) – INTEGER arrayOutput
On exit: details of the interchanges.
- 7: TOL – REAL (KIND=nag_wp)Input/Output
: a relative tolerance to be used to indicate whether or not the matrix is singular. For a discussion on how TOL
is used see Section 8
. If TOL
is non-positive, then TOL
is reset to
is the machine precision
On exit: unchanged unless on entry, in which case it is set to .
- 8: KPIVOT – INTEGEROutput
contains the value
is the first position on the diagonal of the matrix
where too small a pivot was detected. Otherwise KPIVOT
is set to
- 9: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
|or||LENA is too small,|
|or||illegal values detected in BLKSTR.|
The factorization has been completed, but a small pivot has been detected.
The accuracy of F01LHF depends on the conditioning of the matrix .
Singularity or near singularity in
is determined by the parameter TOL
. If the absolute value of any pivot is less than
is the maximum absolute value of an element of
is said to be singular. The position on the diagonal of
of the first of any such pivots is indicated by the parameter KPIVOT
. The factorization, and the test for near singularity, will be more accurate if before entry
is scaled so that the
-norms of the rows and columns of
are all of approximately the same order of magnitude. (The
-norm is the maximum absolute value of any element in the row or column.)
This example solves the set of linear equations
The exact solution is
9.1 Program Text
Program Text (f01lhfe.f90)
9.2 Program Data
Program Data (f01lhfe.d)
9.3 Program Results
Program Results (f01lhfe.r)