OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
zggbak.f
Go to the documentation of this file.
1*> \brief \b ZGGBAK
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> \htmlonly
9*> Download ZGGBAK + dependencies
10*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zggbak.f">
11*> [TGZ]</a>
12*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zggbak.f">
13*> [ZIP]</a>
14*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zggbak.f">
15*> [TXT]</a>
16*> \endhtmlonly
17*
18* Definition:
19* ===========
20*
21* SUBROUTINE ZGGBAK( JOB, SIDE, N, ILO, IHI, LSCALE, RSCALE, M, V,
22* LDV, INFO )
23*
24* .. Scalar Arguments ..
25* CHARACTER JOB, SIDE
26* INTEGER IHI, ILO, INFO, LDV, M, N
27* ..
28* .. Array Arguments ..
29* DOUBLE PRECISION LSCALE( * ), RSCALE( * )
30* COMPLEX*16 V( LDV, * )
31* ..
32*
33*
34*> \par Purpose:
35* =============
36*>
37*> \verbatim
38*>
39*> ZGGBAK forms the right or left eigenvectors of a complex generalized
40*> eigenvalue problem A*x = lambda*B*x, by backward transformation on
41*> the computed eigenvectors of the balanced pair of matrices output by
42*> ZGGBAL.
43*> \endverbatim
44*
45* Arguments:
46* ==========
47*
48*> \param[in] JOB
49*> \verbatim
50*> JOB is CHARACTER*1
51*> Specifies the type of backward transformation required:
52*> = 'N': do nothing, return immediately;
53*> = 'P': do backward transformation for permutation only;
54*> = 'S': do backward transformation for scaling only;
55*> = 'B': do backward transformations for both permutation and
56*> scaling.
57*> JOB must be the same as the argument JOB supplied to ZGGBAL.
58*> \endverbatim
59*>
60*> \param[in] SIDE
61*> \verbatim
62*> SIDE is CHARACTER*1
63*> = 'R': V contains right eigenvectors;
64*> = 'L': V contains left eigenvectors.
65*> \endverbatim
66*>
67*> \param[in] N
68*> \verbatim
69*> N is INTEGER
70*> The number of rows of the matrix V. N >= 0.
71*> \endverbatim
72*>
73*> \param[in] ILO
74*> \verbatim
75*> ILO is INTEGER
76*> \endverbatim
77*>
78*> \param[in] IHI
79*> \verbatim
80*> IHI is INTEGER
81*> The integers ILO and IHI determined by ZGGBAL.
82*> 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
83*> \endverbatim
84*>
85*> \param[in] LSCALE
86*> \verbatim
87*> LSCALE is DOUBLE PRECISION array, dimension (N)
88*> Details of the permutations and/or scaling factors applied
89*> to the left side of A and B, as returned by ZGGBAL.
90*> \endverbatim
91*>
92*> \param[in] RSCALE
93*> \verbatim
94*> RSCALE is DOUBLE PRECISION array, dimension (N)
95*> Details of the permutations and/or scaling factors applied
96*> to the right side of A and B, as returned by ZGGBAL.
97*> \endverbatim
98*>
99*> \param[in] M
100*> \verbatim
101*> M is INTEGER
102*> The number of columns of the matrix V. M >= 0.
103*> \endverbatim
104*>
105*> \param[in,out] V
106*> \verbatim
107*> V is COMPLEX*16 array, dimension (LDV,M)
108*> On entry, the matrix of right or left eigenvectors to be
109*> transformed, as returned by ZTGEVC.
110*> On exit, V is overwritten by the transformed eigenvectors.
111*> \endverbatim
112*>
113*> \param[in] LDV
114*> \verbatim
115*> LDV is INTEGER
116*> The leading dimension of the matrix V. LDV >= max(1,N).
117*> \endverbatim
118*>
119*> \param[out] INFO
120*> \verbatim
121*> INFO is INTEGER
122*> = 0: successful exit.
123*> < 0: if INFO = -i, the i-th argument had an illegal value.
124*> \endverbatim
125*
126* Authors:
127* ========
128*
129*> \author Univ. of Tennessee
130*> \author Univ. of California Berkeley
131*> \author Univ. of Colorado Denver
132*> \author NAG Ltd.
133*
134*> \ingroup complex16GBcomputational
135*
136*> \par Further Details:
137* =====================
138*>
139*> \verbatim
140*>
141*> See R.C. Ward, Balancing the generalized eigenvalue problem,
142*> SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
143*> \endverbatim
144*>
145* =====================================================================
146 SUBROUTINE zggbak( JOB, SIDE, N, ILO, IHI, LSCALE, RSCALE, M, V,
147 $ LDV, INFO )
148*
149* -- LAPACK computational routine --
150* -- LAPACK is a software package provided by Univ. of Tennessee, --
151* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
152*
153* .. Scalar Arguments ..
154 CHARACTER JOB, SIDE
155 INTEGER IHI, ILO, INFO, LDV, M, N
156* ..
157* .. Array Arguments ..
158 DOUBLE PRECISION LSCALE( * ), RSCALE( * )
159 COMPLEX*16 V( LDV, * )
160* ..
161*
162* =====================================================================
163*
164* .. Local Scalars ..
165 LOGICAL LEFTV, RIGHTV
166 INTEGER I, K
167* ..
168* .. External Functions ..
169 LOGICAL LSAME
170 EXTERNAL lsame
171* ..
172* .. External Subroutines ..
173 EXTERNAL xerbla, zdscal, zswap
174* ..
175* .. Intrinsic Functions ..
176 INTRINSIC max, int
177* ..
178* .. Executable Statements ..
179*
180* Test the input parameters
181*
182 rightv = lsame( side, 'r' )
183 LEFTV = LSAME( SIDE, 'l' )
184*
185 INFO = 0
186.NOT. IF( LSAME( JOB, 'n.AND..NOT.' ) LSAME( JOB, 'p.AND.' )
187.NOT. $ LSAME( JOB, 's.AND..NOT.' ) LSAME( JOB, 'b' ) ) THEN
188 INFO = -1
189.NOT..AND..NOT. ELSE IF( RIGHTV LEFTV ) THEN
190 INFO = -2
191.LT. ELSE IF( N0 ) THEN
192 INFO = -3
193.LT. ELSE IF( ILO1 ) THEN
194 INFO = -4
195.EQ..AND..EQ..AND..NE. ELSE IF( N0 IHI0 ILO1 ) THEN
196 INFO = -4
197.GT..AND..LT..OR..GT. ELSE IF( N0 ( IHIILO IHIMAX( 1, N ) ) )
198 $ THEN
199 INFO = -5
200.EQ..AND..EQ..AND..NE. ELSE IF( N0 ILO1 IHI0 ) THEN
201 INFO = -5
202.LT. ELSE IF( M0 ) THEN
203 INFO = -8
204.LT. ELSE IF( LDVMAX( 1, N ) ) THEN
205 INFO = -10
206 END IF
207.NE. IF( INFO0 ) THEN
208 CALL XERBLA( 'zggbak', -INFO )
209 RETURN
210 END IF
211*
212* Quick return if possible
213*
214.EQ. IF( N0 )
215 $ RETURN
216.EQ. IF( M0 )
217 $ RETURN
218 IF( LSAME( JOB, 'n' ) )
219 $ RETURN
220*
221.EQ. IF( ILOIHI )
222 $ GO TO 30
223*
224* Backward balance
225*
226 IF( LSAME( JOB, 's.OR.' ) LSAME( JOB, 'b' ) ) THEN
227*
228* Backward transformation on right eigenvectors
229*
230 IF( RIGHTV ) THEN
231 DO 10 I = ILO, IHI
232 CALL ZDSCAL( M, RSCALE( I ), V( I, 1 ), LDV )
233 10 CONTINUE
234 END IF
235*
236* Backward transformation on left eigenvectors
237*
238 IF( LEFTV ) THEN
239 DO 20 I = ILO, IHI
240 CALL ZDSCAL( M, LSCALE( I ), V( I, 1 ), LDV )
241 20 CONTINUE
242 END IF
243 END IF
244*
245* Backward permutation
246*
247 30 CONTINUE
248 IF( LSAME( JOB, 'p.OR.' ) LSAME( JOB, 'b' ) ) THEN
249*
250* Backward permutation on right eigenvectors
251*
252 IF( RIGHTV ) THEN
253.EQ. IF( ILO1 )
254 $ GO TO 50
255 DO 40 I = ILO - 1, 1, -1
256 K = INT(RSCALE( I ))
257.EQ. IF( KI )
258 $ GO TO 40
259 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
260 40 CONTINUE
261*
262 50 CONTINUE
263.EQ. IF( IHIN )
264 $ GO TO 70
265 DO 60 I = IHI + 1, N
266 K = INT(RSCALE( I ))
267.EQ. IF( KI )
268 $ GO TO 60
269 CALL ZSWAP( 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.EQ. IF( ILO1 )
278 $ GO TO 90
279 DO 80 I = ILO - 1, 1, -1
280 K = INT(LSCALE( I ))
281.EQ. IF( KI )
282 $ GO TO 80
283 CALL ZSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
284 80 CONTINUE
285*
286 90 CONTINUE
287.EQ. IF( IHIN )
288 $ GO TO 110
289 DO 100 I = IHI + 1, N
290 K = INT(LSCALE( I ))
291.EQ. IF( KI )
292 $ GO TO 100
293 CALL ZSWAP( 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 ZGGBAK
303*
304 END
subroutine xerbla(srname, info)
XERBLA
Definition xerbla.f:60
subroutine zggbak(job, side, n, ilo, ihi, lscale, rscale, m, v, ldv, info)
ZGGBAK
Definition zggbak.f:148
subroutine zdscal(n, da, zx, incx)
ZDSCAL
Definition zdscal.f:78
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
Definition zswap.f:81
#define max(a, b)
Definition macros.h:21