LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ clqt05()

subroutine clqt05 ( integer  M,
integer  N,
integer  L,
integer  NB,
real, dimension(6)  RESULT 
)

CLQT05

Purpose:
 CQRT05 tests CTPLQT and CTPMLQT.
Parameters
[in]M
          M is INTEGER
          Number of rows in lower part of the test matrix.
[in]N
          N is INTEGER
          Number of columns in test matrix.
[in]L
          L is INTEGER
          The number of rows of the upper trapezoidal part the
          lower test matrix.  0 <= L <= M.
[in]NB
          NB is INTEGER
          Block size of test matrix.  NB <= N.
[out]RESULT
          RESULT is DOUBLE PRECISION array, dimension (6)
          Results of each of the six tests below.

          RESULT(1) = | A - Q R |
          RESULT(2) = | I - Q^H Q |
          RESULT(3) = | Q C - Q C |
          RESULT(4) = | Q^H C - Q^H C |
          RESULT(5) = | C Q - C Q |
          RESULT(6) = | C Q^H - C Q^H |
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
April 2012

Definition at line 82 of file clqt05.f.

82  IMPLICIT NONE
83 *
84 * -- LAPACK test routine (version 3.7.0) --
85 * -- LAPACK is a software package provided by Univ. of Tennessee, --
86 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
87 * April 2012
88 *
89 * .. Scalar Arguments ..
90  INTEGER lwork, m, n, l, nb, ldt
91 * .. Return values ..
92  REAL result(6)
93 *
94 * =====================================================================
95 *
96 * ..
97 * .. Local allocatable arrays
98  COMPLEX, ALLOCATABLE :: af(:,:), q(:,:),
99  $ r(:,:), rwork(:), work( : ), t(:,:),
100  $ cf(:,:), df(:,:), a(:,:), c(:,:), d(:,:)
101 *
102 * .. Parameters ..
103  REAL zero
104  COMPLEX one, czero
105  parameter( zero = 0.0, one = (1.0,0.0), czero=(0.0,0.0) )
106 * ..
107 * .. Local Scalars ..
108  INTEGER info, j, k, n2, np1,i
109  REAL anorm, eps, resid, cnorm, dnorm
110 * ..
111 * .. Local Arrays ..
112  INTEGER iseed( 4 )
113 * ..
114 * .. External Functions ..
115  REAL slamch
116  REAL clange, clansy
117  LOGICAL lsame
118  EXTERNAL slamch, clange, clansy, lsame
119 * ..
120 * .. Data statements ..
121  DATA iseed / 1988, 1989, 1990, 1991 /
122 *
123  eps = slamch( 'Epsilon' )
124  k = m
125  n2 = m+n
126  IF( n.GT.0 ) THEN
127  np1 = m+1
128  ELSE
129  np1 = 1
130  END IF
131  lwork = n2*n2*nb
132 *
133 * Dynamically allocate all arrays
134 *
135  ALLOCATE(a(m,n2),af(m,n2),q(n2,n2),r(n2,n2),rwork(n2),
136  $ work(lwork),t(nb,m),c(n2,m),cf(n2,m),
137  $ d(m,n2),df(m,n2) )
138 *
139 * Put random stuff into A
140 *
141  ldt=nb
142  CALL claset( 'Full', m, n2, czero, czero, a, m )
143  CALL claset( 'Full', nb, m, czero, czero, t, nb )
144  DO j=1,m
145  CALL clarnv( 2, iseed, m-j+1, a( j, j ) )
146  END DO
147  IF( n.GT.0 ) THEN
148  DO j=1,n-l
149  CALL clarnv( 2, iseed, m, a( 1, min(n+m,m+1) + j - 1 ) )
150  END DO
151  END IF
152  IF( l.GT.0 ) THEN
153  DO j=1,l
154  CALL clarnv( 2, iseed, m-j+1, a( j, min(n+m,n+m-l+1)
155  $ + j - 1 ) )
156  END DO
157  END IF
158 *
159 * Copy the matrix A to the array AF.
160 *
161  CALL clacpy( 'Full', m, n2, a, m, af, m )
162 *
163 * Factor the matrix A in the array AF.
164 *
165  CALL ctplqt( m,n,l,nb,af,m,af(1,np1),m,t,ldt,work,info)
166 *
167 * Generate the (M+N)-by-(M+N) matrix Q by applying H to I
168 *
169  CALL claset( 'Full', n2, n2, czero, one, q, n2 )
170  CALL cgemlqt( 'L', 'N', n2, n2, k, nb, af, m, t, ldt, q, n2,
171  $ work, info )
172 *
173 * Copy L
174 *
175  CALL claset( 'Full', n2, n2, czero, czero, r, n2 )
176  CALL clacpy( 'Lower', m, n2, af, m, r, n2 )
177 *
178 * Compute |L - A*Q*C| / |A| and store in RESULT(1)
179 *
180  CALL cgemm( 'N', 'C', m, n2, n2, -one, a, m, q, n2, one, r, n2)
181  anorm = clange( '1', m, n2, a, m, rwork )
182  resid = clange( '1', m, n2, r, n2, rwork )
183  IF( anorm.GT.zero ) THEN
184  result( 1 ) = resid / (eps*anorm*max(1,n2))
185  ELSE
186  result( 1 ) = zero
187  END IF
188 *
189 * Compute |I - Q*Q'| and store in RESULT(2)
190 *
191  CALL claset( 'Full', n2, n2, czero, one, r, n2 )
192  CALL cherk( 'U', 'N', n2, n2, REAL(-ONE), q, n2, REAL(ONE),
193  $ r, n2 )
194  resid = clansy( '1', 'Upper', n2, r, n2, rwork )
195  result( 2 ) = resid / (eps*max(1,n2))
196 *
197 * Generate random m-by-n matrix C and a copy CF
198 *
199  CALL claset( 'Full', n2, m, czero, one, c, n2 )
200  DO j=1,m
201  CALL clarnv( 2, iseed, n2, c( 1, j ) )
202  END DO
203  cnorm = clange( '1', n2, m, c, n2, rwork)
204  CALL clacpy( 'Full', n2, m, c, n2, cf, n2 )
205 *
206 * Apply Q to C as Q*C
207 *
208  CALL ctpmlqt( 'L','N', n,m,k,l,nb,af(1, np1),m,t,ldt,cf,n2,
209  $ cf(np1,1),n2,work,info)
210 *
211 * Compute |Q*C - Q*C| / |C|
212 *
213  CALL cgemm( 'N', 'N', n2, m, n2, -one, q, n2, c, n2, one, cf, n2 )
214  resid = clange( '1', n2, m, cf, n2, rwork )
215  IF( cnorm.GT.zero ) THEN
216  result( 3 ) = resid / (eps*max(1,n2)*cnorm)
217  ELSE
218  result( 3 ) = zero
219  END IF
220 
221 *
222 * Copy C into CF again
223 *
224  CALL clacpy( 'Full', n2, m, c, n2, cf, n2 )
225 *
226 * Apply Q to C as QT*C
227 *
228  CALL ctpmlqt( 'L','C',n,m,k,l,nb,af(1,np1),m,t,ldt,cf,n2,
229  $ cf(np1,1),n2,work,info)
230 *
231 * Compute |QT*C - QT*C| / |C|
232 *
233  CALL cgemm('C','N',n2,m,n2,-one,q,n2,c,n2,one,cf,n2)
234  resid = clange( '1', n2, m, cf, n2, rwork )
235 
236  IF( cnorm.GT.zero ) THEN
237  result( 4 ) = resid / (eps*max(1,n2)*cnorm)
238  ELSE
239  result( 4 ) = zero
240  END IF
241 *
242 * Generate random m-by-n matrix D and a copy DF
243 *
244  DO j=1,n2
245  CALL clarnv( 2, iseed, m, d( 1, j ) )
246  END DO
247  dnorm = clange( '1', m, n2, d, m, rwork)
248  CALL clacpy( 'Full', m, n2, d, m, df, m )
249 *
250 * Apply Q to D as D*Q
251 *
252  CALL ctpmlqt('R','N',m,n,k,l,nb,af(1,np1),m,t,ldt,df,m,
253  $ df(1,np1),m,work,info)
254 *
255 * Compute |D*Q - D*Q| / |D|
256 *
257  CALL cgemm('N','N',m,n2,n2,-one,d,m,q,n2,one,df,m)
258  resid = clange('1',m, n2,df,m,rwork )
259  IF( cnorm.GT.zero ) THEN
260  result( 5 ) = resid / (eps*max(1,n2)*dnorm)
261  ELSE
262  result( 5 ) = zero
263  END IF
264 *
265 * Copy D into DF again
266 *
267  CALL clacpy('Full',m,n2,d,m,df,m )
268 *
269 * Apply Q to D as D*QT
270 *
271  CALL ctpmlqt('R','C',m,n,k,l,nb,af(1,np1),m,t,ldt,df,m,
272  $ df(1,np1),m,work,info)
273 
274 *
275 * Compute |D*QT - D*QT| / |D|
276 *
277  CALL cgemm( 'N', 'C', m, n2, n2, -one, d, m, q, n2, one, df, m )
278  resid = clange( '1', m, n2, df, m, rwork )
279  IF( cnorm.GT.zero ) THEN
280  result( 6 ) = resid / (eps*max(1,n2)*dnorm)
281  ELSE
282  result( 6 ) = zero
283  END IF
284 *
285 * Deallocate all arrays
286 *
287  DEALLOCATE ( a, af, q, r, rwork, work, t, c, d, cf, df)
288  RETURN
subroutine claset(UPLO, M, N, ALPHA, BETA, A, LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: claset.f:108
subroutine ctpmlqt(SIDE, TRANS, M, N, K, L, MB, V, LDV, T, LDT, A, LDA, B, LDB, WORK, INFO)
Definition: ctpmlqt.f:201
subroutine clarnv(IDIST, ISEED, N, X)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
Definition: clarnv.f:101
subroutine cherk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
CHERK
Definition: cherk.f:175
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:117
subroutine ctplqt(M, N, L, MB, A, LDA, B, LDB, T, LDT, WORK, INFO)
Definition: ctplqt.f:174
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
Definition: clacpy.f:105
real function clansy(NORM, UPLO, N, A, LDA, WORK)
CLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: clansy.f:125
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
Definition: cgemm.f:189
subroutine cgemlqt(SIDE, TRANS, M, N, K, MB, V, LDV, T, LDT, C, LDC, WORK, INFO)
Definition: cgemlqt.f:153
Here is the call graph for this function:
Here is the caller graph for this function: