134 SUBROUTINE sqrt03( M, N, K, AF, C, CC, Q, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 REAL AF( LDA, * ), C( LDA, * ), CC( LDA, * ),
146 $ q( lda, * ), result( * ), rwork( * ), tau( * ),
154 parameter( one = 1.0e0 )
156 parameter( rogue = -1.0e+10 )
159 CHARACTER SIDE, TRANS
160 INTEGER INFO, ISIDE, ITRANS, J, MC, NC
161 REAL CNORM, EPS, RESID
166 EXTERNAL lsame, slamch, slange
181 COMMON / srnamc / srnamt
184 DATA iseed / 1988, 1989, 1990, 1991 /
188 eps = slamch(
'Epsilon' )
192 CALL slaset(
'Full', m, m, rogue, rogue, q, lda )
193 CALL slacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
198 CALL sorgqr( m, m, k, q, lda, tau, work, lwork, info )
201 IF( iside.EQ.1 )
THEN
214 CALL slarnv( 2, iseed, mc, c( 1, j ) )
216 cnorm = slange(
'1', mc, nc, c, lda, rwork )
221 IF( itrans.EQ.1 )
THEN
229 CALL slacpy(
'Full', mc, nc, c, lda, cc, lda )
234 CALL sormqr( side, trans, mc, nc, k, af, lda, tau, cc, lda,
235 $ work, lwork, info )
239 IF( lsame( side,
'L' ) )
THEN
240 CALL sgemm( trans,
'No transpose', mc, nc, mc, -one, q,
241 $ lda, c, lda, one, cc, lda )
243 CALL sgemm(
'No transpose', trans, mc, nc, nc, -one, c,
244 $ lda, q, lda, one, cc, lda )
249 resid = slange(
'1', mc, nc, cc, lda, rwork )
250 result( ( iside-1 )*2+itrans ) = resid /
251 $ ( real( max( 1, m ) )*cnorm*eps )
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 slarnv(idist, iseed, n, x)
SLARNV returns a vector of random numbers from a uniform or normal distribution.
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 sormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
SORMQR
subroutine sqrt03(m, n, k, af, c, cc, q, lda, tau, work, lwork, rwork, result)
SQRT03