1 SUBROUTINE ZGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
4 * -- LAPACK routine (version 3.1) --
5 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
8 * .. Scalar Arguments ..
10 INTEGER IHI, ILO, INFO, LDV, M, N
12 * .. Array Arguments ..
13 DOUBLE PRECISION SCALE( * )
14 COMPLEX*16 V( LDV, * )
20 * ZGEBAK forms the right or left eigenvectors of a complex general
21 * matrix by backward transformation on the computed eigenvectors of the
22 * balanced matrix output by ZGEBAL.
27 * JOB (input) CHARACTER*1
28 * Specifies the type of backward transformation required:
29 * = 'N', do nothing, return immediately;
30 * = 'P', do backward transformation for permutation only;
31 * = 'S', do backward transformation for scaling only;
32 * = 'B', do backward transformations for both permutation and
34 * JOB must be the same as the argument JOB supplied to ZGEBAL.
36 * SIDE (input) CHARACTER*1
37 * = 'R': V contains right eigenvectors;
38 * = 'L': V contains left eigenvectors.
41 * The number of rows of the matrix V. N >= 0.
45 * The integers ILO and IHI determined by ZGEBAL.
46 * 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
48 * SCALE (input) DOUBLE PRECISION array, dimension (N)
49 * Details of the permutation and scaling factors, as returned
53 * The number of columns of the matrix V. M >= 0.
55 * V (input/output) COMPLEX*16 array, dimension (LDV,M)
56 * On entry, the matrix of right or left eigenvectors to be
57 * transformed, as returned by ZHSEIN or ZTREVC.
58 * On exit, V is overwritten by the transformed eigenvectors.
61 * The leading dimension of the array V. LDV >= max(1,N).
63 * INFO (output) INTEGER
64 * = 0: successful exit
65 * < 0: if INFO = -i, the i-th argument had an illegal value.
67 * =====================================================================
71 PARAMETER ( ONE = 1.0D+0 )
78 * .. External Functions ..
82 * .. External Subroutines ..
83 EXTERNAL XERBLA, ZDSCAL, ZSWAP
85 * .. Intrinsic Functions ..
88 * .. Executable Statements ..
90 * Decode and Test the input parameters
92 RIGHTV = LSAME( SIDE, 'R' )
93 LEFTV = LSAME( SIDE, 'L' )
96 IF( .NOT.LSAME( JOB, 'N' ) .AND. .NOT.LSAME( JOB, 'P' ) .AND.
97 $ .NOT.LSAME( JOB, 'S' ) .AND. .NOT.LSAME( JOB, 'B' ) ) THEN
99 ELSE IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
101 ELSE IF( N.LT.0 ) THEN
103 ELSE IF( ILO.LT.1 .OR. ILO.GT.MAX( 1, N ) ) THEN
105 ELSE IF( IHI.LT.MIN( ILO, N ) .OR. IHI.GT.N ) THEN
107 ELSE IF( M.LT.0 ) THEN
109 ELSE IF( LDV.LT.MAX( 1, N ) ) THEN
113 CALL XERBLA( 'ZGEBAK', -INFO )
117 * Quick return if possible
123 IF( LSAME( JOB, 'N' ) )
131 IF( LSAME( JOB, 'S' ) .OR. LSAME( JOB, 'B' ) ) THEN
136 CALL ZDSCAL( M, S, V( I, 1 ), LDV )
143 CALL ZDSCAL( M, S, V( I, 1 ), LDV )
149 * Backward permutation
151 * For I = ILO-1 step -1 until 1,
152 * IHI+1 step 1 until N do --
155 IF( LSAME( JOB, 'P' ) .OR. LSAME( JOB, 'B' ) ) THEN
159 IF( I.GE.ILO .AND. I.LE.IHI )
166 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
173 IF( I.GE.ILO .AND. I.LE.IHI )
180 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )