1 *> \brief \b CLAQSP scales a symmetric/Hermitian matrix in packed storage, using scaling factors computed by sppequ.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CLAQSP + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claqsp.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claqsp.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claqsp.f">
21 * SUBROUTINE CLAQSP( UPLO, N, AP, S, SCOND, AMAX, EQUED )
23 * .. Scalar Arguments ..
24 * CHARACTER EQUED, UPLO
28 * .. Array Arguments ..
39 *> CLAQSP 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 *> AP is COMPLEX array, dimension (N*(N+1)/2)
64 *> On entry, the upper or lower triangle of the symmetric matrix
65 *> A, packed columnwise in a linear array. The j-th column of A
66 *> is stored in the array AP as follows:
67 *> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
68 *> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
70 *> On exit, the equilibrated matrix: diag(S) * A * diag(S), in
71 *> the same storage format as A.
76 *> S is REAL array, dimension (N)
77 *> The scale factors for A.
83 *> Ratio of the smallest S(i) to the largest S(i).
89 *> Absolute value of largest matrix entry.
94 *> EQUED is CHARACTER*1
95 *> Specifies whether or not equilibration was done.
96 *> = 'N': No equilibration.
97 *> = 'Y': Equilibration was done, i.e., A has been replaced by
98 *> diag(S) * A * diag(S).
101 *> \par Internal Parameters:
102 * =========================
105 *> THRESH is a threshold value used to decide if scaling should be done
106 *> based on the ratio of the scaling factors. If SCOND < THRESH,
109 *> LARGE and SMALL are threshold values used to decide if scaling should
110 *> be done based on the absolute size of the largest matrix element.
111 *> If AMAX > LARGE or AMAX < SMALL, scaling is done.
117 *> \author Univ. of Tennessee
118 *> \author Univ. of California Berkeley
119 *> \author Univ. of Colorado Denver
122 *> \date September 2012
124 *> \ingroup complexOTHERauxiliary
126 * =====================================================================
127 SUBROUTINE CLAQSP( UPLO, N, AP, S, SCOND, AMAX, EQUED )
129 * -- LAPACK auxiliary routine (version 3.4.2) --
130 * -- LAPACK is a software package provided by Univ. of Tennessee, --
131 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134 * .. Scalar Arguments ..
135 CHARACTER EQUED, UPLO
139 * .. Array Arguments ..
144 * =====================================================================
148 PARAMETER ( ONE = 1.0E+0, THRESH = 0.1E+0 )
150 * .. Local Scalars ..
152 REAL CJ, LARGE, SMALL
154 * .. External Functions ..
157 EXTERNAL LSAME, SLAMCH
159 * .. Executable Statements ..
161 * Quick return if possible
168 * Initialize LARGE and SMALL.
170 SMALL = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' )
173 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
180 * Replace A by diag(S) * A * diag(S).
182 IF( LSAME( UPLO, 'U' ) ) THEN
184 * Upper triangle of A is stored.
190 AP( JC+I-1 ) = CJ*S( I )*AP( JC+I-1 )
196 * Lower triangle of A is stored.
202 AP( JC+I-J ) = CJ*S( I )*AP( JC+I-J )