1 *> \brief \b DLAQSY 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 DLAQSY + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaqsy.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaqsy.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaqsy.f">
21 * SUBROUTINE DLAQSY( 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 A( LDA, * ), S( * )
38 *> DLAQSY equilibrates a symmetric matrix A using the scaling factors
47 *> UPLO is CHARACTER*1
48 *> Specifies whether the upper or lower triangular part of the
49 *> symmetric matrix A is stored.
50 *> = 'U': Upper triangular
51 *> = 'L': Lower triangular
57 *> The order of the matrix A. N >= 0.
62 *> A is DOUBLE PRECISION array, dimension (LDA,N)
63 *> On entry, the symmetric matrix A. If UPLO = 'U', the leading
64 *> n by n upper triangular part of A contains the upper
65 *> triangular part of the matrix A, and the strictly lower
66 *> triangular part of A is not referenced. If UPLO = 'L', the
67 *> leading n by n lower triangular part of A contains the lower
68 *> triangular part of the matrix A, and the strictly upper
69 *> triangular part of A is not referenced.
71 *> On exit, if EQUED = 'Y', the equilibrated matrix:
72 *> diag(S) * A * diag(S).
78 *> The leading dimension of the array A. LDA >= max(N,1).
83 *> S is DOUBLE PRECISION array, dimension (N)
84 *> The scale factors for A.
89 *> SCOND is DOUBLE PRECISION
90 *> Ratio of the smallest S(i) to the largest S(i).
95 *> AMAX is DOUBLE PRECISION
96 *> Absolute value of largest matrix entry.
101 *> EQUED is CHARACTER*1
102 *> Specifies whether or not equilibration was done.
103 *> = 'N': No equilibration.
104 *> = 'Y': Equilibration was done, i.e., A has been replaced by
105 *> diag(S) * A * diag(S).
108 *> \par Internal Parameters:
109 * =========================
112 *> THRESH is a threshold value used to decide if scaling should be done
113 *> based on the ratio of the scaling factors. If SCOND < THRESH,
116 *> LARGE and SMALL are threshold values used to decide if scaling should
117 *> be done based on the absolute size of the largest matrix element.
118 *> If AMAX > LARGE or AMAX < SMALL, scaling is done.
124 *> \author Univ. of Tennessee
125 *> \author Univ. of California Berkeley
126 *> \author Univ. of Colorado Denver
129 *> \date September 2012
131 *> \ingroup doubleSYauxiliary
133 * =====================================================================
134 SUBROUTINE DLAQSY( UPLO, N, A, LDA, S, SCOND, AMAX, EQUED )
136 * -- LAPACK auxiliary routine (version 3.4.2) --
137 * -- LAPACK is a software package provided by Univ. of Tennessee, --
138 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
141 * .. Scalar Arguments ..
142 CHARACTER EQUED, UPLO
144 DOUBLE PRECISION AMAX, SCOND
146 * .. Array Arguments ..
147 DOUBLE PRECISION A( LDA, * ), S( * )
150 * =====================================================================
153 DOUBLE PRECISION ONE, THRESH
154 PARAMETER ( ONE = 1.0D+0, THRESH = 0.1D+0 )
156 * .. Local Scalars ..
158 DOUBLE PRECISION CJ, LARGE, SMALL
160 * .. External Functions ..
162 DOUBLE PRECISION DLAMCH
163 EXTERNAL LSAME, DLAMCH
165 * .. Executable Statements ..
167 * Quick return if possible
174 * Initialize LARGE and SMALL.
176 SMALL = DLAMCH( 'Safe minimum' ) / DLAMCH( 'Precision' )
179 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
186 * Replace A by diag(S) * A * diag(S).
188 IF( LSAME( UPLO, 'U' ) ) THEN
190 * Upper triangle of A is stored.
195 A( I, J ) = CJ*S( I )*A( I, J )
200 * Lower triangle of A is stored.
205 A( I, J ) = CJ*S( I )*A( I, J )