LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dgebak.f
Go to the documentation of this file.
1*> \brief \b DGEBAK
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DGEBAK + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgebak.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgebak.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgebak.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
20* INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER JOB, SIDE
24* INTEGER IHI, ILO, INFO, LDV, M, N
25* ..
26* .. Array Arguments ..
27* DOUBLE PRECISION SCALE( * ), V( LDV, * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> DGEBAK forms the right or left eigenvectors of a real general matrix
37*> by backward transformation on the computed eigenvectors of the
38*> balanced matrix output by DGEBAL.
39*> \endverbatim
40*
41* Arguments:
42* ==========
43*
44*> \param[in] JOB
45*> \verbatim
46*> JOB is CHARACTER*1
47*> Specifies the type of backward transformation required:
48*> = 'N': do nothing, return immediately;
49*> = 'P': do backward transformation for permutation only;
50*> = 'S': do backward transformation for scaling only;
51*> = 'B': do backward transformations for both permutation and
52*> scaling.
53*> JOB must be the same as the argument JOB supplied to DGEBAL.
54*> \endverbatim
55*>
56*> \param[in] SIDE
57*> \verbatim
58*> SIDE is CHARACTER*1
59*> = 'R': V contains right eigenvectors;
60*> = 'L': V contains left eigenvectors.
61*> \endverbatim
62*>
63*> \param[in] N
64*> \verbatim
65*> N is INTEGER
66*> The number of rows of the matrix V. N >= 0.
67*> \endverbatim
68*>
69*> \param[in] ILO
70*> \verbatim
71*> ILO is INTEGER
72*> \endverbatim
73*>
74*> \param[in] IHI
75*> \verbatim
76*> IHI is INTEGER
77*> The integers ILO and IHI determined by DGEBAL.
78*> 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
79*> \endverbatim
80*>
81*> \param[in] SCALE
82*> \verbatim
83*> SCALE is DOUBLE PRECISION array, dimension (N)
84*> Details of the permutation and scaling factors, as returned
85*> by DGEBAL.
86*> \endverbatim
87*>
88*> \param[in] M
89*> \verbatim
90*> M is INTEGER
91*> The number of columns of the matrix V. M >= 0.
92*> \endverbatim
93*>
94*> \param[in,out] V
95*> \verbatim
96*> V is DOUBLE PRECISION array, dimension (LDV,M)
97*> On entry, the matrix of right or left eigenvectors to be
98*> transformed, as returned by DHSEIN or DTREVC.
99*> On exit, V is overwritten by the transformed eigenvectors.
100*> \endverbatim
101*>
102*> \param[in] LDV
103*> \verbatim
104*> LDV is INTEGER
105*> The leading dimension of the array V. LDV >= max(1,N).
106*> \endverbatim
107*>
108*> \param[out] INFO
109*> \verbatim
110*> INFO is INTEGER
111*> = 0: successful exit
112*> < 0: if INFO = -i, the i-th argument had an illegal value.
113*> \endverbatim
114*
115* Authors:
116* ========
117*
118*> \author Univ. of Tennessee
119*> \author Univ. of California Berkeley
120*> \author Univ. of Colorado Denver
121*> \author NAG Ltd.
122*
123*> \ingroup gebak
124*
125* =====================================================================
126 SUBROUTINE dgebak( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
127 $ INFO )
128*
129* -- LAPACK computational routine --
130* -- LAPACK is a software package provided by Univ. of Tennessee, --
131* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132*
133* .. Scalar Arguments ..
134 CHARACTER JOB, SIDE
135 INTEGER IHI, ILO, INFO, LDV, M, N
136* ..
137* .. Array Arguments ..
138 DOUBLE PRECISION SCALE( * ), V( LDV, * )
139* ..
140*
141* =====================================================================
142*
143* .. Parameters ..
144 DOUBLE PRECISION ONE
145 parameter( one = 1.0d+0 )
146* ..
147* .. Local Scalars ..
148 LOGICAL LEFTV, RIGHTV
149 INTEGER I, II, K
150 DOUBLE PRECISION S
151* ..
152* .. External Functions ..
153 LOGICAL LSAME
154 EXTERNAL lsame
155* ..
156* .. External Subroutines ..
157 EXTERNAL dscal, dswap, xerbla
158* ..
159* .. Intrinsic Functions ..
160 INTRINSIC max, min
161* ..
162* .. Executable Statements ..
163*
164* Decode and Test the input parameters
165*
166 rightv = lsame( side, 'R' )
167 leftv = lsame( side, 'L' )
168*
169 info = 0
170 IF( .NOT.lsame( job, 'N' ) .AND.
171 $ .NOT.lsame( job, 'P' ) .AND.
172 $ .NOT.lsame( job, 'S' ) .AND.
173 $ .NOT.lsame( job, 'B' ) ) THEN
174 info = -1
175 ELSE IF( .NOT.rightv .AND. .NOT.leftv ) THEN
176 info = -2
177 ELSE IF( n.LT.0 ) THEN
178 info = -3
179 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) ) THEN
180 info = -4
181 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n ) THEN
182 info = -5
183 ELSE IF( m.LT.0 ) THEN
184 info = -7
185 ELSE IF( ldv.LT.max( 1, n ) ) THEN
186 info = -9
187 END IF
188 IF( info.NE.0 ) THEN
189 CALL xerbla( 'DGEBAK', -info )
190 RETURN
191 END IF
192*
193* Quick return if possible
194*
195 IF( n.EQ.0 )
196 $ RETURN
197 IF( m.EQ.0 )
198 $ RETURN
199 IF( lsame( job, 'N' ) )
200 $ RETURN
201*
202 IF( ilo.EQ.ihi )
203 $ GO TO 30
204*
205* Backward balance
206*
207 IF( lsame( job, 'S' ) .OR. lsame( job, 'B' ) ) THEN
208*
209 IF( rightv ) THEN
210 DO 10 i = ilo, ihi
211 s = scale( i )
212 CALL dscal( m, s, v( i, 1 ), ldv )
213 10 CONTINUE
214 END IF
215*
216 IF( leftv ) THEN
217 DO 20 i = ilo, ihi
218 s = one / scale( i )
219 CALL dscal( m, s, v( i, 1 ), ldv )
220 20 CONTINUE
221 END IF
222*
223 END IF
224*
225* Backward permutation
226*
227* For I = ILO-1 step -1 until 1,
228* IHI+1 step 1 until N do --
229*
230 30 CONTINUE
231 IF( lsame( job, 'P' ) .OR. lsame( job, 'B' ) ) THEN
232 IF( rightv ) THEN
233 DO 40 ii = 1, n
234 i = ii
235 IF( i.GE.ilo .AND. i.LE.ihi )
236 $ GO TO 40
237 IF( i.LT.ilo )
238 $ i = ilo - ii
239 k = int( scale( i ) )
240 IF( k.EQ.i )
241 $ GO TO 40
242 CALL dswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
243 40 CONTINUE
244 END IF
245*
246 IF( leftv ) THEN
247 DO 50 ii = 1, n
248 i = ii
249 IF( i.GE.ilo .AND. i.LE.ihi )
250 $ GO TO 50
251 IF( i.LT.ilo )
252 $ i = ilo - ii
253 k = int( scale( i ) )
254 IF( k.EQ.i )
255 $ GO TO 50
256 CALL dswap( m, v( i, 1 ), ldv, v( k, 1 ), ldv )
257 50 CONTINUE
258 END IF
259 END IF
260*
261 RETURN
262*
263* End of DGEBAK
264*
265 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dgebak(job, side, n, ilo, ihi, scale, m, v, ldv, info)
DGEBAK
Definition dgebak.f:128
subroutine dscal(n, da, dx, incx)
DSCAL
Definition dscal.f:79
subroutine dswap(n, dx, incx, dy, incy)
DSWAP
Definition dswap.f:82