3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DGEBAK + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgebak.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgebak.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgebak.f">
21 * SUBROUTINE DGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
24 * .. Scalar Arguments ..
26 * INTEGER IHI, ILO, INFO, LDV, M, N
28 * .. Array Arguments ..
29 * DOUBLE PRECISION SCALE( * ), V( LDV, * )
38 *> DGEBAK forms the right or left eigenvectors of a real general matrix
39 *> by backward transformation on the computed eigenvectors of the
40 *> balanced matrix output by DGEBAL.
49 *> Specifies the type of backward transformation required:
50 *> = 'N', do nothing, return immediately;
51 *> = 'P', do backward transformation for permutation only;
52 *> = 'S', do backward transformation for scaling only;
53 *> = 'B', do backward transformations for both permutation and
55 *> JOB must be the same as the argument JOB supplied to DGEBAL.
60 *> SIDE is CHARACTER*1
61 *> = 'R': V contains right eigenvectors;
62 *> = 'L': V contains left eigenvectors.
68 *> The number of rows of the matrix V. N >= 0.
79 *> The integers ILO and IHI determined by DGEBAL.
80 *> 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
85 *> SCALE is DOUBLE PRECISION array, dimension (N)
86 *> Details of the permutation and scaling factors, as returned
93 *> The number of columns of the matrix V. M >= 0.
98 *> V is DOUBLE PRECISION array, dimension (LDV,M)
99 *> On entry, the matrix of right or left eigenvectors to be
100 *> transformed, as returned by DHSEIN or DTREVC.
101 *> On exit, V is overwritten by the transformed eigenvectors.
107 *> The leading dimension of the array V. LDV >= max(1,N).
113 *> = 0: successful exit
114 *> < 0: if INFO = -i, the i-th argument had an illegal value.
120 *> \author Univ. of Tennessee
121 *> \author Univ. of California Berkeley
122 *> \author Univ. of Colorado Denver
125 *> \date November 2011
127 *> \ingroup doubleGEcomputational
129 * =====================================================================
130 SUBROUTINE DGEBAK( JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV,
133 * -- LAPACK computational routine (version 3.4.0) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138 * .. Scalar Arguments ..
140 INTEGER IHI, ILO, INFO, LDV, M, N
142 * .. Array Arguments ..
143 DOUBLE PRECISION SCALE( * ), V( LDV, * )
146 * =====================================================================
150 PARAMETER ( ONE = 1.0D+0 )
152 * .. Local Scalars ..
153 LOGICAL LEFTV, RIGHTV
157 * .. External Functions ..
161 * .. External Subroutines ..
162 EXTERNAL DSCAL, DSWAP, XERBLA
164 * .. Intrinsic Functions ..
167 * .. Executable Statements ..
169 * Decode and Test the input parameters
171 RIGHTV = LSAME( SIDE, 'R' )
172 LEFTV = LSAME( SIDE, 'L' )
175 IF( .NOT.LSAME( JOB, 'N' ) .AND. .NOT.LSAME( JOB, 'P' ) .AND.
176 $ .NOT.LSAME( JOB, 'S' ) .AND. .NOT.LSAME( JOB, 'B' ) ) THEN
178 ELSE IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
180 ELSE IF( N.LT.0 ) THEN
182 ELSE IF( ILO.LT.1 .OR. ILO.GT.MAX( 1, N ) ) THEN
184 ELSE IF( IHI.LT.MIN( ILO, N ) .OR. IHI.GT.N ) THEN
186 ELSE IF( M.LT.0 ) THEN
188 ELSE IF( LDV.LT.MAX( 1, N ) ) THEN
192 CALL XERBLA( 'DGEBAK', -INFO )
196 * Quick return if possible
202 IF( LSAME( JOB, 'N' ) )
210 IF( LSAME( JOB, 'S' ) .OR. LSAME( JOB, 'B' ) ) THEN
215 CALL DSCAL( M, S, V( I, 1 ), LDV )
222 CALL DSCAL( M, S, V( I, 1 ), LDV )
228 * Backward permutation
230 * For I = ILO-1 step -1 until 1,
231 * IHI+1 step 1 until N do --
234 IF( LSAME( JOB, 'P' ) .OR. LSAME( JOB, 'B' ) ) THEN
238 IF( I.GE.ILO .AND. I.LE.IHI )
245 CALL DSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )
252 IF( I.GE.ILO .AND. I.LE.IHI )
259 CALL DSWAP( M, V( I, 1 ), LDV, V( K, 1 ), LDV )