86 INTEGER LWORK, M, N, L, NB, LDT
94 REAL,
ALLOCATABLE :: AF(:,:), Q(:,:),
95 $ R(:,:), RWORK(:), WORK( : ), T(:,:),
96 $ CF(:,:), DF(:,:), A(:,:), C(:,:), D(:,:)
100 parameter( zero = 0.0, one = 1.0 )
103 INTEGER INFO, J, K, N2, NP1,i
104 REAL ANORM, EPS, RESID, CNORM, DNORM
110 REAL SLAMCH, SLANGE, SLANSY
112 EXTERNAL slamch, slange, slansy, lsame
115 DATA iseed / 1988, 1989, 1990, 1991 /
117 eps = slamch(
'Epsilon' )
129 ALLOCATE(a(m,n2),af(m,n2),q(n2,n2),r(n2,n2),rwork(n2),
130 $ work(lwork),t(nb,m),c(n2,m),cf(n2,m),
136 CALL slaset(
'Full', m, n2, zero, zero, a, m )
137 CALL slaset(
'Full', nb, m, zero, zero, t, nb )
139 CALL slarnv( 2, iseed, m-j+1, a( j, j ) )
143 CALL slarnv( 2, iseed, m, a( 1, min(n+m,m+1) + j - 1 ) )
148 CALL slarnv( 2, iseed, m-j+1, a( j, min(n+m,n+m-l+1)
155 CALL slacpy(
'Full', m, n2, a, m, af, m )
159 CALL stplqt( m,n,l,nb,af,m,af(1,np1),m,t,ldt,work,info)
163 CALL slaset(
'Full', n2, n2, zero, one, q, n2 )
164 CALL sgemlqt(
'L',
'N', n2, n2, k, nb, af, m, t, ldt, q, n2,
169 CALL slaset(
'Full', n2, n2, zero, zero, r, n2 )
170 CALL slacpy(
'Lower', m, n2, af, m, r, n2 )
174 CALL sgemm(
'N',
'T', m, n2, n2, -one, a, m, q, n2, one, r, n2)
175 anorm = slange(
'1', m, n2, a, m, rwork )
176 resid = slange(
'1', m, n2, r, n2, rwork )
177 IF( anorm.GT.zero )
THEN
178 result( 1 ) = resid / (eps*anorm*max(1,n2))
185 CALL slaset(
'Full', n2, n2, zero, one, r, n2 )
186 CALL ssyrk(
'U',
'N', n2, n2, -one, q, n2, one, r, n2 )
187 resid = slansy(
'1',
'Upper', n2, r, n2, rwork )
188 result( 2 ) = resid / (eps*max(1,n2))
192 CALL slaset(
'Full', n2, m, zero, one, c, n2 )
194 CALL slarnv( 2, iseed, n2, c( 1, j ) )
196 cnorm = slange(
'1', n2, m, c, n2, rwork)
197 CALL slacpy(
'Full', n2, m, c, n2, cf, n2 )
201 CALL stpmlqt(
'L',
'N', n,m,k,l,nb,af(1, np1),m,t,ldt,cf,n2,
202 $ cf(np1,1),n2,work,info)
206 CALL sgemm(
'N',
'N', n2, m, n2, -one, q, n2, c, n2, one, cf, n2 )
207 resid = slange(
'1', n2, m, cf, n2, rwork )
208 IF( cnorm.GT.zero )
THEN
209 result( 3 ) = resid / (eps*max(1,n2)*cnorm)
217 CALL slacpy(
'Full', n2, m, c, n2, cf, n2 )
221 CALL stpmlqt(
'L',
'T',n,m,k,l,nb,af(1,np1),m,t,ldt,cf,n2,
222 $ cf(np1,1),n2,work,info)
226 CALL sgemm(
'T',
'N',n2,m,n2,-one,q,n2,c,n2,one,cf,n2)
227 resid = slange(
'1', n2, m, cf, n2, rwork )
229 IF( cnorm.GT.zero )
THEN
230 result( 4 ) = resid / (eps*max(1,n2)*cnorm)
238 CALL slarnv( 2, iseed, m, d( 1, j ) )
240 dnorm = slange(
'1', m, n2, d, m, rwork)
241 CALL slacpy(
'Full', m, n2, d, m, df, m )
245 CALL stpmlqt(
'R',
'N',m,n,k,l,nb,af(1,np1),m,t,ldt,df,m,
246 $ df(1,np1),m,work,info)
250 CALL sgemm(
'N',
'N',m,n2,n2,-one,d,m,q,n2,one,df,m)
251 resid = slange(
'1',m, n2,df,m,rwork )
252 IF( cnorm.GT.zero )
THEN
253 result( 5 ) = resid / (eps*max(1,n2)*dnorm)
260 CALL slacpy(
'Full',m,n2,d,m,df,m )
264 CALL stpmlqt(
'R',
'T',m,n,k,l,nb,af(1,np1),m,t,ldt,df,m,
265 $ df(1,np1),m,work,info)
270 CALL sgemm(
'N',
'T', m, n2, n2, -one, d, m, q, n2, one, df, m )
271 resid = slange(
'1', m, n2, df, m, rwork )
272 IF( cnorm.GT.zero )
THEN
273 result( 6 ) = resid / (eps*max(1,n2)*dnorm)
280 DEALLOCATE ( a, af, q, r, rwork, work, t, c, d, cf, df)
subroutine sgemlqt(side, trans, m, n, k, mb, v, ldv, t, ldt, c, ldc, work, info)
SGEMLQT
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 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 stplqt(m, n, l, mb, a, lda, b, ldb, t, ldt, work, info)
STPLQT
subroutine stpmlqt(side, trans, m, n, k, l, mb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
STPMLQT
subroutine slqt05(m, n, l, nb, result)
SLQT05