LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dggbak()

subroutine dggbak ( character job,
character side,
integer n,
integer ilo,
integer ihi,
double precision, dimension( * ) lscale,
double precision, dimension( * ) rscale,
integer m,
double precision, dimension( ldv, * ) v,
integer ldv,
integer info )

DGGBAK

Download DGGBAK + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> DGGBAK forms the right or left eigenvectors of a real generalized
!> eigenvalue problem A*x = lambda*B*x, by backward transformation on
!> the computed eigenvectors of the balanced pair of matrices output by
!> DGGBAL.
!> 
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 DGGBAL.
!> 
[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 DGGBAL.
!>          1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
!> 
[in]LSCALE
!>          LSCALE is DOUBLE PRECISION array, dimension (N)
!>          Details of the permutations and/or scaling factors applied
!>          to the left side of A and B, as returned by DGGBAL.
!> 
[in]RSCALE
!>          RSCALE is DOUBLE PRECISION array, dimension (N)
!>          Details of the permutations and/or scaling factors applied
!>          to the right side of A and B, as returned by DGGBAL.
!> 
[in]M
!>          M is INTEGER
!>          The number of columns of the matrix V.  M >= 0.
!> 
[in,out]V
!>          V is DOUBLE PRECISION array, dimension (LDV,M)
!>          On entry, the matrix of right or left eigenvectors to be
!>          transformed, as returned by DTGEVC.
!>          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.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
!>
!>  See R.C. Ward, Balancing the generalized eigenvalue problem,
!>                 SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
!> 

Definition at line 143 of file dggbak.f.

146*
147* -- LAPACK computational routine --
148* -- LAPACK is a software package provided by Univ. of Tennessee, --
149* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
150*
151* .. Scalar Arguments ..
152 CHARACTER JOB, SIDE
153 INTEGER IHI, ILO, INFO, LDV, M, N
154* ..
155* .. Array Arguments ..
156 DOUBLE PRECISION LSCALE( * ), RSCALE( * ), V( LDV, * )
157* ..
158*
159* =====================================================================
160*
161* .. Local Scalars ..
162 LOGICAL LEFTV, RIGHTV
163 INTEGER I, K
164* ..
165* .. External Functions ..
166 LOGICAL LSAME
167 EXTERNAL lsame
168* ..
169* .. External Subroutines ..
170 EXTERNAL dscal, dswap, xerbla
171* ..
172* .. Intrinsic Functions ..
173 INTRINSIC max, int
174* ..
175* .. Executable Statements ..
176*
177* Test the input parameters
178*
179 rightv = lsame( side, 'R' )
180 leftv = lsame( side, 'L' )
181*
182 info = 0
183 IF( .NOT.lsame( job, 'N' ) .AND.
184 $ .NOT.lsame( job, 'P' ) .AND.
185 $ .NOT.lsame( job, 'S' ) .AND.
186 $ .NOT.lsame( job, 'B' ) ) THEN
187 info = -1
188 ELSE IF( .NOT.rightv .AND. .NOT.leftv ) THEN
189 info = -2
190 ELSE IF( n.LT.0 ) THEN
191 info = -3
192 ELSE IF( ilo.LT.1 ) THEN
193 info = -4
194 ELSE IF( n.EQ.0 .AND. ihi.EQ.0 .AND. ilo.NE.1 ) THEN
195 info = -4
196 ELSE IF( n.GT.0 .AND. ( ihi.LT.ilo .OR. ihi.GT.max( 1, n ) ) )
197 $ THEN
198 info = -5
199 ELSE IF( n.EQ.0 .AND. ilo.EQ.1 .AND. ihi.NE.0 ) THEN
200 info = -5
201 ELSE IF( m.LT.0 ) THEN
202 info = -8
203 ELSE IF( ldv.LT.max( 1, n ) ) THEN
204 info = -10
205 END IF
206 IF( info.NE.0 ) THEN
207 CALL xerbla( 'DGGBAK', -info )
208 RETURN
209 END IF
210*
211* Quick return if possible
212*
213 IF( n.EQ.0 )
214 $ RETURN
215 IF( m.EQ.0 )
216 $ RETURN
217 IF( lsame( job, 'N' ) )
218 $ RETURN
219*
220 IF( ilo.EQ.ihi )
221 $ GO TO 30
222*
223* Backward balance
224*
225 IF( lsame( job, 'S' ) .OR. lsame( job, 'B' ) ) THEN
226*
227* Backward transformation on right eigenvectors
228*
229 IF( rightv ) THEN
230 DO 10 i = ilo, ihi
231 CALL dscal( m, rscale( i ), v( i, 1 ), ldv )
232 10 CONTINUE
233 END IF
234*
235* Backward transformation on left eigenvectors
236*
237 IF( leftv ) THEN
238 DO 20 i = ilo, ihi
239 CALL dscal( m, lscale( i ), v( i, 1 ), ldv )
240 20 CONTINUE
241 END IF
242 END IF
243*
244* Backward permutation
245*
246 30 CONTINUE
247 IF( lsame( job, 'P' ) .OR. lsame( job, 'B' ) ) THEN
248*
249* Backward permutation on right eigenvectors
250*
251 IF( rightv ) THEN
252 IF( ilo.EQ.1 )
253 $ GO TO 50
254*
255 DO 40 i = ilo - 1, 1, -1
256 k = int(rscale( i ))
257 IF( k.EQ.i )
258 $ GO TO 40
259 CALL dswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
260 40 CONTINUE
261*
262 50 CONTINUE
263 IF( ihi.EQ.n )
264 $ GO TO 70
265 DO 60 i = ihi + 1, n
266 k = int(rscale( i ))
267 IF( k.EQ.i )
268 $ GO TO 60
269 CALL dswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
270 60 CONTINUE
271 END IF
272*
273* Backward permutation on left eigenvectors
274*
275 70 CONTINUE
276 IF( leftv ) THEN
277 IF( ilo.EQ.1 )
278 $ GO TO 90
279 DO 80 i = ilo - 1, 1, -1
280 k = int(lscale( i ))
281 IF( k.EQ.i )
282 $ GO TO 80
283 CALL dswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
284 80 CONTINUE
285*
286 90 CONTINUE
287 IF( ihi.EQ.n )
288 $ GO TO 110
289 DO 100 i = ihi + 1, n
290 k = int(lscale( i ))
291 IF( k.EQ.i )
292 $ GO TO 100
293 CALL dswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
294 100 CONTINUE
295 END IF
296 END IF
297*
298 110 CONTINUE
299*
300 RETURN
301*
302* End of DGGBAK
303*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine dscal(n, da, dx, incx)
DSCAL
Definition dscal.f:79
subroutine dswap(n, dx, incx, dy, incy)
DSWAP
Definition dswap.f:82
Here is the call graph for this function:
Here is the caller graph for this function: