Numérotation des lignes :

dqrank
C DQRANK    SOURCE    PV090527  23/02/07    11:58:36     11592                subroutine dqrank ( a, lda, m, n, tol, kr, jpvt, qraux, work ) c*****************************************************************************80cc! DQRANK computes the QR factorization of a rectangular matrix.cc  Discussion:cc    This routine is used in conjunction with sqrlss to solvec    overdetermined, underdetermined and singular linear systemsc    in a least squares sense.cc    DQRANK uses the LINPACK subroutine DQRDC to compute the QRc    factorization, with column pivoting, of an M by N matrix A.c    The numerical rank is determined using the tolerance TOL.cc    Note that on output, ABS ( A(1,1) ) / ABS ( A(KR,KR) ) is an estimatec    of the condition number of the matrix of independent columns,c    and of R.  This estimate will be .le. 1/TOL.cc  Reference:cc    Jack Dongarra, Cleve Moler, Jim Bunch, Pete Stewart,c    LINPACK User's Guide,c    SIAM, 1979,c    ISBN13: 978-0-898711-72-1,c    LC: QA214.L56.cc  Parameters:cc    Input/output, real*8 A(LDA,N).  On input, the matrix whosec    decomposition is to be computed.  On output, the information from DQRDC.c    The triangular matrix R of the QR factorization is contained in thec    upper triangle and information needed to recover the orthogonalc    matrix Q is stored below the diagonal in A and in the vector QRAUX.cc    Input, integer LDA, the leading dimension of A, which mustc    be at least M.cc    Input, integer M, the number of rows of A.cc    Input, integer N, the number of columns of A.cc    Input, real*8 TOL, a relative tolerance used to determine thec    numerical rank.  The problem should be scaled so that all the elementsc    of A have roughly the same absolute accuracy, EPS.  Then a reasonablec    value for TOL is roughly EPS divided by the magnitude of the largestc    element.cc    Output, integer KR, the numerical rank.cc    Output, integer JPVT(N), the pivot information from DQRDC.c    Columns JPVT(1), ..., JPVT(KR) of the original matrix are linearlyc    independent to within the tolerance TOL and the remaining columnsc    are linearly dependent.cc    Output, real*8 QRAUX(N), will contain extra information definingc    the QR factorization.cc    Workspace, real*8 WORK(N).c        implicit real*8 (a-h,o-z)        implicit integer (i-n)         integer lda        integer n         real*8 a(lda,n)        integer j        integer job        integer jpvt(n)        integer k        integer kr        integer m        real*8 qraux(n)        real*8 tol        real*8 work(n)         jpvt(1:n) = 0        job = 1         call dqrdc ( a, lda, m, n, qraux, jpvt, work, job )         kr = 0        k = min ( m, n )         do j = 1, k          if ( abs ( a(j,j) ) .le. tol * abs ( a(1,1) ) ) then            return          end if          kr = j        end do         return      end  

© Cast3M 2003 - Tous droits réservés.
Mentions légales