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.
47 * The integers ILO and IHI determined by ZGEBAL.
48 * 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
50 * SCALE (input) DOUBLE PRECISION array, dimension (N)
51 * Details of the permutation and scaling factors, as returned
55 * The number of columns of the matrix V. M >= 0.
57 * V (input/output) COMPLEX*16 array, dimension (LDV,M)
58 * On entry, the matrix of right or left eigenvectors to be
59 * transformed, as returned by ZHSEIN or ZTREVC.
60 * On exit, V is overwritten by the transformed eigenvectors.
63 * The leading dimension of the array V. LDV >= max(1,N).
65 * INFO (output) INTEGER
66 * = 0: successful exit
67 * < 0: if INFO = -i, the i-th argument had an illegal value.
69 * =====================================================================
73 PARAMETER ( ONE = 1.0D+0 )
80 * .. External Functions ..
84 * .. External Subroutines ..
85 EXTERNAL XERBLA, ZDSCAL, ZSWAP
87 * .. Intrinsic Functions ..
90 * .. Executable Statements ..
92 * Decode and Test the input parameters
94 RIGHTV = LSAME( SIDE, 'R' )
95 LEFTV = LSAME( SIDE, 'L' )
98 IF( .NOT.LSAME( JOB, 'N' ) .AND. .NOT.LSAME( JOB, 'P' ) .AND.
99 $ .NOT.LSAME( JOB, 'S' ) .AND. .NOT.LSAME( JOB, 'B' ) ) THEN
101 ELSE IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
103 ELSE IF( N.LT.0 ) THEN
105 ELSE IF( ILO.LT.1 .OR. ILO.GT.MAX( 1, N ) ) THEN
107 ELSE IF( IHI.LT.MIN( ILO, N ) .OR. IHI.GT.N ) THEN
109 ELSE IF( M.LT.0 ) THEN
111 ELSE IF( LDV.LT.MAX( 1, N ) ) THEN
115 CALL XERBLA( 'ZGEBAK', -INFO )
119 * Quick return if possible
125 IF( LSAME( JOB, 'N' ) )
133 IF( LSAME( JOB, 'S' ) .OR. LSAME( JOB, 'B' ) ) THEN
138 CALL ZDSCAL( M, S, V( I, 1 ), LDV )
145 CALL ZDSCAL( M, S, V( I, 1 ), LDV )
151 * Backward permutation
153 * For I = ILO-1 step -1 until 1,
154 * IHI+1 step 1 until N do --
157 IF( LSAME( JOB, 'P' ) .OR. LSAME( JOB, 'B' ) ) THEN
161 IF( I.GE.ILO .AND. I.LE.IHI )
168 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
175 IF( I.GE.ILO .AND. I.LE.IHI )
182 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )