133 SUBROUTINE sqrt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
141 INTEGER K, LDA, LWORK, M, N
144 REAL A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
145 $ r( lda, * ), result( * ), rwork( * ), tau( * ),
153 parameter( zero = 0.0e+0, one = 1.0e+0 )
155 parameter( rogue = -1.0e+10 )
159 REAL ANORM, EPS, RESID
162 REAL SLAMCH, SLANGE, SLANSY
163 EXTERNAL slamch, slange, slansy
175 COMMON / srnamc / srnamt
179 eps = slamch(
'Epsilon' )
183 CALL slaset(
'Full', m, n, rogue, rogue, q, lda )
184 CALL slacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
189 CALL sorgqr( m, n, k, q, lda, tau, work, lwork, info )
193 CALL slaset(
'Full', n, k, zero, zero, r, lda )
194 CALL slacpy(
'Upper', n, k, af, lda, r, lda )
198 CALL sgemm(
'Transpose',
'No transpose', n, k, m, -one, q, lda, a,
203 anorm = slange(
'1', m, k, a, lda, rwork )
204 resid = slange(
'1', n, k, r, lda, rwork )
205 IF( anorm.GT.zero )
THEN
206 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
213 CALL slaset(
'Full', n, n, zero, one, r, lda )
214 CALL ssyrk(
'Upper',
'Transpose', n, m, -one, q, lda, one, r,
219 resid = slansy(
'1',
'Upper', n, r, lda, rwork )
221 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 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 sqrt02(m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)
SQRT02