# naginterfaces.library.matop.real_​gen_​blkdiag_​lu¶

naginterfaces.library.matop.real_gen_blkdiag_lu(n, blkstr, a, tol)[source]

real_gen_blkdiag_lu factorizes a real almost block diagonal matrix.

For full information please refer to the NAG Library document for f01lh

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/f01/f01lhf.html

Parameters
nint

, the order of the matrix .

blkstrint, array-like, shape

Information which describes the block structure of as follows:

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 and 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 th block);

,

,

(both the number of rows and the number of columns of must equal ).

afloat, array-like, shape

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 argument .

If is the first element in the th block, then an arbitrary element in the th block must be stored in the array element:

where

is the base address of the th block, and

is the number of rows of the th block.

tolfloat

A relative tolerance to be used to indicate whether or not the matrix is singular. For a discussion on how is used see Further Comments. If is non-positive, is reset to , where is the machine precision.

Returns
afloat, ndarray, shape

The factorized form of the matrix.

pivotint, ndarray, shape

Details of the interchanges.

tolfloat

Unchanged unless on entry, in which case it is set to .

kpivotint

If = 2, contains the value , where is the first position on the diagonal of the matrix where too small a pivot was detected. Otherwise is set to .

Raises
NagValueError
(errno )

On entry, is too small. . Minimum possible dimension: .

(errno )

On entry, the following equality does not hold: .

(errno )

On entry, the following equality does not hold: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, the following inequality was not satisfied for: . .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

Factorization completed, but pivot in diagonal was small: .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

real_gen_blkdiag_lu 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:

[figure omitted]

This function may be followed by linsys.real_blkdiag_fac_solve, which is designed to solve sets of linear equations or .

References

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