1 *> \brief \b SLAQSP 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 SLAQSP + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaqsp.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaqsp.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaqsp.f">
21 * SUBROUTINE SLAQSP( UPLO, N, AP, S, SCOND, AMAX, EQUED )
23 * .. Scalar Arguments ..
24 * CHARACTER EQUED, UPLO
28 * .. Array Arguments ..
29 * REAL AP( * ), S( * )
38 *> SLAQSP 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 *> AP is REAL array, dimension (N*(N+1)/2)
63 *> On entry, the upper or lower triangle of the symmetric matrix
64 *> A, packed columnwise in a linear array. The j-th column of A
65 *> is stored in the array AP as follows:
66 *> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
67 *> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
69 *> On exit, the equilibrated matrix: diag(S) * A * diag(S), in
70 *> the same storage format as A.
75 *> S is REAL array, dimension (N)
76 *> The scale factors for A.
82 *> Ratio of the smallest S(i) to the largest S(i).
88 *> Absolute value of largest matrix entry.
93 *> EQUED is CHARACTER*1
94 *> Specifies whether or not equilibration was done.
95 *> = 'N': No equilibration.
96 *> = 'Y': Equilibration was done, i.e., A has been replaced by
97 *> diag(S) * A * diag(S).
100 *> \par Internal Parameters:
101 * =========================
104 *> THRESH is a threshold value used to decide if scaling should be done
105 *> based on the ratio of the scaling factors. If SCOND < THRESH,
108 *> LARGE and SMALL are threshold values used to decide if scaling should
109 *> be done based on the absolute size of the largest matrix element.
110 *> If AMAX > LARGE or AMAX < SMALL, scaling is done.
116 *> \author Univ. of Tennessee
117 *> \author Univ. of California Berkeley
118 *> \author Univ. of Colorado Denver
121 *> \date September 2012
123 *> \ingroup realOTHERauxiliary
125 * =====================================================================
126 SUBROUTINE SLAQSP( UPLO, N, AP, S, SCOND, AMAX, EQUED )
128 * -- LAPACK auxiliary routine (version 3.4.2) --
129 * -- LAPACK is a software package provided by Univ. of Tennessee, --
130 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
133 * .. Scalar Arguments ..
134 CHARACTER EQUED, UPLO
138 * .. Array Arguments ..
142 * =====================================================================
146 PARAMETER ( ONE = 1.0E+0, THRESH = 0.1E+0 )
148 * .. Local Scalars ..
150 REAL CJ, LARGE, SMALL
152 * .. External Functions ..
155 EXTERNAL LSAME, SLAMCH
157 * .. Executable Statements ..
159 * Quick return if possible
166 * Initialize LARGE and SMALL.
168 SMALL = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' )
171 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
178 * Replace A by diag(S) * A * diag(S).
180 IF( LSAME( UPLO, 'U' ) ) THEN
182 * Upper triangle of A is stored.
188 AP( JC+I-1 ) = CJ*S( I )*AP( JC+I-1 )
194 * Lower triangle of A is stored.
200 AP( JC+I-J ) = CJ*S( I )*AP( JC+I-J )