3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CGEBAK + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgebak.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cgebak.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgebak.f">
21 * SUBROUTINE CGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
24 * .. Scalar Arguments ..
26 * INTEGER IHI, ILO, INFO, LDV, M, N
28 * .. Array Arguments ..
39 *> CGEBAK forms the right or left eigenvectors of a complex general
40 *> matrix by backward transformation on the computed eigenvectors of the
41 *> balanced matrix output by CGEBAL.
50 *> Specifies the type of backward transformation required:
51 *> = 'N', do nothing, return immediately;
52 *> = 'P', do backward transformation for permutation only;
53 *> = 'S', do backward transformation for scaling only;
54 *> = 'B', do backward transformations for both permutation and
56 *> JOB must be the same as the argument JOB supplied to CGEBAL.
61 *> SIDE is CHARACTER*1
62 *> = 'R': V contains right eigenvectors;
63 *> = 'L': V contains left eigenvectors.
69 *> The number of rows of the matrix V. N >= 0.
80 *> The integers ILO and IHI determined by CGEBAL.
81 *> 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
86 *> SCALE is REAL array, dimension (N)
87 *> Details of the permutation and scaling factors, as returned
94 *> The number of columns of the matrix V. M >= 0.
99 *> V is COMPLEX array, dimension (LDV,M)
100 *> On entry, the matrix of right or left eigenvectors to be
101 *> transformed, as returned by CHSEIN or CTREVC.
102 *> On exit, V is overwritten by the transformed eigenvectors.
108 *> The leading dimension of the array V. LDV >= max(1,N).
114 *> = 0: successful exit
115 *> < 0: if INFO = -i, the i-th argument had an illegal value.
121 *> \author Univ. of Tennessee
122 *> \author Univ. of California Berkeley
123 *> \author Univ. of Colorado Denver
126 *> \date November 2011
128 *> \ingroup complexGEcomputational
130 * =====================================================================
131 SUBROUTINE CGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
134 * -- LAPACK computational routine (version 3.4.0) --
135 * -- LAPACK is a software package provided by Univ. of Tennessee, --
136 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
139 * .. Scalar Arguments ..
141 INTEGER IHI, ILO, INFO, LDV, M, N
143 * .. Array Arguments ..
148 * =====================================================================
152 PARAMETER ( ONE = 1.0E+0 )
154 * .. Local Scalars ..
155 LOGICAL LEFTV, RIGHTV
159 * .. External Functions ..
163 * .. External Subroutines ..
164 EXTERNAL CSSCAL, CSWAP, XERBLA
166 * .. Intrinsic Functions ..
169 * .. Executable Statements ..
171 * Decode and Test the input parameters
173 RIGHTV = LSAME( SIDE, 'R' )
174 LEFTV = LSAME( SIDE, 'L' )
177 IF( .NOT.LSAME( JOB, 'N' ) .AND. .NOT.LSAME( JOB, 'P' ) .AND.
178 $ .NOT.LSAME( JOB, 'S' ) .AND. .NOT.LSAME( JOB, 'B' ) ) THEN
180 ELSE IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
182 ELSE IF( N.LT.0 ) THEN
184 ELSE IF( ILO.LT.1 .OR. ILO.GT.MAX( 1, N ) ) THEN
186 ELSE IF( IHI.LT.MIN( ILO, N ) .OR. IHI.GT.N ) THEN
188 ELSE IF( M.LT.0 ) THEN
190 ELSE IF( LDV.LT.MAX( 1, N ) ) THEN
194 CALL XERBLA( 'CGEBAK', -INFO )
198 * Quick return if possible
204 IF( LSAME( JOB, 'N' ) )
212 IF( LSAME( JOB, 'S' ) .OR. LSAME( JOB, 'B' ) ) THEN
217 CALL CSSCAL( M, S, V( I, 1 ), LDV )
224 CALL CSSCAL( M, S, V( I, 1 ), LDV )
230 * Backward permutation
232 * For I = ILO-1 step -1 until 1,
233 * IHI+1 step 1 until N do --
236 IF( LSAME( JOB, 'P' ) .OR. LSAME( JOB, 'B' ) ) THEN
240 IF( I.GE.ILO .AND. I.LE.IHI )
247 CALL CSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
254 IF( I.GE.ILO .AND. I.LE.IHI )
261 CALL CSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )