122 SUBROUTINE chet01_aa( UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C,
123 $ LDC, RWORK, RESID )
131 INTEGER LDA, LDAFAC, LDC, N
137 COMPLEX A( LDA, * ), AFAC( LDAFAC, * ), C( LDC, * )
144 parameter( czero = ( 0.0e+0, 0.0e+0 ),
145 $ cone = ( 1.0e+0, 0.0e+0 ) )
147 parameter( zero = 0.0e+0, one = 1.0e+0 )
156 EXTERNAL lsame, slamch, clanhe
175 eps = slamch(
'Epsilon' )
176 anorm = clanhe(
'1', uplo, n, a, lda, rwork )
180 CALL claset(
'Full', n, n, czero, czero, c, ldc )
181 CALL clacpy(
'F', 1, n, afac( 1, 1 ), ldafac+1, c( 1, 1 ), ldc+1 )
183 IF( lsame( uplo,
'U' ) )
THEN
184 CALL clacpy(
'F', 1, n-1, afac( 1, 2 ), ldafac+1, c( 1, 2 ),
186 CALL clacpy(
'F', 1, n-1, afac( 1, 2 ), ldafac+1, c( 2, 1 ),
188 CALL clacgv( n-1, c( 2, 1 ), ldc+1 )
190 CALL clacpy(
'F', 1, n-1, afac( 2, 1 ), ldafac+1, c( 1, 2 ),
192 CALL clacpy(
'F', 1, n-1, afac( 2, 1 ), ldafac+1, c( 2, 1 ),
194 CALL clacgv( n-1, c( 1, 2 ), ldc+1 )
199 IF( lsame( uplo,
'U' ) )
THEN
200 CALL ctrmm(
'Left', uplo,
'Conjugate transpose',
'Unit',
201 $ n-1, n, cone, afac( 1, 2 ), ldafac, c( 2, 1 ),
204 CALL ctrmm(
'Left', uplo,
'No transpose',
'Unit', n-1, n,
205 $ cone, afac( 2, 1 ), ldafac, c( 2, 1 ), ldc )
210 IF( lsame( uplo,
'U' ) )
THEN
211 CALL ctrmm(
'Right', uplo,
'No transpose',
'Unit', n, n-1,
212 $ cone, afac( 1, 2 ), ldafac, c( 1, 2 ), ldc )
214 CALL ctrmm(
'Right', uplo,
'Conjugate transpose',
'Unit', n,
215 $ n-1, cone, afac( 2, 1 ), ldafac, c( 1, 2 ),
225 $
CALL cswap( n, c( j, 1 ), ldc, c( i, 1 ), ldc )
230 $
CALL cswap( n, c( 1, j ), 1, c( 1, i ), 1 )
236 IF( lsame( uplo,
'U' ) )
THEN
239 c( i, j ) = c( i, j ) - a( i, j )
245 c( i, j ) = c( i, j ) - a( i, j )
252 resid = clanhe(
'1', uplo, n, c, ldc, rwork )
254 IF( anorm.LE.zero )
THEN
258 resid = ( ( resid / real( n ) ) / anorm ) / eps
subroutine chet01_aa(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CHET01_AA
subroutine clavhe(uplo, trans, diag, n, nrhs, a, lda, ipiv, b, ldb, info)
CLAVHE
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
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.
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
subroutine ctrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRMM