135 SUBROUTINE sqrt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
144 INTEGER K, LDA, LWORK, M, N
147 REAL A( lda, * ), AF( lda, * ), Q( lda, * ),
148 $ r( lda, * ), result( * ), rwork( * ), tau( * ),
156 parameter ( zero = 0.0e+0, one = 1.0e+0 )
158 parameter ( rogue = -1.0e+10 )
162 REAL ANORM, EPS, RESID
165 REAL SLAMCH, SLANGE, SLANSY
166 EXTERNAL slamch, slange, slansy
178 COMMON / srnamc / srnamt
182 eps = slamch(
'Epsilon' )
186 CALL slaset(
'Full', m, n, rogue, rogue, q, lda )
187 CALL slacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
192 CALL sorgqr( m, n, k, q, lda, tau, work, lwork, info )
196 CALL slaset(
'Full', n, k, zero, zero, r, lda )
197 CALL slacpy(
'Upper', n, k, af, lda, r, lda )
201 CALL sgemm(
'Transpose',
'No transpose', n, k, m, -one, q, lda, a,
206 anorm = slange(
'1', m, k, a, lda, rwork )
207 resid = slange(
'1', n, k, r, lda, rwork )
208 IF( anorm.GT.zero )
THEN
209 result( 1 ) = ( ( resid /
REAL( MAX( 1, M ) ) ) / anorm ) / eps
216 CALL slaset(
'Full', n, n, zero, one, r, lda )
217 CALL ssyrk(
'Upper',
'Transpose', n, m, -one, q, lda, one, r,
222 resid = slansy(
'1',
'Upper', n, r, lda, rwork )
224 result( 2 ) = ( resid /
REAL( MAX( 1, M ) ) ) / eps
subroutine ssyrk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
SSYRK
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaset(UPLO, M, N, ALPHA, BETA, A, LDA)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
subroutine sqrt02(M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK, RWORK, RESULT)
SQRT02
subroutine sorgqr(M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
SORGQR