LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dbdt01()

subroutine dbdt01 ( integer  M,
integer  N,
integer  KD,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldq, * )  Q,
integer  LDQ,
double precision, dimension( * )  D,
double precision, dimension( * )  E,
double precision, dimension( ldpt, * )  PT,
integer  LDPT,
double precision, dimension( * )  WORK,
double precision  RESID 
)

DBDT01

Purpose:
 DBDT01 reconstructs a general matrix A from its bidiagonal form
    A = Q * B * P'
 where Q (m by min(m,n)) and P' (min(m,n) by n) are orthogonal
 matrices and B is bidiagonal.

 The test ratio to test the reduction is
    RESID = norm( A - Q * B * PT ) / ( n * norm(A) * EPS )
 where PT = P' and EPS is the machine precision.
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrices A and Q.
[in]N
          N is INTEGER
          The number of columns of the matrices A and P'.
[in]KD
          KD is INTEGER
          If KD = 0, B is diagonal and the array E is not referenced.
          If KD = 1, the reduction was performed by xGEBRD; B is upper
          bidiagonal if M >= N, and lower bidiagonal if M < N.
          If KD = -1, the reduction was performed by xGBBRD; B is
          always upper bidiagonal.
[in]A
          A is DOUBLE PRECISION array, dimension (LDA,N)
          The m by n matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,M).
[in]Q
          Q is DOUBLE PRECISION array, dimension (LDQ,N)
          The m by min(m,n) orthogonal matrix Q in the reduction
          A = Q * B * P'.
[in]LDQ
          LDQ is INTEGER
          The leading dimension of the array Q.  LDQ >= max(1,M).
[in]D
          D is DOUBLE PRECISION array, dimension (min(M,N))
          The diagonal elements of the bidiagonal matrix B.
[in]E
          E is DOUBLE PRECISION array, dimension (min(M,N)-1)
          The superdiagonal elements of the bidiagonal matrix B if
          m >= n, or the subdiagonal elements of B if m < n.
[in]PT
          PT is DOUBLE PRECISION array, dimension (LDPT,N)
          The min(m,n) by n orthogonal matrix P' in the reduction
          A = Q * B * P'.
[in]LDPT
          LDPT is INTEGER
          The leading dimension of the array PT.
          LDPT >= max(1,min(M,N)).
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (M+N)
[out]RESID
          RESID is DOUBLE PRECISION
          The test ratio:  norm(A - Q * B * P') / ( n * norm(A) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 142 of file dbdt01.f.

142 *
143 * -- LAPACK test routine (version 3.7.0) --
144 * -- LAPACK is a software package provided by Univ. of Tennessee, --
145 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
146 * December 2016
147 *
148 * .. Scalar Arguments ..
149  INTEGER kd, lda, ldpt, ldq, m, n
150  DOUBLE PRECISION resid
151 * ..
152 * .. Array Arguments ..
153  DOUBLE PRECISION a( lda, * ), d( * ), e( * ), pt( ldpt, * ),
154  $ q( ldq, * ), work( * )
155 * ..
156 *
157 * =====================================================================
158 *
159 * .. Parameters ..
160  DOUBLE PRECISION zero, one
161  parameter( zero = 0.0d+0, one = 1.0d+0 )
162 * ..
163 * .. Local Scalars ..
164  INTEGER i, j
165  DOUBLE PRECISION anorm, eps
166 * ..
167 * .. External Functions ..
168  DOUBLE PRECISION dasum, dlamch, dlange
169  EXTERNAL dasum, dlamch, dlange
170 * ..
171 * .. External Subroutines ..
172  EXTERNAL dcopy, dgemv
173 * ..
174 * .. Intrinsic Functions ..
175  INTRINSIC dble, max, min
176 * ..
177 * .. Executable Statements ..
178 *
179 * Quick return if possible
180 *
181  IF( m.LE.0 .OR. n.LE.0 ) THEN
182  resid = zero
183  RETURN
184  END IF
185 *
186 * Compute A - Q * B * P' one column at a time.
187 *
188  resid = zero
189  IF( kd.NE.0 ) THEN
190 *
191 * B is bidiagonal.
192 *
193  IF( kd.NE.0 .AND. m.GE.n ) THEN
194 *
195 * B is upper bidiagonal and M >= N.
196 *
197  DO 20 j = 1, n
198  CALL dcopy( m, a( 1, j ), 1, work, 1 )
199  DO 10 i = 1, n - 1
200  work( m+i ) = d( i )*pt( i, j ) + e( i )*pt( i+1, j )
201  10 CONTINUE
202  work( m+n ) = d( n )*pt( n, j )
203  CALL dgemv( 'No transpose', m, n, -one, q, ldq,
204  $ work( m+1 ), 1, one, work, 1 )
205  resid = max( resid, dasum( m, work, 1 ) )
206  20 CONTINUE
207  ELSE IF( kd.LT.0 ) THEN
208 *
209 * B is upper bidiagonal and M < N.
210 *
211  DO 40 j = 1, n
212  CALL dcopy( m, a( 1, j ), 1, work, 1 )
213  DO 30 i = 1, m - 1
214  work( m+i ) = d( i )*pt( i, j ) + e( i )*pt( i+1, j )
215  30 CONTINUE
216  work( m+m ) = d( m )*pt( m, j )
217  CALL dgemv( 'No transpose', m, m, -one, q, ldq,
218  $ work( m+1 ), 1, one, work, 1 )
219  resid = max( resid, dasum( m, work, 1 ) )
220  40 CONTINUE
221  ELSE
222 *
223 * B is lower bidiagonal.
224 *
225  DO 60 j = 1, n
226  CALL dcopy( m, a( 1, j ), 1, work, 1 )
227  work( m+1 ) = d( 1 )*pt( 1, j )
228  DO 50 i = 2, m
229  work( m+i ) = e( i-1 )*pt( i-1, j ) +
230  $ d( i )*pt( i, j )
231  50 CONTINUE
232  CALL dgemv( 'No transpose', m, m, -one, q, ldq,
233  $ work( m+1 ), 1, one, work, 1 )
234  resid = max( resid, dasum( m, work, 1 ) )
235  60 CONTINUE
236  END IF
237  ELSE
238 *
239 * B is diagonal.
240 *
241  IF( m.GE.n ) THEN
242  DO 80 j = 1, n
243  CALL dcopy( m, a( 1, j ), 1, work, 1 )
244  DO 70 i = 1, n
245  work( m+i ) = d( i )*pt( i, j )
246  70 CONTINUE
247  CALL dgemv( 'No transpose', m, n, -one, q, ldq,
248  $ work( m+1 ), 1, one, work, 1 )
249  resid = max( resid, dasum( m, work, 1 ) )
250  80 CONTINUE
251  ELSE
252  DO 100 j = 1, n
253  CALL dcopy( m, a( 1, j ), 1, work, 1 )
254  DO 90 i = 1, m
255  work( m+i ) = d( i )*pt( i, j )
256  90 CONTINUE
257  CALL dgemv( 'No transpose', m, m, -one, q, ldq,
258  $ work( m+1 ), 1, one, work, 1 )
259  resid = max( resid, dasum( m, work, 1 ) )
260  100 CONTINUE
261  END IF
262  END IF
263 *
264 * Compute norm(A - Q * B * P') / ( n * norm(A) * EPS )
265 *
266  anorm = dlange( '1', m, n, a, lda, work )
267  eps = dlamch( 'Precision' )
268 *
269  IF( anorm.LE.zero ) THEN
270  IF( resid.NE.zero )
271  $ resid = one / eps
272  ELSE
273  IF( anorm.GE.resid ) THEN
274  resid = ( resid / anorm ) / ( dble( n )*eps )
275  ELSE
276  IF( anorm.LT.one ) THEN
277  resid = ( min( resid, dble( n )*anorm ) / anorm ) /
278  $ ( dble( n )*eps )
279  ELSE
280  resid = min( resid / anorm, dble( n ) ) /
281  $ ( dble( n )*eps )
282  END IF
283  END IF
284  END IF
285 *
286  RETURN
287 *
288 * End of DBDT01
289 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
Definition: dcopy.f:84
subroutine dgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
DGEMV
Definition: dgemv.f:158
double precision function dlange(NORM, M, N, A, LDA, WORK)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: dlange.f:116
double precision function dasum(N, DX, INCX)
DASUM
Definition: dasum.f:73
Here is the call graph for this function:
Here is the caller graph for this function: