LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine cggbak ( character JOB, character SIDE, integer N, integer ILO, integer IHI, real, dimension( * ) LSCALE, real, dimension( * ) RSCALE, integer M, complex, dimension( ldv, * ) V, integer LDV, integer INFO )

CGGBAK

Purpose:
``` CGGBAK forms the right or left eigenvectors of a complex generalized
eigenvalue problem A*x = lambda*B*x, by backward transformation on
the computed eigenvectors of the balanced pair of matrices output by
CGGBAL.```
Parameters
 [in] JOB ``` JOB is CHARACTER*1 Specifies the type of backward transformation required: = 'N': do nothing, return immediately; = 'P': do backward transformation for permutation only; = 'S': do backward transformation for scaling only; = 'B': do backward transformations for both permutation and scaling. JOB must be the same as the argument JOB supplied to CGGBAL.``` [in] SIDE ``` SIDE is CHARACTER*1 = 'R': V contains right eigenvectors; = 'L': V contains left eigenvectors.``` [in] N ``` N is INTEGER The number of rows of the matrix V. N >= 0.``` [in] ILO ` ILO is INTEGER` [in] IHI ``` IHI is INTEGER The integers ILO and IHI determined by CGGBAL. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.``` [in] LSCALE ``` LSCALE is REAL array, dimension (N) Details of the permutations and/or scaling factors applied to the left side of A and B, as returned by CGGBAL.``` [in] RSCALE ``` RSCALE is REAL array, dimension (N) Details of the permutations and/or scaling factors applied to the right side of A and B, as returned by CGGBAL.``` [in] M ``` M is INTEGER The number of columns of the matrix V. M >= 0.``` [in,out] V ``` V is COMPLEX array, dimension (LDV,M) On entry, the matrix of right or left eigenvectors to be transformed, as returned by CTGEVC. On exit, V is overwritten by the transformed eigenvectors.``` [in] LDV ``` LDV is INTEGER The leading dimension of the matrix V. LDV >= max(1,N).``` [out] INFO ``` INFO is INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.```
Date
November 2011
Further Details:
```  See R.C. Ward, Balancing the generalized eigenvalue problem,
SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.```

Definition at line 150 of file cggbak.f.

150 *
151 * -- LAPACK computational routine (version 3.4.0) --
152 * -- LAPACK is a software package provided by Univ. of Tennessee, --
153 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
154 * November 2011
155 *
156 * .. Scalar Arguments ..
157  CHARACTER job, side
158  INTEGER ihi, ilo, info, ldv, m, n
159 * ..
160 * .. Array Arguments ..
161  REAL lscale( * ), rscale( * )
162  COMPLEX v( ldv, * )
163 * ..
164 *
165 * =====================================================================
166 *
167 * .. Local Scalars ..
168  LOGICAL leftv, rightv
169  INTEGER i, k
170 * ..
171 * .. External Functions ..
172  LOGICAL lsame
173  EXTERNAL lsame
174 * ..
175 * .. External Subroutines ..
176  EXTERNAL csscal, cswap, xerbla
177 * ..
178 * .. Intrinsic Functions ..
179  INTRINSIC max
180 * ..
181 * .. Executable Statements ..
182 *
183 * Test the input parameters
184 *
185  rightv = lsame( side, 'R' )
186  leftv = lsame( side, 'L' )
187 *
188  info = 0
189  IF( .NOT.lsame( job, 'N' ) .AND. .NOT.lsame( job, 'P' ) .AND.
190  \$ .NOT.lsame( job, 'S' ) .AND. .NOT.lsame( job, 'B' ) ) THEN
191  info = -1
192  ELSE IF( .NOT.rightv .AND. .NOT.leftv ) THEN
193  info = -2
194  ELSE IF( n.LT.0 ) THEN
195  info = -3
196  ELSE IF( ilo.LT.1 ) THEN
197  info = -4
198  ELSE IF( n.EQ.0 .AND. ihi.EQ.0 .AND. ilo.NE.1 ) THEN
199  info = -4
200  ELSE IF( n.GT.0 .AND. ( ihi.LT.ilo .OR. ihi.GT.max( 1, n ) ) )
201  \$ THEN
202  info = -5
203  ELSE IF( n.EQ.0 .AND. ilo.EQ.1 .AND. ihi.NE.0 ) THEN
204  info = -5
205  ELSE IF( m.LT.0 ) THEN
206  info = -8
207  ELSE IF( ldv.LT.max( 1, n ) ) THEN
208  info = -10
209  END IF
210  IF( info.NE.0 ) THEN
211  CALL xerbla( 'CGGBAK', -info )
212  RETURN
213  END IF
214 *
215 * Quick return if possible
216 *
217  IF( n.EQ.0 )
218  \$ RETURN
219  IF( m.EQ.0 )
220  \$ RETURN
221  IF( lsame( job, 'N' ) )
222  \$ RETURN
223 *
224  IF( ilo.EQ.ihi )
225  \$ GO TO 30
226 *
227 * Backward balance
228 *
229  IF( lsame( job, 'S' ) .OR. lsame( job, 'B' ) ) THEN
230 *
231 * Backward transformation on right eigenvectors
232 *
233  IF( rightv ) THEN
234  DO 10 i = ilo, ihi
235  CALL csscal( m, rscale( i ), v( i, 1 ), ldv )
236  10 CONTINUE
237  END IF
238 *
239 * Backward transformation on left eigenvectors
240 *
241  IF( leftv ) THEN
242  DO 20 i = ilo, ihi
243  CALL csscal( m, lscale( i ), v( i, 1 ), ldv )
244  20 CONTINUE
245  END IF
246  END IF
247 *
248 * Backward permutation
249 *
250  30 CONTINUE
251  IF( lsame( job, 'P' ) .OR. lsame( job, 'B' ) ) THEN
252 *
253 * Backward permutation on right eigenvectors
254 *
255  IF( rightv ) THEN
256  IF( ilo.EQ.1 )
257  \$ GO TO 50
258  DO 40 i = ilo - 1, 1, -1
259  k = rscale( i )
260  IF( k.EQ.i )
261  \$ GO TO 40
262  CALL cswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
263  40 CONTINUE
264 *
265  50 CONTINUE
266  IF( ihi.EQ.n )
267  \$ GO TO 70
268  DO 60 i = ihi + 1, n
269  k = rscale( i )
270  IF( k.EQ.i )
271  \$ GO TO 60
272  CALL cswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
273  60 CONTINUE
274  END IF
275 *
276 * Backward permutation on left eigenvectors
277 *
278  70 CONTINUE
279  IF( leftv ) THEN
280  IF( ilo.EQ.1 )
281  \$ GO TO 90
282  DO 80 i = ilo - 1, 1, -1
283  k = lscale( i )
284  IF( k.EQ.i )
285  \$ GO TO 80
286  CALL cswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
287  80 CONTINUE
288 *
289  90 CONTINUE
290  IF( ihi.EQ.n )
291  \$ GO TO 110
292  DO 100 i = ihi + 1, n
293  k = lscale( i )
294  IF( k.EQ.i )
295  \$ GO TO 100
296  CALL cswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
297  100 CONTINUE
298  END IF
299  END IF
300 *
301  110 CONTINUE
302 *
303  RETURN
304 *
305 * End of CGGBAK
306 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine cswap(N, CX, INCX, CY, INCY)
CSWAP
Definition: cswap.f:52
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine csscal(N, SA, CX, INCX)
CSSCAL
Definition: csscal.f:54

Here is the call graph for this function:

Here is the caller graph for this function: