>  Docs Center  >  IDL Reference  >  Advanced Math and Stats  >  IMSL_SP_BDSOL



The IMSL_SP_BDSOL function solves a general band system of linear equations Ax = b. By using keywords, any of several related computations can be performed.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

The IMSL_SP_BDSOL function solves a system of linear algebraic equations with a real or complex band matrix A. It first computes the LU factorization of A with based on the blocked LU factorization algorithm given in Du Croz, et al, (1990). Level-3 BLAS invocations were replaced by in-line loops. The blocking factor BLK_FACTOR has the default value of 1, but can be reset to any positive value not exceeding 32.

The solution of the linear system is then found by solving two simpler systems, y = L–1b and x = U–1y. When the solution to the linear system or the inverse of the matrix is sought, an estimate of the L1 condition number of A is computed using Higham’s modifications to Hager’s method, as given in Higham (1988). If the estimated condition number is greater than 1/ε (where ε is the machine precision), a warning message is issued. This indicates that very small changes in A may produce large changes in the solution x. The IMSL_SP_BDSOL function fails if U, the upper triangular part of the factorization, has a zero diagonal element.


Consider the 1000 x 1000 banded matrix below:

This example computes the solution to Ax = b, where b is a random vector.


n_rows = 1000L
nlca = 1L
nuca = 1L
a = DBLARR(n_rows*(nlca+nuca+1))
a(1:n_rows-1) = 4
a(n_rows:2*n_rows-1) = -1
a(2*n_rows:*) = 4
; Fill A with the values of the bands.
seed = 123L
b = RANDOMU(seed, n_rows)
; Compute a random right-hand side.
x = IMSL_SP_BDSOL(b, nlca, nuca, a)
; Compute the solution using IMSL_SP_BDSOL above,
; and output residual.
PM, TOTAL(ABS(IMSL_SP_MVMUL(n_rows, n_rows, nlca, nuca, a, x)-b))


Result = IMSL_SP_BDSOL(B, Nlca, Nuca [, A] [, BLK_FACTOR=value] [, CONDITION=variable] [, /DOUBLE] [, FACTOR=array] [, PIVOT=array] [, TRANSPOSE=value])

Return Value

Structure containing the LU factorization of A.



One-dimensional matrix containing the right-hand side.


Number of lower codiagonals in a.


Number of upper codiagonals in a.

A (optional)

Array of size (nlca + nuca + 1) x n containing the n x n banded coefficient matrix in band storage mode A(i, j). See “Band Storage Format” for a description of band storage mode.


BLK_FACTOR (optional)

The blocking factor. This keyword must be set no larger than 32. Default: BLK_FACTOR = 1.

CONDITION (optional)

Named variable into which an estimate of the L1 condition number is stored. This keyword cannot be used with PIVOT and FACTOR.

DOUBLE (optional)

If present and nonzero, double precision is used.

FACTOR (optional)

An array of size (2*nlca + nuca + 1) x N_ELEMENTS(b) containing the LU factorization of A with column pivoting, as returned from IMSL_SP_BDFAC. The keywords PIVOT and FACTOR must be used together. The keywords FACTOR and CONDITION cannot be used together.

PIVOT (optional)

One-dimensional array containing the pivot sequence. The keywords PIVOT and FACTOR must be used together. The keywords PIVOT and CONDITION cannot be used together.

TRANSPOSE (optional)

If present and nonzero, ATx = b is solved.

Version History



See Also


© 2020 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us