1 *> \brief \b ZLAQGE scales a general rectangular matrix, using row and column scaling factors computed by sgeequ.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLAQGE + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlaqge.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlaqge.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlaqge.f">
21 * SUBROUTINE ZLAQGE( M, N, A, LDA, R, C, ROWCND, COLCND, AMAX,
24 * .. Scalar Arguments ..
27 * DOUBLE PRECISION AMAX, COLCND, ROWCND
29 * .. Array Arguments ..
30 * DOUBLE PRECISION C( * ), R( * )
31 * COMPLEX*16 A( LDA, * )
40 *> ZLAQGE equilibrates a general M by N matrix A using the row and
41 *> column scaling factors in the vectors R and C.
50 *> The number of rows of the matrix A. M >= 0.
56 *> The number of columns of the matrix A. N >= 0.
61 *> A is COMPLEX*16 array, dimension (LDA,N)
62 *> On entry, the M by N matrix A.
63 *> On exit, the equilibrated matrix. See EQUED for the form of
64 *> the equilibrated matrix.
70 *> The leading dimension of the array A. LDA >= max(M,1).
75 *> R is DOUBLE PRECISION array, dimension (M)
76 *> The row scale factors for A.
81 *> C is DOUBLE PRECISION array, dimension (N)
82 *> The column scale factors for A.
87 *> ROWCND is DOUBLE PRECISION
88 *> Ratio of the smallest R(i) to the largest R(i).
93 *> COLCND is DOUBLE PRECISION
94 *> Ratio of the smallest C(i) to the largest C(i).
99 *> AMAX is DOUBLE PRECISION
100 *> Absolute value of largest matrix entry.
105 *> EQUED is CHARACTER*1
106 *> Specifies the form of equilibration that was done.
107 *> = 'N': No equilibration
108 *> = 'R': Row equilibration, i.e., A has been premultiplied by
110 *> = 'C': Column equilibration, i.e., A has been postmultiplied
112 *> = 'B': Both row and column equilibration, i.e., A has been
113 *> replaced by diag(R) * A * diag(C).
116 *> \par Internal Parameters:
117 * =========================
120 *> THRESH is a threshold value used to decide if row or column scaling
121 *> should be done based on the ratio of the row or column scaling
122 *> factors. If ROWCND < THRESH, row scaling is done, and if
123 *> COLCND < THRESH, column scaling is done.
125 *> LARGE and SMALL are threshold values used to decide if row scaling
126 *> should be done based on the absolute size of the largest matrix
127 *> element. If AMAX > LARGE or AMAX < SMALL, row scaling is done.
133 *> \author Univ. of Tennessee
134 *> \author Univ. of California Berkeley
135 *> \author Univ. of Colorado Denver
138 *> \date September 2012
140 *> \ingroup complex16GEauxiliary
142 * =====================================================================
143 SUBROUTINE ZLAQGE( M, N, A, LDA, R, C, ROWCND, COLCND, AMAX,
146 * -- LAPACK auxiliary routine (version 3.4.2) --
147 * -- LAPACK is a software package provided by Univ. of Tennessee, --
148 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * .. Scalar Arguments ..
154 DOUBLE PRECISION AMAX, COLCND, ROWCND
156 * .. Array Arguments ..
157 DOUBLE PRECISION C( * ), R( * )
158 COMPLEX*16 A( LDA, * )
161 * =====================================================================
164 DOUBLE PRECISION ONE, THRESH
165 PARAMETER ( ONE = 1.0D+0, THRESH = 0.1D+0 )
167 * .. Local Scalars ..
169 DOUBLE PRECISION CJ, LARGE, SMALL
171 * .. External Functions ..
172 DOUBLE PRECISION DLAMCH
175 * .. Executable Statements ..
177 * Quick return if possible
179 IF( M.LE.0 .OR. N.LE.0 ) THEN
184 * Initialize LARGE and SMALL.
186 SMALL = DLAMCH( 'Safe minimum' ) / DLAMCH( 'Precision' )
189 IF( ROWCND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE )
194 IF( COLCND.GE.THRESH ) THEN
206 A( I, J ) = CJ*A( I, J )
211 ELSE IF( COLCND.GE.THRESH ) THEN
213 * Row scaling, no column scaling
217 A( I, J ) = R( I )*A( I, J )
223 * Row and column scaling
228 A( I, J ) = CJ*R( I )*A( I, J )