1 *> \brief <b> SGBSV computes the solution to system of linear equations A * X = B for GB matrices</b> (simple driver)
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SGBSV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sgbsv.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sgbsv.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgbsv.f">
21 * SUBROUTINE SGBSV( N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO )
23 * .. Scalar Arguments ..
24 * INTEGER INFO, KL, KU, LDAB, LDB, N, NRHS
26 * .. Array Arguments ..
28 * REAL AB( LDAB, * ), B( LDB, * )
37 *> SGBSV computes the solution to a real system of linear equations
38 *> A * X = B, where A is a band matrix of order N with KL subdiagonals
39 *> and KU superdiagonals, and X and B are N-by-NRHS matrices.
41 *> The LU decomposition with partial pivoting and row interchanges is
42 *> used to factor A as A = L * U, where L is a product of permutation
43 *> and unit lower triangular matrices with KL subdiagonals, and U is
44 *> upper triangular with KL+KU superdiagonals. The factored form of A
45 *> is then used to solve the system of equations A * X = B.
54 *> The number of linear equations, i.e., the order of the
61 *> The number of subdiagonals within the band of A. KL >= 0.
67 *> The number of superdiagonals within the band of A. KU >= 0.
73 *> The number of right hand sides, i.e., the number of columns
74 *> of the matrix B. NRHS >= 0.
79 *> AB is REAL array, dimension (LDAB,N)
80 *> On entry, the matrix A in band storage, in rows KL+1 to
81 *> 2*KL+KU+1; rows 1 to KL of the array need not be set.
82 *> The j-th column of A is stored in the j-th column of the
83 *> array AB as follows:
84 *> AB(KL+KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+KL)
85 *> On exit, details of the factorization: U is stored as an
86 *> upper triangular band matrix with KL+KU superdiagonals in
87 *> rows 1 to KL+KU+1, and the multipliers used during the
88 *> factorization are stored in rows KL+KU+2 to 2*KL+KU+1.
89 *> See below for further details.
95 *> The leading dimension of the array AB. LDAB >= 2*KL+KU+1.
100 *> IPIV is INTEGER array, dimension (N)
101 *> The pivot indices that define the permutation matrix P;
102 *> row i of the matrix was interchanged with row IPIV(i).
107 *> B is REAL array, dimension (LDB,NRHS)
108 *> On entry, the N-by-NRHS right hand side matrix B.
109 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
115 *> The leading dimension of the array B. LDB >= max(1,N).
121 *> = 0: successful exit
122 *> < 0: if INFO = -i, the i-th argument had an illegal value
123 *> > 0: if INFO = i, U(i,i) is exactly zero. The factorization
124 *> has been completed, but the factor U is exactly
125 *> singular, and the solution has not been computed.
131 *> \author Univ. of Tennessee
132 *> \author Univ. of California Berkeley
133 *> \author Univ. of Colorado Denver
136 *> \date November 2011
138 *> \ingroup realGBsolve
140 *> \par Further Details:
141 * =====================
145 *> The band storage scheme is illustrated by the following example, when
146 *> M = N = 6, KL = 2, KU = 1:
148 *> On entry: On exit:
150 *> * * * + + + * * * u14 u25 u36
151 *> * * + + + + * * u13 u24 u35 u46
152 *> * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56
153 *> a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66
154 *> a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 *
155 *> a31 a42 a53 a64 * * m31 m42 m53 m64 * *
157 *> Array elements marked * are not used by the routine; elements marked
158 *> + need not be set on entry, but are required by the routine to store
159 *> elements of U because of fill-in resulting from the row interchanges.
162 * =====================================================================
163 SUBROUTINE SGBSV( N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO )
165 * -- LAPACK driver routine (version 3.4.0) --
166 * -- LAPACK is a software package provided by Univ. of Tennessee, --
167 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
170 * .. Scalar Arguments ..
171 INTEGER INFO, KL, KU, LDAB, LDB, N, NRHS
173 * .. Array Arguments ..
175 REAL AB( LDAB, * ), B( LDB, * )
178 * =====================================================================
180 * .. External Subroutines ..
181 EXTERNAL SGBTRF, SGBTRS, XERBLA
183 * .. Intrinsic Functions ..
186 * .. Executable Statements ..
188 * Test the input parameters.
193 ELSE IF( KL.LT.0 ) THEN
195 ELSE IF( KU.LT.0 ) THEN
197 ELSE IF( NRHS.LT.0 ) THEN
199 ELSE IF( LDAB.LT.2*KL+KU+1 ) THEN
201 ELSE IF( LDB.LT.MAX( N, 1 ) ) THEN
205 CALL XERBLA( 'SGBSV ', -INFO )
209 * Compute the LU factorization of the band matrix A.
211 CALL SGBTRF( N, N, KL, KU, AB, LDAB, IPIV, INFO )
214 * Solve the system A*X = B, overwriting B with X.
216 CALL SGBTRS( 'No transpose', N, KL, KU, NRHS, AB, LDAB, IPIV,