3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZGGBAK + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zggbak.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zggbak.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggbak.f">
21 * SUBROUTINE ZGGBAK( JOB, SIDE, N, ILO, IHI, LSCALE, RSCALE, M, V,
24 * .. Scalar Arguments ..
26 * INTEGER IHI, ILO, INFO, LDV, M, N
28 * .. Array Arguments ..
29 * DOUBLE PRECISION LSCALE( * ), RSCALE( * )
30 * COMPLEX*16 V( LDV, * )
39 *> ZGGBAK forms the right or left eigenvectors of a complex generalized
40 *> eigenvalue problem A*x = lambda*B*x, by backward transformation on
41 *> the computed eigenvectors of the balanced pair of matrices output by
51 *> Specifies the type of backward transformation required:
52 *> = 'N': do nothing, return immediately;
53 *> = 'P': do backward transformation for permutation only;
54 *> = 'S': do backward transformation for scaling only;
55 *> = 'B': do backward transformations for both permutation and
57 *> JOB must be the same as the argument JOB supplied to ZGGBAL.
62 *> SIDE is CHARACTER*1
63 *> = 'R': V contains right eigenvectors;
64 *> = 'L': V contains left eigenvectors.
70 *> The number of rows of the matrix V. N >= 0.
81 *> The integers ILO and IHI determined by ZGGBAL.
82 *> 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
87 *> LSCALE is DOUBLE PRECISION array, dimension (N)
88 *> Details of the permutations and/or scaling factors applied
89 *> to the left side of A and B, as returned by ZGGBAL.
94 *> RSCALE is DOUBLE PRECISION array, dimension (N)
95 *> Details of the permutations and/or scaling factors applied
96 *> to the right side of A and B, as returned by ZGGBAL.
102 *> The number of columns of the matrix V. M >= 0.
107 *> V is COMPLEX*16 array, dimension (LDV,M)
108 *> On entry, the matrix of right or left eigenvectors to be
109 *> transformed, as returned by ZTGEVC.
110 *> On exit, V is overwritten by the transformed eigenvectors.
116 *> The leading dimension of the matrix V. LDV >= max(1,N).
122 *> = 0: successful exit.
123 *> < 0: if INFO = -i, the i-th argument had an illegal value.
129 *> \author Univ. of Tennessee
130 *> \author Univ. of California Berkeley
131 *> \author Univ. of Colorado Denver
134 *> \date November 2015
136 *> \ingroup complex16GBcomputational
138 *> \par Further Details:
139 * =====================
143 *> See R.C. Ward, Balancing the generalized eigenvalue problem,
144 *> SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
147 * =====================================================================
148 SUBROUTINE ZGGBAK( JOB, SIDE, N, ILO, IHI, LSCALE, RSCALE, M, V,
151 * -- LAPACK computational routine (version 3.6.0) --
152 * -- LAPACK is a software package provided by Univ. of Tennessee, --
153 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
156 * .. Scalar Arguments ..
158 INTEGER IHI, ILO, INFO, LDV, M, N
160 * .. Array Arguments ..
161 DOUBLE PRECISION LSCALE( * ), RSCALE( * )
162 COMPLEX*16 V( LDV, * )
165 * =====================================================================
167 * .. Local Scalars ..
168 LOGICAL LEFTV, RIGHTV
171 * .. External Functions ..
175 * .. External Subroutines ..
176 EXTERNAL XERBLA, ZDSCAL, ZSWAP
178 * .. Intrinsic Functions ..
181 * .. Executable Statements ..
183 * Test the input parameters
185 RIGHTV = LSAME( SIDE, 'R' )
186 LEFTV = LSAME( SIDE, 'L' )
189 IF( .NOT.LSAME( JOB, 'N' ) .AND. .NOT.LSAME( JOB, 'P' ) .AND.
190 $ .NOT.LSAME( JOB, 'S' ) .AND. .NOT.LSAME( JOB, 'B' ) ) THEN
192 ELSE IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
194 ELSE IF( N.LT.0 ) THEN
196 ELSE IF( ILO.LT.1 ) THEN
198 ELSE IF( N.EQ.0 .AND. IHI.EQ.0 .AND. ILO.NE.1 ) THEN
200 ELSE IF( N.GT.0 .AND. ( IHI.LT.ILO .OR. IHI.GT.MAX( 1, N ) ) )
203 ELSE IF( N.EQ.0 .AND. ILO.EQ.1 .AND. IHI.NE.0 ) THEN
205 ELSE IF( M.LT.0 ) THEN
207 ELSE IF( LDV.LT.MAX( 1, N ) ) THEN
211 CALL XERBLA( 'ZGGBAK', -INFO )
215 * Quick return if possible
221 IF( LSAME( JOB, 'N' ) )
229 IF( LSAME( JOB, 'S' ) .OR. LSAME( JOB, 'B' ) ) THEN
231 * Backward transformation on right eigenvectors
235 CALL ZDSCAL( M, RSCALE( I ), V( I, 1 ), LDV )
239 * Backward transformation on left eigenvectors
243 CALL ZDSCAL( M, LSCALE( I ), V( I, 1 ), LDV )
248 * Backward permutation
251 IF( LSAME( JOB, 'P' ) .OR. LSAME( JOB, 'B' ) ) THEN
253 * Backward permutation on right eigenvectors
258 DO 40 I = ILO - 1, 1, -1
262 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
272 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
276 * Backward permutation on left eigenvectors
282 DO 80 I = ILO - 1, 1, -1
286 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
292 DO 100 I = IHI + 1, N
296 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )