124 SUBROUTINE sqrt01p( M, N, A, AF, Q, R, LDA, TAU, WORK, LWORK,
132 INTEGER LDA, LWORK, M, N
135 REAL A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
136 $ r( lda, * ), result( * ), rwork( * ), tau( * ),
144 parameter( zero = 0.0e+0, one = 1.0e+0 )
146 parameter( rogue = -1.0e+10 )
150 REAL ANORM, EPS, RESID
153 REAL SLAMCH, SLANGE, SLANSY
154 EXTERNAL slamch, slange, slansy
160 INTRINSIC max, min, real
166 COMMON / srnamc / srnamt
171 eps = slamch(
'Epsilon' )
175 CALL slacpy(
'Full', m, n, a, lda, af, lda )
180 CALL sgeqrfp( m, n, af, lda, tau, work, lwork, info )
184 CALL slaset(
'Full', m, m, rogue, rogue, q, lda )
185 CALL slacpy(
'Lower', m-1, n, af( 2, 1 ), lda, q( 2, 1 ), lda )
190 CALL sorgqr( m, m, minmn, q, lda, tau, work, lwork, info )
194 CALL slaset(
'Full', m, n, zero, zero, r, lda )
195 CALL slacpy(
'Upper', m, n, af, lda, r, lda )
199 CALL sgemm(
'Transpose',
'No transpose', m, n, m, -one, q, lda, a,
204 anorm = slange(
'1', m, n, a, lda, rwork )
205 resid = slange(
'1', m, n, r, lda, rwork )
206 IF( anorm.GT.zero )
THEN
207 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
214 CALL slaset(
'Full', m, m, zero, one, r, lda )
215 CALL ssyrk(
'Upper',
'Transpose', m, m, -one, q, lda, one, r,
220 resid = slansy(
'1',
'Upper', m, r, lda, rwork )
222 result( 2 ) = ( resid / real( max( 1, m ) ) ) / eps
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sgeqrfp(m, n, a, lda, tau, work, lwork, info)
SGEQRFP
subroutine ssyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
SSYRK
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 sorgqr(m, n, k, a, lda, tau, work, lwork, info)
SORGQR
subroutine sqrt01p(m, n, a, af, q, r, lda, tau, work, lwork, rwork, result)
SQRT01P