132 SUBROUTINE clahilb( N, NRHS, A, LDA, X, LDX, B, LDB, WORK,
140 INTEGER N, NRHS, LDA, LDX, LDB, INFO
143 COMPLEX A(LDA,N), X(LDX, NRHS), B(LDB, NRHS)
161 INTEGER NMAX_EXACT, NMAX_APPROX, SIZE_D
162 parameter(nmax_exact = 6, nmax_approx = 11, size_d = 8)
165 COMPLEX D1(8), D2(8), INVD1(8), INVD2(8)
166 DATA d1 /(-1,0),(0,1),(-1,-1),(0,-1),(1,0),(-1,1),(1,1),(1,-1)/
167 DATA d2 /(-1,0),(0,-1),(-1,1),(0,1),(1,0),(-1,-1),(1,-1),(1,1)/
169 DATA invd1 /(-1,0),(0,-1),(-.5,.5),(0,1),(1,0),
170 $ (-.5,-.5),(.5,-.5),(.5,.5)/
171 DATA invd2 /(-1,0),(0,1),(-.5,-.5),(0,-1),(1,0),
172 $ (-.5,.5),(.5,.5),(.5,-.5)/
185 IF (n .LT. 0 .OR. n .GT. nmax_approx)
THEN
187 ELSE IF (nrhs .LT. 0)
THEN
189 ELSE IF (lda .LT. n)
THEN
191 ELSE IF (ldx .LT. n)
THEN
193 ELSE IF (ldb .LT. n)
THEN
196 IF (info .LT. 0)
THEN
197 CALL xerbla(
'CLAHILB', -info)
200 IF (n .GT. nmax_exact)
THEN
222 IF ( lsamen( 2, c2,
'SY' ) )
THEN
225 a(i, j) = d1(mod(j,size_d)+1) * (real(m) / (i + j - 1))
226 $ * d1(mod(i,size_d)+1)
232 a(i, j) = d1(mod(j,size_d)+1) * (real(m) / (i + j - 1))
233 $ * d2(mod(i,size_d)+1)
241 CALL claset(
'Full', n, nrhs, (0.0,0.0), tmp, b, ldb)
248 work(j) = ( ( (work(j-1)/(j-1)) * (j-1 - n) ) /(j-1) )
254 IF ( lsamen( 2, c2,
'SY' ) )
THEN
258 $ invd1(mod(j,size_d)+1) *
259 $ ((work(i)*work(j)) / (i + j - 1))
260 $ * invd1(mod(i,size_d)+1)
267 $ invd2(mod(j,size_d)+1) *
268 $ ((work(i)*work(j)) / (i + j - 1))
269 $ * invd1(mod(i,size_d)+1)
subroutine clahilb(n, nrhs, a, lda, x, ldx, b, ldb, work, info, path)
CLAHILB
subroutine xerbla(srname, info)
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
logical function lsamen(n, ca, cb)
LSAMEN