3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE CLATSP( UPLO, N, X, ISEED )
13 * .. Scalar Arguments ..
17 * .. Array Arguments ..
28 *> CLATSP generates a special test matrix for the complex symmetric
29 *> (indefinite) factorization for packed matrices. The pivot blocks of
30 *> the generated matrix will be in the following order:
31 *> 2x2 pivot block, non diagonalizable
33 *> 2x2 pivot block, diagonalizable
35 *> A row interchange is required for each non-diagonalizable 2x2 block.
44 *> Specifies whether the generated matrix is to be upper or
46 *> = 'U': Upper triangular
47 *> = 'L': Lower triangular
53 *> The dimension of the matrix to be generated.
58 *> X is COMPLEX array, dimension (N*(N+1)/2)
59 *> The generated matrix in packed storage format. The matrix
60 *> consists of 3x3 and 2x2 diagonal blocks which result in the
61 *> pivot sequence given above. The matrix outside these
62 *> diagonal blocks is zero.
65 *> \param[in,out] ISEED
67 *> ISEED is INTEGER array, dimension (4)
68 *> On entry, the seed for the random number generator. The last
69 *> of the four integers must be odd. (modified on exit)
75 *> \author Univ. of Tennessee
76 *> \author Univ. of California Berkeley
77 *> \author Univ. of Colorado Denver
80 *> \date November 2011
82 *> \ingroup complex_lin
84 * =====================================================================
85 SUBROUTINE CLATSP( UPLO, N, X, ISEED )
87 * -- LAPACK test routine (version 3.4.0) --
88 * -- LAPACK is a software package provided by Univ. of Tennessee, --
89 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
92 * .. Scalar Arguments ..
96 * .. Array Arguments ..
101 * =====================================================================
105 PARAMETER ( EYE = ( 0.0, 1.0 ) )
107 * .. Local Scalars ..
109 REAL ALPHA, ALPHA3, BETA
112 * .. External Functions ..
116 * .. Intrinsic Functions ..
119 * .. Executable Statements ..
121 * Initialize constants
123 ALPHA = ( 1.+SQRT( 17. ) ) / 8.
124 BETA = ALPHA - 1. / 1000.
125 ALPHA3 = ALPHA*ALPHA*ALPHA
127 * Fill the matrix with zeros.
129 DO 10 J = 1, N*( N+1 ) / 2
133 * UPLO = 'U': Upper triangular storage
135 IF( UPLO.EQ.'U' ) THEN
141 A = ALPHA3*CLARND( 5, ISEED )
142 B = CLARND( 5, ISEED ) / ALPHA
148 X( JJ ) = CLARND( 2, ISEED )
153 X( JJ ) = CLARND( 2, ISEED )
155 X( JJ ) = CLARND( 2, ISEED )
156 IF( ABS( X( JJ+( J-3 ) ) ).GT.ABS( X( JJ ) ) ) THEN
157 X( JJ+( J-4 ) ) = 2.0*X( JJ+( J-3 ) )
159 X( JJ+( J-4 ) ) = 2.0*X( JJ )
164 * Clean-up for N not a multiple of 5.
168 A = ALPHA3*CLARND( 5, ISEED )
169 B = CLARND( 5, ISEED ) / ALPHA
175 X( JJ ) = CLARND( 2, ISEED )
183 X( JJ ) = CLARND( 2, ISEED )
184 X( JJ-J ) = CLARND( 2, ISEED )
185 IF( ABS( X( JJ ) ).GT.ABS( X( JJ-J ) ) ) THEN
186 X( JJ-1 ) = 2.0*X( JJ )
188 X( JJ-1 ) = 2.0*X( JJ-J )
190 JJ = JJ - J - ( J-1 )
192 ELSE IF( J.EQ.1 ) THEN
193 X( JJ ) = CLARND( 2, ISEED )
197 * UPLO = 'L': Lower triangular storage
205 A = ALPHA3*CLARND( 5, ISEED )
206 B = CLARND( 5, ISEED ) / ALPHA
212 X( JJ ) = CLARND( 2, ISEED )
217 X( JJ ) = CLARND( 2, ISEED )
219 X( JJ ) = CLARND( 2, ISEED )
220 IF( ABS( X( JJ-( N-J-2 ) ) ).GT.ABS( X( JJ ) ) ) THEN
221 X( JJ-( N-J-2 )+1 ) = 2.0*X( JJ-( N-J-2 ) )
223 X( JJ-( N-J-2 )+1 ) = 2.0*X( JJ )
228 * Clean-up for N not a multiple of 5.
232 A = ALPHA3*CLARND( 5, ISEED )
233 B = CLARND( 5, ISEED ) / ALPHA
239 X( JJ ) = CLARND( 2, ISEED )
247 X( JJ ) = CLARND( 2, ISEED )
248 X( JJ+( N-J+1 ) ) = CLARND( 2, ISEED )
249 IF( ABS( X( JJ ) ).GT.ABS( X( JJ+( N-J+1 ) ) ) ) THEN
250 X( JJ+1 ) = 2.0*X( JJ )
252 X( JJ+1 ) = 2.0*X( JJ+( N-J+1 ) )
254 JJ = JJ + ( N-J+1 ) + ( N-J )
256 ELSE IF( J.EQ.N ) THEN
257 X( JJ ) = CLARND( 2, ISEED )