82 DOUBLE PRECISION RESULT(6)
88 COMPLEX*16,
ALLOCATABLE :: AF(:,:), Q(:,:),
89 $ L(:,:), WORK( : ), T(:,:),
90 $ CF(:,:), DF(:,:), A(:,:), C(:,:), D(:,:)
91 DOUBLE PRECISION,
ALLOCATABLE :: RWORK(:)
96 parameter( zero = 0.0)
97 parameter( one = (1.0,0.0), czero=(0.0,0.0) )
100 INTEGER INFO, J, K, LL, LWORK, LDT
101 DOUBLE PRECISION ANORM, EPS, RESID, CNORM, DNORM
107 DOUBLE PRECISION DLAMCH
108 DOUBLE PRECISION ZLANGE, ZLANSY
110 EXTERNAL dlamch, zlange, zlansy, lsame
116 DATA iseed / 1988, 1989, 1990, 1991 /
118 eps = dlamch(
'Epsilon' )
121 lwork = max(2,ll)*max(2,ll)*nb
125 ALLOCATE ( a(m,n), af(m,n), q(n,n), l(ll,n), rwork(ll),
126 $ work(lwork), t(nb,n), c(m,n), cf(m,n),
133 CALL zlarnv( 2, iseed, m, a( 1, j ) )
135 CALL zlacpy(
'Full', m, n, a, m, af, m )
139 CALL zgelqt( m, n, nb, af, m, t, ldt, work, info )
143 CALL zlaset(
'Full', n, n, czero, one, q, n )
144 CALL zgemlqt(
'R',
'N', n, n, k, nb, af, m, t, ldt, q, n,
149 CALL zlaset(
'Full', ll, n, czero, czero, l, ll )
150 CALL zlacpy(
'Lower', m, n, af, m, l, ll )
154 CALL zgemm(
'N',
'C', m, n, n, -one, a, m, q, n, one, l, ll )
155 anorm = zlange(
'1', m, n, a, m, rwork )
156 resid = zlange(
'1', m, n, l, ll, rwork )
157 IF( anorm.GT.zero )
THEN
158 result( 1 ) = resid / (eps*max(1,m)*anorm)
165 CALL zlaset(
'Full', n, n, czero, one, l, ll )
166 CALL zherk(
'U',
'C', n, n, dreal(-one), q, n, dreal(one), l, ll)
167 resid = zlansy(
'1',
'Upper', n, l, ll, rwork )
168 result( 2 ) = resid / (eps*max(1,n))
173 CALL zlarnv( 2, iseed, n, d( 1, j ) )
175 dnorm = zlange(
'1', n, m, d, n, rwork)
176 CALL zlacpy(
'Full', n, m, d, n, df, n )
180 CALL zgemlqt(
'L',
'N', n, m, k, nb, af, m, t, nb, df, n,
185 CALL zgemm(
'N',
'N', n, m, n, -one, q, n, d, n, one, df, n )
186 resid = zlange(
'1', n, m, df, n, rwork )
187 IF( dnorm.GT.zero )
THEN
188 result( 3 ) = resid / (eps*max(1,m)*dnorm)
195 CALL zlacpy(
'Full', n, m, d, n, df, n )
199 CALL zgemlqt(
'L',
'C', n, m, k, nb, af, m, t, nb, df, n,
204 CALL zgemm(
'C',
'N', n, m, n, -one, q, n, d, n, one, df, n )
205 resid = zlange(
'1', n, m, df, n, rwork )
206 IF( dnorm.GT.zero )
THEN
207 result( 4 ) = resid / (eps*max(1,m)*dnorm)
215 CALL zlarnv( 2, iseed, m, c( 1, j ) )
217 cnorm = zlange(
'1', m, n, c, m, rwork)
218 CALL zlacpy(
'Full', m, n, c, m, cf, m )
222 CALL zgemlqt(
'R',
'N', m, n, k, nb, af, m, t, nb, cf, m,
227 CALL zgemm(
'N',
'N', m, n, n, -one, c, m, q, n, one, cf, m )
228 resid = zlange(
'1', n, m, df, n, rwork )
229 IF( cnorm.GT.zero )
THEN
230 result( 5 ) = resid / (eps*max(1,m)*dnorm)
237 CALL zlacpy(
'Full', m, n, c, m, cf, m )
241 CALL zgemlqt(
'R',
'C', m, n, k, nb, af, m, t, nb, cf, m,
246 CALL zgemm(
'N',
'C', m, n, n, -one, c, m, q, n, one, cf, m )
247 resid = zlange(
'1', m, n, cf, m, rwork )
248 IF( cnorm.GT.zero )
THEN
249 result( 6 ) = resid / (eps*max(1,m)*dnorm)
256 DEALLOCATE ( a, af, q, l, rwork, work, t, c, d, cf, df)
subroutine zgelqt(m, n, mb, a, lda, t, ldt, work, info)
ZGELQT
subroutine zgemlqt(side, trans, m, n, k, mb, v, ldv, t, ldt, c, ldc, work, info)
ZGEMLQT
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
ZHERK
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlarnv(idist, iseed, n, x)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zlqt04(m, n, nb, result)
DLQT04