1 SUBROUTINE ZGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
4 * -- LAPACK routine (version 3.2) --
5 * -- LAPACK is a software package provided by Univ. of Tennessee, --
6 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
9 * .. Scalar Arguments ..
11 INTEGER IHI, ILO, INFO, LDV, M, N
13 * .. Array Arguments ..
14 DOUBLE PRECISION SCALE( * )
15 COMPLEX*16 V( LDV, * )
21 * ZGEBAK forms the right or left eigenvectors of a complex general
22 * matrix by backward transformation on the computed eigenvectors of the
23 * balanced matrix output by ZGEBAL.
28 * JOB (input) CHARACTER*1
29 * Specifies the type of backward transformation required:
30 * = 'N', do nothing, return immediately;
31 * = 'P', do backward transformation for permutation only;
32 * = 'S', do backward transformation for scaling only;
33 * = 'B', do backward transformations for both permutation and
35 * JOB must be the same as the argument JOB supplied to ZGEBAL.
37 * SIDE (input) CHARACTER*1
38 * = 'R': V contains right eigenvectors;
39 * = 'L': V contains left eigenvectors.
42 * The number of rows of the matrix V. N >= 0.
46 * The integers ILO and IHI determined by ZGEBAL.
47 * 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
49 * SCALE (input) DOUBLE PRECISION array, dimension (N)
50 * Details of the permutation and scaling factors, as returned
54 * The number of columns of the matrix V. M >= 0.
56 * V (input/output) COMPLEX*16 array, dimension (LDV,M)
57 * On entry, the matrix of right or left eigenvectors to be
58 * transformed, as returned by ZHSEIN or ZTREVC.
59 * On exit, V is overwritten by the transformed eigenvectors.
62 * The leading dimension of the array V. LDV >= max(1,N).
64 * INFO (output) INTEGER
65 * = 0: successful exit
66 * < 0: if INFO = -i, the i-th argument had an illegal value.
68 * =====================================================================
72 PARAMETER ( ONE = 1.0D+0 )
79 * .. External Functions ..
83 * .. External Subroutines ..
84 EXTERNAL XERBLA, ZDSCAL, ZSWAP
86 * .. Intrinsic Functions ..
89 * .. Executable Statements ..
91 * Decode and Test the input parameters
93 RIGHTV = LSAME( SIDE, 'R' )
94 LEFTV = LSAME( SIDE, 'L' )
97 IF( .NOT.LSAME( JOB, 'N' ) .AND. .NOT.LSAME( JOB, 'P' ) .AND.
98 $ .NOT.LSAME( JOB, 'S' ) .AND. .NOT.LSAME( JOB, 'B' ) ) THEN
100 ELSE IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
102 ELSE IF( N.LT.0 ) THEN
104 ELSE IF( ILO.LT.1 .OR. ILO.GT.MAX( 1, N ) ) THEN
106 ELSE IF( IHI.LT.MIN( ILO, N ) .OR. IHI.GT.N ) THEN
108 ELSE IF( M.LT.0 ) THEN
110 ELSE IF( LDV.LT.MAX( 1, N ) ) THEN
114 CALL XERBLA( 'ZGEBAK', -INFO )
118 * Quick return if possible
124 IF( LSAME( JOB, 'N' ) )
132 IF( LSAME( JOB, 'S' ) .OR. LSAME( JOB, 'B' ) ) THEN
137 CALL ZDSCAL( M, S, V( I, 1 ), LDV )
144 CALL ZDSCAL( M, S, V( I, 1 ), LDV )
150 * Backward permutation
152 * For I = ILO-1 step -1 until 1,
153 * IHI+1 step 1 until N do --
156 IF( LSAME( JOB, 'P' ) .OR. LSAME( JOB, 'B' ) ) THEN
160 IF( I.GE.ILO .AND. I.LE.IHI )
167 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
174 IF( I.GE.ILO .AND. I.LE.IHI )
181 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )