LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zgbsvx.f
Go to the documentation of this file.
1*> \brief <b> ZGBSVX computes the solution to system of linear equations A * X = B for GB matrices</b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZGBSVX + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgbsvx.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgbsvx.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgbsvx.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZGBSVX( FACT, TRANS, N, KL, KU, NRHS, AB, LDAB, AFB,
20* LDAFB, IPIV, EQUED, R, C, B, LDB, X, LDX,
21* RCOND, FERR, BERR, WORK, RWORK, INFO )
22*
23* .. Scalar Arguments ..
24* CHARACTER EQUED, FACT, TRANS
25* INTEGER INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
26* DOUBLE PRECISION RCOND
27* ..
28* .. Array Arguments ..
29* INTEGER IPIV( * )
30* DOUBLE PRECISION BERR( * ), C( * ), FERR( * ), R( * ),
31* $ RWORK( * )
32* COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
33* $ WORK( * ), X( LDX, * )
34* ..
35*
36*
37*> \par Purpose:
38* =============
39*>
40*> \verbatim
41*>
42*> ZGBSVX uses the LU factorization to compute the solution to a complex
43*> system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
44*> where A is a band matrix of order N with KL subdiagonals and KU
45*> superdiagonals, and X and B are N-by-NRHS matrices.
46*>
47*> Error bounds on the solution and a condition estimate are also
48*> provided.
49*> \endverbatim
50*
51*> \par Description:
52* =================
53*>
54*> \verbatim
55*>
56*> The following steps are performed by this subroutine:
57*>
58*> 1. If FACT = 'E', real scaling factors are computed to equilibrate
59*> the system:
60*> TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
61*> TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
62*> TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
63*> Whether or not the system will be equilibrated depends on the
64*> scaling of the matrix A, but if equilibration is used, A is
65*> overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
66*> or diag(C)*B (if TRANS = 'T' or 'C').
67*>
68*> 2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
69*> matrix A (after equilibration if FACT = 'E') as
70*> A = L * U,
71*> where L is a product of permutation and unit lower triangular
72*> matrices with KL subdiagonals, and U is upper triangular with
73*> KL+KU superdiagonals.
74*>
75*> 3. If some U(i,i)=0, so that U is exactly singular, then the routine
76*> returns with INFO = i. Otherwise, the factored form of A is used
77*> to estimate the condition number of the matrix A. If the
78*> reciprocal of the condition number is less than machine precision,
79*> INFO = N+1 is returned as a warning, but the routine still goes on
80*> to solve for X and compute error bounds as described below.
81*>
82*> 4. The system of equations is solved for X using the factored form
83*> of A.
84*>
85*> 5. Iterative refinement is applied to improve the computed solution
86*> matrix and calculate error bounds and backward error estimates
87*> for it.
88*>
89*> 6. If equilibration was used, the matrix X is premultiplied by
90*> diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
91*> that it solves the original system before equilibration.
92*> \endverbatim
93*
94* Arguments:
95* ==========
96*
97*> \param[in] FACT
98*> \verbatim
99*> FACT is CHARACTER*1
100*> Specifies whether or not the factored form of the matrix A is
101*> supplied on entry, and if not, whether the matrix A should be
102*> equilibrated before it is factored.
103*> = 'F': On entry, AFB and IPIV contain the factored form of
104*> A. If EQUED is not 'N', the matrix A has been
105*> equilibrated with scaling factors given by R and C.
106*> AB, AFB, and IPIV are not modified.
107*> = 'N': The matrix A will be copied to AFB and factored.
108*> = 'E': The matrix A will be equilibrated if necessary, then
109*> copied to AFB and factored.
110*> \endverbatim
111*>
112*> \param[in] TRANS
113*> \verbatim
114*> TRANS is CHARACTER*1
115*> Specifies the form of the system of equations.
116*> = 'N': A * X = B (No transpose)
117*> = 'T': A**T * X = B (Transpose)
118*> = 'C': A**H * X = B (Conjugate transpose)
119*> \endverbatim
120*>
121*> \param[in] N
122*> \verbatim
123*> N is INTEGER
124*> The number of linear equations, i.e., the order of the
125*> matrix A. N >= 0.
126*> \endverbatim
127*>
128*> \param[in] KL
129*> \verbatim
130*> KL is INTEGER
131*> The number of subdiagonals within the band of A. KL >= 0.
132*> \endverbatim
133*>
134*> \param[in] KU
135*> \verbatim
136*> KU is INTEGER
137*> The number of superdiagonals within the band of A. KU >= 0.
138*> \endverbatim
139*>
140*> \param[in] NRHS
141*> \verbatim
142*> NRHS is INTEGER
143*> The number of right hand sides, i.e., the number of columns
144*> of the matrices B and X. NRHS >= 0.
145*> \endverbatim
146*>
147*> \param[in,out] AB
148*> \verbatim
149*> AB is COMPLEX*16 array, dimension (LDAB,N)
150*> On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
151*> The j-th column of A is stored in the j-th column of the
152*> array AB as follows:
153*> AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
154*>
155*> If FACT = 'F' and EQUED is not 'N', then A must have been
156*> equilibrated by the scaling factors in R and/or C. AB is not
157*> modified if FACT = 'F' or 'N', or if FACT = 'E' and
158*> EQUED = 'N' on exit.
159*>
160*> On exit, if EQUED .ne. 'N', A is scaled as follows:
161*> EQUED = 'R': A := diag(R) * A
162*> EQUED = 'C': A := A * diag(C)
163*> EQUED = 'B': A := diag(R) * A * diag(C).
164*> \endverbatim
165*>
166*> \param[in] LDAB
167*> \verbatim
168*> LDAB is INTEGER
169*> The leading dimension of the array AB. LDAB >= KL+KU+1.
170*> \endverbatim
171*>
172*> \param[in,out] AFB
173*> \verbatim
174*> AFB is COMPLEX*16 array, dimension (LDAFB,N)
175*> If FACT = 'F', then AFB is an input argument and on entry
176*> contains details of the LU factorization of the band matrix
177*> A, as computed by ZGBTRF. U is stored as an upper triangular
178*> band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
179*> and the multipliers used during the factorization are stored
180*> in rows KL+KU+2 to 2*KL+KU+1. If EQUED .ne. 'N', then AFB is
181*> the factored form of the equilibrated matrix A.
182*>
183*> If FACT = 'N', then AFB is an output argument and on exit
184*> returns details of the LU factorization of A.
185*>
186*> If FACT = 'E', then AFB is an output argument and on exit
187*> returns details of the LU factorization of the equilibrated
188*> matrix A (see the description of AB for the form of the
189*> equilibrated matrix).
190*> \endverbatim
191*>
192*> \param[in] LDAFB
193*> \verbatim
194*> LDAFB is INTEGER
195*> The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.
196*> \endverbatim
197*>
198*> \param[in,out] IPIV
199*> \verbatim
200*> IPIV is INTEGER array, dimension (N)
201*> If FACT = 'F', then IPIV is an input argument and on entry
202*> contains the pivot indices from the factorization A = L*U
203*> as computed by ZGBTRF; row i of the matrix was interchanged
204*> with row IPIV(i).
205*>
206*> If FACT = 'N', then IPIV is an output argument and on exit
207*> contains the pivot indices from the factorization A = L*U
208*> of the original matrix A.
209*>
210*> If FACT = 'E', then IPIV is an output argument and on exit
211*> contains the pivot indices from the factorization A = L*U
212*> of the equilibrated matrix A.
213*> \endverbatim
214*>
215*> \param[in,out] EQUED
216*> \verbatim
217*> EQUED is CHARACTER*1
218*> Specifies the form of equilibration that was done.
219*> = 'N': No equilibration (always true if FACT = 'N').
220*> = 'R': Row equilibration, i.e., A has been premultiplied by
221*> diag(R).
222*> = 'C': Column equilibration, i.e., A has been postmultiplied
223*> by diag(C).
224*> = 'B': Both row and column equilibration, i.e., A has been
225*> replaced by diag(R) * A * diag(C).
226*> EQUED is an input argument if FACT = 'F'; otherwise, it is an
227*> output argument.
228*> \endverbatim
229*>
230*> \param[in,out] R
231*> \verbatim
232*> R is DOUBLE PRECISION array, dimension (N)
233*> The row scale factors for A. If EQUED = 'R' or 'B', A is
234*> multiplied on the left by diag(R); if EQUED = 'N' or 'C', R
235*> is not accessed. R is an input argument if FACT = 'F';
236*> otherwise, R is an output argument. If FACT = 'F' and
237*> EQUED = 'R' or 'B', each element of R must be positive.
238*> \endverbatim
239*>
240*> \param[in,out] C
241*> \verbatim
242*> C is DOUBLE PRECISION array, dimension (N)
243*> The column scale factors for A. If EQUED = 'C' or 'B', A is
244*> multiplied on the right by diag(C); if EQUED = 'N' or 'R', C
245*> is not accessed. C is an input argument if FACT = 'F';
246*> otherwise, C is an output argument. If FACT = 'F' and
247*> EQUED = 'C' or 'B', each element of C must be positive.
248*> \endverbatim
249*>
250*> \param[in,out] B
251*> \verbatim
252*> B is COMPLEX*16 array, dimension (LDB,NRHS)
253*> On entry, the right hand side matrix B.
254*> On exit,
255*> if EQUED = 'N', B is not modified;
256*> if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by
257*> diag(R)*B;
258*> if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is
259*> overwritten by diag(C)*B.
260*> \endverbatim
261*>
262*> \param[in] LDB
263*> \verbatim
264*> LDB is INTEGER
265*> The leading dimension of the array B. LDB >= max(1,N).
266*> \endverbatim
267*>
268*> \param[out] X
269*> \verbatim
270*> X is COMPLEX*16 array, dimension (LDX,NRHS)
271*> If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X
272*> to the original system of equations. Note that A and B are
273*> modified on exit if EQUED .ne. 'N', and the solution to the
274*> equilibrated system is inv(diag(C))*X if TRANS = 'N' and
275*> EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C'
276*> and EQUED = 'R' or 'B'.
277*> \endverbatim
278*>
279*> \param[in] LDX
280*> \verbatim
281*> LDX is INTEGER
282*> The leading dimension of the array X. LDX >= max(1,N).
283*> \endverbatim
284*>
285*> \param[out] RCOND
286*> \verbatim
287*> RCOND is DOUBLE PRECISION
288*> The estimate of the reciprocal condition number of the matrix
289*> A after equilibration (if done). If RCOND is less than the
290*> machine precision (in particular, if RCOND = 0), the matrix
291*> is singular to working precision. This condition is
292*> indicated by a return code of INFO > 0.
293*> \endverbatim
294*>
295*> \param[out] FERR
296*> \verbatim
297*> FERR is DOUBLE PRECISION array, dimension (NRHS)
298*> The estimated forward error bound for each solution vector
299*> X(j) (the j-th column of the solution matrix X).
300*> If XTRUE is the true solution corresponding to X(j), FERR(j)
301*> is an estimated upper bound for the magnitude of the largest
302*> element in (X(j) - XTRUE) divided by the magnitude of the
303*> largest element in X(j). The estimate is as reliable as
304*> the estimate for RCOND, and is almost always a slight
305*> overestimate of the true error.
306*> \endverbatim
307*>
308*> \param[out] BERR
309*> \verbatim
310*> BERR is DOUBLE PRECISION array, dimension (NRHS)
311*> The componentwise relative backward error of each solution
312*> vector X(j) (i.e., the smallest relative change in
313*> any element of A or B that makes X(j) an exact solution).
314*> \endverbatim
315*>
316*> \param[out] WORK
317*> \verbatim
318*> WORK is COMPLEX*16 array, dimension (2*N)
319*> \endverbatim
320*>
321*> \param[out] RWORK
322*> \verbatim
323*> RWORK is DOUBLE PRECISION array, dimension (MAX(1,N))
324*> On exit, RWORK(1) contains the reciprocal pivot growth
325*> factor norm(A)/norm(U). The "max absolute element" norm is
326*> used. If RWORK(1) is much less than 1, then the stability
327*> of the LU factorization of the (equilibrated) matrix A
328*> could be poor. This also means that the solution X, condition
329*> estimator RCOND, and forward error bound FERR could be
330*> unreliable. If factorization fails with 0<INFO<=N, then
331*> RWORK(1) contains the reciprocal pivot growth factor for the
332*> leading INFO columns of A.
333*> \endverbatim
334*>
335*> \param[out] INFO
336*> \verbatim
337*> INFO is INTEGER
338*> = 0: successful exit
339*> < 0: if INFO = -i, the i-th argument had an illegal value
340*> > 0: if INFO = i, and i is
341*> <= N: U(i,i) is exactly zero. The factorization
342*> has been completed, but the factor U is exactly
343*> singular, so the solution and error bounds
344*> could not be computed. RCOND = 0 is returned.
345*> = N+1: U is nonsingular, but RCOND is less than machine
346*> precision, meaning that the matrix is singular
347*> to working precision. Nevertheless, the
348*> solution and error bounds are computed because
349*> there are a number of situations where the
350*> computed solution can be more accurate than the
351*> value of RCOND would suggest.
352*> \endverbatim
353*
354* Authors:
355* ========
356*
357*> \author Univ. of Tennessee
358*> \author Univ. of California Berkeley
359*> \author Univ. of Colorado Denver
360*> \author NAG Ltd.
361*
362*> \ingroup gbsvx
363*
364* =====================================================================
365 SUBROUTINE zgbsvx( FACT, TRANS, N, KL, KU, NRHS, AB, LDAB, AFB,
366 $ LDAFB, IPIV, EQUED, R, C, B, LDB, X, LDX,
367 $ RCOND, FERR, BERR, WORK, RWORK, INFO )
368*
369* -- LAPACK driver routine --
370* -- LAPACK is a software package provided by Univ. of Tennessee, --
371* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
372*
373* .. Scalar Arguments ..
374 CHARACTER EQUED, FACT, TRANS
375 INTEGER INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
376 DOUBLE PRECISION RCOND
377* ..
378* .. Array Arguments ..
379 INTEGER IPIV( * )
380 DOUBLE PRECISION BERR( * ), C( * ), FERR( * ), R( * ),
381 $ rwork( * )
382 COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
383 $ WORK( * ), X( LDX, * )
384* ..
385*
386* =====================================================================
387* Moved setting of INFO = N+1 so INFO does not subsequently get
388* overwritten. Sven, 17 Mar 05.
389* =====================================================================
390*
391* .. Parameters ..
392 DOUBLE PRECISION ZERO, ONE
393 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
394* ..
395* .. Local Scalars ..
396 LOGICAL COLEQU, EQUIL, NOFACT, NOTRAN, ROWEQU
397 CHARACTER NORM
398 INTEGER I, INFEQU, J, J1, J2
399 DOUBLE PRECISION AMAX, ANORM, BIGNUM, COLCND, RCMAX, RCMIN,
400 $ rowcnd, rpvgrw, smlnum
401* ..
402* .. External Functions ..
403 LOGICAL LSAME
404 DOUBLE PRECISION DLAMCH, ZLANGB, ZLANTB
405 EXTERNAL lsame, dlamch, zlangb, zlantb
406* ..
407* .. External Subroutines ..
408 EXTERNAL xerbla, zcopy, zgbcon, zgbequ, zgbrfs,
409 $ zgbtrf,
411* ..
412* .. Intrinsic Functions ..
413 INTRINSIC abs, max, min
414* ..
415* .. Executable Statements ..
416*
417 info = 0
418 nofact = lsame( fact, 'N' )
419 equil = lsame( fact, 'E' )
420 notran = lsame( trans, 'N' )
421 IF( nofact .OR. equil ) THEN
422 equed = 'N'
423 rowequ = .false.
424 colequ = .false.
425 ELSE
426 rowequ = lsame( equed, 'R' ) .OR. lsame( equed, 'B' )
427 colequ = lsame( equed, 'C' ) .OR. lsame( equed, 'B' )
428 smlnum = dlamch( 'Safe minimum' )
429 bignum = one / smlnum
430 END IF
431*
432* Test the input parameters.
433*
434 IF( .NOT.nofact .AND.
435 $ .NOT.equil .AND.
436 $ .NOT.lsame( fact, 'F' ) )
437 $ THEN
438 info = -1
439 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'T' ) .AND. .NOT.
440 $ lsame( trans, 'C' ) ) THEN
441 info = -2
442 ELSE IF( n.LT.0 ) THEN
443 info = -3
444 ELSE IF( kl.LT.0 ) THEN
445 info = -4
446 ELSE IF( ku.LT.0 ) THEN
447 info = -5
448 ELSE IF( nrhs.LT.0 ) THEN
449 info = -6
450 ELSE IF( ldab.LT.kl+ku+1 ) THEN
451 info = -8
452 ELSE IF( ldafb.LT.2*kl+ku+1 ) THEN
453 info = -10
454 ELSE IF( lsame( fact, 'F' ) .AND. .NOT.
455 $ ( rowequ .OR. colequ .OR. lsame( equed, 'N' ) ) ) THEN
456 info = -12
457 ELSE
458 IF( rowequ ) THEN
459 rcmin = bignum
460 rcmax = zero
461 DO 10 j = 1, n
462 rcmin = min( rcmin, r( j ) )
463 rcmax = max( rcmax, r( j ) )
464 10 CONTINUE
465 IF( rcmin.LE.zero ) THEN
466 info = -13
467 ELSE IF( n.GT.0 ) THEN
468 rowcnd = max( rcmin, smlnum ) / min( rcmax, bignum )
469 ELSE
470 rowcnd = one
471 END IF
472 END IF
473 IF( colequ .AND. info.EQ.0 ) THEN
474 rcmin = bignum
475 rcmax = zero
476 DO 20 j = 1, n
477 rcmin = min( rcmin, c( j ) )
478 rcmax = max( rcmax, c( j ) )
479 20 CONTINUE
480 IF( rcmin.LE.zero ) THEN
481 info = -14
482 ELSE IF( n.GT.0 ) THEN
483 colcnd = max( rcmin, smlnum ) / min( rcmax, bignum )
484 ELSE
485 colcnd = one
486 END IF
487 END IF
488 IF( info.EQ.0 ) THEN
489 IF( ldb.LT.max( 1, n ) ) THEN
490 info = -16
491 ELSE IF( ldx.LT.max( 1, n ) ) THEN
492 info = -18
493 END IF
494 END IF
495 END IF
496*
497 IF( info.NE.0 ) THEN
498 CALL xerbla( 'ZGBSVX', -info )
499 RETURN
500 END IF
501*
502 IF( equil ) THEN
503*
504* Compute row and column scalings to equilibrate the matrix A.
505*
506 CALL zgbequ( n, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd,
507 $ amax, infequ )
508 IF( infequ.EQ.0 ) THEN
509*
510* Equilibrate the matrix.
511*
512 CALL zlaqgb( n, n, kl, ku, ab, ldab, r, c, rowcnd,
513 $ colcnd,
514 $ amax, equed )
515 rowequ = lsame( equed, 'R' ) .OR. lsame( equed, 'B' )
516 colequ = lsame( equed, 'C' ) .OR. lsame( equed, 'B' )
517 END IF
518 END IF
519*
520* Scale the right hand side.
521*
522 IF( notran ) THEN
523 IF( rowequ ) THEN
524 DO 40 j = 1, nrhs
525 DO 30 i = 1, n
526 b( i, j ) = r( i )*b( i, j )
527 30 CONTINUE
528 40 CONTINUE
529 END IF
530 ELSE IF( colequ ) THEN
531 DO 60 j = 1, nrhs
532 DO 50 i = 1, n
533 b( i, j ) = c( i )*b( i, j )
534 50 CONTINUE
535 60 CONTINUE
536 END IF
537*
538 IF( nofact .OR. equil ) THEN
539*
540* Compute the LU factorization of the band matrix A.
541*
542 DO 70 j = 1, n
543 j1 = max( j-ku, 1 )
544 j2 = min( j+kl, n )
545 CALL zcopy( j2-j1+1, ab( ku+1-j+j1, j ), 1,
546 $ afb( kl+ku+1-j+j1, j ), 1 )
547 70 CONTINUE
548*
549 CALL zgbtrf( n, n, kl, ku, afb, ldafb, ipiv, info )
550*
551* Return if INFO is non-zero.
552*
553 IF( info.GT.0 ) THEN
554*
555* Compute the reciprocal pivot growth factor of the
556* leading rank-deficient INFO columns of A.
557*
558 anorm = zero
559 DO 90 j = 1, info
560 DO 80 i = max( ku+2-j, 1 ), min( n+ku+1-j, kl+ku+1 )
561 anorm = max( anorm, abs( ab( i, j ) ) )
562 80 CONTINUE
563 90 CONTINUE
564 rpvgrw = zlantb( 'M', 'U', 'N', info, min( info-1,
565 $ kl+ku ),
566 $ afb( max( 1, kl+ku+2-info ), 1 ), ldafb,
567 $ rwork )
568 IF( rpvgrw.EQ.zero ) THEN
569 rpvgrw = one
570 ELSE
571 rpvgrw = anorm / rpvgrw
572 END IF
573 rwork( 1 ) = rpvgrw
574 rcond = zero
575 RETURN
576 END IF
577 END IF
578*
579* Compute the norm of the matrix A and the
580* reciprocal pivot growth factor RPVGRW.
581*
582 IF( notran ) THEN
583 norm = '1'
584 ELSE
585 norm = 'I'
586 END IF
587 anorm = zlangb( norm, n, kl, ku, ab, ldab, rwork )
588 rpvgrw = zlantb( 'M', 'U', 'N', n, kl+ku, afb, ldafb, rwork )
589 IF( rpvgrw.EQ.zero ) THEN
590 rpvgrw = one
591 ELSE
592 rpvgrw = zlangb( 'M', n, kl, ku, ab, ldab, rwork ) / rpvgrw
593 END IF
594*
595* Compute the reciprocal of the condition number of A.
596*
597 CALL zgbcon( norm, n, kl, ku, afb, ldafb, ipiv, anorm, rcond,
598 $ work, rwork, info )
599*
600* Compute the solution matrix X.
601*
602 CALL zlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
603 CALL zgbtrs( trans, n, kl, ku, nrhs, afb, ldafb, ipiv, x, ldx,
604 $ info )
605*
606* Use iterative refinement to improve the computed solution and
607* compute error bounds and backward error estimates for it.
608*
609 CALL zgbrfs( trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
610 $ ipiv,
611 $ b, ldb, x, ldx, ferr, berr, work, rwork, info )
612*
613* Transform the solution matrix X to a solution of the original
614* system.
615*
616 IF( notran ) THEN
617 IF( colequ ) THEN
618 DO 110 j = 1, nrhs
619 DO 100 i = 1, n
620 x( i, j ) = c( i )*x( i, j )
621 100 CONTINUE
622 110 CONTINUE
623 DO 120 j = 1, nrhs
624 ferr( j ) = ferr( j ) / colcnd
625 120 CONTINUE
626 END IF
627 ELSE IF( rowequ ) THEN
628 DO 140 j = 1, nrhs
629 DO 130 i = 1, n
630 x( i, j ) = r( i )*x( i, j )
631 130 CONTINUE
632 140 CONTINUE
633 DO 150 j = 1, nrhs
634 ferr( j ) = ferr( j ) / rowcnd
635 150 CONTINUE
636 END IF
637*
638* Set INFO = N+1 if the matrix is singular to working precision.
639*
640 IF( rcond.LT.dlamch( 'Epsilon' ) )
641 $ info = n + 1
642*
643 rwork( 1 ) = rpvgrw
644 RETURN
645*
646* End of ZGBSVX
647*
648 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
Definition zcopy.f:81
subroutine zgbcon(norm, n, kl, ku, ab, ldab, ipiv, anorm, rcond, work, rwork, info)
ZGBCON
Definition zgbcon.f:146
subroutine zgbequ(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
ZGBEQU
Definition zgbequ.f:153
subroutine zgbrfs(trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZGBRFS
Definition zgbrfs.f:205
subroutine zgbsvx(fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
ZGBSVX computes the solution to system of linear equations A * X = B for GB matrices
Definition zgbsvx.f:368
subroutine zgbtrf(m, n, kl, ku, ab, ldab, ipiv, info)
ZGBTRF
Definition zgbtrf.f:142
subroutine zgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
ZGBTRS
Definition zgbtrs.f:137
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
Definition zlacpy.f:101
subroutine zlaqgb(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, equed)
ZLAQGB scales a general band matrix, using row and column scaling factors computed by sgbequ.
Definition zlaqgb.f:159