1 *> \brief \b ZLAQSY scales a symmetric/Hermitian matrix, using scaling factors computed by spoequ.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLAQSY + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlaqsy.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlaqsy.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlaqsy.f">
21 * SUBROUTINE ZLAQSY( UPLO, N, A, LDA, S, SCOND, AMAX, EQUED )
23 * .. Scalar Arguments ..
24 * CHARACTER EQUED, UPLO
26 * DOUBLE PRECISION AMAX, SCOND
28 * .. Array Arguments ..
29 * DOUBLE PRECISION S( * )
30 * COMPLEX*16 A( LDA, * )
39 *> ZLAQSY equilibrates a symmetric matrix A using the scaling factors
48 *> UPLO is CHARACTER*1
49 *> Specifies whether the upper or lower triangular part of the
50 *> symmetric matrix A is stored.
51 *> = 'U': Upper triangular
52 *> = 'L': Lower triangular
58 *> The order of the matrix A. N >= 0.
63 *> A is COMPLEX*16 array, dimension (LDA,N)
64 *> On entry, the symmetric matrix A. If UPLO = 'U', the leading
65 *> n by n upper triangular part of A contains the upper
66 *> triangular part of the matrix A, and the strictly lower
67 *> triangular part of A is not referenced. If UPLO = 'L', the
68 *> leading n by n lower triangular part of A contains the lower
69 *> triangular part of the matrix A, and the strictly upper
70 *> triangular part of A is not referenced.
72 *> On exit, if EQUED = 'Y', the equilibrated matrix:
73 *> diag(S) * A * diag(S).
79 *> The leading dimension of the array A. LDA >= max(N,1).
84 *> S is DOUBLE PRECISION array, dimension (N)
85 *> The scale factors for A.
90 *> SCOND is DOUBLE PRECISION
91 *> Ratio of the smallest S(i) to the largest S(i).
96 *> AMAX is DOUBLE PRECISION
97 *> Absolute value of largest matrix entry.
102 *> EQUED is CHARACTER*1
103 *> Specifies whether or not equilibration was done.
104 *> = 'N': No equilibration.
105 *> = 'Y': Equilibration was done, i.e., A has been replaced by
106 *> diag(S) * A * diag(S).
109 *> \par Internal Parameters:
110 * =========================
113 *> THRESH is a threshold value used to decide if scaling should be done
114 *> based on the ratio of the scaling factors. If SCOND < THRESH,
117 *> LARGE and SMALL are threshold values used to decide if scaling should
118 *> be done based on the absolute size of the largest matrix element.
119 *> If AMAX > LARGE or AMAX < SMALL, scaling is done.
125 *> \author Univ. of Tennessee
126 *> \author Univ. of California Berkeley
127 *> \author Univ. of Colorado Denver
130 *> \date September 2012
132 *> \ingroup complex16SYauxiliary
134 * =====================================================================
135 SUBROUTINE ZLAQSY( UPLO, N, A, LDA, S, SCOND, AMAX, EQUED )
137 * -- LAPACK auxiliary routine (version 3.4.2) --
138 * -- LAPACK is a software package provided by Univ. of Tennessee, --
139 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
142 * .. Scalar Arguments ..
143 CHARACTER EQUED, UPLO
145 DOUBLE PRECISION AMAX, SCOND
147 * .. Array Arguments ..
148 DOUBLE PRECISION S( * )
149 COMPLEX*16 A( LDA, * )
152 * =====================================================================
155 DOUBLE PRECISION ONE, THRESH
156 PARAMETER ( ONE = 1.0D+0, THRESH = 0.1D+0 )
158 * .. Local Scalars ..
160 DOUBLE PRECISION CJ, LARGE, SMALL
162 * .. External Functions ..
164 DOUBLE PRECISION DLAMCH
165 EXTERNAL LSAME, DLAMCH
167 * .. Executable Statements ..
169 * Quick return if possible
176 * Initialize LARGE and SMALL.
178 SMALL = DLAMCH( 'Safe minimum' ) / DLAMCH( 'Precision' )
181 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
188 * Replace A by diag(S) * A * diag(S).
190 IF( LSAME( UPLO, 'U' ) ) THEN
192 * Upper triangle of A is stored.
197 A( I, J ) = CJ*S( I )*A( I, J )
202 * Lower triangle of A is stored.
207 A( I, J ) = CJ*S( I )*A( I, J )