1 *> \brief \b CLAQGE 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 CLAQGE + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claqge.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claqge.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claqge.f">
21 * SUBROUTINE CLAQGE( M, N, A, LDA, R, C, ROWCND, COLCND, AMAX,
24 * .. Scalar Arguments ..
27 * REAL AMAX, COLCND, ROWCND
29 * .. Array Arguments ..
40 *> CLAQGE 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 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 REAL array, dimension (M)
76 *> The row scale factors for A.
81 *> C is REAL array, dimension (N)
82 *> The column scale factors for A.
88 *> Ratio of the smallest R(i) to the largest R(i).
94 *> Ratio of the smallest C(i) to the largest C(i).
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 December 2016
140 *> \ingroup complexGEauxiliary
142 * =====================================================================
143 SUBROUTINE CLAQGE( M, N, A, LDA, R, C, ROWCND, COLCND, AMAX,
146 * -- LAPACK auxiliary routine (version 3.7.0) --
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 REAL AMAX, COLCND, ROWCND
156 * .. Array Arguments ..
161 * =====================================================================
165 PARAMETER ( ONE = 1.0E+0, THRESH = 0.1E+0 )
167 * .. Local Scalars ..
169 REAL CJ, LARGE, SMALL
171 * .. External Functions ..
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 = SLAMCH( 'Safe minimum' ) / SLAMCH( '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 )