1 *> \brief \b ZLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLANSP + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlansp.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlansp.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlansp.f">
21 * DOUBLE PRECISION FUNCTION ZLANSP( NORM, UPLO, N, AP, WORK )
23 * .. Scalar Arguments ..
24 * CHARACTER NORM, UPLO
27 * .. Array Arguments ..
28 * DOUBLE PRECISION WORK( * )
38 *> ZLANSP returns the value of the one norm, or the Frobenius norm, or
39 *> the infinity norm, or the element of largest absolute value of a
40 *> complex symmetric matrix A, supplied in packed form.
46 *> ZLANSP = ( max(abs(A(i,j))), NORM = 'M' or 'm'
48 *> ( norm1(A), NORM = '1', 'O' or 'o'
50 *> ( normI(A), NORM = 'I' or 'i'
52 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
54 *> where norm1 denotes the one norm of a matrix (maximum column sum),
55 *> normI denotes the infinity norm of a matrix (maximum row sum) and
56 *> normF denotes the Frobenius norm of a matrix (square root of sum of
57 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
65 *> NORM is CHARACTER*1
66 *> Specifies the value to be returned in ZLANSP as described
72 *> UPLO is CHARACTER*1
73 *> Specifies whether the upper or lower triangular part of the
74 *> symmetric matrix A is supplied.
75 *> = 'U': Upper triangular part of A is supplied
76 *> = 'L': Lower triangular part of A is supplied
82 *> The order of the matrix A. N >= 0. When N = 0, ZLANSP is
88 *> AP is COMPLEX*16 array, dimension (N*(N+1)/2)
89 *> The upper or lower triangle of the symmetric matrix A, packed
90 *> columnwise in a linear array. The j-th column of A is stored
91 *> in the array AP as follows:
92 *> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
93 *> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
98 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
99 *> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
100 *> WORK is not referenced.
106 *> \author Univ. of Tennessee
107 *> \author Univ. of California Berkeley
108 *> \author Univ. of Colorado Denver
111 *> \date September 2012
113 *> \ingroup complex16OTHERauxiliary
115 * =====================================================================
116 DOUBLE PRECISION FUNCTION ZLANSP( NORM, UPLO, N, AP, WORK )
118 * -- LAPACK auxiliary routine (version 3.4.2) --
119 * -- LAPACK is a software package provided by Univ. of Tennessee, --
120 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123 * .. Scalar Arguments ..
127 * .. Array Arguments ..
128 DOUBLE PRECISION WORK( * )
132 * =====================================================================
135 DOUBLE PRECISION ONE, ZERO
136 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
138 * .. Local Scalars ..
140 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
142 * .. External Functions ..
143 LOGICAL LSAME, DISNAN
144 EXTERNAL LSAME, DISNAN
146 * .. External Subroutines ..
149 * .. Intrinsic Functions ..
150 INTRINSIC ABS, DBLE, DIMAG, SQRT
152 * .. Executable Statements ..
156 ELSE IF( LSAME( NORM, 'M' ) ) THEN
158 * Find max(abs(A(i,j))).
161 IF( LSAME( UPLO, 'U' ) ) THEN
164 DO 10 I = K, K + J - 1
166 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
173 DO 30 I = K, K + N - J
175 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
180 ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
181 $ ( NORM.EQ.'1' ) ) THEN
183 * Find normI(A) ( = norm1(A), since A is symmetric).
187 IF( LSAME( UPLO, 'U' ) ) THEN
191 ABSA = ABS( AP( K ) )
193 WORK( I ) = WORK( I ) + ABSA
196 WORK( J ) = SUM + ABS( AP( K ) )
201 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
208 SUM = WORK( J ) + ABS( AP( K ) )
211 ABSA = ABS( AP( K ) )
213 WORK( I ) = WORK( I ) + ABSA
216 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
219 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
226 IF( LSAME( UPLO, 'U' ) ) THEN
228 CALL ZLASSQ( J-1, AP( K ), 1, SCALE, SUM )
233 CALL ZLASSQ( N-J, AP( K ), 1, SCALE, SUM )
240 IF( DBLE( AP( K ) ).NE.ZERO ) THEN
241 ABSA = ABS( DBLE( AP( K ) ) )
242 IF( SCALE.LT.ABSA ) THEN
243 SUM = ONE + SUM*( SCALE / ABSA )**2
246 SUM = SUM + ( ABSA / SCALE )**2
249 IF( DIMAG( AP( K ) ).NE.ZERO ) THEN
250 ABSA = ABS( DIMAG( AP( K ) ) )
251 IF( SCALE.LT.ABSA ) THEN
252 SUM = ONE + SUM*( SCALE / ABSA )**2
255 SUM = SUM + ( ABSA / SCALE )**2
258 IF( LSAME( UPLO, 'U' ) ) THEN
264 VALUE = SCALE*SQRT( SUM )