Topics | |
| double | |
| real | |
| complex | |
| complex16 | |
Namespaces | |
| module | la_constants |
| LA_CONSTANTS is a module for the scaling constants for the compiled Fortran single and double precisions | |
Functions | |
| subroutine | clartg (f, g, c, s, r) |
| CLARTG generates a plane rotation with real cosine and complex sine. | |
| subroutine | classq (n, x, incx, scl, sumsq) |
| CLASSQ updates a sum of squares represented in scaled form. | |
| logical function | disnan (din) |
| DISNAN tests input for NaN. | |
| subroutine | dlabad (small, large) |
| DLABAD | |
| subroutine | dlacpy (uplo, m, n, a, lda, b, ldb) |
| DLACPY copies all or part of one two-dimensional array to another. | |
| subroutine | dlae2 (a, b, c, rt1, rt2) |
| DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix. | |
| subroutine | dlaebz (ijob, nitmax, n, mmax, minp, nbmin, abstol, reltol, pivmin, d, e, e2, nval, ab, c, mout, nab, work, iwork, info) |
| DLAEBZ computes the number of eigenvalues of a real symmetric tridiagonal matrix which are less than or equal to a given value, and performs other tasks required by the routine sstebz. | |
| subroutine | dlaev2 (a, b, c, rt1, rt2, cs1, sn1) |
| DLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. | |
| subroutine | dlagts (job, n, a, b, c, d, in, y, tol, info) |
| DLAGTS solves the system of equations (T-λI)x = y or (T-λI)Tx = y,where T is a general tridiagonal matrix and λ a scalar, using the LU factorization computed by slagtf. | |
| logical function | dlaisnan (din1, din2) |
| DLAISNAN tests input for NaN by comparing two arguments for inequality. | |
| integer function | dlaneg (n, d, lld, sigma, pivmin, r) |
| DLANEG computes the Sturm count. | |
| double precision function | dlanst (norm, n, d, e) |
| DLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric tridiagonal matrix. | |
| double precision function | dlapy2 (x, y) |
| DLAPY2 returns sqrt(x2+y2). | |
| double precision function | dlapy3 (x, y, z) |
| DLAPY3 returns sqrt(x2+y2+z2). | |
| subroutine | dlarnv (idist, iseed, n, x) |
| DLARNV returns a vector of random numbers from a uniform or normal distribution. | |
| subroutine | dlarra (n, d, e, e2, spltol, tnrm, nsplit, isplit, info) |
| DLARRA computes the splitting points with the specified threshold. | |
| subroutine | dlarrb (n, d, lld, ifirst, ilast, rtol1, rtol2, offset, w, wgap, werr, work, iwork, pivmin, spdiam, twist, info) |
| DLARRB provides limited bisection to locate eigenvalues for more accuracy. | |
| subroutine | dlarrc (jobt, n, vl, vu, d, e, pivmin, eigcnt, lcnt, rcnt, info) |
| DLARRC computes the number of eigenvalues of the symmetric tridiagonal matrix. | |
| subroutine | dlarrd (range, order, n, vl, vu, il, iu, gers, reltol, d, e, e2, pivmin, nsplit, isplit, m, w, werr, wl, wu, iblock, indexw, work, iwork, info) |
| DLARRD computes the eigenvalues of a symmetric tridiagonal matrix to suitable accuracy. | |
| subroutine | dlarre (range, n, vl, vu, il, iu, d, e, e2, rtol1, rtol2, spltol, nsplit, isplit, m, w, werr, wgap, iblock, indexw, gers, pivmin, work, iwork, info) |
| DLARRE given the tridiagonal matrix T, sets small off-diagonal elements to zero and for each unreduced block Ti, finds base representations and eigenvalues. | |
| subroutine | dlarrf (n, d, l, ld, clstrt, clend, w, wgap, werr, spdiam, clgapl, clgapr, pivmin, sigma, dplus, lplus, work, info) |
| DLARRF finds a new relatively robust representation such that at least one of the eigenvalues is relatively isolated. | |
| subroutine | dlarrj (n, d, e2, ifirst, ilast, rtol, offset, w, werr, work, iwork, pivmin, spdiam, info) |
| DLARRJ performs refinement of the initial estimates of the eigenvalues of the matrix T. | |
| subroutine | dlarrk (n, iw, gl, gu, d, e2, pivmin, reltol, w, werr, info) |
| DLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy. | |
| subroutine | dlarrr (n, d, e, info) |
| DLARRR performs tests to decide whether the symmetric tridiagonal matrix T warrants expensive computations which guarantee high relative accuracy in the eigenvalues. | |
| subroutine | dlartg (f, g, c, s, r) |
| DLARTG generates a plane rotation with real cosine and real sine. | |
| subroutine | dlartgp (f, g, cs, sn, r) |
| DLARTGP generates a plane rotation so that the diagonal is nonnegative. | |
| subroutine | dlaruv (iseed, n, x) |
| DLARUV returns a vector of n random real numbers from a uniform distribution. | |
| subroutine | dlas2 (f, g, h, ssmin, ssmax) |
| DLAS2 computes singular values of a 2-by-2 triangular matrix. | |
| subroutine | dlascl (type, kl, ku, cfrom, cto, m, n, a, lda, info) |
| DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom. | |
| subroutine | dlasd0 (n, sqre, d, e, u, ldu, vt, ldvt, smlsiz, iwork, work, info) |
| DLASD0 computes the singular values of a real upper bidiagonal n-by-m matrix B with diagonal d and off-diagonal e. Used by sbdsdc. | |
| subroutine | dlasd1 (nl, nr, sqre, d, alpha, beta, u, ldu, vt, ldvt, idxq, iwork, work, info) |
| DLASD1 computes the SVD of an upper bidiagonal matrix B of the specified size. Used by sbdsdc. | |
| subroutine | dlasd2 (nl, nr, sqre, k, d, z, alpha, beta, u, ldu, vt, ldvt, dsigma, u2, ldu2, vt2, ldvt2, idxp, idx, idxc, idxq, coltyp, info) |
| DLASD2 merges the two sets of singular values together into a single sorted set. Used by sbdsdc. | |
| subroutine | dlasd3 (nl, nr, sqre, k, d, q, ldq, dsigma, u, ldu, u2, ldu2, vt, ldvt, vt2, ldvt2, idxc, ctot, z, info) |
| DLASD3 finds all square roots of the roots of the secular equation, as defined by the values in D and Z, and then updates the singular vectors by matrix multiplication. Used by sbdsdc. | |
| subroutine | dlasd4 (n, i, d, z, delta, rho, sigma, work, info) |
| DLASD4 computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by dbdsdc. | |
| subroutine | dlasd5 (i, d, z, delta, rho, dsigma, work) |
| DLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification of a 2-by-2 diagonal matrix. Used by sbdsdc. | |
| subroutine | dlasd6 (icompq, nl, nr, sqre, d, vf, vl, alpha, beta, idxq, perm, givptr, givcol, ldgcol, givnum, ldgnum, poles, difl, difr, z, k, c, s, work, iwork, info) |
| DLASD6 computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used by sbdsdc. | |
| subroutine | dlasd7 (icompq, nl, nr, sqre, k, d, z, zw, vf, vfw, vl, vlw, alpha, beta, dsigma, idx, idxp, idxq, perm, givptr, givcol, ldgcol, givnum, ldgnum, c, s, info) |
| DLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to deflate the size of the problem. Used by sbdsdc. | |
| subroutine | dlasd8 (icompq, k, d, z, vf, vl, difl, difr, lddifr, dsigma, work, info) |
| DLASD8 finds the square roots of the roots of the secular equation, and stores, for each element in D, the distance to its two nearest poles. Used by sbdsdc. | |
| subroutine | dlasda (icompq, smlsiz, n, sqre, d, e, u, ldu, vt, k, difl, difr, z, poles, givptr, givcol, ldgcol, perm, givnum, c, s, work, iwork, info) |
| DLASDA computes the singular value decomposition (SVD) of a real upper bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc. | |
| subroutine | dlasdq (uplo, sqre, n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work, info) |
| DLASDQ computes the SVD of a real bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc. | |
| subroutine | dlasdt (n, lvl, nd, inode, ndiml, ndimr, msub) |
| DLASDT creates a tree of subproblems for bidiagonal divide and conquer. Used by sbdsdc. | |
| subroutine | dlaset (uplo, m, n, alpha, beta, a, lda) |
| DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values. | |
| subroutine | dlasr (side, pivot, direct, m, n, c, s, a, lda) |
| DLASR applies a sequence of plane rotations to a general rectangular matrix. | |
| subroutine | dlassq (n, x, incx, scl, sumsq) |
| DLASSQ updates a sum of squares represented in scaled form. | |
| subroutine | dlasv2 (f, g, h, ssmin, ssmax, snr, csr, snl, csl) |
| DLASV2 computes the singular value decomposition of a 2-by-2 triangular matrix. | |
| integer function | ieeeck (ispec, zero, one) |
| IEEECK | |
| integer function | iladlc (m, n, a, lda) |
| ILADLC scans a matrix for its last non-zero column. | |
| integer function | iladlr (m, n, a, lda) |
| ILADLR scans a matrix for its last non-zero row. | |
| integer function | ilaenv (ispec, name, opts, n1, n2, n3, n4) |
| ILAENV | |
| integer function | ilaenv2stage (ispec, name, opts, n1, n2, n3, n4) |
| ILAENV2STAGE | |
| integer function | iparmq (ispec, name, opts, n, ilo, ihi, lwork) |
| IPARMQ | |
| logical function | lsamen (n, ca, cb) |
| LSAMEN | |
| logical function | sisnan (sin) |
| SISNAN tests input for NaN. | |
| subroutine | slabad (small, large) |
| SLABAD | |
| subroutine | slacpy (uplo, m, n, a, lda, b, ldb) |
| SLACPY copies all or part of one two-dimensional array to another. | |
| subroutine | slae2 (a, b, c, rt1, rt2) |
| SLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix. | |
| subroutine | slaebz (ijob, nitmax, n, mmax, minp, nbmin, abstol, reltol, pivmin, d, e, e2, nval, ab, c, mout, nab, work, iwork, info) |
| SLAEBZ computes the number of eigenvalues of a real symmetric tridiagonal matrix which are less than or equal to a given value, and performs other tasks required by the routine sstebz. | |
| subroutine | slaev2 (a, b, c, rt1, rt2, cs1, sn1) |
| SLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. | |
| subroutine | slag2d (m, n, sa, ldsa, a, lda, info) |
| SLAG2D converts a single precision matrix to a double precision matrix. | |
| subroutine | slagts (job, n, a, b, c, d, in, y, tol, info) |
| SLAGTS solves the system of equations (T-λI)x = y or (T-λI)Tx = y,where T is a general tridiagonal matrix and λ a scalar, using the LU factorization computed by slagtf. | |
| logical function | slaisnan (sin1, sin2) |
| SLAISNAN tests input for NaN by comparing two arguments for inequality. | |
| integer function | slaneg (n, d, lld, sigma, pivmin, r) |
| SLANEG computes the Sturm count. | |
| real function | slanst (norm, n, d, e) |
| SLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric tridiagonal matrix. | |
| real function | slapy2 (x, y) |
| SLAPY2 returns sqrt(x2+y2). | |
| real function | slapy3 (x, y, z) |
| SLAPY3 returns sqrt(x2+y2+z2). | |
| subroutine | slarnv (idist, iseed, n, x) |
| SLARNV returns a vector of random numbers from a uniform or normal distribution. | |
| subroutine | slarra (n, d, e, e2, spltol, tnrm, nsplit, isplit, info) |
| SLARRA computes the splitting points with the specified threshold. | |
| subroutine | slarrb (n, d, lld, ifirst, ilast, rtol1, rtol2, offset, w, wgap, werr, work, iwork, pivmin, spdiam, twist, info) |
| SLARRB provides limited bisection to locate eigenvalues for more accuracy. | |
| subroutine | slarrc (jobt, n, vl, vu, d, e, pivmin, eigcnt, lcnt, rcnt, info) |
| SLARRC computes the number of eigenvalues of the symmetric tridiagonal matrix. | |
| subroutine | slarrd (range, order, n, vl, vu, il, iu, gers, reltol, d, e, e2, pivmin, nsplit, isplit, m, w, werr, wl, wu, iblock, indexw, work, iwork, info) |
| SLARRD computes the eigenvalues of a symmetric tridiagonal matrix to suitable accuracy. | |
| subroutine | slarre (range, n, vl, vu, il, iu, d, e, e2, rtol1, rtol2, spltol, nsplit, isplit, m, w, werr, wgap, iblock, indexw, gers, pivmin, work, iwork, info) |
| SLARRE given the tridiagonal matrix T, sets small off-diagonal elements to zero and for each unreduced block Ti, finds base representations and eigenvalues. | |
| subroutine | slarrf (n, d, l, ld, clstrt, clend, w, wgap, werr, spdiam, clgapl, clgapr, pivmin, sigma, dplus, lplus, work, info) |
| SLARRF finds a new relatively robust representation such that at least one of the eigenvalues is relatively isolated. | |
| subroutine | slarrj (n, d, e2, ifirst, ilast, rtol, offset, w, werr, work, iwork, pivmin, spdiam, info) |
| SLARRJ performs refinement of the initial estimates of the eigenvalues of the matrix T. | |
| subroutine | slarrk (n, iw, gl, gu, d, e2, pivmin, reltol, w, werr, info) |
| SLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy. | |
| subroutine | slarrr (n, d, e, info) |
| SLARRR performs tests to decide whether the symmetric tridiagonal matrix T warrants expensive computations which guarantee high relative accuracy in the eigenvalues. | |
| subroutine | slartg (f, g, c, s, r) |
| SLARTG generates a plane rotation with real cosine and real sine. | |
| subroutine | slartgp (f, g, cs, sn, r) |
| SLARTGP generates a plane rotation so that the diagonal is nonnegative. | |
| subroutine | slaruv (iseed, n, x) |
| SLARUV returns a vector of n random real numbers from a uniform distribution. | |
| subroutine | slas2 (f, g, h, ssmin, ssmax) |
| SLAS2 computes singular values of a 2-by-2 triangular matrix. | |
| subroutine | slascl (type, kl, ku, cfrom, cto, m, n, a, lda, info) |
| SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom. | |
| subroutine | slasd0 (n, sqre, d, e, u, ldu, vt, ldvt, smlsiz, iwork, work, info) |
| SLASD0 computes the singular values of a real upper bidiagonal n-by-m matrix B with diagonal d and off-diagonal e. Used by sbdsdc. | |
| subroutine | slasd1 (nl, nr, sqre, d, alpha, beta, u, ldu, vt, ldvt, idxq, iwork, work, info) |
| SLASD1 computes the SVD of an upper bidiagonal matrix B of the specified size. Used by sbdsdc. | |
| subroutine | slasd2 (nl, nr, sqre, k, d, z, alpha, beta, u, ldu, vt, ldvt, dsigma, u2, ldu2, vt2, ldvt2, idxp, idx, idxc, idxq, coltyp, info) |
| SLASD2 merges the two sets of singular values together into a single sorted set. Used by sbdsdc. | |
| subroutine | slasd3 (nl, nr, sqre, k, d, q, ldq, dsigma, u, ldu, u2, ldu2, vt, ldvt, vt2, ldvt2, idxc, ctot, z, info) |
| SLASD3 finds all square roots of the roots of the secular equation, as defined by the values in D and Z, and then updates the singular vectors by matrix multiplication. Used by sbdsdc. | |
| subroutine | slasd4 (n, i, d, z, delta, rho, sigma, work, info) |
| SLASD4 computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by sbdsdc. | |
| subroutine | slasd5 (i, d, z, delta, rho, dsigma, work) |
| SLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification of a 2-by-2 diagonal matrix. Used by sbdsdc. | |
| subroutine | slasd6 (icompq, nl, nr, sqre, d, vf, vl, alpha, beta, idxq, perm, givptr, givcol, ldgcol, givnum, ldgnum, poles, difl, difr, z, k, c, s, work, iwork, info) |
| SLASD6 computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used by sbdsdc. | |
| subroutine | slasd7 (icompq, nl, nr, sqre, k, d, z, zw, vf, vfw, vl, vlw, alpha, beta, dsigma, idx, idxp, idxq, perm, givptr, givcol, ldgcol, givnum, ldgnum, c, s, info) |
| SLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to deflate the size of the problem. Used by sbdsdc. | |
| subroutine | slasd8 (icompq, k, d, z, vf, vl, difl, difr, lddifr, dsigma, work, info) |
| SLASD8 finds the square roots of the roots of the secular equation, and stores, for each element in D, the distance to its two nearest poles. Used by sbdsdc. | |
| subroutine | slasda (icompq, smlsiz, n, sqre, d, e, u, ldu, vt, k, difl, difr, z, poles, givptr, givcol, ldgcol, perm, givnum, c, s, work, iwork, info) |
| SLASDA computes the singular value decomposition (SVD) of a real upper bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc. | |
| subroutine | slasdq (uplo, sqre, n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work, info) |
| SLASDQ computes the SVD of a real bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc. | |
| subroutine | slasdt (n, lvl, nd, inode, ndiml, ndimr, msub) |
| SLASDT creates a tree of subproblems for bidiagonal divide and conquer. Used by sbdsdc. | |
| 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 | slasr (side, pivot, direct, m, n, c, s, a, lda) |
| SLASR applies a sequence of plane rotations to a general rectangular matrix. | |
| subroutine | slassq (n, x, incx, scl, sumsq) |
| SLASSQ updates a sum of squares represented in scaled form. | |
| subroutine | slasv2 (f, g, h, ssmin, ssmax, snr, csr, snl, csl) |
| SLASV2 computes the singular value decomposition of a 2-by-2 triangular matrix. | |
| subroutine | xerbla (srname, info) |
| XERBLA | |
| subroutine | xerbla_array (srname_array, srname_len, info) |
| XERBLA_ARRAY | |
| subroutine | zlartg (f, g, c, s, r) |
| ZLARTG generates a plane rotation with real cosine and complex sine. | |
| subroutine | zlassq (n, x, incx, scl, sumsq) |
| ZLASSQ updates a sum of squares represented in scaled form. | |
This is the group of Other Auxiliary routines
CLARTG generates a plane rotation with real cosine and complex sine.
!>
!> CLARTG generates a plane rotation so that
!>
!> [ C S ] . [ F ] = [ R ]
!> [ -conjg(S) C ] [ G ] [ 0 ]
!>
!> where C is real and C**2 + |S|**2 = 1.
!>
!> The mathematical formulas used for C and S are
!>
!> sgn(x) = { x / |x|, x != 0
!> { 1, x = 0
!>
!> R = sgn(F) * sqrt(|F|**2 + |G|**2)
!>
!> C = |F| / sqrt(|F|**2 + |G|**2)
!>
!> S = sgn(F) * conjg(G) / sqrt(|F|**2 + |G|**2)
!>
!> When F and G are real, the formulas simplify to C = F/R and
!> S = G/R, and the returned values of C, S, and R should be
!> identical to those returned by CLARTG.
!>
!> The algorithm used to compute these quantities incorporates scaling
!> to avoid overflow or underflow in computing the square root of the
!> sum of squares.
!>
!> This is a faster version of the BLAS1 routine CROTG, except for
!> the following differences:
!> F and G are unchanged on return.
!> If G=0, then C=1 and S=0.
!> If F=0, then C=0 and S is chosen so that R is real.
!>
!> Below, wp=>sp stands for single precision from LA_CONSTANTS module.
!> | [in] | F | !> F is COMPLEX(wp) !> The first component of vector to be rotated. !> |
| [in] | G | !> G is COMPLEX(wp) !> The second component of vector to be rotated. !> |
| [out] | C | !> C is REAL(wp) !> The cosine of the rotation. !> |
| [out] | S | !> S is COMPLEX(wp) !> The sine of the rotation. !> |
| [out] | R | !> R is COMPLEX(wp) !> The nonzero component of the rotated vector. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !>
Definition at line 117 of file clartg.f90.
| subroutine classq | ( | integer | n, |
| complex(wp), dimension(*) | x, | ||
| integer | incx, | ||
| real(wp) | scl, | ||
| real(wp) | sumsq ) |
CLASSQ updates a sum of squares represented in scaled form.
Download CLASSQ + dependencies [TGZ] [ZIP] [TXT]
!> !> CLASSQ returns the values scl and smsq such that !> !> ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, !> !> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is !> assumed to be non-negative. !> !> scale and sumsq must be supplied in SCALE and SUMSQ and !> scl and smsq are overwritten on SCALE and SUMSQ respectively. !> !> If scale * sqrt( sumsq ) > tbig then !> we require: scale >= sqrt( TINY*EPS ) / sbig on entry, !> and if 0 < scale * sqrt( sumsq ) < tsml then !> we require: scale <= sqrt( HUGE ) / ssml on entry, !> where !> tbig -- upper threshold for values whose square is representable; !> sbig -- scaling constant for big numbers; \see la_constants.f90 !> tsml -- lower threshold for values whose square is representable; !> ssml -- scaling constant for small numbers; \see la_constants.f90 !> and !> TINY*EPS -- tiniest representable number; !> HUGE -- biggest representable number. !> !>
| [in] | N | !> N is INTEGER !> The number of elements to be used from the vector x. !> |
| [in] | X | !> X is COMPLEX array, dimension (1+(N-1)*abs(INCX)) !> The vector for which a scaled sum of squares is computed. !> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. !> |
| [in] | INCX | !> INCX is INTEGER !> The increment between successive values of the vector x. !> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n !> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n !> If INCX = 0, x isn't a vector so there is no need to call !> this subroutine. If you call it anyway, it will count x(1) !> in the vector norm N times. !> |
| [in,out] | SCALE | !> SCALE is REAL !> On entry, the value scale in the equation above. !> On exit, SCALE is overwritten with scl , the scaling factor !> for the sum of squares. !> |
| [in,out] | SUMSQ | !> SUMSQ is REAL !> On entry, the value sumsq in the equation above. !> On exit, SUMSQ is overwritten with smsq , the basic sum of !> squares from which scl has been factored out. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !> Blue, James L. (1978) !> A Portable Fortran Program to Find the Euclidean Norm of a Vector !> ACM Trans Math Softw 4:15--23 !> https://doi.org/10.1145/355769.355771 !> !>
Definition at line 136 of file classq.f90.
| logical function disnan | ( | double precision, intent(in) | din | ) |
DISNAN tests input for NaN.
Download DISNAN + dependencies [TGZ] [ZIP] [TXT]
!> !> DISNAN returns .TRUE. if its argument is NaN, and .FALSE. !> otherwise. To be replaced by the Fortran 2003 intrinsic in the !> future. !>
| [in] | DIN | !> DIN is DOUBLE PRECISION !> Input to test for NaN. !> |
Definition at line 58 of file disnan.f.
| subroutine dlabad | ( | double precision | small, |
| double precision | large ) |
DLABAD
Download DLABAD + dependencies [TGZ] [ZIP] [TXT]
!> !> DLABAD takes as input the values computed by DLAMCH for underflow and !> overflow, and returns the square root of each of these values if the !> log of LARGE is sufficiently large. This subroutine is intended to !> identify machines with a large exponent range, such as the Crays, and !> redefine the underflow and overflow limits to be the square roots of !> the values computed by DLAMCH. This subroutine is needed because !> DLAMCH does not compensate for poor arithmetic in the upper half of !> the exponent range, as is found on a Cray. !>
| [in,out] | SMALL | !> SMALL is DOUBLE PRECISION !> On entry, the underflow threshold as computed by DLAMCH. !> On exit, if LOG10(LARGE) is sufficiently large, the square !> root of SMALL, otherwise unchanged. !> |
| [in,out] | LARGE | !> LARGE is DOUBLE PRECISION !> On entry, the overflow threshold as computed by DLAMCH. !> On exit, if LOG10(LARGE) is sufficiently large, the square !> root of LARGE, otherwise unchanged. !> |
Definition at line 73 of file dlabad.f.
| subroutine dlacpy | ( | character | uplo, |
| integer | m, | ||
| integer | n, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda, | ||
| double precision, dimension( ldb, * ) | b, | ||
| integer | ldb ) |
DLACPY copies all or part of one two-dimensional array to another.
Download DLACPY + dependencies [TGZ] [ZIP] [TXT]
!> !> DLACPY copies all or part of a two-dimensional matrix A to another !> matrix B. !>
| [in] | UPLO | !> UPLO is CHARACTER*1 !> Specifies the part of the matrix A to be copied to B. !> = 'U': Upper triangular part !> = 'L': Lower triangular part !> Otherwise: All of the matrix A !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in] | A | !> A is DOUBLE PRECISION array, dimension (LDA,N) !> The m by n matrix A. If UPLO = 'U', only the upper triangle !> or trapezoid is accessed; if UPLO = 'L', only the lower !> triangle or trapezoid is accessed. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
| [out] | B | !> B is DOUBLE PRECISION array, dimension (LDB,N) !> On exit, B = A in the locations specified by UPLO. !> |
| [in] | LDB | !> LDB is INTEGER !> The leading dimension of the array B. LDB >= max(1,M). !> |
Definition at line 102 of file dlacpy.f.
| subroutine dlae2 | ( | double precision | a, |
| double precision | b, | ||
| double precision | c, | ||
| double precision | rt1, | ||
| double precision | rt2 ) |
DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix.
Download DLAE2 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix !> [ A B ] !> [ B C ]. !> On return, RT1 is the eigenvalue of larger absolute value, and RT2 !> is the eigenvalue of smaller absolute value. !>
| [in] | A | !> A is DOUBLE PRECISION !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | B | !> B is DOUBLE PRECISION !> The (1,2) and (2,1) elements of the 2-by-2 matrix. !> |
| [in] | C | !> C is DOUBLE PRECISION !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | RT1 | !> RT1 is DOUBLE PRECISION !> The eigenvalue of larger absolute value. !> |
| [out] | RT2 | !> RT2 is DOUBLE PRECISION !> The eigenvalue of smaller absolute value. !> |
!> !> RT1 is accurate to a few ulps barring over/underflow. !> !> RT2 may be inaccurate if there is massive cancellation in the !> determinant A*C-B*B; higher precision or correctly rounded or !> correctly truncated arithmetic would be needed to compute RT2 !> accurately in all cases. !> !> Overflow is possible only if RT1 is within a factor of 5 of overflow. !> Underflow is harmless if the input data is 0 or exceeds !> underflow_threshold / macheps. !>
Definition at line 101 of file dlae2.f.
| subroutine dlaebz | ( | integer | ijob, |
| integer | nitmax, | ||
| integer | n, | ||
| integer | mmax, | ||
| integer | minp, | ||
| integer | nbmin, | ||
| double precision | abstol, | ||
| double precision | reltol, | ||
| double precision | pivmin, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( * ) | e2, | ||
| integer, dimension( * ) | nval, | ||
| double precision, dimension( mmax, * ) | ab, | ||
| double precision, dimension( * ) | c, | ||
| integer | mout, | ||
| integer, dimension( mmax, * ) | nab, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
DLAEBZ computes the number of eigenvalues of a real symmetric tridiagonal matrix which are less than or equal to a given value, and performs other tasks required by the routine sstebz.
Download DLAEBZ + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAEBZ contains the iteration loops which compute and use the !> function N(w), which is the count of eigenvalues of a symmetric !> tridiagonal matrix T less than or equal to its argument w. It !> performs a choice of two types of loops: !> !> IJOB=1, followed by !> IJOB=2: It takes as input a list of intervals and returns a list of !> sufficiently small intervals whose union contains the same !> eigenvalues as the union of the original intervals. !> The input intervals are (AB(j,1),AB(j,2)], j=1,...,MINP. !> The output interval (AB(j,1),AB(j,2)] will contain !> eigenvalues NAB(j,1)+1,...,NAB(j,2), where 1 <= j <= MOUT. !> !> IJOB=3: It performs a binary search in each input interval !> (AB(j,1),AB(j,2)] for a point w(j) such that !> N(w(j))=NVAL(j), and uses C(j) as the starting point of !> the search. If such a w(j) is found, then on output !> AB(j,1)=AB(j,2)=w. If no such w(j) is found, then on output !> (AB(j,1),AB(j,2)] will be a small interval containing the !> point where N(w) jumps through NVAL(j), unless that point !> lies outside the initial interval. !> !> Note that the intervals are in all cases half-open intervals, !> i.e., of the form (a,b] , which includes b but not a . !> !> To avoid underflow, the matrix should be scaled so that its largest !> element is no greater than overflow**(1/2) * underflow**(1/4) !> in absolute value. To assure the most accurate computation !> of small eigenvalues, the matrix should be scaled to be !> not much smaller than that, either. !> !> See W. Kahan , Report CS41, Computer Science Dept., Stanford !> University, July 21, 1966 !> !> Note: the arguments are, in general, *not* checked for unreasonable !> values. !>
| [in] | IJOB | !> IJOB is INTEGER !> Specifies what is to be done: !> = 1: Compute NAB for the initial intervals. !> = 2: Perform bisection iteration to find eigenvalues of T. !> = 3: Perform bisection iteration to invert N(w), i.e., !> to find a point which has a specified number of !> eigenvalues of T to its left. !> Other values will cause DLAEBZ to return with INFO=-1. !> |
| [in] | NITMAX | !> NITMAX is INTEGER !> The maximum number of of bisection to be !> performed, i.e., an interval of width W will not be made !> smaller than 2^(-NITMAX) * W. If not all intervals !> have converged after NITMAX iterations, then INFO is set !> to the number of non-converged intervals. !> |
| [in] | N | !> N is INTEGER !> The dimension n of the tridiagonal matrix T. It must be at !> least 1. !> |
| [in] | MMAX | !> MMAX is INTEGER !> The maximum number of intervals. If more than MMAX intervals !> are generated, then DLAEBZ will quit with INFO=MMAX+1. !> |
| [in] | MINP | !> MINP is INTEGER !> The initial number of intervals. It may not be greater than !> MMAX. !> |
| [in] | NBMIN | !> NBMIN is INTEGER !> The smallest number of intervals that should be processed !> using a vector loop. If zero, then only the scalar loop !> will be used. !> |
| [in] | ABSTOL | !> ABSTOL is DOUBLE PRECISION !> The minimum (absolute) width of an interval. When an !> interval is narrower than ABSTOL, or than RELTOL times the !> larger (in magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. This must be at least !> zero. !> |
| [in] | RELTOL | !> RELTOL is DOUBLE PRECISION !> The minimum relative width of an interval. When an interval !> is narrower than ABSTOL, or than RELTOL times the larger (in !> magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. Note: this should !> always be at least radix*machine epsilon. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum absolute value of a in the Sturm !> sequence loop. !> This must be at least max |e(j)**2|*safe_min and at !> least safe_min, where safe_min is at least !> the smallest number that can divide one without overflow. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The diagonal elements of the tridiagonal matrix T. !> |
| [in] | E | !> E is DOUBLE PRECISION array, dimension (N) !> The offdiagonal elements of the tridiagonal matrix T in !> positions 1 through N-1. E(N) is arbitrary. !> |
| [in] | E2 | !> E2 is DOUBLE PRECISION array, dimension (N) !> The squares of the offdiagonal elements of the tridiagonal !> matrix T. E2(N) is ignored. !> |
| [in,out] | NVAL | !> NVAL is INTEGER array, dimension (MINP) !> If IJOB=1 or 2, not referenced. !> If IJOB=3, the desired values of N(w). The elements of NVAL !> will be reordered to correspond with the intervals in AB. !> Thus, NVAL(j) on output will not, in general be the same as !> NVAL(j) on input, but it will correspond with the interval !> (AB(j,1),AB(j,2)] on output. !> |
| [in,out] | AB | !> AB is DOUBLE PRECISION array, dimension (MMAX,2) !> The endpoints of the intervals. AB(j,1) is a(j), the left !> endpoint of the j-th interval, and AB(j,2) is b(j), the !> right endpoint of the j-th interval. The input intervals !> will, in general, be modified, split, and reordered by the !> calculation. !> |
| [in,out] | C | !> C is DOUBLE PRECISION array, dimension (MMAX) !> If IJOB=1, ignored. !> If IJOB=2, workspace. !> If IJOB=3, then on input C(j) should be initialized to the !> first search point in the binary search. !> |
| [out] | MOUT | !> MOUT is INTEGER !> If IJOB=1, the number of eigenvalues in the intervals. !> If IJOB=2 or 3, the number of intervals output. !> If IJOB=3, MOUT will equal MINP. !> |
| [in,out] | NAB | !> NAB is INTEGER array, dimension (MMAX,2) !> If IJOB=1, then on output NAB(i,j) will be set to N(AB(i,j)). !> If IJOB=2, then on input, NAB(i,j) should be set. It must !> satisfy the condition: !> N(AB(i,1)) <= NAB(i,1) <= NAB(i,2) <= N(AB(i,2)), !> which means that in interval i only eigenvalues !> NAB(i,1)+1,...,NAB(i,2) will be considered. Usually, !> NAB(i,j)=N(AB(i,j)), from a previous call to DLAEBZ with !> IJOB=1. !> On output, NAB(i,j) will contain !> max(na(k),min(nb(k),N(AB(i,j)))), where k is the index of !> the input interval that the output interval !> (AB(j,1),AB(j,2)] came from, and na(k) and nb(k) are the !> the input values of NAB(k,1) and NAB(k,2). !> If IJOB=3, then on output, NAB(i,j) contains N(AB(i,j)), !> unless N(w) > NVAL(i) for all search points w , in which !> case NAB(i,1) will not be modified, i.e., the output !> value will be the same as the input value (modulo !> reorderings -- see NVAL and AB), or unless N(w) < NVAL(i) !> for all search points w , in which case NAB(i,2) will !> not be modified. Normally, NAB should be set to some !> distinctive value(s) before DLAEBZ is called. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (MMAX) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (MMAX) !> Workspace. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: All intervals converged. !> = 1--MMAX: The last INFO intervals did not converge. !> = MMAX+1: More than MMAX intervals were generated. !> |
!> !> This routine is intended to be called only by other LAPACK !> routines, thus the interface is less user-friendly. It is intended !> for two purposes: !> !> (a) finding eigenvalues. In this case, DLAEBZ should have one or !> more initial intervals set up in AB, and DLAEBZ should be called !> with IJOB=1. This sets up NAB, and also counts the eigenvalues. !> Intervals with no eigenvalues would usually be thrown out at !> this point. Also, if not all the eigenvalues in an interval i !> are desired, NAB(i,1) can be increased or NAB(i,2) decreased. !> For example, set NAB(i,1)=NAB(i,2)-1 to get the largest !> eigenvalue. DLAEBZ is then called with IJOB=2 and MMAX !> no smaller than the value of MOUT returned by the call with !> IJOB=1. After this (IJOB=2) call, eigenvalues NAB(i,1)+1 !> through NAB(i,2) are approximately AB(i,1) (or AB(i,2)) to the !> tolerance specified by ABSTOL and RELTOL. !> !> (b) finding an interval (a',b'] containing eigenvalues w(f),...,w(l). !> In this case, start with a Gershgorin interval (a,b). Set up !> AB to contain 2 search intervals, both initially (a,b). One !> NVAL element should contain f-1 and the other should contain l !> , while C should contain a and b, resp. NAB(i,1) should be -1 !> and NAB(i,2) should be N+1, to flag an error if the desired !> interval does not lie in (a,b). DLAEBZ is then called with !> IJOB=3. On exit, if w(f-1) < w(f), then one of the intervals -- !> j -- will have AB(j,1)=AB(j,2) and NAB(j,1)=NAB(j,2)=f-1, while !> if, to the specified tolerance, w(f-k)=...=w(f+r), k > 0 and r !> >= 0, then the interval will have N(AB(j,1))=NAB(j,1)=f-k and !> N(AB(j,2))=NAB(j,2)=f+r. The cases w(l) < w(l+1) and !> w(l-r)=...=w(l+k) are handled similarly. !>
Definition at line 316 of file dlaebz.f.
| subroutine dlaev2 | ( | double precision | a, |
| double precision | b, | ||
| double precision | c, | ||
| double precision | rt1, | ||
| double precision | rt2, | ||
| double precision | cs1, | ||
| double precision | sn1 ) |
DLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.
Download DLAEV2 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix !> [ A B ] !> [ B C ]. !> On return, RT1 is the eigenvalue of larger absolute value, RT2 is the !> eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right !> eigenvector for RT1, giving the decomposition !> !> [ CS1 SN1 ] [ A B ] [ CS1 -SN1 ] = [ RT1 0 ] !> [-SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ]. !>
| [in] | A | !> A is DOUBLE PRECISION !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | B | !> B is DOUBLE PRECISION !> The (1,2) element and the conjugate of the (2,1) element of !> the 2-by-2 matrix. !> |
| [in] | C | !> C is DOUBLE PRECISION !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | RT1 | !> RT1 is DOUBLE PRECISION !> The eigenvalue of larger absolute value. !> |
| [out] | RT2 | !> RT2 is DOUBLE PRECISION !> The eigenvalue of smaller absolute value. !> |
| [out] | CS1 | !> CS1 is DOUBLE PRECISION !> |
| [out] | SN1 | !> SN1 is DOUBLE PRECISION !> The vector (CS1, SN1) is a unit right eigenvector for RT1. !> |
!> !> RT1 is accurate to a few ulps barring over/underflow. !> !> RT2 may be inaccurate if there is massive cancellation in the !> determinant A*C-B*B; higher precision or correctly rounded or !> correctly truncated arithmetic would be needed to compute RT2 !> accurately in all cases. !> !> CS1 and SN1 are accurate to a few ulps barring over/underflow. !> !> Overflow is possible only if RT1 is within a factor of 5 of overflow. !> Underflow is harmless if the input data is 0 or exceeds !> underflow_threshold / macheps. !>
Definition at line 119 of file dlaev2.f.
| subroutine dlagts | ( | integer | job, |
| integer | n, | ||
| double precision, dimension( * ) | a, | ||
| double precision, dimension( * ) | b, | ||
| double precision, dimension( * ) | c, | ||
| double precision, dimension( * ) | d, | ||
| integer, dimension( * ) | in, | ||
| double precision, dimension( * ) | y, | ||
| double precision | tol, | ||
| integer | info ) |
DLAGTS solves the system of equations (T-λI)x = y or (T-λI)Tx = y,where T is a general tridiagonal matrix and λ a scalar, using the LU factorization computed by slagtf.
Download DLAGTS + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAGTS may be used to solve one of the systems of equations !> !> (T - lambda*I)*x = y or (T - lambda*I)**T*x = y, !> !> where T is an n by n tridiagonal matrix, for x, following the !> factorization of (T - lambda*I) as !> !> (T - lambda*I) = P*L*U , !> !> by routine DLAGTF. The choice of equation to be solved is !> controlled by the argument JOB, and in each case there is an option !> to perturb zero or very small diagonal elements of U, this option !> being intended for use in applications such as inverse iteration. !>
| [in] | JOB | !> JOB is INTEGER !> Specifies the job to be performed by DLAGTS as follows: !> = 1: The equations (T - lambda*I)x = y are to be solved, !> but diagonal elements of U are not to be perturbed. !> = -1: The equations (T - lambda*I)x = y are to be solved !> and, if overflow would otherwise occur, the diagonal !> elements of U are to be perturbed. See argument TOL !> below. !> = 2: The equations (T - lambda*I)**Tx = y are to be solved, !> but diagonal elements of U are not to be perturbed. !> = -2: The equations (T - lambda*I)**Tx = y are to be solved !> and, if overflow would otherwise occur, the diagonal !> elements of U are to be perturbed. See argument TOL !> below. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix T. !> |
| [in] | A | !> A is DOUBLE PRECISION array, dimension (N) !> On entry, A must contain the diagonal elements of U as !> returned from DLAGTF. !> |
| [in] | B | !> B is DOUBLE PRECISION array, dimension (N-1) !> On entry, B must contain the first super-diagonal elements of !> U as returned from DLAGTF. !> |
| [in] | C | !> C is DOUBLE PRECISION array, dimension (N-1) !> On entry, C must contain the sub-diagonal elements of L as !> returned from DLAGTF. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N-2) !> On entry, D must contain the second super-diagonal elements !> of U as returned from DLAGTF. !> |
| [in] | IN | !> IN is INTEGER array, dimension (N) !> On entry, IN must contain details of the matrix P as returned !> from DLAGTF. !> |
| [in,out] | Y | !> Y is DOUBLE PRECISION array, dimension (N) !> On entry, the right hand side vector y. !> On exit, Y is overwritten by the solution vector x. !> |
| [in,out] | TOL | !> TOL is DOUBLE PRECISION !> On entry, with JOB < 0, TOL should be the minimum !> perturbation to be made to very small diagonal elements of U. !> TOL should normally be chosen as about eps*norm(U), where eps !> is the relative machine precision, but if TOL is supplied as !> non-positive, then it is reset to eps*max( abs( u(i,j) ) ). !> If JOB > 0 then TOL is not referenced. !> !> On exit, TOL is changed as described above, only if TOL is !> non-positive on entry. Otherwise TOL is unchanged. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !> > 0: overflow would occur when computing the INFO(th) !> element of the solution vector x. This can only occur !> when JOB is supplied as positive and either means !> that a diagonal element of U is very small, or that !> the elements of the right-hand side vector y are very !> large. !> |
Definition at line 160 of file dlagts.f.
| logical function dlaisnan | ( | double precision, intent(in) | din1, |
| double precision, intent(in) | din2 ) |
DLAISNAN tests input for NaN by comparing two arguments for inequality.
Download DLAISNAN + dependencies [TGZ] [ZIP] [TXT]
!> !> This routine is not for general use. It exists solely to avoid !> over-optimization in DISNAN. !> !> DLAISNAN checks for NaNs by comparing its two arguments for !> inequality. NaN is the only floating-point value where NaN != NaN !> returns .TRUE. To check for NaNs, pass the same variable as both !> arguments. !> !> A compiler must assume that the two arguments are !> not the same variable, and the test will not be optimized away. !> Interprocedural or whole-program optimization may delete this !> test. The ISNAN functions will be replaced by the correct !> Fortran 03 intrinsic once the intrinsic is widely available. !>
| [in] | DIN1 | !> DIN1 is DOUBLE PRECISION !> |
| [in] | DIN2 | !> DIN2 is DOUBLE PRECISION !> Two numbers to compare for inequality. !> |
Definition at line 73 of file dlaisnan.f.
| integer function dlaneg | ( | integer | n, |
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | lld, | ||
| double precision | sigma, | ||
| double precision | pivmin, | ||
| integer | r ) |
DLANEG computes the Sturm count.
Download DLANEG + dependencies [TGZ] [ZIP] [TXT]
!> !> DLANEG computes the Sturm count, the number of negative pivots !> encountered while factoring tridiagonal T - sigma I = L D L^T. !> This implementation works directly on the factors without forming !> the tridiagonal matrix T. The Sturm count is also the number of !> eigenvalues of T less than sigma. !> !> This routine is called from DLARRB. !> !> The current routine does not use the PIVMIN parameter but rather !> requires IEEE-754 propagation of Infinities and NaNs. This !> routine also has no input range restrictions but does require !> default exception handling such that x/0 produces Inf when x is !> non-zero, and Inf/Inf produces NaN. For more information, see: !> !> Marques, Riedy, and Voemel, SIAM Journal on !> Scientific Computing, v28, n5, 2006. DOI 10.1137/050641624 !> (Tech report version in LAWN 172 with the same title.) !>
| [in] | N | !> N is INTEGER !> The order of the matrix. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The N diagonal elements of the diagonal matrix D. !> |
| [in] | LLD | !> LLD is DOUBLE PRECISION array, dimension (N-1) !> The (N-1) elements L(i)*L(i)*D(i). !> |
| [in] | SIGMA | !> SIGMA is DOUBLE PRECISION !> Shift amount in T - sigma I = L D L^T. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot in the Sturm sequence. May be used !> when zero pivots are encountered on non-IEEE-754 !> architectures. !> |
| [in] | R | !> R is INTEGER !> The twist index for the twisted factorization that is used !> for the negcount. !> |
Definition at line 117 of file dlaneg.f.
| double precision function dlanst | ( | character | norm, |
| integer | n, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e ) |
DLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric tridiagonal matrix.
Download DLANST + dependencies [TGZ] [ZIP] [TXT]
!> !> DLANST returns the value of the one norm, or the Frobenius norm, or !> the infinity norm, or the element of largest absolute value of a !> real symmetric tridiagonal matrix A. !>
!> !> DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm' !> ( !> ( norm1(A), NORM = '1', 'O' or 'o' !> ( !> ( normI(A), NORM = 'I' or 'i' !> ( !> ( normF(A), NORM = 'F', 'f', 'E' or 'e' !> !> where norm1 denotes the one norm of a matrix (maximum column sum), !> normI denotes the infinity norm of a matrix (maximum row sum) and !> normF denotes the Frobenius norm of a matrix (square root of sum of !> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. !>
| [in] | NORM | !> NORM is CHARACTER*1 !> Specifies the value to be returned in DLANST as described !> above. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix A. N >= 0. When N = 0, DLANST is !> set to zero. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The diagonal elements of A. !> |
| [in] | E | !> E is DOUBLE PRECISION array, dimension (N-1) !> The (n-1) sub-diagonal or super-diagonal elements of A. !> |
Definition at line 99 of file dlanst.f.
| double precision function dlapy2 | ( | double precision | x, |
| double precision | y ) |
DLAPY2 returns sqrt(x2+y2).
Download DLAPY2 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary !> overflow and unnecessary underflow. !>
| [in] | X | !> X is DOUBLE PRECISION !> |
| [in] | Y | !> Y is DOUBLE PRECISION !> X and Y specify the values x and y. !> |
Definition at line 62 of file dlapy2.f.
| double precision function dlapy3 | ( | double precision | x, |
| double precision | y, | ||
| double precision | z ) |
DLAPY3 returns sqrt(x2+y2+z2).
Download DLAPY3 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAPY3 returns sqrt(x**2+y**2+z**2), taking care not to cause !> unnecessary overflow and unnecessary underflow. !>
| [in] | X | !> X is DOUBLE PRECISION !> |
| [in] | Y | !> Y is DOUBLE PRECISION !> |
| [in] | Z | !> Z is DOUBLE PRECISION !> X, Y and Z specify the values x, y and z. !> |
Definition at line 67 of file dlapy3.f.
| subroutine dlarnv | ( | integer | idist, |
| integer, dimension( 4 ) | iseed, | ||
| integer | n, | ||
| double precision, dimension( * ) | x ) |
DLARNV returns a vector of random numbers from a uniform or normal distribution.
Download DLARNV + dependencies [TGZ] [ZIP] [TXT]
!> !> DLARNV returns a vector of n random real numbers from a uniform or !> normal distribution. !>
| [in] | IDIST | !> IDIST is INTEGER !> Specifies the distribution of the random numbers: !> = 1: uniform (0,1) !> = 2: uniform (-1,1) !> = 3: normal (0,1) !> |
| [in,out] | ISEED | !> ISEED is INTEGER array, dimension (4) !> On entry, the seed of the random number generator; the array !> elements must be between 0 and 4095, and ISEED(4) must be !> odd. !> On exit, the seed is updated. !> |
| [in] | N | !> N is INTEGER !> The number of random numbers to be generated. !> |
| [out] | X | !> X is DOUBLE PRECISION array, dimension (N) !> The generated random numbers. !> |
!> !> This routine calls the auxiliary routine DLARUV to generate random !> real numbers from a uniform (0,1) distribution, in batches of up to !> 128 using vectorisable code. The Box-Muller method is used to !> transform numbers from a uniform to a normal distribution. !>
Definition at line 96 of file dlarnv.f.
| subroutine dlarra | ( | integer | n, |
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( * ) | e2, | ||
| double precision | spltol, | ||
| double precision | tnrm, | ||
| integer | nsplit, | ||
| integer, dimension( * ) | isplit, | ||
| integer | info ) |
DLARRA computes the splitting points with the specified threshold.
Download DLARRA + dependencies [TGZ] [ZIP] [TXT]
!> !> Compute the splitting points with threshold SPLTOL. !> DLARRA sets any off-diagonal elements to zero. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> On entry, the N diagonal elements of the tridiagonal !> matrix T. !> |
| [in,out] | E | !> E is DOUBLE PRECISION array, dimension (N) !> On entry, the first (N-1) entries contain the subdiagonal !> elements of the tridiagonal matrix T; E(N) need not be set. !> On exit, the entries E( ISPLIT( I ) ), 1 <= I <= NSPLIT, !> are set to zero, the other entries of E are untouched. !> |
| [in,out] | E2 | !> E2 is DOUBLE PRECISION array, dimension (N) !> On entry, the first (N-1) entries contain the SQUARES of the !> subdiagonal elements of the tridiagonal matrix T; !> E2(N) need not be set. !> On exit, the entries E2( ISPLIT( I ) ), !> 1 <= I <= NSPLIT, have been set to zero !> |
| [in] | SPLTOL | !> SPLTOL is DOUBLE PRECISION !> The threshold for splitting. Two criteria can be used: !> SPLTOL<0 : criterion based on absolute off-diagonal value !> SPLTOL>0 : criterion that preserves relative accuracy !> |
| [in] | TNRM | !> TNRM is DOUBLE PRECISION !> The norm of the matrix. !> |
| [out] | NSPLIT | !> NSPLIT is INTEGER !> The number of blocks T splits into. 1 <= NSPLIT <= N. !> |
| [out] | ISPLIT | !> ISPLIT is INTEGER array, dimension (N) !> The splitting points, at which T breaks up into blocks. !> The first block consists of rows/columns 1 to ISPLIT(1), !> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), !> etc., and the NSPLIT-th consists of rows/columns !> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> |
Definition at line 134 of file dlarra.f.
| subroutine dlarrb | ( | integer | n, |
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | lld, | ||
| integer | ifirst, | ||
| integer | ilast, | ||
| double precision | rtol1, | ||
| double precision | rtol2, | ||
| integer | offset, | ||
| double precision, dimension( * ) | w, | ||
| double precision, dimension( * ) | wgap, | ||
| double precision, dimension( * ) | werr, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| double precision | pivmin, | ||
| double precision | spdiam, | ||
| integer | twist, | ||
| integer | info ) |
DLARRB provides limited bisection to locate eigenvalues for more accuracy.
Download DLARRB + dependencies [TGZ] [ZIP] [TXT]
!> !> Given the relatively robust representation(RRR) L D L^T, DLARRB !> does bisection to refine the eigenvalues of L D L^T, !> W( IFIRST-OFFSET ) through W( ILAST-OFFSET ), to more accuracy. Initial !> guesses for these eigenvalues are input in W, the corresponding estimate !> of the error in these guesses and their gaps are input in WERR !> and WGAP, respectively. During bisection, intervals !> [left, right] are maintained by storing their mid-points and !> semi-widths in the arrays W and WERR respectively. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The N diagonal elements of the diagonal matrix D. !> |
| [in] | LLD | !> LLD is DOUBLE PRECISION array, dimension (N-1) !> The (N-1) elements L(i)*L(i)*D(i). !> |
| [in] | IFIRST | !> IFIRST is INTEGER !> The index of the first eigenvalue to be computed. !> |
| [in] | ILAST | !> ILAST is INTEGER !> The index of the last eigenvalue to be computed. !> |
| [in] | RTOL1 | !> RTOL1 is DOUBLE PRECISION !> |
| [in] | RTOL2 | !> RTOL2 is DOUBLE PRECISION !> Tolerance for the convergence of the bisection intervals. !> An interval [LEFT,RIGHT] has converged if !> RIGHT-LEFT < MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) ) !> where GAP is the (estimated) distance to the nearest !> eigenvalue. !> |
| [in] | OFFSET | !> OFFSET is INTEGER !> Offset for the arrays W, WGAP and WERR, i.e., the IFIRST-OFFSET !> through ILAST-OFFSET elements of these arrays are to be used. !> |
| [in,out] | W | !> W is DOUBLE PRECISION array, dimension (N) !> On input, W( IFIRST-OFFSET ) through W( ILAST-OFFSET ) are !> estimates of the eigenvalues of L D L^T indexed IFIRST through !> ILAST. !> On output, these estimates are refined. !> |
| [in,out] | WGAP | !> WGAP is DOUBLE PRECISION array, dimension (N-1) !> On input, the (estimated) gaps between consecutive !> eigenvalues of L D L^T, i.e., WGAP(I-OFFSET) is the gap between !> eigenvalues I and I+1. Note that if IFIRST = ILAST !> then WGAP(IFIRST-OFFSET) must be set to ZERO. !> On output, these gaps are refined. !> |
| [in,out] | WERR | !> WERR is DOUBLE PRECISION array, dimension (N) !> On input, WERR( IFIRST-OFFSET ) through WERR( ILAST-OFFSET ) are !> the errors in the estimates of the corresponding elements in W. !> On output, these errors are refined. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (2*N) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (2*N) !> Workspace. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot in the Sturm sequence. !> |
| [in] | SPDIAM | !> SPDIAM is DOUBLE PRECISION !> The spectral diameter of the matrix. !> |
| [in] | TWIST | !> TWIST is INTEGER !> The twist index for the twisted factorization that is used !> for the negcount. !> TWIST = N: Compute negcount from L D L^T - LAMBDA I = L+ D+ L+^T !> TWIST = 1: Compute negcount from L D L^T - LAMBDA I = U- D- U-^T !> TWIST = R: Compute negcount from L D L^T - LAMBDA I = N(r) D(r) N(r) !> |
| [out] | INFO | !> INFO is INTEGER !> Error flag. !> |
Definition at line 193 of file dlarrb.f.
| subroutine dlarrc | ( | character | jobt, |
| integer | n, | ||
| double precision | vl, | ||
| double precision | vu, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision | pivmin, | ||
| integer | eigcnt, | ||
| integer | lcnt, | ||
| integer | rcnt, | ||
| integer | info ) |
DLARRC computes the number of eigenvalues of the symmetric tridiagonal matrix.
Download DLARRC + dependencies [TGZ] [ZIP] [TXT]
!> !> Find the number of eigenvalues of the symmetric tridiagonal matrix T !> that are in the interval (VL,VU] if JOBT = 'T', and of L D L^T !> if JOBT = 'L'. !>
| [in] | JOBT | !> JOBT is CHARACTER*1 !> = 'T': Compute Sturm count for matrix T. !> = 'L': Compute Sturm count for matrix L D L^T. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in] | VL | !> VL is DOUBLE PRECISION !> The lower bound for the eigenvalues. !> |
| [in] | VU | !> VU is DOUBLE PRECISION !> The upper bound for the eigenvalues. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> JOBT = 'T': The N diagonal elements of the tridiagonal matrix T. !> JOBT = 'L': The N diagonal elements of the diagonal matrix D. !> |
| [in] | E | !> E is DOUBLE PRECISION array, dimension (N) !> JOBT = 'T': The N-1 offdiagonal elements of the matrix T. !> JOBT = 'L': The N-1 offdiagonal elements of the matrix L. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot in the Sturm sequence for T. !> |
| [out] | EIGCNT | !> EIGCNT is INTEGER !> The number of eigenvalues of the symmetric tridiagonal matrix T !> that are in the interval (VL,VU] !> |
| [out] | LCNT | !> LCNT is INTEGER !> |
| [out] | RCNT | !> RCNT is INTEGER !> The left and right negcounts of the interval. !> |
| [out] | INFO | !> INFO is INTEGER !> |
Definition at line 135 of file dlarrc.f.
| subroutine dlarrd | ( | character | range, |
| character | order, | ||
| integer | n, | ||
| double precision | vl, | ||
| double precision | vu, | ||
| integer | il, | ||
| integer | iu, | ||
| double precision, dimension( * ) | gers, | ||
| double precision | reltol, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( * ) | e2, | ||
| double precision | pivmin, | ||
| integer | nsplit, | ||
| integer, dimension( * ) | isplit, | ||
| integer | m, | ||
| double precision, dimension( * ) | w, | ||
| double precision, dimension( * ) | werr, | ||
| double precision | wl, | ||
| double precision | wu, | ||
| integer, dimension( * ) | iblock, | ||
| integer, dimension( * ) | indexw, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
DLARRD computes the eigenvalues of a symmetric tridiagonal matrix to suitable accuracy.
Download DLARRD + dependencies [TGZ] [ZIP] [TXT]
!> !> DLARRD computes the eigenvalues of a symmetric tridiagonal !> matrix T to suitable accuracy. This is an auxiliary code to be !> called from DSTEMR. !> The user may ask for all eigenvalues, all eigenvalues !> in the half-open interval (VL, VU], or the IL-th through IU-th !> eigenvalues. !> !> To avoid overflow, the matrix must be scaled so that its !> largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest !> accuracy, it should not be much smaller than that. !> !> See W. Kahan , Report CS41, Computer Science Dept., Stanford !> University, July 21, 1966. !>
| [in] | RANGE | !> RANGE is CHARACTER*1 !> = 'A': () all eigenvalues will be found. !> = 'V': () all eigenvalues in the half-open interval !> (VL, VU] will be found. !> = 'I': () the IL-th through IU-th eigenvalues (of the !> entire matrix) will be found. !> |
| [in] | ORDER | !> ORDER is CHARACTER*1 !> = 'B': () the eigenvalues will be grouped by !> split-off block (see IBLOCK, ISPLIT) and !> ordered from smallest to largest within !> the block. !> = 'E': () !> the eigenvalues for the entire matrix !> will be ordered from smallest to !> largest. !> |
| [in] | N | !> N is INTEGER !> The order of the tridiagonal matrix T. N >= 0. !> |
| [in] | VL | !> VL is DOUBLE PRECISION !> If RANGE='V', the lower bound of the interval to !> be searched for eigenvalues. Eigenvalues less than or equal !> to VL, or greater than VU, will not be returned. VL < VU. !> Not referenced if RANGE = 'A' or 'I'. !> |
| [in] | VU | !> VU is DOUBLE PRECISION !> If RANGE='V', the upper bound of the interval to !> be searched for eigenvalues. Eigenvalues less than or equal !> to VL, or greater than VU, will not be returned. VL < VU. !> Not referenced if RANGE = 'A' or 'I'. !> |
| [in] | IL | !> IL is INTEGER !> If RANGE='I', the index of the !> smallest eigenvalue to be returned. !> 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. !> Not referenced if RANGE = 'A' or 'V'. !> |
| [in] | IU | !> IU is INTEGER !> If RANGE='I', the index of the !> largest eigenvalue to be returned. !> 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. !> Not referenced if RANGE = 'A' or 'V'. !> |
| [in] | GERS | !> GERS is DOUBLE PRECISION array, dimension (2*N) !> The N Gerschgorin intervals (the i-th Gerschgorin interval !> is (GERS(2*i-1), GERS(2*i)). !> |
| [in] | RELTOL | !> RELTOL is DOUBLE PRECISION !> The minimum relative width of an interval. When an interval !> is narrower than RELTOL times the larger (in !> magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. Note: this should !> always be at least radix*machine epsilon. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The n diagonal elements of the tridiagonal matrix T. !> |
| [in] | E | !> E is DOUBLE PRECISION array, dimension (N-1) !> The (n-1) off-diagonal elements of the tridiagonal matrix T. !> |
| [in] | E2 | !> E2 is DOUBLE PRECISION array, dimension (N-1) !> The (n-1) squared off-diagonal elements of the tridiagonal matrix T. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot allowed in the Sturm sequence for T. !> |
| [in] | NSPLIT | !> NSPLIT is INTEGER !> The number of diagonal blocks in the matrix T. !> 1 <= NSPLIT <= N. !> |
| [in] | ISPLIT | !> ISPLIT is INTEGER array, dimension (N) !> The splitting points, at which T breaks up into submatrices. !> The first submatrix consists of rows/columns 1 to ISPLIT(1), !> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), !> etc., and the NSPLIT-th consists of rows/columns !> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. !> (Only the first NSPLIT elements will actually be used, but !> since the user cannot know a priori what value NSPLIT will !> have, N words must be reserved for ISPLIT.) !> |
| [out] | M | !> M is INTEGER !> The actual number of eigenvalues found. 0 <= M <= N. !> (See also the description of INFO=2,3.) !> |
| [out] | W | !> W is DOUBLE PRECISION array, dimension (N) !> On exit, the first M elements of W will contain the !> eigenvalue approximations. DLARRD computes an interval !> I_j = (a_j, b_j] that includes eigenvalue j. The eigenvalue !> approximation is given as the interval midpoint !> W(j)= ( a_j + b_j)/2. The corresponding error is bounded by !> WERR(j) = abs( a_j - b_j)/2 !> |
| [out] | WERR | !> WERR is DOUBLE PRECISION array, dimension (N) !> The error bound on the corresponding eigenvalue approximation !> in W. !> |
| [out] | WL | !> WL is DOUBLE PRECISION !> |
| [out] | WU | !> WU is DOUBLE PRECISION !> The interval (WL, WU] contains all the wanted eigenvalues. !> If RANGE='V', then WL=VL and WU=VU. !> If RANGE='A', then WL and WU are the global Gerschgorin bounds !> on the spectrum. !> If RANGE='I', then WL and WU are computed by DLAEBZ from the !> index range specified. !> |
| [out] | IBLOCK | !> IBLOCK is INTEGER array, dimension (N) !> At each row/column j where E(j) is zero or small, the !> matrix T is considered to split into a block diagonal !> matrix. On exit, if INFO = 0, IBLOCK(i) specifies to which !> block (from 1 to the number of blocks) the eigenvalue W(i) !> belongs. (DLARRD may use the remaining N-M elements as !> workspace.) !> |
| [out] | INDEXW | !> INDEXW is INTEGER array, dimension (N) !> The indices of the eigenvalues within each block (submatrix); !> for example, INDEXW(i)= j and IBLOCK(i)=k imply that the !> i-th eigenvalue W(i) is the j-th eigenvalue in block k. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (4*N) !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (3*N) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !> > 0: some or all of the eigenvalues failed to converge or !> were not computed: !> =1 or 3: Bisection failed to converge for some !> eigenvalues; these eigenvalues are flagged by a !> negative block number. The effect is that the !> eigenvalues may not be as accurate as the !> absolute and relative tolerances. This is !> generally caused by unexpectedly inaccurate !> arithmetic. !> =2 or 3: RANGE='I' only: Not all of the eigenvalues !> IL:IU were found. !> Effect: M < IU+1-IL !> Cause: non-monotonic arithmetic, causing the !> Sturm sequence to be non-monotonic. !> Cure: recalculate, using RANGE='A', and pick !> out eigenvalues IL:IU. In some cases, !> increasing the PARAMETER may !> make things work. !> = 4: RANGE='I', and the Gershgorin interval !> initially used was too small. No eigenvalues !> were computed. !> Probable cause: your machine has sloppy !> floating-point arithmetic. !> Cure: Increase the PARAMETER , !> recompile, and try again. !> |
!> FUDGE DOUBLE PRECISION, default = 2 !> A to widen the Gershgorin intervals. Ideally, !> a value of 1 should work, but on machines with sloppy !> arithmetic, this needs to be larger. The default for !> publicly released versions should be large enough to handle !> the worst machine around. Note that this has no effect !> on accuracy of the solution. !>
Definition at line 325 of file dlarrd.f.
| subroutine dlarre | ( | character | range, |
| integer | n, | ||
| double precision | vl, | ||
| double precision | vu, | ||
| integer | il, | ||
| integer | iu, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( * ) | e2, | ||
| double precision | rtol1, | ||
| double precision | rtol2, | ||
| double precision | spltol, | ||
| integer | nsplit, | ||
| integer, dimension( * ) | isplit, | ||
| integer | m, | ||
| double precision, dimension( * ) | w, | ||
| double precision, dimension( * ) | werr, | ||
| double precision, dimension( * ) | wgap, | ||
| integer, dimension( * ) | iblock, | ||
| integer, dimension( * ) | indexw, | ||
| double precision, dimension( * ) | gers, | ||
| double precision | pivmin, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
DLARRE given the tridiagonal matrix T, sets small off-diagonal elements to zero and for each unreduced block Ti, finds base representations and eigenvalues.
Download DLARRE + dependencies [TGZ] [ZIP] [TXT]
!> !> To find the desired eigenvalues of a given real symmetric !> tridiagonal matrix T, DLARRE sets any off-diagonal !> elements to zero, and for each unreduced block T_i, it finds !> (a) a suitable shift at one end of the block's spectrum, !> (b) the base representation, T_i - sigma_i I = L_i D_i L_i^T, and !> (c) eigenvalues of each L_i D_i L_i^T. !> The representations and eigenvalues found are then used by !> DSTEMR to compute the eigenvectors of T. !> The accuracy varies depending on whether bisection is used to !> find a few eigenvalues or the dqds algorithm (subroutine DLASQ2) to !> conpute all and then discard any unwanted one. !> As an added benefit, DLARRE also outputs the n !> Gerschgorin intervals for the matrices L_i D_i L_i^T. !>
| [in] | RANGE | !> RANGE is CHARACTER*1 !> = 'A': () all eigenvalues will be found. !> = 'V': () all eigenvalues in the half-open interval !> (VL, VU] will be found. !> = 'I': () the IL-th through IU-th eigenvalues (of the !> entire matrix) will be found. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in,out] | VL | !> VL is DOUBLE PRECISION !> If RANGE='V', the lower bound for the eigenvalues. !> Eigenvalues less than or equal to VL, or greater than VU, !> will not be returned. VL < VU. !> If RANGE='I' or ='A', DLARRE computes bounds on the desired !> part of the spectrum. !> |
| [in,out] | VU | !> VU is DOUBLE PRECISION !> If RANGE='V', the upper bound for the eigenvalues. !> Eigenvalues less than or equal to VL, or greater than VU, !> will not be returned. VL < VU. !> If RANGE='I' or ='A', DLARRE computes bounds on the desired !> part of the spectrum. !> |
| [in] | IL | !> IL is INTEGER !> If RANGE='I', the index of the !> smallest eigenvalue to be returned. !> 1 <= IL <= IU <= N. !> |
| [in] | IU | !> IU is INTEGER !> If RANGE='I', the index of the !> largest eigenvalue to be returned. !> 1 <= IL <= IU <= N. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension (N) !> On entry, the N diagonal elements of the tridiagonal !> matrix T. !> On exit, the N diagonal elements of the diagonal !> matrices D_i. !> |
| [in,out] | E | !> E is DOUBLE PRECISION array, dimension (N) !> On entry, the first (N-1) entries contain the subdiagonal !> elements of the tridiagonal matrix T; E(N) need not be set. !> On exit, E contains the subdiagonal elements of the unit !> bidiagonal matrices L_i. The entries E( ISPLIT( I ) ), !> 1 <= I <= NSPLIT, contain the base points sigma_i on output. !> |
| [in,out] | E2 | !> E2 is DOUBLE PRECISION array, dimension (N) !> On entry, the first (N-1) entries contain the SQUARES of the !> subdiagonal elements of the tridiagonal matrix T; !> E2(N) need not be set. !> On exit, the entries E2( ISPLIT( I ) ), !> 1 <= I <= NSPLIT, have been set to zero !> |
| [in] | RTOL1 | !> RTOL1 is DOUBLE PRECISION !> |
| [in] | RTOL2 | !> RTOL2 is DOUBLE PRECISION !> Parameters for bisection. !> An interval [LEFT,RIGHT] has converged if !> RIGHT-LEFT < MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) ) !> |
| [in] | SPLTOL | !> SPLTOL is DOUBLE PRECISION !> The threshold for splitting. !> |
| [out] | NSPLIT | !> NSPLIT is INTEGER !> The number of blocks T splits into. 1 <= NSPLIT <= N. !> |
| [out] | ISPLIT | !> ISPLIT is INTEGER array, dimension (N) !> The splitting points, at which T breaks up into blocks. !> The first block consists of rows/columns 1 to ISPLIT(1), !> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), !> etc., and the NSPLIT-th consists of rows/columns !> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. !> |
| [out] | M | !> M is INTEGER !> The total number of eigenvalues (of all L_i D_i L_i^T) !> found. !> |
| [out] | W | !> W is DOUBLE PRECISION array, dimension (N) !> The first M elements contain the eigenvalues. The !> eigenvalues of each of the blocks, L_i D_i L_i^T, are !> sorted in ascending order ( DLARRE may use the !> remaining N-M elements as workspace). !> |
| [out] | WERR | !> WERR is DOUBLE PRECISION array, dimension (N) !> The error bound on the corresponding eigenvalue in W. !> |
| [out] | WGAP | !> WGAP is DOUBLE PRECISION array, dimension (N) !> The separation from the right neighbor eigenvalue in W. !> The gap is only with respect to the eigenvalues of the same block !> as each block has its own representation tree. !> Exception: at the right end of a block we store the left gap !> |
| [out] | IBLOCK | !> IBLOCK is INTEGER array, dimension (N) !> The indices of the blocks (submatrices) associated with the !> corresponding eigenvalues in W; IBLOCK(i)=1 if eigenvalue !> W(i) belongs to the first block from the top, =2 if W(i) !> belongs to the second block, etc. !> |
| [out] | INDEXW | !> INDEXW is INTEGER array, dimension (N) !> The indices of the eigenvalues within each block (submatrix); !> for example, INDEXW(i)= 10 and IBLOCK(i)=2 imply that the !> i-th eigenvalue W(i) is the 10-th eigenvalue in block 2 !> |
| [out] | GERS | !> GERS is DOUBLE PRECISION array, dimension (2*N) !> The N Gerschgorin intervals (the i-th Gerschgorin interval !> is (GERS(2*i-1), GERS(2*i)). !> |
| [out] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot in the Sturm sequence for T. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (6*N) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (5*N) !> Workspace. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> > 0: A problem occurred in DLARRE. !> < 0: One of the called subroutines signaled an internal problem. !> Needs inspection of the corresponding parameter IINFO !> for further information. !> !> =-1: Problem in DLARRD. !> = 2: No base representation could be found in MAXTRY iterations. !> Increasing MAXTRY and recompilation might be a remedy. !> =-3: Problem in DLARRB when computing the refined root !> representation for DLASQ2. !> =-4: Problem in DLARRB when preforming bisection on the !> desired part of the spectrum. !> =-5: Problem in DLASQ2. !> =-6: Problem in DLASQ2. !> |
!> !> The base representations are required to suffer very little !> element growth and consequently define all their eigenvalues to !> high relative accuracy. !>
Definition at line 301 of file dlarre.f.
| subroutine dlarrf | ( | integer | n, |
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | l, | ||
| double precision, dimension( * ) | ld, | ||
| integer | clstrt, | ||
| integer | clend, | ||
| double precision, dimension( * ) | w, | ||
| double precision, dimension( * ) | wgap, | ||
| double precision, dimension( * ) | werr, | ||
| double precision | spdiam, | ||
| double precision | clgapl, | ||
| double precision | clgapr, | ||
| double precision | pivmin, | ||
| double precision | sigma, | ||
| double precision, dimension( * ) | dplus, | ||
| double precision, dimension( * ) | lplus, | ||
| double precision, dimension( * ) | work, | ||
| integer | info ) |
DLARRF finds a new relatively robust representation such that at least one of the eigenvalues is relatively isolated.
Download DLARRF + dependencies [TGZ] [ZIP] [TXT]
!> !> Given the initial representation L D L^T and its cluster of close !> eigenvalues (in a relative measure), W( CLSTRT ), W( CLSTRT+1 ), ... !> W( CLEND ), DLARRF finds a new relatively robust representation !> L D L^T - SIGMA I = L(+) D(+) L(+)^T such that at least one of the !> eigenvalues of L(+) D(+) L(+)^T is relatively isolated. !>
| [in] | N | !> N is INTEGER !> The order of the matrix (subblock, if the matrix split). !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The N diagonal elements of the diagonal matrix D. !> |
| [in] | L | !> L is DOUBLE PRECISION array, dimension (N-1) !> The (N-1) subdiagonal elements of the unit bidiagonal !> matrix L. !> |
| [in] | LD | !> LD is DOUBLE PRECISION array, dimension (N-1) !> The (N-1) elements L(i)*D(i). !> |
| [in] | CLSTRT | !> CLSTRT is INTEGER !> The index of the first eigenvalue in the cluster. !> |
| [in] | CLEND | !> CLEND is INTEGER !> The index of the last eigenvalue in the cluster. !> |
| [in] | W | !> W is DOUBLE PRECISION array, dimension !> dimension is >= (CLEND-CLSTRT+1) !> The eigenvalue APPROXIMATIONS of L D L^T in ascending order. !> W( CLSTRT ) through W( CLEND ) form the cluster of relatively !> close eigenalues. !> |
| [in,out] | WGAP | !> WGAP is DOUBLE PRECISION array, dimension !> dimension is >= (CLEND-CLSTRT+1) !> The separation from the right neighbor eigenvalue in W. !> |
| [in] | WERR | !> WERR is DOUBLE PRECISION array, dimension !> dimension is >= (CLEND-CLSTRT+1) !> WERR contain the semiwidth of the uncertainty !> interval of the corresponding eigenvalue APPROXIMATION in W !> |
| [in] | SPDIAM | !> SPDIAM is DOUBLE PRECISION !> estimate of the spectral diameter obtained from the !> Gerschgorin intervals !> |
| [in] | CLGAPL | !> CLGAPL is DOUBLE PRECISION !> |
| [in] | CLGAPR | !> CLGAPR is DOUBLE PRECISION !> absolute gap on each end of the cluster. !> Set by the calling routine to protect against shifts too close !> to eigenvalues outside the cluster. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot allowed in the Sturm sequence. !> |
| [out] | SIGMA | !> SIGMA is DOUBLE PRECISION !> The shift used to form L(+) D(+) L(+)^T. !> |
| [out] | DPLUS | !> DPLUS is DOUBLE PRECISION array, dimension (N) !> The N diagonal elements of the diagonal matrix D(+). !> |
| [out] | LPLUS | !> LPLUS is DOUBLE PRECISION array, dimension (N-1) !> The first (N-1) elements of LPLUS contain the subdiagonal !> elements of the unit bidiagonal matrix L(+). !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (2*N) !> Workspace. !> |
| [out] | INFO | !> INFO is INTEGER !> Signals processing OK (=0) or failure (=1) !> |
Definition at line 189 of file dlarrf.f.
| subroutine dlarrj | ( | integer | n, |
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e2, | ||
| integer | ifirst, | ||
| integer | ilast, | ||
| double precision | rtol, | ||
| integer | offset, | ||
| double precision, dimension( * ) | w, | ||
| double precision, dimension( * ) | werr, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| double precision | pivmin, | ||
| double precision | spdiam, | ||
| integer | info ) |
DLARRJ performs refinement of the initial estimates of the eigenvalues of the matrix T.
Download DLARRJ + dependencies [TGZ] [ZIP] [TXT]
!> !> Given the initial eigenvalue approximations of T, DLARRJ !> does bisection to refine the eigenvalues of T, !> W( IFIRST-OFFSET ) through W( ILAST-OFFSET ), to more accuracy. Initial !> guesses for these eigenvalues are input in W, the corresponding estimate !> of the error in these guesses in WERR. During bisection, intervals !> [left, right] are maintained by storing their mid-points and !> semi-widths in the arrays W and WERR respectively. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The N diagonal elements of T. !> |
| [in] | E2 | !> E2 is DOUBLE PRECISION array, dimension (N-1) !> The Squares of the (N-1) subdiagonal elements of T. !> |
| [in] | IFIRST | !> IFIRST is INTEGER !> The index of the first eigenvalue to be computed. !> |
| [in] | ILAST | !> ILAST is INTEGER !> The index of the last eigenvalue to be computed. !> |
| [in] | RTOL | !> RTOL is DOUBLE PRECISION !> Tolerance for the convergence of the bisection intervals. !> An interval [LEFT,RIGHT] has converged if !> RIGHT-LEFT < RTOL*MAX(|LEFT|,|RIGHT|). !> |
| [in] | OFFSET | !> OFFSET is INTEGER !> Offset for the arrays W and WERR, i.e., the IFIRST-OFFSET !> through ILAST-OFFSET elements of these arrays are to be used. !> |
| [in,out] | W | !> W is DOUBLE PRECISION array, dimension (N) !> On input, W( IFIRST-OFFSET ) through W( ILAST-OFFSET ) are !> estimates of the eigenvalues of L D L^T indexed IFIRST through !> ILAST. !> On output, these estimates are refined. !> |
| [in,out] | WERR | !> WERR is DOUBLE PRECISION array, dimension (N) !> On input, WERR( IFIRST-OFFSET ) through WERR( ILAST-OFFSET ) are !> the errors in the estimates of the corresponding elements in W. !> On output, these errors are refined. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (2*N) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (2*N) !> Workspace. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot in the Sturm sequence for T. !> |
| [in] | SPDIAM | !> SPDIAM is DOUBLE PRECISION !> The spectral diameter of T. !> |
| [out] | INFO | !> INFO is INTEGER !> Error flag. !> |
Definition at line 165 of file dlarrj.f.
| subroutine dlarrk | ( | integer | n, |
| integer | iw, | ||
| double precision | gl, | ||
| double precision | gu, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e2, | ||
| double precision | pivmin, | ||
| double precision | reltol, | ||
| double precision | w, | ||
| double precision | werr, | ||
| integer | info ) |
DLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy.
Download DLARRK + dependencies [TGZ] [ZIP] [TXT]
!> !> DLARRK computes one eigenvalue of a symmetric tridiagonal !> matrix T to suitable accuracy. This is an auxiliary code to be !> called from DSTEMR. !> !> To avoid overflow, the matrix must be scaled so that its !> largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest !> accuracy, it should not be much smaller than that. !> !> See W. Kahan , Report CS41, Computer Science Dept., Stanford !> University, July 21, 1966. !>
| [in] | N | !> N is INTEGER !> The order of the tridiagonal matrix T. N >= 0. !> |
| [in] | IW | !> IW is INTEGER !> The index of the eigenvalues to be returned. !> |
| [in] | GL | !> GL is DOUBLE PRECISION !> |
| [in] | GU | !> GU is DOUBLE PRECISION !> An upper and a lower bound on the eigenvalue. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The n diagonal elements of the tridiagonal matrix T. !> |
| [in] | E2 | !> E2 is DOUBLE PRECISION array, dimension (N-1) !> The (n-1) squared off-diagonal elements of the tridiagonal matrix T. !> |
| [in] | PIVMIN | !> PIVMIN is DOUBLE PRECISION !> The minimum pivot allowed in the Sturm sequence for T. !> |
| [in] | RELTOL | !> RELTOL is DOUBLE PRECISION !> The minimum relative width of an interval. When an interval !> is narrower than RELTOL times the larger (in !> magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. Note: this should !> always be at least radix*machine epsilon. !> |
| [out] | W | !> W is DOUBLE PRECISION !> |
| [out] | WERR | !> WERR is DOUBLE PRECISION !> The error bound on the corresponding eigenvalue approximation !> in W. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: Eigenvalue converged !> = -1: Eigenvalue did NOT converge !> |
!> FUDGE DOUBLE PRECISION, default = 2 !> A to widen the Gershgorin intervals. !>
Definition at line 143 of file dlarrk.f.
| subroutine dlarrr | ( | integer | n, |
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| integer | info ) |
DLARRR performs tests to decide whether the symmetric tridiagonal matrix T warrants expensive computations which guarantee high relative accuracy in the eigenvalues.
Download DLARRR + dependencies [TGZ] [ZIP] [TXT]
!> !> Perform tests to decide whether the symmetric tridiagonal matrix T !> warrants expensive computations which guarantee high relative accuracy !> in the eigenvalues. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension (N) !> The N diagonal elements of the tridiagonal matrix T. !> |
| [in,out] | E | !> E is DOUBLE PRECISION array, dimension (N) !> On entry, the first (N-1) entries contain the subdiagonal !> elements of the tridiagonal matrix T; E(N) is set to ZERO. !> |
| [out] | INFO | !> INFO is INTEGER !> INFO = 0(default) : the matrix warrants computations preserving !> relative accuracy. !> INFO = 1 : the matrix warrants computations guaranteeing !> only absolute accuracy. !> |
Definition at line 93 of file dlarrr.f.
| subroutine dlartg | ( | real(wp) | f, |
| real(wp) | g, | ||
| real(wp) | c, | ||
| real(wp) | s, | ||
| real(wp) | r ) |
DLARTG generates a plane rotation with real cosine and real sine.
!> !> DLARTG generates a plane rotation so that !> !> [ C S ] . [ F ] = [ R ] !> [ -S C ] [ G ] [ 0 ] !> !> where C**2 + S**2 = 1. !> !> The mathematical formulas used for C and S are !> R = sign(F) * sqrt(F**2 + G**2) !> C = F / R !> S = G / R !> Hence C >= 0. The algorithm used to compute these quantities !> incorporates scaling to avoid overflow or underflow in computing the !> square root of the sum of squares. !> !> This version is discontinuous in R at F = 0 but it returns the same !> C and S as ZLARTG for complex inputs (F,0) and (G,0). !> !> This is a more accurate version of the BLAS1 routine DROTG, !> with the following other differences: !> F and G are unchanged on return. !> If G=0, then C=1 and S=0. !> If F=0 and (G .ne. 0), then C=0 and S=sign(1,G) without doing any !> floating point operations (saves work in DBDSQR when !> there are zeros on the diagonal). !> !> If F exceeds G in magnitude, C will be positive. !> !> Below, wp=>dp stands for double precision from LA_CONSTANTS module. !>
| [in] | F | !> F is REAL(wp) !> The first component of vector to be rotated. !> |
| [in] | G | !> G is REAL(wp) !> The second component of vector to be rotated. !> |
| [out] | C | !> C is REAL(wp) !> The cosine of the rotation. !> |
| [out] | S | !> S is REAL(wp) !> The sine of the rotation. !> |
| [out] | R | !> R is REAL(wp) !> The nonzero component of the rotated vector. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !>
Definition at line 112 of file dlartg.f90.
| subroutine dlartgp | ( | double precision | f, |
| double precision | g, | ||
| double precision | cs, | ||
| double precision | sn, | ||
| double precision | r ) |
DLARTGP generates a plane rotation so that the diagonal is nonnegative.
Download DLARTGP + dependencies [TGZ] [ZIP] [TXT]
!> !> DLARTGP generates a plane rotation so that !> !> [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. !> [ -SN CS ] [ G ] [ 0 ] !> !> This is a slower, more accurate version of the Level 1 BLAS routine DROTG, !> with the following other differences: !> F and G are unchanged on return. !> If G=0, then CS=(+/-)1 and SN=0. !> If F=0 and (G .ne. 0), then CS=0 and SN=(+/-)1. !> !> The sign is chosen so that R >= 0. !>
| [in] | F | !> F is DOUBLE PRECISION !> The first component of vector to be rotated. !> |
| [in] | G | !> G is DOUBLE PRECISION !> The second component of vector to be rotated. !> |
| [out] | CS | !> CS is DOUBLE PRECISION !> The cosine of the rotation. !> |
| [out] | SN | !> SN is DOUBLE PRECISION !> The sine of the rotation. !> |
| [out] | R | !> R is DOUBLE PRECISION !> The nonzero component of the rotated vector. !> !> This version has a few statements commented out for thread safety !> (machine parameters are computed on each entry). 10 feb 03, SJH. !> |
Definition at line 94 of file dlartgp.f.
| subroutine dlaruv | ( | integer, dimension( 4 ) | iseed, |
| integer | n, | ||
| double precision, dimension( n ) | x ) |
DLARUV returns a vector of n random real numbers from a uniform distribution.
Download DLARUV + dependencies [TGZ] [ZIP] [TXT]
!> !> DLARUV returns a vector of n random real numbers from a uniform (0,1) !> distribution (n <= 128). !> !> This is an auxiliary routine called by DLARNV and ZLARNV. !>
| [in,out] | ISEED | !> ISEED is INTEGER array, dimension (4) !> On entry, the seed of the random number generator; the array !> elements must be between 0 and 4095, and ISEED(4) must be !> odd. !> On exit, the seed is updated. !> |
| [in] | N | !> N is INTEGER !> The number of random numbers to be generated. N <= 128. !> |
| [out] | X | !> X is DOUBLE PRECISION array, dimension (N) !> The generated random numbers. !> |
!> !> This routine uses a multiplicative congruential method with modulus !> 2**48 and multiplier 33952834046453 (see G.S.Fishman, !> 'Multiplicative congruential random number generators with modulus !> 2**b: an exhaustive analysis for b = 32 and a partial analysis for !> b = 48', Math. Comp. 189, pp 331-344, 1990). !> !> 48-bit integers are stored in 4 integer array elements with 12 bits !> per element. Hence the routine is portable across machines with !> integers of 32 bits or more. !>
Definition at line 94 of file dlaruv.f.
| subroutine dlas2 | ( | double precision | f, |
| double precision | g, | ||
| double precision | h, | ||
| double precision | ssmin, | ||
| double precision | ssmax ) |
DLAS2 computes singular values of a 2-by-2 triangular matrix.
Download DLAS2 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLAS2 computes the singular values of the 2-by-2 matrix !> [ F G ] !> [ 0 H ]. !> On return, SSMIN is the smaller singular value and SSMAX is the !> larger singular value. !>
| [in] | F | !> F is DOUBLE PRECISION !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | G | !> G is DOUBLE PRECISION !> The (1,2) element of the 2-by-2 matrix. !> |
| [in] | H | !> H is DOUBLE PRECISION !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | SSMIN | !> SSMIN is DOUBLE PRECISION !> The smaller singular value. !> |
| [out] | SSMAX | !> SSMAX is DOUBLE PRECISION !> The larger singular value. !> |
!> !> Barring over/underflow, all output quantities are correct to within !> a few units in the last place (ulps), even in the absence of a guard !> digit in addition/subtraction. !> !> In IEEE arithmetic, the code works correctly if one matrix element is !> infinite. !> !> Overflow will not occur unless the largest singular value itself !> overflows, or is within a few ulps of overflow. (On machines with !> partial overflow, like the Cray, overflow may occur if the largest !> singular value is within a factor of 2 of overflow.) !> !> Underflow is harmless if underflow is gradual. Otherwise, results !> may correspond to a matrix modified by perturbations of size near !> the underflow threshold. !>
Definition at line 106 of file dlas2.f.
| subroutine dlascl | ( | character | type, |
| integer | kl, | ||
| integer | ku, | ||
| double precision | cfrom, | ||
| double precision | cto, | ||
| integer | m, | ||
| integer | n, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda, | ||
| integer | info ) |
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Download DLASCL + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASCL multiplies the M by N real matrix A by the real scalar !> CTO/CFROM. This is done without over/underflow as long as the final !> result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that !> A may be full, upper triangular, lower triangular, upper Hessenberg, !> or banded. !>
| [in] | TYPE | !> TYPE is CHARACTER*1 !> TYPE indices the storage type of the input matrix. !> = 'G': A is a full matrix. !> = 'L': A is a lower triangular matrix. !> = 'U': A is an upper triangular matrix. !> = 'H': A is an upper Hessenberg matrix. !> = 'B': A is a symmetric band matrix with lower bandwidth KL !> and upper bandwidth KU and with the only the lower !> half stored. !> = 'Q': A is a symmetric band matrix with lower bandwidth KL !> and upper bandwidth KU and with the only the upper !> half stored. !> = 'Z': A is a band matrix with lower bandwidth KL and upper !> bandwidth KU. See DGBTRF for storage details. !> |
| [in] | KL | !> KL is INTEGER !> The lower bandwidth of A. Referenced only if TYPE = 'B', !> 'Q' or 'Z'. !> |
| [in] | KU | !> KU is INTEGER !> The upper bandwidth of A. Referenced only if TYPE = 'B', !> 'Q' or 'Z'. !> |
| [in] | CFROM | !> CFROM is DOUBLE PRECISION !> |
| [in] | CTO | !> CTO is DOUBLE PRECISION !> !> The matrix A is multiplied by CTO/CFROM. A(I,J) is computed !> without over/underflow if the final result CTO*A(I,J)/CFROM !> can be represented without over/underflow. CFROM must be !> nonzero. !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in,out] | A | !> A is DOUBLE PRECISION array, dimension (LDA,N) !> The matrix to be multiplied by CTO/CFROM. See TYPE for the !> storage type. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. !> If TYPE = 'G', 'L', 'U', 'H', LDA >= max(1,M); !> TYPE = 'B', LDA >= KL+1; !> TYPE = 'Q', LDA >= KU+1; !> TYPE = 'Z', LDA >= 2*KL+KU+1. !> |
| [out] | INFO | !> INFO is INTEGER !> 0 - successful exit !> <0 - if INFO = -i, the i-th argument had an illegal value. !> |
Definition at line 142 of file dlascl.f.
| subroutine dlasd0 | ( | integer | n, |
| integer | sqre, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| double precision, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| integer | smlsiz, | ||
| integer, dimension( * ) | iwork, | ||
| double precision, dimension( * ) | work, | ||
| integer | info ) |
DLASD0 computes the singular values of a real upper bidiagonal n-by-m matrix B with diagonal d and off-diagonal e. Used by sbdsdc.
Download DLASD0 + dependencies [TGZ] [ZIP] [TXT]
!> !> Using a divide and conquer approach, DLASD0 computes the singular !> value decomposition (SVD) of a real upper bidiagonal N-by-M !> matrix B with diagonal D and offdiagonal E, where M = N + SQRE. !> The algorithm computes orthogonal matrices U and VT such that !> B = U * S * VT. The singular values S are overwritten on D. !> !> A related subroutine, DLASDA, computes only the singular values, !> and optionally, the singular vectors in compact form. !>
| [in] | N | !> N is INTEGER !> On entry, the row dimension of the upper bidiagonal matrix. !> This is also the dimension of the main diagonal array D. !> |
| [in] | SQRE | !> SQRE is INTEGER !> Specifies the column dimension of the bidiagonal matrix. !> = 0: The bidiagonal matrix has column dimension M = N; !> = 1: The bidiagonal matrix has column dimension M = N+1; !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension (N) !> On entry D contains the main diagonal of the bidiagonal !> matrix. !> On exit D, if INFO = 0, contains its singular values. !> |
| [in,out] | E | !> E is DOUBLE PRECISION array, dimension (M-1) !> Contains the subdiagonal entries of the bidiagonal matrix. !> On exit, E has been destroyed. !> |
| [out] | U | !> U is DOUBLE PRECISION array, dimension (LDU, N) !> On exit, U contains the left singular vectors. !> |
| [in] | LDU | !> LDU is INTEGER !> On entry, leading dimension of U. !> |
| [out] | VT | !> VT is DOUBLE PRECISION array, dimension (LDVT, M) !> On exit, VT**T contains the right singular vectors. !> |
| [in] | LDVT | !> LDVT is INTEGER !> On entry, leading dimension of VT. !> |
| [in] | SMLSIZ | !> SMLSIZ is INTEGER !> On entry, maximum size of the subproblems at the !> bottom of the computation tree. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (8*N) !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (3*M**2+2*M) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 148 of file dlasd0.f.
| subroutine dlasd1 | ( | integer | nl, |
| integer | nr, | ||
| integer | sqre, | ||
| double precision, dimension( * ) | d, | ||
| double precision | alpha, | ||
| double precision | beta, | ||
| double precision, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| double precision, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | iwork, | ||
| double precision, dimension( * ) | work, | ||
| integer | info ) |
DLASD1 computes the SVD of an upper bidiagonal matrix B of the specified size. Used by sbdsdc.
Download DLASD1 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASD1 computes the SVD of an upper bidiagonal N-by-M matrix B, !> where N = NL + NR + 1 and M = N + SQRE. DLASD1 is called from DLASD0. !> !> A related subroutine DLASD7 handles the case in which the singular !> values (and the singular vectors in factored form) are desired. !> !> DLASD1 computes the SVD as follows: !> !> ( D1(in) 0 0 0 ) !> B = U(in) * ( Z1**T a Z2**T b ) * VT(in) !> ( 0 0 D2(in) 0 ) !> !> = U(out) * ( D(out) 0) * VT(out) !> !> where Z**T = (Z1**T a Z2**T b) = u**T VT**T, and u is a vector of dimension M !> with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros !> elsewhere; and the entry b is empty if SQRE = 0. !> !> The left singular vectors of the original matrix are stored in U, and !> the transpose of the right singular vectors are stored in VT, and the !> singular values are in D. The algorithm consists of three stages: !> !> The first stage consists of deflating the size of the problem !> when there are multiple singular values or when there are zeros in !> the Z vector. For each such occurrence the dimension of the !> secular equation problem is reduced by one. This stage is !> performed by the routine DLASD2. !> !> The second stage consists of calculating the updated !> singular values. This is done by finding the square roots of the !> roots of the secular equation via the routine DLASD4 (as called !> by DLASD3). This routine also calculates the singular vectors of !> the current problem. !> !> The final stage consists of computing the updated singular vectors !> directly using the updated singular values. The singular vectors !> for the current problem are multiplied with the singular vectors !> from the overall problem. !>
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has row dimension N = NL + NR + 1, !> and column dimension M = N + SQRE. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, !> dimension (N = NL+NR+1). !> On entry D(1:NL,1:NL) contains the singular values of the !> upper block; and D(NL+2:N) contains the singular values of !> the lower block. On exit D(1:N) contains the singular values !> of the modified matrix. !> |
| [in,out] | ALPHA | !> ALPHA is DOUBLE PRECISION !> Contains the diagonal element associated with the added row. !> |
| [in,out] | BETA | !> BETA is DOUBLE PRECISION !> Contains the off-diagonal element associated with the added !> row. !> |
| [in,out] | U | !> U is DOUBLE PRECISION array, dimension(LDU,N) !> On entry U(1:NL, 1:NL) contains the left singular vectors of !> the upper block; U(NL+2:N, NL+2:N) contains the left singular !> vectors of the lower block. On exit U contains the left !> singular vectors of the bidiagonal matrix. !> |
| [in] | LDU | !> LDU is INTEGER !> The leading dimension of the array U. LDU >= max( 1, N ). !> |
| [in,out] | VT | !> VT is DOUBLE PRECISION array, dimension(LDVT,M) !> where M = N + SQRE. !> On entry VT(1:NL+1, 1:NL+1)**T contains the right singular !> vectors of the upper block; VT(NL+2:M, NL+2:M)**T contains !> the right singular vectors of the lower block. On exit !> VT**T contains the right singular vectors of the !> bidiagonal matrix. !> |
| [in] | LDVT | !> LDVT is INTEGER !> The leading dimension of the array VT. LDVT >= max( 1, M ). !> |
| [in,out] | IDXQ | !> IDXQ is INTEGER array, dimension(N) !> This contains the permutation which will reintegrate the !> subproblem just solved back into sorted order, i.e. !> D( IDXQ( I = 1, N ) ) will be in ascending order. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension( 4 * N ) !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension( 3*M**2 + 2*M ) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 202 of file dlasd1.f.
| subroutine dlasd2 | ( | integer | nl, |
| integer | nr, | ||
| integer | sqre, | ||
| integer | k, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | z, | ||
| double precision | alpha, | ||
| double precision | beta, | ||
| double precision, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| double precision, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| double precision, dimension( * ) | dsigma, | ||
| double precision, dimension( ldu2, * ) | u2, | ||
| integer | ldu2, | ||
| double precision, dimension( ldvt2, * ) | vt2, | ||
| integer | ldvt2, | ||
| integer, dimension( * ) | idxp, | ||
| integer, dimension( * ) | idx, | ||
| integer, dimension( * ) | idxc, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | coltyp, | ||
| integer | info ) |
DLASD2 merges the two sets of singular values together into a single sorted set. Used by sbdsdc.
Download DLASD2 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASD2 merges the two sets of singular values together into a single !> sorted set. Then it tries to deflate the size of the problem. !> There are two ways in which deflation can occur: when two or more !> singular values are close together or if there is a tiny entry in the !> Z vector. For each such occurrence the order of the related secular !> equation problem is reduced by one. !> !> DLASD2 is called from DLASD1. !>
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [out] | K | !> K is INTEGER !> Contains the dimension of the non-deflated matrix, !> This is the order of the related secular equation. 1 <= K <=N. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension(N) !> On entry D contains the singular values of the two submatrices !> to be combined. On exit D contains the trailing (N-K) updated !> singular values (those which were deflated) sorted into !> increasing order. !> |
| [out] | Z | !> Z is DOUBLE PRECISION array, dimension(N) !> On exit Z contains the updating row vector in the secular !> equation. !> |
| [in] | ALPHA | !> ALPHA is DOUBLE PRECISION !> Contains the diagonal element associated with the added row. !> |
| [in] | BETA | !> BETA is DOUBLE PRECISION !> Contains the off-diagonal element associated with the added !> row. !> |
| [in,out] | U | !> U is DOUBLE PRECISION array, dimension(LDU,N) !> On entry U contains the left singular vectors of two !> submatrices in the two square blocks with corners at (1,1), !> (NL, NL), and (NL+2, NL+2), (N,N). !> On exit U contains the trailing (N-K) updated left singular !> vectors (those which were deflated) in its last N-K columns. !> |
| [in] | LDU | !> LDU is INTEGER !> The leading dimension of the array U. LDU >= N. !> |
| [in,out] | VT | !> VT is DOUBLE PRECISION array, dimension(LDVT,M) !> On entry VT**T contains the right singular vectors of two !> submatrices in the two square blocks with corners at (1,1), !> (NL+1, NL+1), and (NL+2, NL+2), (M,M). !> On exit VT**T contains the trailing (N-K) updated right singular !> vectors (those which were deflated) in its last N-K columns. !> In case SQRE =1, the last row of VT spans the right null !> space. !> |
| [in] | LDVT | !> LDVT is INTEGER !> The leading dimension of the array VT. LDVT >= M. !> |
| [out] | DSIGMA | !> DSIGMA is DOUBLE PRECISION array, dimension (N) !> Contains a copy of the diagonal elements (K-1 singular values !> and one zero) in the secular equation. !> |
| [out] | U2 | !> U2 is DOUBLE PRECISION array, dimension(LDU2,N) !> Contains a copy of the first K-1 left singular vectors which !> will be used by DLASD3 in a matrix multiply (DGEMM) to solve !> for the new left singular vectors. U2 is arranged into four !> blocks. The first block contains a column with 1 at NL+1 and !> zero everywhere else; the second block contains non-zero !> entries only at and above NL; the third contains non-zero !> entries only below NL+1; and the fourth is dense. !> |
| [in] | LDU2 | !> LDU2 is INTEGER !> The leading dimension of the array U2. LDU2 >= N. !> |
| [out] | VT2 | !> VT2 is DOUBLE PRECISION array, dimension(LDVT2,N) !> VT2**T contains a copy of the first K right singular vectors !> which will be used by DLASD3 in a matrix multiply (DGEMM) to !> solve for the new right singular vectors. VT2 is arranged into !> three blocks. The first block contains a row that corresponds !> to the special 0 diagonal element in SIGMA; the second block !> contains non-zeros only at and before NL +1; the third block !> contains non-zeros only at and after NL +2. !> |
| [in] | LDVT2 | !> LDVT2 is INTEGER !> The leading dimension of the array VT2. LDVT2 >= M. !> |
| [out] | IDXP | !> IDXP is INTEGER array, dimension(N) !> This will contain the permutation used to place deflated !> values of D at the end of the array. On output IDXP(2:K) !> points to the nondeflated D-values and IDXP(K+1:N) !> points to the deflated singular values. !> |
| [out] | IDX | !> IDX is INTEGER array, dimension(N) !> This will contain the permutation used to sort the contents of !> D into ascending order. !> |
| [out] | IDXC | !> IDXC is INTEGER array, dimension(N) !> This will contain the permutation used to arrange the columns !> of the deflated U matrix into three groups: the first group !> contains non-zero entries only at and above NL, the second !> contains non-zero entries only below NL+2, and the third is !> dense. !> |
| [in,out] | IDXQ | !> IDXQ is INTEGER array, dimension(N) !> This contains the permutation which separately sorts the two !> sub-problems in D into ascending order. Note that entries in !> the first hlaf of this permutation must first be moved one !> position backward; and entries in the second half !> must first have NL+1 added to their values. !> |
| [out] | COLTYP | !> COLTYP is INTEGER array, dimension(N) !> As workspace, this will contain a label which will indicate !> which of the following types a column in the U2 matrix or a !> row in the VT2 matrix is: !> 1 : non-zero in the upper half only !> 2 : non-zero in the lower half only !> 3 : dense !> 4 : deflated !> !> On exit, it is an array of dimension 4, with COLTYP(I) being !> the dimension of the I-th type columns. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> |
Definition at line 266 of file dlasd2.f.
| subroutine dlasd3 | ( | integer | nl, |
| integer | nr, | ||
| integer | sqre, | ||
| integer | k, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( ldq, * ) | q, | ||
| integer | ldq, | ||
| double precision, dimension( * ) | dsigma, | ||
| double precision, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| double precision, dimension( ldu2, * ) | u2, | ||
| integer | ldu2, | ||
| double precision, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| double precision, dimension( ldvt2, * ) | vt2, | ||
| integer | ldvt2, | ||
| integer, dimension( * ) | idxc, | ||
| integer, dimension( * ) | ctot, | ||
| double precision, dimension( * ) | z, | ||
| integer | info ) |
DLASD3 finds all square roots of the roots of the secular equation, as defined by the values in D and Z, and then updates the singular vectors by matrix multiplication. Used by sbdsdc.
Download DLASD3 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASD3 finds all the square roots of the roots of the secular !> equation, as defined by the values in D and Z. It makes the !> appropriate calls to DLASD4 and then updates the singular !> vectors by matrix multiplication. !> !> This code makes very mild assumptions about floating point !> arithmetic. It will work on machines with a guard digit in !> add/subtract, or on those binary machines without guard digits !> which subtract like the Cray XMP, Cray YMP, Cray C 90, or Cray 2. !> It could conceivably fail on hexadecimal or decimal machines !> without guard digits, but we know of none. !> !> DLASD3 is called from DLASD1. !>
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [in] | K | !> K is INTEGER !> The size of the secular equation, 1 =< K = < N. !> |
| [out] | D | !> D is DOUBLE PRECISION array, dimension(K) !> On exit the square roots of the roots of the secular equation, !> in ascending order. !> |
| [out] | Q | !> Q is DOUBLE PRECISION array, dimension (LDQ,K) !> |
| [in] | LDQ | !> LDQ is INTEGER !> The leading dimension of the array Q. LDQ >= K. !> |
| [in,out] | DSIGMA | !> DSIGMA is DOUBLE PRECISION array, dimension(K) !> The first K elements of this array contain the old roots !> of the deflated updating problem. These are the poles !> of the secular equation. !> |
| [out] | U | !> U is DOUBLE PRECISION array, dimension (LDU, N) !> The last N - K columns of this matrix contain the deflated !> left singular vectors. !> |
| [in] | LDU | !> LDU is INTEGER !> The leading dimension of the array U. LDU >= N. !> |
| [in] | U2 | !> U2 is DOUBLE PRECISION array, dimension (LDU2, N) !> The first K columns of this matrix contain the non-deflated !> left singular vectors for the split problem. !> |
| [in] | LDU2 | !> LDU2 is INTEGER !> The leading dimension of the array U2. LDU2 >= N. !> |
| [out] | VT | !> VT is DOUBLE PRECISION array, dimension (LDVT, M) !> The last M - K columns of VT**T contain the deflated !> right singular vectors. !> |
| [in] | LDVT | !> LDVT is INTEGER !> The leading dimension of the array VT. LDVT >= N. !> |
| [in,out] | VT2 | !> VT2 is DOUBLE PRECISION array, dimension (LDVT2, N) !> The first K columns of VT2**T contain the non-deflated !> right singular vectors for the split problem. !> |
| [in] | LDVT2 | !> LDVT2 is INTEGER !> The leading dimension of the array VT2. LDVT2 >= N. !> |
| [in] | IDXC | !> IDXC is INTEGER array, dimension ( N ) !> The permutation used to arrange the columns of U (and rows of !> VT) into three groups: the first group contains non-zero !> entries only at and above (or before) NL +1; the second !> contains non-zero entries only at and below (or after) NL+2; !> and the third is dense. The first column of U and the row of !> VT are treated separately, however. !> !> The rows of the singular vectors found by DLASD4 !> must be likewise permuted before the matrix multiplies can !> take place. !> |
| [in] | CTOT | !> CTOT is INTEGER array, dimension ( 4 ) !> A count of the total number of the various types of columns !> in U (or rows in VT), as described in IDXC. The fourth column !> type is any column which has been deflated. !> |
| [in,out] | Z | !> Z is DOUBLE PRECISION array, dimension (K) !> The first K elements of this array contain the components !> of the deflation-adjusted updating row vector. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 221 of file dlasd3.f.
| subroutine dlasd4 | ( | integer | n, |
| integer | i, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | z, | ||
| double precision, dimension( * ) | delta, | ||
| double precision | rho, | ||
| double precision | sigma, | ||
| double precision, dimension( * ) | work, | ||
| integer | info ) |
DLASD4 computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by dbdsdc.
Download DLASD4 + dependencies [TGZ] [ZIP] [TXT]
!> !> This subroutine computes the square root of the I-th updated !> eigenvalue of a positive symmetric rank-one modification to !> a positive diagonal matrix whose entries are given as the squares !> of the corresponding entries in the array d, and that !> !> 0 <= D(i) < D(j) for i < j !> !> and that RHO > 0. This is arranged by the calling routine, and is !> no loss in generality. The rank-one modified system is thus !> !> diag( D ) * diag( D ) + RHO * Z * Z_transpose. !> !> where we assume the Euclidean norm of Z is 1. !> !> The method consists of approximating the rational functions in the !> secular equation by simpler interpolating rational functions. !>
| [in] | N | !> N is INTEGER !> The length of all arrays. !> |
| [in] | I | !> I is INTEGER !> The index of the eigenvalue to be computed. 1 <= I <= N. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension ( N ) !> The original eigenvalues. It is assumed that they are in !> order, 0 <= D(I) < D(J) for I < J. !> |
| [in] | Z | !> Z is DOUBLE PRECISION array, dimension ( N ) !> The components of the updating vector. !> |
| [out] | DELTA | !> DELTA is DOUBLE PRECISION array, dimension ( N ) !> If N .ne. 1, DELTA contains (D(j) - sigma_I) in its j-th !> component. If N = 1, then DELTA(1) = 1. The vector DELTA !> contains the information necessary to construct the !> (singular) eigenvectors. !> |
| [in] | RHO | !> RHO is DOUBLE PRECISION !> The scalar in the symmetric updating formula. !> |
| [out] | SIGMA | !> SIGMA is DOUBLE PRECISION !> The computed sigma_I, the I-th updated eigenvalue. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension ( N ) !> If N .ne. 1, WORK contains (D(j) + sigma_I) in its j-th !> component. If N = 1, then WORK( 1 ) = 1. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> > 0: if INFO = 1, the updating process failed. !> |
!> Logical variable ORGATI (origin-at-i?) is used for distinguishing !> whether D(i) or D(i+1) is treated as the origin. !> !> ORGATI = .true. origin at i !> ORGATI = .false. origin at i+1 !> !> Logical variable SWTCH3 (switch-for-3-poles?) is for noting !> if we are working with THREE poles! !> !> MAXIT is the maximum number of iterations allowed for each !> eigenvalue. !>
Definition at line 152 of file dlasd4.f.
| subroutine dlasd5 | ( | integer | i, |
| double precision, dimension( 2 ) | d, | ||
| double precision, dimension( 2 ) | z, | ||
| double precision, dimension( 2 ) | delta, | ||
| double precision | rho, | ||
| double precision | dsigma, | ||
| double precision, dimension( 2 ) | work ) |
DLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification of a 2-by-2 diagonal matrix. Used by sbdsdc.
Download DLASD5 + dependencies [TGZ] [ZIP] [TXT]
!> !> This subroutine computes the square root of the I-th eigenvalue !> of a positive symmetric rank-one modification of a 2-by-2 diagonal !> matrix !> !> diag( D ) * diag( D ) + RHO * Z * transpose(Z) . !> !> The diagonal entries in the array D are assumed to satisfy !> !> 0 <= D(i) < D(j) for i < j . !> !> We also assume RHO > 0 and that the Euclidean norm of the vector !> Z is one. !>
| [in] | I | !> I is INTEGER !> The index of the eigenvalue to be computed. I = 1 or I = 2. !> |
| [in] | D | !> D is DOUBLE PRECISION array, dimension ( 2 ) !> The original eigenvalues. We assume 0 <= D(1) < D(2). !> |
| [in] | Z | !> Z is DOUBLE PRECISION array, dimension ( 2 ) !> The components of the updating vector. !> |
| [out] | DELTA | !> DELTA is DOUBLE PRECISION array, dimension ( 2 ) !> Contains (D(j) - sigma_I) in its j-th component. !> The vector DELTA contains the information necessary !> to construct the eigenvectors. !> |
| [in] | RHO | !> RHO is DOUBLE PRECISION !> The scalar in the symmetric updating formula. !> |
| [out] | DSIGMA | !> DSIGMA is DOUBLE PRECISION !> The computed sigma_I, the I-th updated eigenvalue. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension ( 2 ) !> WORK contains (D(j) + sigma_I) in its j-th component. !> |
Definition at line 115 of file dlasd5.f.
| subroutine dlasd6 | ( | integer | icompq, |
| integer | nl, | ||
| integer | nr, | ||
| integer | sqre, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | vf, | ||
| double precision, dimension( * ) | vl, | ||
| double precision | alpha, | ||
| double precision | beta, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | perm, | ||
| integer | givptr, | ||
| integer, dimension( ldgcol, * ) | givcol, | ||
| integer | ldgcol, | ||
| double precision, dimension( ldgnum, * ) | givnum, | ||
| integer | ldgnum, | ||
| double precision, dimension( ldgnum, * ) | poles, | ||
| double precision, dimension( * ) | difl, | ||
| double precision, dimension( * ) | difr, | ||
| double precision, dimension( * ) | z, | ||
| integer | k, | ||
| double precision | c, | ||
| double precision | s, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
DLASD6 computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used by sbdsdc.
Download DLASD6 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASD6 computes the SVD of an updated upper bidiagonal matrix B !> obtained by merging two smaller ones by appending a row. This !> routine is used only for the problem which requires all singular !> values and optionally singular vector matrices in factored form. !> B is an N-by-M matrix with N = NL + NR + 1 and M = N + SQRE. !> A related subroutine, DLASD1, handles the case in which all singular !> values and singular vectors of the bidiagonal matrix are desired. !> !> DLASD6 computes the SVD as follows: !> !> ( D1(in) 0 0 0 ) !> B = U(in) * ( Z1**T a Z2**T b ) * VT(in) !> ( 0 0 D2(in) 0 ) !> !> = U(out) * ( D(out) 0) * VT(out) !> !> where Z**T = (Z1**T a Z2**T b) = u**T VT**T, and u is a vector of dimension M !> with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros !> elsewhere; and the entry b is empty if SQRE = 0. !> !> The singular values of B can be computed using D1, D2, the first !> components of all the right singular vectors of the lower block, and !> the last components of all the right singular vectors of the upper !> block. These components are stored and updated in VF and VL, !> respectively, in DLASD6. Hence U and VT are not explicitly !> referenced. !> !> The singular values are stored in D. The algorithm consists of two !> stages: !> !> The first stage consists of deflating the size of the problem !> when there are multiple singular values or if there is a zero !> in the Z vector. For each such occurrence the dimension of the !> secular equation problem is reduced by one. This stage is !> performed by the routine DLASD7. !> !> The second stage consists of calculating the updated !> singular values. This is done by finding the roots of the !> secular equation via the routine DLASD4 (as called by DLASD8). !> This routine also updates VF and VL and computes the distances !> between the updated singular values and the old singular !> values. !> !> DLASD6 is called from DLASDA. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed in !> factored form: !> = 0: Compute singular values only. !> = 1: Compute singular vectors in factored form as well. !> |
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has row dimension N = NL + NR + 1, !> and column dimension M = N + SQRE. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension ( NL+NR+1 ). !> On entry D(1:NL,1:NL) contains the singular values of the !> upper block, and D(NL+2:N) contains the singular values !> of the lower block. On exit D(1:N) contains the singular !> values of the modified matrix. !> |
| [in,out] | VF | !> VF is DOUBLE PRECISION array, dimension ( M ) !> On entry, VF(1:NL+1) contains the first components of all !> right singular vectors of the upper block; and VF(NL+2:M) !> contains the first components of all right singular vectors !> of the lower block. On exit, VF contains the first components !> of all right singular vectors of the bidiagonal matrix. !> |
| [in,out] | VL | !> VL is DOUBLE PRECISION array, dimension ( M ) !> On entry, VL(1:NL+1) contains the last components of all !> right singular vectors of the upper block; and VL(NL+2:M) !> contains the last components of all right singular vectors of !> the lower block. On exit, VL contains the last components of !> all right singular vectors of the bidiagonal matrix. !> |
| [in,out] | ALPHA | !> ALPHA is DOUBLE PRECISION !> Contains the diagonal element associated with the added row. !> |
| [in,out] | BETA | !> BETA is DOUBLE PRECISION !> Contains the off-diagonal element associated with the added !> row. !> |
| [in,out] | IDXQ | !> IDXQ is INTEGER array, dimension ( N ) !> This contains the permutation which will reintegrate the !> subproblem just solved back into sorted order, i.e. !> D( IDXQ( I = 1, N ) ) will be in ascending order. !> |
| [out] | PERM | !> PERM is INTEGER array, dimension ( N ) !> The permutations (from deflation and sorting) to be applied !> to each block. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVPTR | !> GIVPTR is INTEGER !> The number of Givens rotations which took place in this !> subproblem. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVCOL | !> GIVCOL is INTEGER array, dimension ( LDGCOL, 2 ) !> Each pair of numbers indicates a pair of columns to take place !> in a Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGCOL | !> LDGCOL is INTEGER !> leading dimension of GIVCOL, must be at least N. !> |
| [out] | GIVNUM | !> GIVNUM is DOUBLE PRECISION array, dimension ( LDGNUM, 2 ) !> Each number indicates the C or S value to be used in the !> corresponding Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGNUM | !> LDGNUM is INTEGER !> The leading dimension of GIVNUM and POLES, must be at least N. !> |
| [out] | POLES | !> POLES is DOUBLE PRECISION array, dimension ( LDGNUM, 2 ) !> On exit, POLES(1,*) is an array containing the new singular !> values obtained from solving the secular equation, and !> POLES(2,*) is an array containing the poles in the secular !> equation. Not referenced if ICOMPQ = 0. !> |
| [out] | DIFL | !> DIFL is DOUBLE PRECISION array, dimension ( N ) !> On exit, DIFL(I) is the distance between I-th updated !> (undeflated) singular value and the I-th (undeflated) old !> singular value. !> |
| [out] | DIFR | !> DIFR is DOUBLE PRECISION array, !> dimension ( LDDIFR, 2 ) if ICOMPQ = 1 and !> dimension ( K ) if ICOMPQ = 0. !> On exit, DIFR(I,1) = D(I) - DSIGMA(I+1), DIFR(K,1) is not !> defined and will not be referenced. !> !> If ICOMPQ = 1, DIFR(1:K,2) is an array containing the !> normalizing factors for the right singular vector matrix. !> !> See DLASD8 for details on DIFL and DIFR. !> |
| [out] | Z | !> Z is DOUBLE PRECISION array, dimension ( M ) !> The first elements of this array contain the components !> of the deflation-adjusted updating row vector. !> |
| [out] | K | !> K is INTEGER !> Contains the dimension of the non-deflated matrix, !> This is the order of the related secular equation. 1 <= K <=N. !> |
| [out] | C | !> C is DOUBLE PRECISION !> C contains garbage if SQRE =0 and the C-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | S | !> S is DOUBLE PRECISION !> S contains garbage if SQRE =0 and the S-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension ( 4 * M ) !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension ( 3 * N ) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 309 of file dlasd6.f.
| subroutine dlasd7 | ( | integer | icompq, |
| integer | nl, | ||
| integer | nr, | ||
| integer | sqre, | ||
| integer | k, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | z, | ||
| double precision, dimension( * ) | zw, | ||
| double precision, dimension( * ) | vf, | ||
| double precision, dimension( * ) | vfw, | ||
| double precision, dimension( * ) | vl, | ||
| double precision, dimension( * ) | vlw, | ||
| double precision | alpha, | ||
| double precision | beta, | ||
| double precision, dimension( * ) | dsigma, | ||
| integer, dimension( * ) | idx, | ||
| integer, dimension( * ) | idxp, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | perm, | ||
| integer | givptr, | ||
| integer, dimension( ldgcol, * ) | givcol, | ||
| integer | ldgcol, | ||
| double precision, dimension( ldgnum, * ) | givnum, | ||
| integer | ldgnum, | ||
| double precision | c, | ||
| double precision | s, | ||
| integer | info ) |
DLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to deflate the size of the problem. Used by sbdsdc.
Download DLASD7 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASD7 merges the two sets of singular values together into a single !> sorted set. Then it tries to deflate the size of the problem. There !> are two ways in which deflation can occur: when two or more singular !> values are close together or if there is a tiny entry in the Z !> vector. For each such occurrence the order of the related !> secular equation problem is reduced by one. !> !> DLASD7 is called from DLASD6. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed !> in compact form, as follows: !> = 0: Compute singular values only. !> = 1: Compute singular vectors of upper !> bidiagonal matrix in compact form. !> |
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has !> N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [out] | K | !> K is INTEGER !> Contains the dimension of the non-deflated matrix, this is !> the order of the related secular equation. 1 <= K <=N. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension ( N ) !> On entry D contains the singular values of the two submatrices !> to be combined. On exit D contains the trailing (N-K) updated !> singular values (those which were deflated) sorted into !> increasing order. !> |
| [out] | Z | !> Z is DOUBLE PRECISION array, dimension ( M ) !> On exit Z contains the updating row vector in the secular !> equation. !> |
| [out] | ZW | !> ZW is DOUBLE PRECISION array, dimension ( M ) !> Workspace for Z. !> |
| [in,out] | VF | !> VF is DOUBLE PRECISION array, dimension ( M ) !> On entry, VF(1:NL+1) contains the first components of all !> right singular vectors of the upper block; and VF(NL+2:M) !> contains the first components of all right singular vectors !> of the lower block. On exit, VF contains the first components !> of all right singular vectors of the bidiagonal matrix. !> |
| [out] | VFW | !> VFW is DOUBLE PRECISION array, dimension ( M ) !> Workspace for VF. !> |
| [in,out] | VL | !> VL is DOUBLE PRECISION array, dimension ( M ) !> On entry, VL(1:NL+1) contains the last components of all !> right singular vectors of the upper block; and VL(NL+2:M) !> contains the last components of all right singular vectors !> of the lower block. On exit, VL contains the last components !> of all right singular vectors of the bidiagonal matrix. !> |
| [out] | VLW | !> VLW is DOUBLE PRECISION array, dimension ( M ) !> Workspace for VL. !> |
| [in] | ALPHA | !> ALPHA is DOUBLE PRECISION !> Contains the diagonal element associated with the added row. !> |
| [in] | BETA | !> BETA is DOUBLE PRECISION !> Contains the off-diagonal element associated with the added !> row. !> |
| [out] | DSIGMA | !> DSIGMA is DOUBLE PRECISION array, dimension ( N ) !> Contains a copy of the diagonal elements (K-1 singular values !> and one zero) in the secular equation. !> |
| [out] | IDX | !> IDX is INTEGER array, dimension ( N ) !> This will contain the permutation used to sort the contents of !> D into ascending order. !> |
| [out] | IDXP | !> IDXP is INTEGER array, dimension ( N ) !> This will contain the permutation used to place deflated !> values of D at the end of the array. On output IDXP(2:K) !> points to the nondeflated D-values and IDXP(K+1:N) !> points to the deflated singular values. !> |
| [in] | IDXQ | !> IDXQ is INTEGER array, dimension ( N ) !> This contains the permutation which separately sorts the two !> sub-problems in D into ascending order. Note that entries in !> the first half of this permutation must first be moved one !> position backward; and entries in the second half !> must first have NL+1 added to their values. !> |
| [out] | PERM | !> PERM is INTEGER array, dimension ( N ) !> The permutations (from deflation and sorting) to be applied !> to each singular block. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVPTR | !> GIVPTR is INTEGER !> The number of Givens rotations which took place in this !> subproblem. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVCOL | !> GIVCOL is INTEGER array, dimension ( LDGCOL, 2 ) !> Each pair of numbers indicates a pair of columns to take place !> in a Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGCOL | !> LDGCOL is INTEGER !> The leading dimension of GIVCOL, must be at least N. !> |
| [out] | GIVNUM | !> GIVNUM is DOUBLE PRECISION array, dimension ( LDGNUM, 2 ) !> Each number indicates the C or S value to be used in the !> corresponding Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGNUM | !> LDGNUM is INTEGER !> The leading dimension of GIVNUM, must be at least N. !> |
| [out] | C | !> C is DOUBLE PRECISION !> C contains garbage if SQRE =0 and the C-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | S | !> S is DOUBLE PRECISION !> S contains garbage if SQRE =0 and the S-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> |
Definition at line 276 of file dlasd7.f.
| subroutine dlasd8 | ( | integer | icompq, |
| integer | k, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | z, | ||
| double precision, dimension( * ) | vf, | ||
| double precision, dimension( * ) | vl, | ||
| double precision, dimension( * ) | difl, | ||
| double precision, dimension( lddifr, * ) | difr, | ||
| integer | lddifr, | ||
| double precision, dimension( * ) | dsigma, | ||
| double precision, dimension( * ) | work, | ||
| integer | info ) |
DLASD8 finds the square roots of the roots of the secular equation, and stores, for each element in D, the distance to its two nearest poles. Used by sbdsdc.
Download DLASD8 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASD8 finds the square roots of the roots of the secular equation, !> as defined by the values in DSIGMA and Z. It makes the appropriate !> calls to DLASD4, and stores, for each element in D, the distance !> to its two nearest poles (elements in DSIGMA). It also updates !> the arrays VF and VL, the first and last components of all the !> right singular vectors of the original bidiagonal matrix. !> !> DLASD8 is called from DLASD6. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed in !> factored form in the calling routine: !> = 0: Compute singular values only. !> = 1: Compute singular vectors in factored form as well. !> |
| [in] | K | !> K is INTEGER !> The number of terms in the rational function to be solved !> by DLASD4. K >= 1. !> |
| [out] | D | !> D is DOUBLE PRECISION array, dimension ( K ) !> On output, D contains the updated singular values. !> |
| [in,out] | Z | !> Z is DOUBLE PRECISION array, dimension ( K ) !> On entry, the first K elements of this array contain the !> components of the deflation-adjusted updating row vector. !> On exit, Z is updated. !> |
| [in,out] | VF | !> VF is DOUBLE PRECISION array, dimension ( K ) !> On entry, VF contains information passed through DBEDE8. !> On exit, VF contains the first K components of the first !> components of all right singular vectors of the bidiagonal !> matrix. !> |
| [in,out] | VL | !> VL is DOUBLE PRECISION array, dimension ( K ) !> On entry, VL contains information passed through DBEDE8. !> On exit, VL contains the first K components of the last !> components of all right singular vectors of the bidiagonal !> matrix. !> |
| [out] | DIFL | !> DIFL is DOUBLE PRECISION array, dimension ( K ) !> On exit, DIFL(I) = D(I) - DSIGMA(I). !> |
| [out] | DIFR | !> DIFR is DOUBLE PRECISION array, !> dimension ( LDDIFR, 2 ) if ICOMPQ = 1 and !> dimension ( K ) if ICOMPQ = 0. !> On exit, DIFR(I,1) = D(I) - DSIGMA(I+1), DIFR(K,1) is not !> defined and will not be referenced. !> !> If ICOMPQ = 1, DIFR(1:K,2) is an array containing the !> normalizing factors for the right singular vector matrix. !> |
| [in] | LDDIFR | !> LDDIFR is INTEGER !> The leading dimension of DIFR, must be at least K. !> |
| [in,out] | DSIGMA | !> DSIGMA is DOUBLE PRECISION array, dimension ( K ) !> On entry, the first K elements of this array contain the old !> roots of the deflated updating problem. These are the poles !> of the secular equation. !> On exit, the elements of DSIGMA may be very slightly altered !> in value. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (3*K) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 164 of file dlasd8.f.
| subroutine dlasda | ( | integer | icompq, |
| integer | smlsiz, | ||
| integer | n, | ||
| integer | sqre, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| double precision, dimension( ldu, * ) | vt, | ||
| integer, dimension( * ) | k, | ||
| double precision, dimension( ldu, * ) | difl, | ||
| double precision, dimension( ldu, * ) | difr, | ||
| double precision, dimension( ldu, * ) | z, | ||
| double precision, dimension( ldu, * ) | poles, | ||
| integer, dimension( * ) | givptr, | ||
| integer, dimension( ldgcol, * ) | givcol, | ||
| integer | ldgcol, | ||
| integer, dimension( ldgcol, * ) | perm, | ||
| double precision, dimension( ldu, * ) | givnum, | ||
| double precision, dimension( * ) | c, | ||
| double precision, dimension( * ) | s, | ||
| double precision, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
DLASDA computes the singular value decomposition (SVD) of a real upper bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc.
Download DLASDA + dependencies [TGZ] [ZIP] [TXT]
!> !> Using a divide and conquer approach, DLASDA computes the singular !> value decomposition (SVD) of a real upper bidiagonal N-by-M matrix !> B with diagonal D and offdiagonal E, where M = N + SQRE. The !> algorithm computes the singular values in the SVD B = U * S * VT. !> The orthogonal matrices U and VT are optionally computed in !> compact form. !> !> A related subroutine, DLASD0, computes the singular values and !> the singular vectors in explicit form. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed !> in compact form, as follows !> = 0: Compute singular values only. !> = 1: Compute singular vectors of upper bidiagonal !> matrix in compact form. !> |
| [in] | SMLSIZ | !> SMLSIZ is INTEGER !> The maximum size of the subproblems at the bottom of the !> computation tree. !> |
| [in] | N | !> N is INTEGER !> The row dimension of the upper bidiagonal matrix. This is !> also the dimension of the main diagonal array D. !> |
| [in] | SQRE | !> SQRE is INTEGER !> Specifies the column dimension of the bidiagonal matrix. !> = 0: The bidiagonal matrix has column dimension M = N; !> = 1: The bidiagonal matrix has column dimension M = N + 1. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension ( N ) !> On entry D contains the main diagonal of the bidiagonal !> matrix. On exit D, if INFO = 0, contains its singular values. !> |
| [in] | E | !> E is DOUBLE PRECISION array, dimension ( M-1 ) !> Contains the subdiagonal entries of the bidiagonal matrix. !> On exit, E has been destroyed. !> |
| [out] | U | !> U is DOUBLE PRECISION array, !> dimension ( LDU, SMLSIZ ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, U contains the left !> singular vector matrices of all subproblems at the bottom !> level. !> |
| [in] | LDU | !> LDU is INTEGER, LDU = > N. !> The leading dimension of arrays U, VT, DIFL, DIFR, POLES, !> GIVNUM, and Z. !> |
| [out] | VT | !> VT is DOUBLE PRECISION array, !> dimension ( LDU, SMLSIZ+1 ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, VT**T contains the right !> singular vector matrices of all subproblems at the bottom !> level. !> |
| [out] | K | !> K is INTEGER array, !> dimension ( N ) if ICOMPQ = 1 and dimension 1 if ICOMPQ = 0. !> If ICOMPQ = 1, on exit, K(I) is the dimension of the I-th !> secular equation on the computation tree. !> |
| [out] | DIFL | !> DIFL is DOUBLE PRECISION array, dimension ( LDU, NLVL ), !> where NLVL = floor(log_2 (N/SMLSIZ))). !> |
| [out] | DIFR | !> DIFR is DOUBLE PRECISION array, !> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1 and !> dimension ( N ) if ICOMPQ = 0. !> If ICOMPQ = 1, on exit, DIFL(1:N, I) and DIFR(1:N, 2 * I - 1) !> record distances between singular values on the I-th !> level and singular values on the (I -1)-th level, and !> DIFR(1:N, 2 * I ) contains the normalizing factors for !> the right singular vector matrix. See DLASD8 for details. !> |
| [out] | Z | !> Z is DOUBLE PRECISION array, !> dimension ( LDU, NLVL ) if ICOMPQ = 1 and !> dimension ( N ) if ICOMPQ = 0. !> The first K elements of Z(1, I) contain the components of !> the deflation-adjusted updating row vector for subproblems !> on the I-th level. !> |
| [out] | POLES | !> POLES is DOUBLE PRECISION array, !> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, POLES(1, 2*I - 1) and !> POLES(1, 2*I) contain the new and old singular values !> involved in the secular equations on the I-th level. !> |
| [out] | GIVPTR | !> GIVPTR is INTEGER array, !> dimension ( N ) if ICOMPQ = 1, and not referenced if !> ICOMPQ = 0. If ICOMPQ = 1, on exit, GIVPTR( I ) records !> the number of Givens rotations performed on the I-th !> problem on the computation tree. !> |
| [out] | GIVCOL | !> GIVCOL is INTEGER array, !> dimension ( LDGCOL, 2 * NLVL ) if ICOMPQ = 1, and not !> referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I, !> GIVCOL(1, 2 *I - 1) and GIVCOL(1, 2 *I) record the locations !> of Givens rotations performed on the I-th level on the !> computation tree. !> |
| [in] | LDGCOL | !> LDGCOL is INTEGER, LDGCOL = > N. !> The leading dimension of arrays GIVCOL and PERM. !> |
| [out] | PERM | !> PERM is INTEGER array, !> dimension ( LDGCOL, NLVL ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, PERM(1, I) records !> permutations done on the I-th level of the computation tree. !> |
| [out] | GIVNUM | !> GIVNUM is DOUBLE PRECISION array, !> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not !> referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I, !> GIVNUM(1, 2 *I - 1) and GIVNUM(1, 2 *I) record the C- and S- !> values of Givens rotations performed on the I-th level on !> the computation tree. !> |
| [out] | C | !> C is DOUBLE PRECISION array, !> dimension ( N ) if ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. !> If ICOMPQ = 1 and the I-th subproblem is not square, on exit, !> C( I ) contains the C-value of a Givens rotation related to !> the right null space of the I-th subproblem. !> |
| [out] | S | !> S is DOUBLE PRECISION array, dimension ( N ) if !> ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. If ICOMPQ = 1 !> and the I-th subproblem is not square, on exit, S( I ) !> contains the S-value of a Givens rotation related to !> the right null space of the I-th subproblem. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension !> (6 * N + (SMLSIZ + 1)*(SMLSIZ + 1)). !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (7*N) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 270 of file dlasda.f.
| subroutine dlasdq | ( | character | uplo, |
| integer | sqre, | ||
| integer | n, | ||
| integer | ncvt, | ||
| integer | nru, | ||
| integer | ncc, | ||
| double precision, dimension( * ) | d, | ||
| double precision, dimension( * ) | e, | ||
| double precision, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| double precision, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| double precision, dimension( ldc, * ) | c, | ||
| integer | ldc, | ||
| double precision, dimension( * ) | work, | ||
| integer | info ) |
DLASDQ computes the SVD of a real bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc.
Download DLASDQ + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASDQ computes the singular value decomposition (SVD) of a real !> (upper or lower) bidiagonal matrix with diagonal D and offdiagonal !> E, accumulating the transformations if desired. Letting B denote !> the input bidiagonal matrix, the algorithm computes orthogonal !> matrices Q and P such that B = Q * S * P**T (P**T denotes the transpose !> of P). The singular values S are overwritten on D. !> !> The input matrix U is changed to U * Q if desired. !> The input matrix VT is changed to P**T * VT if desired. !> The input matrix C is changed to Q**T * C if desired. !> !> See by J. Demmel and W. Kahan, !> LAPACK Working Note #3, for a detailed description of the algorithm. !>
| [in] | UPLO | !> UPLO is CHARACTER*1 !> On entry, UPLO specifies whether the input bidiagonal matrix !> is upper or lower bidiagonal, and whether it is square are !> not. !> UPLO = 'U' or 'u' B is upper bidiagonal. !> UPLO = 'L' or 'l' B is lower bidiagonal. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: then the input matrix is N-by-N. !> = 1: then the input matrix is N-by-(N+1) if UPLU = 'U' and !> (N+1)-by-N if UPLU = 'L'. !> !> The bidiagonal matrix has !> N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [in] | N | !> N is INTEGER !> On entry, N specifies the number of rows and columns !> in the matrix. N must be at least 0. !> |
| [in] | NCVT | !> NCVT is INTEGER !> On entry, NCVT specifies the number of columns of !> the matrix VT. NCVT must be at least 0. !> |
| [in] | NRU | !> NRU is INTEGER !> On entry, NRU specifies the number of rows of !> the matrix U. NRU must be at least 0. !> |
| [in] | NCC | !> NCC is INTEGER !> On entry, NCC specifies the number of columns of !> the matrix C. NCC must be at least 0. !> |
| [in,out] | D | !> D is DOUBLE PRECISION array, dimension (N) !> On entry, D contains the diagonal entries of the !> bidiagonal matrix whose SVD is desired. On normal exit, !> D contains the singular values in ascending order. !> |
| [in,out] | E | !> E is DOUBLE PRECISION array. !> dimension is (N-1) if SQRE = 0 and N if SQRE = 1. !> On entry, the entries of E contain the offdiagonal entries !> of the bidiagonal matrix whose SVD is desired. On normal !> exit, E will contain 0. If the algorithm does not converge, !> D and E will contain the diagonal and superdiagonal entries !> of a bidiagonal matrix orthogonally equivalent to the one !> given as input. !> |
| [in,out] | VT | !> VT is DOUBLE PRECISION array, dimension (LDVT, NCVT) !> On entry, contains a matrix which on exit has been !> premultiplied by P**T, dimension N-by-NCVT if SQRE = 0 !> and (N+1)-by-NCVT if SQRE = 1 (not referenced if NCVT=0). !> |
| [in] | LDVT | !> LDVT is INTEGER !> On entry, LDVT specifies the leading dimension of VT as !> declared in the calling (sub) program. LDVT must be at !> least 1. If NCVT is nonzero LDVT must also be at least N. !> |
| [in,out] | U | !> U is DOUBLE PRECISION array, dimension (LDU, N) !> On entry, contains a matrix which on exit has been !> postmultiplied by Q, dimension NRU-by-N if SQRE = 0 !> and NRU-by-(N+1) if SQRE = 1 (not referenced if NRU=0). !> |
| [in] | LDU | !> LDU is INTEGER !> On entry, LDU specifies the leading dimension of U as !> declared in the calling (sub) program. LDU must be at !> least max( 1, NRU ) . !> |
| [in,out] | C | !> C is DOUBLE PRECISION array, dimension (LDC, NCC) !> On entry, contains an N-by-NCC matrix which on exit !> has been premultiplied by Q**T dimension N-by-NCC if SQRE = 0 !> and (N+1)-by-NCC if SQRE = 1 (not referenced if NCC=0). !> |
| [in] | LDC | !> LDC is INTEGER !> On entry, LDC specifies the leading dimension of C as !> declared in the calling (sub) program. LDC must be at !> least 1. If NCC is nonzero, LDC must also be at least N. !> |
| [out] | WORK | !> WORK is DOUBLE PRECISION array, dimension (4*N) !> Workspace. Only referenced if one of NCVT, NRU, or NCC is !> nonzero, and if N is at least 2. !> |
| [out] | INFO | !> INFO is INTEGER !> On exit, a value of 0 indicates a successful exit. !> If INFO < 0, argument number -INFO is illegal. !> If INFO > 0, the algorithm did not converge, and INFO !> specifies how many superdiagonals did not converge. !> |
Definition at line 209 of file dlasdq.f.
| subroutine dlasdt | ( | integer | n, |
| integer | lvl, | ||
| integer | nd, | ||
| integer, dimension( * ) | inode, | ||
| integer, dimension( * ) | ndiml, | ||
| integer, dimension( * ) | ndimr, | ||
| integer | msub ) |
DLASDT creates a tree of subproblems for bidiagonal divide and conquer. Used by sbdsdc.
Download DLASDT + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASDT creates a tree of subproblems for bidiagonal divide and !> conquer. !>
| [in] | N | !> N is INTEGER !> On entry, the number of diagonal elements of the !> bidiagonal matrix. !> |
| [out] | LVL | !> LVL is INTEGER !> On exit, the number of levels on the computation tree. !> |
| [out] | ND | !> ND is INTEGER !> On exit, the number of nodes on the tree. !> |
| [out] | INODE | !> INODE is INTEGER array, dimension ( N ) !> On exit, centers of subproblems. !> |
| [out] | NDIML | !> NDIML is INTEGER array, dimension ( N ) !> On exit, row dimensions of left children. !> |
| [out] | NDIMR | !> NDIMR is INTEGER array, dimension ( N ) !> On exit, row dimensions of right children. !> |
| [in] | MSUB | !> MSUB is INTEGER !> On entry, the maximum row dimension each subproblem at the !> bottom of the tree can be of. !> |
Definition at line 104 of file dlasdt.f.
| subroutine dlaset | ( | character | uplo, |
| integer | m, | ||
| integer | n, | ||
| double precision | alpha, | ||
| double precision | beta, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda ) |
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
Download DLASET + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASET initializes an m-by-n matrix A to BETA on the diagonal and !> ALPHA on the offdiagonals. !>
| [in] | UPLO | !> UPLO is CHARACTER*1 !> Specifies the part of the matrix A to be set. !> = 'U': Upper triangular part is set; the strictly lower !> triangular part of A is not changed. !> = 'L': Lower triangular part is set; the strictly upper !> triangular part of A is not changed. !> Otherwise: All of the matrix A is set. !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in] | ALPHA | !> ALPHA is DOUBLE PRECISION !> The constant to which the offdiagonal elements are to be set. !> |
| [in] | BETA | !> BETA is DOUBLE PRECISION !> The constant to which the diagonal elements are to be set. !> |
| [out] | A | !> A is DOUBLE PRECISION array, dimension (LDA,N) !> On exit, the leading m-by-n submatrix of A is set as follows: !> !> if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, !> if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, !> otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, !> !> and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
Definition at line 109 of file dlaset.f.
| subroutine dlasr | ( | character | side, |
| character | pivot, | ||
| character | direct, | ||
| integer | m, | ||
| integer | n, | ||
| double precision, dimension( * ) | c, | ||
| double precision, dimension( * ) | s, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda ) |
DLASR applies a sequence of plane rotations to a general rectangular matrix.
Download DLASR + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASR applies a sequence of plane rotations to a real matrix A, !> from either the left or the right. !> !> When SIDE = 'L', the transformation takes the form !> !> A := P*A !> !> and when SIDE = 'R', the transformation takes the form !> !> A := A*P**T !> !> where P is an orthogonal matrix consisting of a sequence of z plane !> rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', !> and P**T is the transpose of P. !> !> When DIRECT = 'F' (Forward sequence), then !> !> P = P(z-1) * ... * P(2) * P(1) !> !> and when DIRECT = 'B' (Backward sequence), then !> !> P = P(1) * P(2) * ... * P(z-1) !> !> where P(k) is a plane rotation matrix defined by the 2-by-2 rotation !> !> R(k) = ( c(k) s(k) ) !> = ( -s(k) c(k) ). !> !> When PIVOT = 'V' (Variable pivot), the rotation is performed !> for the plane (k,k+1), i.e., P(k) has the form !> !> P(k) = ( 1 ) !> ( ... ) !> ( 1 ) !> ( c(k) s(k) ) !> ( -s(k) c(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> !> where R(k) appears as a rank-2 modification to the identity matrix in !> rows and columns k and k+1. !> !> When PIVOT = 'T' (Top pivot), the rotation is performed for the !> plane (1,k+1), so P(k) has the form !> !> P(k) = ( c(k) s(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> ( -s(k) c(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> !> where R(k) appears in rows and columns 1 and k+1. !> !> Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is !> performed for the plane (k,z), giving P(k) the form !> !> P(k) = ( 1 ) !> ( ... ) !> ( 1 ) !> ( c(k) s(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> ( -s(k) c(k) ) !> !> where R(k) appears in rows and columns k and z. The rotations are !> performed without ever forming P(k) explicitly. !>
| [in] | SIDE | !> SIDE is CHARACTER*1 !> Specifies whether the plane rotation matrix P is applied to !> A on the left or the right. !> = 'L': Left, compute A := P*A !> = 'R': Right, compute A:= A*P**T !> |
| [in] | PIVOT | !> PIVOT is CHARACTER*1 !> Specifies the plane for which P(k) is a plane rotation !> matrix. !> = 'V': Variable pivot, the plane (k,k+1) !> = 'T': Top pivot, the plane (1,k+1) !> = 'B': Bottom pivot, the plane (k,z) !> |
| [in] | DIRECT | !> DIRECT is CHARACTER*1 !> Specifies whether P is a forward or backward sequence of !> plane rotations. !> = 'F': Forward, P = P(z-1)*...*P(2)*P(1) !> = 'B': Backward, P = P(1)*P(2)*...*P(z-1) !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. If m <= 1, an immediate !> return is effected. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. If n <= 1, an !> immediate return is effected. !> |
| [in] | C | !> C is DOUBLE PRECISION array, dimension !> (M-1) if SIDE = 'L' !> (N-1) if SIDE = 'R' !> The cosines c(k) of the plane rotations. !> |
| [in] | S | !> S is DOUBLE PRECISION array, dimension !> (M-1) if SIDE = 'L' !> (N-1) if SIDE = 'R' !> The sines s(k) of the plane rotations. The 2-by-2 plane !> rotation part of the matrix P(k), R(k), has the form !> R(k) = ( c(k) s(k) ) !> ( -s(k) c(k) ). !> |
| [in,out] | A | !> A is DOUBLE PRECISION array, dimension (LDA,N) !> The M-by-N matrix A. On exit, A is overwritten by P*A if !> SIDE = 'L' or by A*P**T if SIDE = 'R'. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
Definition at line 198 of file dlasr.f.
| subroutine dlassq | ( | integer | n, |
| real(wp), dimension(*) | x, | ||
| integer | incx, | ||
| real(wp) | scl, | ||
| real(wp) | sumsq ) |
DLASSQ updates a sum of squares represented in scaled form.
Download DLASSQ + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASSQ returns the values scl and smsq such that !> !> ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, !> !> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is !> assumed to be non-negative. !> !> scale and sumsq must be supplied in SCALE and SUMSQ and !> scl and smsq are overwritten on SCALE and SUMSQ respectively. !> !> If scale * sqrt( sumsq ) > tbig then !> we require: scale >= sqrt( TINY*EPS ) / sbig on entry, !> and if 0 < scale * sqrt( sumsq ) < tsml then !> we require: scale <= sqrt( HUGE ) / ssml on entry, !> where !> tbig -- upper threshold for values whose square is representable; !> sbig -- scaling constant for big numbers; \see la_constants.f90 !> tsml -- lower threshold for values whose square is representable; !> ssml -- scaling constant for small numbers; \see la_constants.f90 !> and !> TINY*EPS -- tiniest representable number; !> HUGE -- biggest representable number. !> !>
| [in] | N | !> N is INTEGER !> The number of elements to be used from the vector x. !> |
| [in] | X | !> X is DOUBLE PRECISION array, dimension (1+(N-1)*abs(INCX)) !> The vector for which a scaled sum of squares is computed. !> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. !> |
| [in] | INCX | !> INCX is INTEGER !> The increment between successive values of the vector x. !> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n !> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n !> If INCX = 0, x isn't a vector so there is no need to call !> this subroutine. If you call it anyway, it will count x(1) !> in the vector norm N times. !> |
| [in,out] | SCALE | !> SCALE is DOUBLE PRECISION !> On entry, the value scale in the equation above. !> On exit, SCALE is overwritten with scl , the scaling factor !> for the sum of squares. !> |
| [in,out] | SUMSQ | !> SUMSQ is DOUBLE PRECISION !> On entry, the value sumsq in the equation above. !> On exit, SUMSQ is overwritten with smsq , the basic sum of !> squares from which scl has been factored out. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !> Blue, James L. (1978) !> A Portable Fortran Program to Find the Euclidean Norm of a Vector !> ACM Trans Math Softw 4:15--23 !> https://doi.org/10.1145/355769.355771 !> !>
Definition at line 136 of file dlassq.f90.
| subroutine dlasv2 | ( | double precision | f, |
| double precision | g, | ||
| double precision | h, | ||
| double precision | ssmin, | ||
| double precision | ssmax, | ||
| double precision | snr, | ||
| double precision | csr, | ||
| double precision | snl, | ||
| double precision | csl ) |
DLASV2 computes the singular value decomposition of a 2-by-2 triangular matrix.
Download DLASV2 + dependencies [TGZ] [ZIP] [TXT]
!> !> DLASV2 computes the singular value decomposition of a 2-by-2 !> triangular matrix !> [ F G ] !> [ 0 H ]. !> On return, abs(SSMAX) is the larger singular value, abs(SSMIN) is the !> smaller singular value, and (CSL,SNL) and (CSR,SNR) are the left and !> right singular vectors for abs(SSMAX), giving the decomposition !> !> [ CSL SNL ] [ F G ] [ CSR -SNR ] = [ SSMAX 0 ] !> [-SNL CSL ] [ 0 H ] [ SNR CSR ] [ 0 SSMIN ]. !>
| [in] | F | !> F is DOUBLE PRECISION !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | G | !> G is DOUBLE PRECISION !> The (1,2) element of the 2-by-2 matrix. !> |
| [in] | H | !> H is DOUBLE PRECISION !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | SSMIN | !> SSMIN is DOUBLE PRECISION !> abs(SSMIN) is the smaller singular value. !> |
| [out] | SSMAX | !> SSMAX is DOUBLE PRECISION !> abs(SSMAX) is the larger singular value. !> |
| [out] | SNL | !> SNL is DOUBLE PRECISION !> |
| [out] | CSL | !> CSL is DOUBLE PRECISION !> The vector (CSL, SNL) is a unit left singular vector for the !> singular value abs(SSMAX). !> |
| [out] | SNR | !> SNR is DOUBLE PRECISION !> |
| [out] | CSR | !> CSR is DOUBLE PRECISION !> The vector (CSR, SNR) is a unit right singular vector for the !> singular value abs(SSMAX). !> |
!> !> Any input parameter may be aliased with any output parameter. !> !> Barring over/underflow and assuming a guard digit in subtraction, all !> output quantities are correct to within a few units in the last !> place (ulps). !> !> In IEEE arithmetic, the code works correctly if one matrix element is !> infinite. !> !> Overflow will not occur unless the largest singular value itself !> overflows or is within a few ulps of overflow. (On machines with !> partial overflow, like the Cray, overflow may occur if the largest !> singular value is within a factor of 2 of overflow.) !> !> Underflow is harmless if underflow is gradual. Otherwise, results !> may correspond to a matrix modified by perturbations of size near !> the underflow threshold. !>
Definition at line 137 of file dlasv2.f.
| integer function ieeeck | ( | integer | ispec, |
| real | zero, | ||
| real | one ) |
IEEECK
Download IEEECK + dependencies [TGZ] [ZIP] [TXT]
!> !> IEEECK is called from the ILAENV to verify that Infinity and !> possibly NaN arithmetic is safe (i.e. will not trap). !>
| [in] | ISPEC | !> ISPEC is INTEGER !> Specifies whether to test just for inifinity arithmetic !> or whether to test for infinity and NaN arithmetic. !> = 0: Verify infinity arithmetic only. !> = 1: Verify infinity and NaN arithmetic. !> |
| [in] | ZERO | !> ZERO is REAL !> Must contain the value 0.0 !> This is passed to prevent the compiler from optimizing !> away this code. !> |
| [in] | ONE | !> ONE is REAL !> Must contain the value 1.0 !> This is passed to prevent the compiler from optimizing !> away this code. !> !> RETURN VALUE: INTEGER !> = 0: Arithmetic failed to produce the correct answers !> = 1: Arithmetic produced the correct answers !> |
Definition at line 81 of file ieeeck.f.
| integer function iladlc | ( | integer | m, |
| integer | n, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda ) |
ILADLC scans a matrix for its last non-zero column.
Download ILADLC + dependencies [TGZ] [ZIP] [TXT]
!> !> ILADLC scans A for its last non-zero column. !>
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. !> |
| [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). !> |
Definition at line 77 of file iladlc.f.
| integer function iladlr | ( | integer | m, |
| integer | n, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda ) |
ILADLR scans a matrix for its last non-zero row.
Download ILADLR + dependencies [TGZ] [ZIP] [TXT]
!> !> ILADLR scans A for its last non-zero row. !>
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. !> |
| [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). !> |
Definition at line 77 of file iladlr.f.
| integer function ilaenv | ( | integer | ispec, |
| character*( * ) | name, | ||
| character*( * ) | opts, | ||
| integer | n1, | ||
| integer | n2, | ||
| integer | n3, | ||
| integer | n4 ) |
ILAENV
Download ILAENV + dependencies [TGZ] [ZIP] [TXT]
!> !> ILAENV is called from the LAPACK routines to choose problem-dependent !> parameters for the local environment. See ISPEC for a description of !> the parameters. !> !> ILAENV returns an INTEGER !> if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC !> if ILAENV < 0: if ILAENV = -k, the k-th argument had an illegal value. !> !> This version provides a set of parameters which should give good, !> but not optimal, performance on many of the currently available !> computers. Users are encouraged to modify this subroutine to set !> the tuning parameters for their particular machine using the option !> and problem size information in the arguments. !> !> This routine will not function correctly if it is converted to all !> lower case. Converting it to all upper case is allowed. !>
| [in] | ISPEC | !> ISPEC is INTEGER !> Specifies the parameter to be returned as the value of !> ILAENV. !> = 1: the optimal blocksize; if this value is 1, an unblocked !> algorithm will give the best performance. !> = 2: the minimum block size for which the block routine !> should be used; if the usable block size is less than !> this value, an unblocked routine should be used. !> = 3: the crossover point (in a block routine, for N less !> than this value, an unblocked routine should be used) !> = 4: the number of shifts, used in the nonsymmetric !> eigenvalue routines (DEPRECATED) !> = 5: the minimum column dimension for blocking to be used; !> rectangular blocks must have dimension at least k by m, !> where k is given by ILAENV(2,...) and m by ILAENV(5,...) !> = 6: the crossover point for the SVD (when reducing an m by n !> matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds !> this value, a QR factorization is used first to reduce !> the matrix to a triangular form.) !> = 7: the number of processors !> = 8: the crossover point for the multishift QR method !> for nonsymmetric eigenvalue problems (DEPRECATED) !> = 9: maximum size of the subproblems at the bottom of the !> computation tree in the divide-and-conquer algorithm !> (used by xGELSD and xGESDD) !> =10: ieee infinity and NaN arithmetic can be trusted not to trap !> =11: infinity arithmetic can be trusted not to trap !> 12 <= ISPEC <= 17: !> xHSEQR or related subroutines, !> see IPARMQ for detailed explanation !> |
| [in] | NAME | !> NAME is CHARACTER*(*) !> The name of the calling subroutine, in either upper case or !> lower case. !> |
| [in] | OPTS | !> OPTS is CHARACTER*(*) !> The character options to the subroutine NAME, concatenated !> into a single character string. For example, UPLO = 'U', !> TRANS = 'T', and DIAG = 'N' for a triangular routine would !> be specified as OPTS = 'UTN'. !> |
| [in] | N1 | !> N1 is INTEGER !> |
| [in] | N2 | !> N2 is INTEGER !> |
| [in] | N3 | !> N3 is INTEGER !> |
| [in] | N4 | !> N4 is INTEGER !> Problem dimensions for the subroutine NAME; these may not all !> be required. !> |
!> !> The following conventions have been used when calling ILAENV from the !> LAPACK routines: !> 1) OPTS is a concatenation of all of the character options to !> subroutine NAME, in the same order that they appear in the !> argument list for NAME, even if they are not used in determining !> the value of the parameter specified by ISPEC. !> 2) The problem dimensions N1, N2, N3, N4 are specified in the order !> that they appear in the argument list for NAME. N1 is used !> first, N2 second, and so on, and unused problem dimensions are !> passed a value of -1. !> 3) The parameter value returned by ILAENV is checked for validity in !> the calling subroutine. For example, ILAENV is used to retrieve !> the optimal blocksize for STRTRI as follows: !> !> NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) !> IF( NB.LE.1 ) NB = MAX( 1, N ) !>
!> !> ILAENV returns problem-dependent parameters for the local !> environment. See ISPEC for a description of the parameters. !> !> In this version, the problem-dependent parameters are contained in !> the integer array IPARMS in the common block CLAENV and the value !> with index ISPEC is copied to ILAENV. This version of ILAENV is !> to be used in conjunction with XLAENV in TESTING and TIMING. !>
| [in] | ISPEC | !> ISPEC is INTEGER !> Specifies the parameter to be returned as the value of !> ILAENV. !> = 1: the optimal blocksize; if this value is 1, an unblocked !> algorithm will give the best performance. !> = 2: the minimum block size for which the block routine !> should be used; if the usable block size is less than !> this value, an unblocked routine should be used. !> = 3: the crossover point (in a block routine, for N less !> than this value, an unblocked routine should be used) !> = 4: the number of shifts, used in the nonsymmetric !> eigenvalue routines !> = 5: the minimum column dimension for blocking to be used; !> rectangular blocks must have dimension at least k by m, !> where k is given by ILAENV(2,...) and m by ILAENV(5,...) !> = 6: the crossover point for the SVD (when reducing an m by n !> matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds !> this value, a QR factorization is used first to reduce !> the matrix to a triangular form.) !> = 7: the number of processors !> = 8: the crossover point for the multishift QR and QZ methods !> for nonsymmetric eigenvalue problems. !> = 9: maximum size of the subproblems at the bottom of the !> computation tree in the divide-and-conquer algorithm !> =10: ieee NaN arithmetic can be trusted not to trap !> =11: infinity arithmetic can be trusted not to trap !> 12 <= ISPEC <= 16: !> xHSEQR or one of its subroutines, !> see IPARMQ for detailed explanation !> !> Other specifications (up to 100) can be added later. !> |
| [in] | NAME | !> NAME is CHARACTER*(*) !> The name of the calling subroutine. !> |
| [in] | OPTS | !> OPTS is CHARACTER*(*) !> The character options to the subroutine NAME, concatenated !> into a single character string. For example, UPLO = 'U', !> TRANS = 'T', and DIAG = 'N' for a triangular routine would !> be specified as OPTS = 'UTN'. !> |
| [in] | N1 | !> N1 is INTEGER !> |
| [in] | N2 | !> N2 is INTEGER !> |
| [in] | N3 | !> N3 is INTEGER !> |
| [in] | N4 | !> N4 is INTEGER !> !> Problem dimensions for the subroutine NAME; these may not all !> be required. !> |
!> ILAENV is INTEGER !> >= 0: the value of the parameter specified by ISPEC !> < 0: if ILAENV = -k, the k-th argument had an illegal value. !>
!> !> The following conventions have been used when calling ILAENV from the !> LAPACK routines: !> 1) OPTS is a concatenation of all of the character options to !> subroutine NAME, in the same order that they appear in the !> argument list for NAME, even if they are not used in determining !> the value of the parameter specified by ISPEC. !> 2) The problem dimensions N1, N2, N3, N4 are specified in the order !> that they appear in the argument list for NAME. N1 is used !> first, N2 second, and so on, and unused problem dimensions are !> passed a value of -1. !> 3) The parameter value returned by ILAENV is checked for validity in !> the calling subroutine. For example, ILAENV is used to retrieve !> the optimal blocksize for STRTRI as follows: !> !> NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) !> IF( NB.LE.1 ) NB = MAX( 1, N ) !>
Definition at line 161 of file ilaenv.f.
| integer function ilaenv2stage | ( | integer | ispec, |
| character*( * ) | name, | ||
| character*( * ) | opts, | ||
| integer | n1, | ||
| integer | n2, | ||
| integer | n3, | ||
| integer | n4 ) |
ILAENV2STAGE
Download ILAENV2STAGE + dependencies [TGZ] [ZIP] [TXT]
!> !> ILAENV2STAGE is called from the LAPACK routines to choose problem-dependent !> parameters for the local environment. See ISPEC for a description of !> the parameters. !> It sets problem and machine dependent parameters useful for *_2STAGE and !> related subroutines. !> !> ILAENV2STAGE returns an INTEGER !> if ILAENV2STAGE >= 0: ILAENV2STAGE returns the value of the parameter !> specified by ISPEC !> if ILAENV2STAGE < 0: if ILAENV2STAGE = -k, the k-th argument had an !> illegal value. !> !> This version provides a set of parameters which should give good, !> but not optimal, performance on many of the currently available !> computers for the 2-stage solvers. Users are encouraged to modify this !> subroutine to set the tuning parameters for their particular machine using !> the option and problem size information in the arguments. !> !> This routine will not function correctly if it is converted to all !> lower case. Converting it to all upper case is allowed. !>
| [in] | ISPEC | !> ISPEC is INTEGER !> Specifies the parameter to be returned as the value of !> ILAENV2STAGE. !> = 1: the optimal blocksize nb for the reduction to BAND !> !> = 2: the optimal blocksize ib for the eigenvectors !> singular vectors update routine !> !> = 3: The length of the array that store the Housholder !> representation for the second stage !> Band to Tridiagonal or Bidiagonal !> !> = 4: The workspace needed for the routine in input. !> !> = 5: For future release. !> |
| [in] | NAME | !> NAME is CHARACTER*(*) !> The name of the calling subroutine, in either upper case or !> lower case. !> |
| [in] | OPTS | !> OPTS is CHARACTER*(*) !> The character options to the subroutine NAME, concatenated !> into a single character string. For example, UPLO = 'U', !> TRANS = 'T', and DIAG = 'N' for a triangular routine would !> be specified as OPTS = 'UTN'. !> |
| [in] | N1 | !> N1 is INTEGER !> |
| [in] | N2 | !> N2 is INTEGER !> |
| [in] | N3 | !> N3 is INTEGER !> |
| [in] | N4 | !> N4 is INTEGER !> Problem dimensions for the subroutine NAME; these may not all !> be required. !> |
!> !> The following conventions have been used when calling ILAENV2STAGE !> from the LAPACK routines: !> 1) OPTS is a concatenation of all of the character options to !> subroutine NAME, in the same order that they appear in the !> argument list for NAME, even if they are not used in determining !> the value of the parameter specified by ISPEC. !> 2) The problem dimensions N1, N2, N3, N4 are specified in the order !> that they appear in the argument list for NAME. N1 is used !> first, N2 second, and so on, and unused problem dimensions are !> passed a value of -1. !> 3) The parameter value returned by ILAENV2STAGE is checked for validity in !> the calling subroutine. !> !>
Definition at line 148 of file ilaenv2stage.f.
| integer function iparmq | ( | integer | ispec, |
| character, dimension( * ) | name, | ||
| character, dimension( * ) | opts, | ||
| integer | n, | ||
| integer | ilo, | ||
| integer | ihi, | ||
| integer | lwork ) |
IPARMQ
Download IPARMQ + dependencies [TGZ] [ZIP] [TXT]
!> !> This program sets problem and machine dependent parameters !> useful for xHSEQR and related subroutines for eigenvalue !> problems. It is called whenever !> IPARMQ is called with 12 <= ISPEC <= 16 !>
| [in] | ISPEC | !> ISPEC is INTEGER !> ISPEC specifies which tunable parameter IPARMQ should !> return. !> !> ISPEC=12: (INMIN) Matrices of order nmin or less !> are sent directly to xLAHQR, the implicit !> double shift QR algorithm. NMIN must be !> at least 11. !> !> ISPEC=13: (INWIN) Size of the deflation window. !> This is best set greater than or equal to !> the number of simultaneous shifts NS. !> Larger matrices benefit from larger deflation !> windows. !> !> ISPEC=14: (INIBL) Determines when to stop nibbling and !> invest in an (expensive) multi-shift QR sweep. !> If the aggressive early deflation subroutine !> finds LD converged eigenvalues from an order !> NW deflation window and LD > (NW*NIBBLE)/100, !> then the next QR sweep is skipped and early !> deflation is applied immediately to the !> remaining active diagonal block. Setting !> IPARMQ(ISPEC=14) = 0 causes TTQRE to skip a !> multi-shift QR sweep whenever early deflation !> finds a converged eigenvalue. Setting !> IPARMQ(ISPEC=14) greater than or equal to 100 !> prevents TTQRE from skipping a multi-shift !> QR sweep. !> !> ISPEC=15: (NSHFTS) The number of simultaneous shifts in !> a multi-shift QR iteration. !> !> ISPEC=16: (IACC22) IPARMQ is set to 0, 1 or 2 with the !> following meanings. !> 0: During the multi-shift QR/QZ sweep, !> blocked eigenvalue reordering, blocked !> Hessenberg-triangular reduction, !> reflections and/or rotations are not !> accumulated when updating the !> far-from-diagonal matrix entries. !> 1: During the multi-shift QR/QZ sweep, !> blocked eigenvalue reordering, blocked !> Hessenberg-triangular reduction, !> reflections and/or rotations are !> accumulated, and matrix-matrix !> multiplication is used to update the !> far-from-diagonal matrix entries. !> 2: During the multi-shift QR/QZ sweep, !> blocked eigenvalue reordering, blocked !> Hessenberg-triangular reduction, !> reflections and/or rotations are !> accumulated, and 2-by-2 block structure !> is exploited during matrix-matrix !> multiplies. !> (If xTRMM is slower than xGEMM, then !> IPARMQ(ISPEC=16)=1 may be more efficient than !> IPARMQ(ISPEC=16)=2 despite the greater level of !> arithmetic work implied by the latter choice.) !> !> ISPEC=17: (ICOST) An estimate of the relative cost of flops !> within the near-the-diagonal shift chase compared !> to flops within the BLAS calls of a QZ sweep. !> |
| [in] | NAME | !> NAME is CHARACTER string !> Name of the calling subroutine !> |
| [in] | OPTS | !> OPTS is CHARACTER string !> This is a concatenation of the string arguments to !> TTQRE. !> |
| [in] | N | !> N is INTEGER !> N is the order of the Hessenberg matrix H. !> |
| [in] | ILO | !> ILO is INTEGER !> |
| [in] | IHI | !> IHI is INTEGER !> It is assumed that H is already upper triangular !> in rows and columns 1:ILO-1 and IHI+1:N. !> |
| [in] | LWORK | !> LWORK is INTEGER !> The amount of workspace available. !> |
!> !> Little is known about how best to choose these parameters. !> It is possible to use different values of the parameters !> for each of CHSEQR, DHSEQR, SHSEQR and ZHSEQR. !> !> It is probably best to choose different parameters for !> different matrices and different parameters at different !> times during the iteration, but this has not been !> implemented --- yet. !> !> !> The best choices of most of the parameters depend !> in an ill-understood way on the relative execution !> rate of xLAQR3 and xLAQR5 and on the nature of each !> particular eigenvalue problem. Experiment may be the !> only practical way to determine which choices are most !> effective. !> !> Following is a list of default values supplied by IPARMQ. !> These defaults may be adjusted in order to attain better !> performance in any particular computational environment. !> !> IPARMQ(ISPEC=12) The xLAHQR vs xLAQR0 crossover point. !> Default: 75. (Must be at least 11.) !> !> IPARMQ(ISPEC=13) Recommended deflation window size. !> This depends on ILO, IHI and NS, the !> number of simultaneous shifts returned !> by IPARMQ(ISPEC=15). The default for !> (IHI-ILO+1) <= 500 is NS. The default !> for (IHI-ILO+1) > 500 is 3*NS/2. !> !> IPARMQ(ISPEC=14) Nibble crossover point. Default: 14. !> !> IPARMQ(ISPEC=15) Number of simultaneous shifts, NS. !> a multi-shift QR iteration. !> !> If IHI-ILO+1 is ... !> !> greater than ...but less ... the !> or equal to ... than default is !> !> 0 30 NS = 2+ !> 30 60 NS = 4+ !> 60 150 NS = 10 !> 150 590 NS = ** !> 590 3000 NS = 64 !> 3000 6000 NS = 128 !> 6000 infinity NS = 256 !> !> (+) By default matrices of this order are !> passed to the implicit double shift routine !> xLAHQR. See IPARMQ(ISPEC=12) above. These !> values of NS are used only in case of a rare !> xLAHQR failure. !> !> (**) The asterisks (**) indicate an ad-hoc !> function increasing from 10 to 64. !> !> IPARMQ(ISPEC=16) Select structured matrix multiply. !> (See ISPEC=16 above for details.) !> Default: 3. !> !> IPARMQ(ISPEC=17) Relative cost heuristic for blocksize selection. !> Expressed as a percentage. !> Default: 10. !>
Definition at line 229 of file iparmq.f.
| logical function lsamen | ( | integer | n, |
| character*( * ) | ca, | ||
| character*( * ) | cb ) |
LSAMEN
Download LSAMEN + dependencies [TGZ] [ZIP] [TXT]
!> !> LSAMEN tests if the first N letters of CA are the same as the !> first N letters of CB, regardless of case. !> LSAMEN returns .TRUE. if CA and CB are equivalent except for case !> and .FALSE. otherwise. LSAMEN also returns .FALSE. if LEN( CA ) !> or LEN( CB ) is less than N. !>
| [in] | N | !> N is INTEGER !> The number of characters in CA and CB to be compared. !> |
| [in] | CA | !> CA is CHARACTER*(*) !> |
| [in] | CB | !> CB is CHARACTER*(*) !> CA and CB specify two character strings of length at least N. !> Only the first N characters of each string will be accessed. !> |
Definition at line 73 of file lsamen.f.
| logical function sisnan | ( | real, intent(in) | sin | ) |
SISNAN tests input for NaN.
Download SISNAN + dependencies [TGZ] [ZIP] [TXT]
!> !> SISNAN returns .TRUE. if its argument is NaN, and .FALSE. !> otherwise. To be replaced by the Fortran 2003 intrinsic in the !> future. !>
| [in] | SIN | !> SIN is REAL !> Input to test for NaN. !> |
Definition at line 58 of file sisnan.f.
| subroutine slabad | ( | real | small, |
| real | large ) |
SLABAD
Download SLABAD + dependencies [TGZ] [ZIP] [TXT]
!> !> SLABAD takes as input the values computed by SLAMCH for underflow and !> overflow, and returns the square root of each of these values if the !> log of LARGE is sufficiently large. This subroutine is intended to !> identify machines with a large exponent range, such as the Crays, and !> redefine the underflow and overflow limits to be the square roots of !> the values computed by SLAMCH. This subroutine is needed because !> SLAMCH does not compensate for poor arithmetic in the upper half of !> the exponent range, as is found on a Cray. !>
| [in,out] | SMALL | !> SMALL is REAL !> On entry, the underflow threshold as computed by SLAMCH. !> On exit, if LOG10(LARGE) is sufficiently large, the square !> root of SMALL, otherwise unchanged. !> |
| [in,out] | LARGE | !> LARGE is REAL !> On entry, the overflow threshold as computed by SLAMCH. !> On exit, if LOG10(LARGE) is sufficiently large, the square !> root of LARGE, otherwise unchanged. !> |
Definition at line 73 of file slabad.f.
| subroutine slacpy | ( | character | uplo, |
| integer | m, | ||
| integer | n, | ||
| real, dimension( lda, * ) | a, | ||
| integer | lda, | ||
| real, dimension( ldb, * ) | b, | ||
| integer | ldb ) |
SLACPY copies all or part of one two-dimensional array to another.
Download SLACPY + dependencies [TGZ] [ZIP] [TXT]
!> !> SLACPY copies all or part of a two-dimensional matrix A to another !> matrix B. !>
| [in] | UPLO | !> UPLO is CHARACTER*1 !> Specifies the part of the matrix A to be copied to B. !> = 'U': Upper triangular part !> = 'L': Lower triangular part !> Otherwise: All of the matrix A !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in] | A | !> A is REAL array, dimension (LDA,N) !> The m by n matrix A. If UPLO = 'U', only the upper triangle !> or trapezoid is accessed; if UPLO = 'L', only the lower !> triangle or trapezoid is accessed. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
| [out] | B | !> B is REAL array, dimension (LDB,N) !> On exit, B = A in the locations specified by UPLO. !> |
| [in] | LDB | !> LDB is INTEGER !> The leading dimension of the array B. LDB >= max(1,M). !> |
Definition at line 102 of file slacpy.f.
| subroutine slae2 | ( | real | a, |
| real | b, | ||
| real | c, | ||
| real | rt1, | ||
| real | rt2 ) |
SLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix.
Download SLAE2 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix !> [ A B ] !> [ B C ]. !> On return, RT1 is the eigenvalue of larger absolute value, and RT2 !> is the eigenvalue of smaller absolute value. !>
| [in] | A | !> A is REAL !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | B | !> B is REAL !> The (1,2) and (2,1) elements of the 2-by-2 matrix. !> |
| [in] | C | !> C is REAL !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | RT1 | !> RT1 is REAL !> The eigenvalue of larger absolute value. !> |
| [out] | RT2 | !> RT2 is REAL !> The eigenvalue of smaller absolute value. !> |
!> !> RT1 is accurate to a few ulps barring over/underflow. !> !> RT2 may be inaccurate if there is massive cancellation in the !> determinant A*C-B*B; higher precision or correctly rounded or !> correctly truncated arithmetic would be needed to compute RT2 !> accurately in all cases. !> !> Overflow is possible only if RT1 is within a factor of 5 of overflow. !> Underflow is harmless if the input data is 0 or exceeds !> underflow_threshold / macheps. !>
Definition at line 101 of file slae2.f.
| subroutine slaebz | ( | integer | ijob, |
| integer | nitmax, | ||
| integer | n, | ||
| integer | mmax, | ||
| integer | minp, | ||
| integer | nbmin, | ||
| real | abstol, | ||
| real | reltol, | ||
| real | pivmin, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( * ) | e2, | ||
| integer, dimension( * ) | nval, | ||
| real, dimension( mmax, * ) | ab, | ||
| real, dimension( * ) | c, | ||
| integer | mout, | ||
| integer, dimension( mmax, * ) | nab, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
SLAEBZ computes the number of eigenvalues of a real symmetric tridiagonal matrix which are less than or equal to a given value, and performs other tasks required by the routine sstebz.
Download SLAEBZ + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAEBZ contains the iteration loops which compute and use the !> function N(w), which is the count of eigenvalues of a symmetric !> tridiagonal matrix T less than or equal to its argument w. It !> performs a choice of two types of loops: !> !> IJOB=1, followed by !> IJOB=2: It takes as input a list of intervals and returns a list of !> sufficiently small intervals whose union contains the same !> eigenvalues as the union of the original intervals. !> The input intervals are (AB(j,1),AB(j,2)], j=1,...,MINP. !> The output interval (AB(j,1),AB(j,2)] will contain !> eigenvalues NAB(j,1)+1,...,NAB(j,2), where 1 <= j <= MOUT. !> !> IJOB=3: It performs a binary search in each input interval !> (AB(j,1),AB(j,2)] for a point w(j) such that !> N(w(j))=NVAL(j), and uses C(j) as the starting point of !> the search. If such a w(j) is found, then on output !> AB(j,1)=AB(j,2)=w. If no such w(j) is found, then on output !> (AB(j,1),AB(j,2)] will be a small interval containing the !> point where N(w) jumps through NVAL(j), unless that point !> lies outside the initial interval. !> !> Note that the intervals are in all cases half-open intervals, !> i.e., of the form (a,b] , which includes b but not a . !> !> To avoid underflow, the matrix should be scaled so that its largest !> element is no greater than overflow**(1/2) * underflow**(1/4) !> in absolute value. To assure the most accurate computation !> of small eigenvalues, the matrix should be scaled to be !> not much smaller than that, either. !> !> See W. Kahan , Report CS41, Computer Science Dept., Stanford !> University, July 21, 1966 !> !> Note: the arguments are, in general, *not* checked for unreasonable !> values. !>
| [in] | IJOB | !> IJOB is INTEGER !> Specifies what is to be done: !> = 1: Compute NAB for the initial intervals. !> = 2: Perform bisection iteration to find eigenvalues of T. !> = 3: Perform bisection iteration to invert N(w), i.e., !> to find a point which has a specified number of !> eigenvalues of T to its left. !> Other values will cause SLAEBZ to return with INFO=-1. !> |
| [in] | NITMAX | !> NITMAX is INTEGER !> The maximum number of of bisection to be !> performed, i.e., an interval of width W will not be made !> smaller than 2^(-NITMAX) * W. If not all intervals !> have converged after NITMAX iterations, then INFO is set !> to the number of non-converged intervals. !> |
| [in] | N | !> N is INTEGER !> The dimension n of the tridiagonal matrix T. It must be at !> least 1. !> |
| [in] | MMAX | !> MMAX is INTEGER !> The maximum number of intervals. If more than MMAX intervals !> are generated, then SLAEBZ will quit with INFO=MMAX+1. !> |
| [in] | MINP | !> MINP is INTEGER !> The initial number of intervals. It may not be greater than !> MMAX. !> |
| [in] | NBMIN | !> NBMIN is INTEGER !> The smallest number of intervals that should be processed !> using a vector loop. If zero, then only the scalar loop !> will be used. !> |
| [in] | ABSTOL | !> ABSTOL is REAL !> The minimum (absolute) width of an interval. When an !> interval is narrower than ABSTOL, or than RELTOL times the !> larger (in magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. This must be at least !> zero. !> |
| [in] | RELTOL | !> RELTOL is REAL !> The minimum relative width of an interval. When an interval !> is narrower than ABSTOL, or than RELTOL times the larger (in !> magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. Note: this should !> always be at least radix*machine epsilon. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum absolute value of a in the Sturm !> sequence loop. !> This must be at least max |e(j)**2|*safe_min and at !> least safe_min, where safe_min is at least !> the smallest number that can divide one without overflow. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The diagonal elements of the tridiagonal matrix T. !> |
| [in] | E | !> E is REAL array, dimension (N) !> The offdiagonal elements of the tridiagonal matrix T in !> positions 1 through N-1. E(N) is arbitrary. !> |
| [in] | E2 | !> E2 is REAL array, dimension (N) !> The squares of the offdiagonal elements of the tridiagonal !> matrix T. E2(N) is ignored. !> |
| [in,out] | NVAL | !> NVAL is INTEGER array, dimension (MINP) !> If IJOB=1 or 2, not referenced. !> If IJOB=3, the desired values of N(w). The elements of NVAL !> will be reordered to correspond with the intervals in AB. !> Thus, NVAL(j) on output will not, in general be the same as !> NVAL(j) on input, but it will correspond with the interval !> (AB(j,1),AB(j,2)] on output. !> |
| [in,out] | AB | !> AB is REAL array, dimension (MMAX,2) !> The endpoints of the intervals. AB(j,1) is a(j), the left !> endpoint of the j-th interval, and AB(j,2) is b(j), the !> right endpoint of the j-th interval. The input intervals !> will, in general, be modified, split, and reordered by the !> calculation. !> |
| [in,out] | C | !> C is REAL array, dimension (MMAX) !> If IJOB=1, ignored. !> If IJOB=2, workspace. !> If IJOB=3, then on input C(j) should be initialized to the !> first search point in the binary search. !> |
| [out] | MOUT | !> MOUT is INTEGER !> If IJOB=1, the number of eigenvalues in the intervals. !> If IJOB=2 or 3, the number of intervals output. !> If IJOB=3, MOUT will equal MINP. !> |
| [in,out] | NAB | !> NAB is INTEGER array, dimension (MMAX,2) !> If IJOB=1, then on output NAB(i,j) will be set to N(AB(i,j)). !> If IJOB=2, then on input, NAB(i,j) should be set. It must !> satisfy the condition: !> N(AB(i,1)) <= NAB(i,1) <= NAB(i,2) <= N(AB(i,2)), !> which means that in interval i only eigenvalues !> NAB(i,1)+1,...,NAB(i,2) will be considered. Usually, !> NAB(i,j)=N(AB(i,j)), from a previous call to SLAEBZ with !> IJOB=1. !> On output, NAB(i,j) will contain !> max(na(k),min(nb(k),N(AB(i,j)))), where k is the index of !> the input interval that the output interval !> (AB(j,1),AB(j,2)] came from, and na(k) and nb(k) are the !> the input values of NAB(k,1) and NAB(k,2). !> If IJOB=3, then on output, NAB(i,j) contains N(AB(i,j)), !> unless N(w) > NVAL(i) for all search points w , in which !> case NAB(i,1) will not be modified, i.e., the output !> value will be the same as the input value (modulo !> reorderings -- see NVAL and AB), or unless N(w) < NVAL(i) !> for all search points w , in which case NAB(i,2) will !> not be modified. Normally, NAB should be set to some !> distinctive value(s) before SLAEBZ is called. !> |
| [out] | WORK | !> WORK is REAL array, dimension (MMAX) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (MMAX) !> Workspace. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: All intervals converged. !> = 1--MMAX: The last INFO intervals did not converge. !> = MMAX+1: More than MMAX intervals were generated. !> |
!> !> This routine is intended to be called only by other LAPACK !> routines, thus the interface is less user-friendly. It is intended !> for two purposes: !> !> (a) finding eigenvalues. In this case, SLAEBZ should have one or !> more initial intervals set up in AB, and SLAEBZ should be called !> with IJOB=1. This sets up NAB, and also counts the eigenvalues. !> Intervals with no eigenvalues would usually be thrown out at !> this point. Also, if not all the eigenvalues in an interval i !> are desired, NAB(i,1) can be increased or NAB(i,2) decreased. !> For example, set NAB(i,1)=NAB(i,2)-1 to get the largest !> eigenvalue. SLAEBZ is then called with IJOB=2 and MMAX !> no smaller than the value of MOUT returned by the call with !> IJOB=1. After this (IJOB=2) call, eigenvalues NAB(i,1)+1 !> through NAB(i,2) are approximately AB(i,1) (or AB(i,2)) to the !> tolerance specified by ABSTOL and RELTOL. !> !> (b) finding an interval (a',b'] containing eigenvalues w(f),...,w(l). !> In this case, start with a Gershgorin interval (a,b). Set up !> AB to contain 2 search intervals, both initially (a,b). One !> NVAL element should contain f-1 and the other should contain l !> , while C should contain a and b, resp. NAB(i,1) should be -1 !> and NAB(i,2) should be N+1, to flag an error if the desired !> interval does not lie in (a,b). SLAEBZ is then called with !> IJOB=3. On exit, if w(f-1) < w(f), then one of the intervals -- !> j -- will have AB(j,1)=AB(j,2) and NAB(j,1)=NAB(j,2)=f-1, while !> if, to the specified tolerance, w(f-k)=...=w(f+r), k > 0 and r !> >= 0, then the interval will have N(AB(j,1))=NAB(j,1)=f-k and !> N(AB(j,2))=NAB(j,2)=f+r. The cases w(l) < w(l+1) and !> w(l-r)=...=w(l+k) are handled similarly. !>
Definition at line 316 of file slaebz.f.
| subroutine slaev2 | ( | real | a, |
| real | b, | ||
| real | c, | ||
| real | rt1, | ||
| real | rt2, | ||
| real | cs1, | ||
| real | sn1 ) |
SLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.
Download SLAEV2 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix !> [ A B ] !> [ B C ]. !> On return, RT1 is the eigenvalue of larger absolute value, RT2 is the !> eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right !> eigenvector for RT1, giving the decomposition !> !> [ CS1 SN1 ] [ A B ] [ CS1 -SN1 ] = [ RT1 0 ] !> [-SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ]. !>
| [in] | A | !> A is REAL !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | B | !> B is REAL !> The (1,2) element and the conjugate of the (2,1) element of !> the 2-by-2 matrix. !> |
| [in] | C | !> C is REAL !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | RT1 | !> RT1 is REAL !> The eigenvalue of larger absolute value. !> |
| [out] | RT2 | !> RT2 is REAL !> The eigenvalue of smaller absolute value. !> |
| [out] | CS1 | !> CS1 is REAL !> |
| [out] | SN1 | !> SN1 is REAL !> The vector (CS1, SN1) is a unit right eigenvector for RT1. !> |
!> !> RT1 is accurate to a few ulps barring over/underflow. !> !> RT2 may be inaccurate if there is massive cancellation in the !> determinant A*C-B*B; higher precision or correctly rounded or !> correctly truncated arithmetic would be needed to compute RT2 !> accurately in all cases. !> !> CS1 and SN1 are accurate to a few ulps barring over/underflow. !> !> Overflow is possible only if RT1 is within a factor of 5 of overflow. !> Underflow is harmless if the input data is 0 or exceeds !> underflow_threshold / macheps. !>
Definition at line 119 of file slaev2.f.
| subroutine slag2d | ( | integer | m, |
| integer | n, | ||
| real, dimension( ldsa, * ) | sa, | ||
| integer | ldsa, | ||
| double precision, dimension( lda, * ) | a, | ||
| integer | lda, | ||
| integer | info ) |
SLAG2D converts a single precision matrix to a double precision matrix.
Download SLAG2D + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAG2D converts a SINGLE PRECISION matrix, SA, to a DOUBLE !> PRECISION matrix, A. !> !> Note that while it is possible to overflow while converting !> from double to single, it is not possible to overflow when !> converting from single to double. !> !> This is an auxiliary routine so there is no argument checking. !>
| [in] | M | !> M is INTEGER !> The number of lines of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in] | SA | !> SA is REAL array, dimension (LDSA,N) !> On entry, the M-by-N coefficient matrix SA. !> |
| [in] | LDSA | !> LDSA is INTEGER !> The leading dimension of the array SA. LDSA >= max(1,M). !> |
| [out] | A | !> A is DOUBLE PRECISION array, dimension (LDA,N) !> On exit, the M-by-N coefficient matrix A. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> |
Definition at line 103 of file slag2d.f.
| subroutine slagts | ( | integer | job, |
| integer | n, | ||
| real, dimension( * ) | a, | ||
| real, dimension( * ) | b, | ||
| real, dimension( * ) | c, | ||
| real, dimension( * ) | d, | ||
| integer, dimension( * ) | in, | ||
| real, dimension( * ) | y, | ||
| real | tol, | ||
| integer | info ) |
SLAGTS solves the system of equations (T-λI)x = y or (T-λI)Tx = y,where T is a general tridiagonal matrix and λ a scalar, using the LU factorization computed by slagtf.
Download SLAGTS + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAGTS may be used to solve one of the systems of equations !> !> (T - lambda*I)*x = y or (T - lambda*I)**T*x = y, !> !> where T is an n by n tridiagonal matrix, for x, following the !> factorization of (T - lambda*I) as !> !> (T - lambda*I) = P*L*U , !> !> by routine SLAGTF. The choice of equation to be solved is !> controlled by the argument JOB, and in each case there is an option !> to perturb zero or very small diagonal elements of U, this option !> being intended for use in applications such as inverse iteration. !>
| [in] | JOB | !> JOB is INTEGER !> Specifies the job to be performed by SLAGTS as follows: !> = 1: The equations (T - lambda*I)x = y are to be solved, !> but diagonal elements of U are not to be perturbed. !> = -1: The equations (T - lambda*I)x = y are to be solved !> and, if overflow would otherwise occur, the diagonal !> elements of U are to be perturbed. See argument TOL !> below. !> = 2: The equations (T - lambda*I)**Tx = y are to be solved, !> but diagonal elements of U are not to be perturbed. !> = -2: The equations (T - lambda*I)**Tx = y are to be solved !> and, if overflow would otherwise occur, the diagonal !> elements of U are to be perturbed. See argument TOL !> below. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix T. !> |
| [in] | A | !> A is REAL array, dimension (N) !> On entry, A must contain the diagonal elements of U as !> returned from SLAGTF. !> |
| [in] | B | !> B is REAL array, dimension (N-1) !> On entry, B must contain the first super-diagonal elements of !> U as returned from SLAGTF. !> |
| [in] | C | !> C is REAL array, dimension (N-1) !> On entry, C must contain the sub-diagonal elements of L as !> returned from SLAGTF. !> |
| [in] | D | !> D is REAL array, dimension (N-2) !> On entry, D must contain the second super-diagonal elements !> of U as returned from SLAGTF. !> |
| [in] | IN | !> IN is INTEGER array, dimension (N) !> On entry, IN must contain details of the matrix P as returned !> from SLAGTF. !> |
| [in,out] | Y | !> Y is REAL array, dimension (N) !> On entry, the right hand side vector y. !> On exit, Y is overwritten by the solution vector x. !> |
| [in,out] | TOL | !> TOL is REAL !> On entry, with JOB < 0, TOL should be the minimum !> perturbation to be made to very small diagonal elements of U. !> TOL should normally be chosen as about eps*norm(U), where eps !> is the relative machine precision, but if TOL is supplied as !> non-positive, then it is reset to eps*max( abs( u(i,j) ) ). !> If JOB > 0 then TOL is not referenced. !> !> On exit, TOL is changed as described above, only if TOL is !> non-positive on entry. Otherwise TOL is unchanged. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !> > 0: overflow would occur when computing the INFO(th) !> element of the solution vector x. This can only occur !> when JOB is supplied as positive and either means !> that a diagonal element of U is very small, or that !> the elements of the right-hand side vector y are very !> large. !> |
Definition at line 160 of file slagts.f.
| logical function slaisnan | ( | real, intent(in) | sin1, |
| real, intent(in) | sin2 ) |
SLAISNAN tests input for NaN by comparing two arguments for inequality.
Download SLAISNAN + dependencies [TGZ] [ZIP] [TXT]
!> !> This routine is not for general use. It exists solely to avoid !> over-optimization in SISNAN. !> !> SLAISNAN checks for NaNs by comparing its two arguments for !> inequality. NaN is the only floating-point value where NaN != NaN !> returns .TRUE. To check for NaNs, pass the same variable as both !> arguments. !> !> A compiler must assume that the two arguments are !> not the same variable, and the test will not be optimized away. !> Interprocedural or whole-program optimization may delete this !> test. The ISNAN functions will be replaced by the correct !> Fortran 03 intrinsic once the intrinsic is widely available. !>
| [in] | SIN1 | !> SIN1 is REAL !> |
| [in] | SIN2 | !> SIN2 is REAL !> Two numbers to compare for inequality. !> |
Definition at line 73 of file slaisnan.f.
| integer function slaneg | ( | integer | n, |
| real, dimension( * ) | d, | ||
| real, dimension( * ) | lld, | ||
| real | sigma, | ||
| real | pivmin, | ||
| integer | r ) |
SLANEG computes the Sturm count.
Download SLANEG + dependencies [TGZ] [ZIP] [TXT]
!> !> SLANEG computes the Sturm count, the number of negative pivots !> encountered while factoring tridiagonal T - sigma I = L D L^T. !> This implementation works directly on the factors without forming !> the tridiagonal matrix T. The Sturm count is also the number of !> eigenvalues of T less than sigma. !> !> This routine is called from SLARRB. !> !> The current routine does not use the PIVMIN parameter but rather !> requires IEEE-754 propagation of Infinities and NaNs. This !> routine also has no input range restrictions but does require !> default exception handling such that x/0 produces Inf when x is !> non-zero, and Inf/Inf produces NaN. For more information, see: !> !> Marques, Riedy, and Voemel, SIAM Journal on !> Scientific Computing, v28, n5, 2006. DOI 10.1137/050641624 !> (Tech report version in LAWN 172 with the same title.) !>
| [in] | N | !> N is INTEGER !> The order of the matrix. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The N diagonal elements of the diagonal matrix D. !> |
| [in] | LLD | !> LLD is REAL array, dimension (N-1) !> The (N-1) elements L(i)*L(i)*D(i). !> |
| [in] | SIGMA | !> SIGMA is REAL !> Shift amount in T - sigma I = L D L^T. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot in the Sturm sequence. May be used !> when zero pivots are encountered on non-IEEE-754 !> architectures. !> |
| [in] | R | !> R is INTEGER !> The twist index for the twisted factorization that is used !> for the negcount. !> |
Definition at line 117 of file slaneg.f.
| real function slanst | ( | character | norm, |
| integer | n, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e ) |
SLANST returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric tridiagonal matrix.
Download SLANST + dependencies [TGZ] [ZIP] [TXT]
!> !> SLANST returns the value of the one norm, or the Frobenius norm, or !> the infinity norm, or the element of largest absolute value of a !> real symmetric tridiagonal matrix A. !>
!> !> SLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm' !> ( !> ( norm1(A), NORM = '1', 'O' or 'o' !> ( !> ( normI(A), NORM = 'I' or 'i' !> ( !> ( normF(A), NORM = 'F', 'f', 'E' or 'e' !> !> where norm1 denotes the one norm of a matrix (maximum column sum), !> normI denotes the infinity norm of a matrix (maximum row sum) and !> normF denotes the Frobenius norm of a matrix (square root of sum of !> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. !>
| [in] | NORM | !> NORM is CHARACTER*1 !> Specifies the value to be returned in SLANST as described !> above. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix A. N >= 0. When N = 0, SLANST is !> set to zero. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The diagonal elements of A. !> |
| [in] | E | !> E is REAL array, dimension (N-1) !> The (n-1) sub-diagonal or super-diagonal elements of A. !> |
Definition at line 99 of file slanst.f.
| real function slapy2 | ( | real | x, |
| real | y ) |
SLAPY2 returns sqrt(x2+y2).
Download SLAPY2 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary !> overflow and unnecessary underflow. !>
| [in] | X | !> X is REAL !> |
| [in] | Y | !> Y is REAL !> X and Y specify the values x and y. !> |
Definition at line 62 of file slapy2.f.
| real function slapy3 | ( | real | x, |
| real | y, | ||
| real | z ) |
SLAPY3 returns sqrt(x2+y2+z2).
Download SLAPY3 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAPY3 returns sqrt(x**2+y**2+z**2), taking care not to cause !> unnecessary overflow and unnecessary underflow. !>
| [in] | X | !> X is REAL !> |
| [in] | Y | !> Y is REAL !> |
| [in] | Z | !> Z is REAL !> X, Y and Z specify the values x, y and z. !> |
Definition at line 67 of file slapy3.f.
| subroutine slarnv | ( | integer | idist, |
| integer, dimension( 4 ) | iseed, | ||
| integer | n, | ||
| real, dimension( * ) | x ) |
SLARNV returns a vector of random numbers from a uniform or normal distribution.
Download SLARNV + dependencies [TGZ] [ZIP] [TXT]
!> !> SLARNV returns a vector of n random real numbers from a uniform or !> normal distribution. !>
| [in] | IDIST | !> IDIST is INTEGER !> Specifies the distribution of the random numbers: !> = 1: uniform (0,1) !> = 2: uniform (-1,1) !> = 3: normal (0,1) !> |
| [in,out] | ISEED | !> ISEED is INTEGER array, dimension (4) !> On entry, the seed of the random number generator; the array !> elements must be between 0 and 4095, and ISEED(4) must be !> odd. !> On exit, the seed is updated. !> |
| [in] | N | !> N is INTEGER !> The number of random numbers to be generated. !> |
| [out] | X | !> X is REAL array, dimension (N) !> The generated random numbers. !> |
!> !> This routine calls the auxiliary routine SLARUV to generate random !> real numbers from a uniform (0,1) distribution, in batches of up to !> 128 using vectorisable code. The Box-Muller method is used to !> transform numbers from a uniform to a normal distribution. !>
Definition at line 96 of file slarnv.f.
| subroutine slarra | ( | integer | n, |
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( * ) | e2, | ||
| real | spltol, | ||
| real | tnrm, | ||
| integer | nsplit, | ||
| integer, dimension( * ) | isplit, | ||
| integer | info ) |
SLARRA computes the splitting points with the specified threshold.
Download SLARRA + dependencies [TGZ] [ZIP] [TXT]
!> !> Compute the splitting points with threshold SPLTOL. !> SLARRA sets any off-diagonal elements to zero. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in] | D | !> D is REAL array, dimension (N) !> On entry, the N diagonal elements of the tridiagonal !> matrix T. !> |
| [in,out] | E | !> E is REAL array, dimension (N) !> On entry, the first (N-1) entries contain the subdiagonal !> elements of the tridiagonal matrix T; E(N) need not be set. !> On exit, the entries E( ISPLIT( I ) ), 1 <= I <= NSPLIT, !> are set to zero, the other entries of E are untouched. !> |
| [in,out] | E2 | !> E2 is REAL array, dimension (N) !> On entry, the first (N-1) entries contain the SQUARES of the !> subdiagonal elements of the tridiagonal matrix T; !> E2(N) need not be set. !> On exit, the entries E2( ISPLIT( I ) ), !> 1 <= I <= NSPLIT, have been set to zero !> |
| [in] | SPLTOL | !> SPLTOL is REAL !> The threshold for splitting. Two criteria can be used: !> SPLTOL<0 : criterion based on absolute off-diagonal value !> SPLTOL>0 : criterion that preserves relative accuracy !> |
| [in] | TNRM | !> TNRM is REAL !> The norm of the matrix. !> |
| [out] | NSPLIT | !> NSPLIT is INTEGER !> The number of blocks T splits into. 1 <= NSPLIT <= N. !> |
| [out] | ISPLIT | !> ISPLIT is INTEGER array, dimension (N) !> The splitting points, at which T breaks up into blocks. !> The first block consists of rows/columns 1 to ISPLIT(1), !> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), !> etc., and the NSPLIT-th consists of rows/columns !> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> |
Definition at line 134 of file slarra.f.
| subroutine slarrb | ( | integer | n, |
| real, dimension( * ) | d, | ||
| real, dimension( * ) | lld, | ||
| integer | ifirst, | ||
| integer | ilast, | ||
| real | rtol1, | ||
| real | rtol2, | ||
| integer | offset, | ||
| real, dimension( * ) | w, | ||
| real, dimension( * ) | wgap, | ||
| real, dimension( * ) | werr, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| real | pivmin, | ||
| real | spdiam, | ||
| integer | twist, | ||
| integer | info ) |
SLARRB provides limited bisection to locate eigenvalues for more accuracy.
Download SLARRB + dependencies [TGZ] [ZIP] [TXT]
!> !> Given the relatively robust representation(RRR) L D L^T, SLARRB !> does bisection to refine the eigenvalues of L D L^T, !> W( IFIRST-OFFSET ) through W( ILAST-OFFSET ), to more accuracy. Initial !> guesses for these eigenvalues are input in W, the corresponding estimate !> of the error in these guesses and their gaps are input in WERR !> and WGAP, respectively. During bisection, intervals !> [left, right] are maintained by storing their mid-points and !> semi-widths in the arrays W and WERR respectively. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The N diagonal elements of the diagonal matrix D. !> |
| [in] | LLD | !> LLD is REAL array, dimension (N-1) !> The (N-1) elements L(i)*L(i)*D(i). !> |
| [in] | IFIRST | !> IFIRST is INTEGER !> The index of the first eigenvalue to be computed. !> |
| [in] | ILAST | !> ILAST is INTEGER !> The index of the last eigenvalue to be computed. !> |
| [in] | RTOL1 | !> RTOL1 is REAL !> |
| [in] | RTOL2 | !> RTOL2 is REAL !> Tolerance for the convergence of the bisection intervals. !> An interval [LEFT,RIGHT] has converged if !> RIGHT-LEFT < MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) ) !> where GAP is the (estimated) distance to the nearest !> eigenvalue. !> |
| [in] | OFFSET | !> OFFSET is INTEGER !> Offset for the arrays W, WGAP and WERR, i.e., the IFIRST-OFFSET !> through ILAST-OFFSET elements of these arrays are to be used. !> |
| [in,out] | W | !> W is REAL array, dimension (N) !> On input, W( IFIRST-OFFSET ) through W( ILAST-OFFSET ) are !> estimates of the eigenvalues of L D L^T indexed IFIRST through !> ILAST. !> On output, these estimates are refined. !> |
| [in,out] | WGAP | !> WGAP is REAL array, dimension (N-1) !> On input, the (estimated) gaps between consecutive !> eigenvalues of L D L^T, i.e., WGAP(I-OFFSET) is the gap between !> eigenvalues I and I+1. Note that if IFIRST = ILAST !> then WGAP(IFIRST-OFFSET) must be set to ZERO. !> On output, these gaps are refined. !> |
| [in,out] | WERR | !> WERR is REAL array, dimension (N) !> On input, WERR( IFIRST-OFFSET ) through WERR( ILAST-OFFSET ) are !> the errors in the estimates of the corresponding elements in W. !> On output, these errors are refined. !> |
| [out] | WORK | !> WORK is REAL array, dimension (2*N) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (2*N) !> Workspace. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot in the Sturm sequence. !> |
| [in] | SPDIAM | !> SPDIAM is REAL !> The spectral diameter of the matrix. !> |
| [in] | TWIST | !> TWIST is INTEGER !> The twist index for the twisted factorization that is used !> for the negcount. !> TWIST = N: Compute negcount from L D L^T - LAMBDA I = L+ D+ L+^T !> TWIST = 1: Compute negcount from L D L^T - LAMBDA I = U- D- U-^T !> TWIST = R: Compute negcount from L D L^T - LAMBDA I = N(r) D(r) N(r) !> |
| [out] | INFO | !> INFO is INTEGER !> Error flag. !> |
Definition at line 193 of file slarrb.f.
| subroutine slarrc | ( | character | jobt, |
| integer | n, | ||
| real | vl, | ||
| real | vu, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real | pivmin, | ||
| integer | eigcnt, | ||
| integer | lcnt, | ||
| integer | rcnt, | ||
| integer | info ) |
SLARRC computes the number of eigenvalues of the symmetric tridiagonal matrix.
Download SLARRC + dependencies [TGZ] [ZIP] [TXT]
!> !> Find the number of eigenvalues of the symmetric tridiagonal matrix T !> that are in the interval (VL,VU] if JOBT = 'T', and of L D L^T !> if JOBT = 'L'. !>
| [in] | JOBT | !> JOBT is CHARACTER*1 !> = 'T': Compute Sturm count for matrix T. !> = 'L': Compute Sturm count for matrix L D L^T. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in] | VL | !> VL is REAL !> The lower bound for the eigenvalues. !> |
| [in] | VU | !> VU is REAL !> The upper bound for the eigenvalues. !> |
| [in] | D | !> D is REAL array, dimension (N) !> JOBT = 'T': The N diagonal elements of the tridiagonal matrix T. !> JOBT = 'L': The N diagonal elements of the diagonal matrix D. !> |
| [in] | E | !> E is REAL array, dimension (N) !> JOBT = 'T': The N-1 offdiagonal elements of the matrix T. !> JOBT = 'L': The N-1 offdiagonal elements of the matrix L. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot in the Sturm sequence for T. !> |
| [out] | EIGCNT | !> EIGCNT is INTEGER !> The number of eigenvalues of the symmetric tridiagonal matrix T !> that are in the interval (VL,VU] !> |
| [out] | LCNT | !> LCNT is INTEGER !> |
| [out] | RCNT | !> RCNT is INTEGER !> The left and right negcounts of the interval. !> |
| [out] | INFO | !> INFO is INTEGER !> |
Definition at line 135 of file slarrc.f.
| subroutine slarrd | ( | character | range, |
| character | order, | ||
| integer | n, | ||
| real | vl, | ||
| real | vu, | ||
| integer | il, | ||
| integer | iu, | ||
| real, dimension( * ) | gers, | ||
| real | reltol, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( * ) | e2, | ||
| real | pivmin, | ||
| integer | nsplit, | ||
| integer, dimension( * ) | isplit, | ||
| integer | m, | ||
| real, dimension( * ) | w, | ||
| real, dimension( * ) | werr, | ||
| real | wl, | ||
| real | wu, | ||
| integer, dimension( * ) | iblock, | ||
| integer, dimension( * ) | indexw, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
SLARRD computes the eigenvalues of a symmetric tridiagonal matrix to suitable accuracy.
Download SLARRD + dependencies [TGZ] [ZIP] [TXT]
!> !> SLARRD computes the eigenvalues of a symmetric tridiagonal !> matrix T to suitable accuracy. This is an auxiliary code to be !> called from SSTEMR. !> The user may ask for all eigenvalues, all eigenvalues !> in the half-open interval (VL, VU], or the IL-th through IU-th !> eigenvalues. !> !> To avoid overflow, the matrix must be scaled so that its !> largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest !> accuracy, it should not be much smaller than that. !> !> See W. Kahan , Report CS41, Computer Science Dept., Stanford !> University, July 21, 1966. !>
| [in] | RANGE | !> RANGE is CHARACTER*1 !> = 'A': () all eigenvalues will be found. !> = 'V': () all eigenvalues in the half-open interval !> (VL, VU] will be found. !> = 'I': () the IL-th through IU-th eigenvalues (of the !> entire matrix) will be found. !> |
| [in] | ORDER | !> ORDER is CHARACTER*1 !> = 'B': () the eigenvalues will be grouped by !> split-off block (see IBLOCK, ISPLIT) and !> ordered from smallest to largest within !> the block. !> = 'E': () !> the eigenvalues for the entire matrix !> will be ordered from smallest to !> largest. !> |
| [in] | N | !> N is INTEGER !> The order of the tridiagonal matrix T. N >= 0. !> |
| [in] | VL | !> VL is REAL !> If RANGE='V', the lower bound of the interval to !> be searched for eigenvalues. Eigenvalues less than or equal !> to VL, or greater than VU, will not be returned. VL < VU. !> Not referenced if RANGE = 'A' or 'I'. !> |
| [in] | VU | !> VU is REAL !> If RANGE='V', the upper bound of the interval to !> be searched for eigenvalues. Eigenvalues less than or equal !> to VL, or greater than VU, will not be returned. VL < VU. !> Not referenced if RANGE = 'A' or 'I'. !> |
| [in] | IL | !> IL is INTEGER !> If RANGE='I', the index of the !> smallest eigenvalue to be returned. !> 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. !> Not referenced if RANGE = 'A' or 'V'. !> |
| [in] | IU | !> IU is INTEGER !> If RANGE='I', the index of the !> largest eigenvalue to be returned. !> 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. !> Not referenced if RANGE = 'A' or 'V'. !> |
| [in] | GERS | !> GERS is REAL array, dimension (2*N) !> The N Gerschgorin intervals (the i-th Gerschgorin interval !> is (GERS(2*i-1), GERS(2*i)). !> |
| [in] | RELTOL | !> RELTOL is REAL !> The minimum relative width of an interval. When an interval !> is narrower than RELTOL times the larger (in !> magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. Note: this should !> always be at least radix*machine epsilon. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The n diagonal elements of the tridiagonal matrix T. !> |
| [in] | E | !> E is REAL array, dimension (N-1) !> The (n-1) off-diagonal elements of the tridiagonal matrix T. !> |
| [in] | E2 | !> E2 is REAL array, dimension (N-1) !> The (n-1) squared off-diagonal elements of the tridiagonal matrix T. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot allowed in the Sturm sequence for T. !> |
| [in] | NSPLIT | !> NSPLIT is INTEGER !> The number of diagonal blocks in the matrix T. !> 1 <= NSPLIT <= N. !> |
| [in] | ISPLIT | !> ISPLIT is INTEGER array, dimension (N) !> The splitting points, at which T breaks up into submatrices. !> The first submatrix consists of rows/columns 1 to ISPLIT(1), !> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), !> etc., and the NSPLIT-th consists of rows/columns !> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. !> (Only the first NSPLIT elements will actually be used, but !> since the user cannot know a priori what value NSPLIT will !> have, N words must be reserved for ISPLIT.) !> |
| [out] | M | !> M is INTEGER !> The actual number of eigenvalues found. 0 <= M <= N. !> (See also the description of INFO=2,3.) !> |
| [out] | W | !> W is REAL array, dimension (N) !> On exit, the first M elements of W will contain the !> eigenvalue approximations. SLARRD computes an interval !> I_j = (a_j, b_j] that includes eigenvalue j. The eigenvalue !> approximation is given as the interval midpoint !> W(j)= ( a_j + b_j)/2. The corresponding error is bounded by !> WERR(j) = abs( a_j - b_j)/2 !> |
| [out] | WERR | !> WERR is REAL array, dimension (N) !> The error bound on the corresponding eigenvalue approximation !> in W. !> |
| [out] | WL | !> WL is REAL !> |
| [out] | WU | !> WU is REAL !> The interval (WL, WU] contains all the wanted eigenvalues. !> If RANGE='V', then WL=VL and WU=VU. !> If RANGE='A', then WL and WU are the global Gerschgorin bounds !> on the spectrum. !> If RANGE='I', then WL and WU are computed by SLAEBZ from the !> index range specified. !> |
| [out] | IBLOCK | !> IBLOCK is INTEGER array, dimension (N) !> At each row/column j where E(j) is zero or small, the !> matrix T is considered to split into a block diagonal !> matrix. On exit, if INFO = 0, IBLOCK(i) specifies to which !> block (from 1 to the number of blocks) the eigenvalue W(i) !> belongs. (SLARRD may use the remaining N-M elements as !> workspace.) !> |
| [out] | INDEXW | !> INDEXW is INTEGER array, dimension (N) !> The indices of the eigenvalues within each block (submatrix); !> for example, INDEXW(i)= j and IBLOCK(i)=k imply that the !> i-th eigenvalue W(i) is the j-th eigenvalue in block k. !> |
| [out] | WORK | !> WORK is REAL array, dimension (4*N) !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (3*N) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !> > 0: some or all of the eigenvalues failed to converge or !> were not computed: !> =1 or 3: Bisection failed to converge for some !> eigenvalues; these eigenvalues are flagged by a !> negative block number. The effect is that the !> eigenvalues may not be as accurate as the !> absolute and relative tolerances. This is !> generally caused by unexpectedly inaccurate !> arithmetic. !> =2 or 3: RANGE='I' only: Not all of the eigenvalues !> IL:IU were found. !> Effect: M < IU+1-IL !> Cause: non-monotonic arithmetic, causing the !> Sturm sequence to be non-monotonic. !> Cure: recalculate, using RANGE='A', and pick !> out eigenvalues IL:IU. In some cases, !> increasing the PARAMETER may !> make things work. !> = 4: RANGE='I', and the Gershgorin interval !> initially used was too small. No eigenvalues !> were computed. !> Probable cause: your machine has sloppy !> floating-point arithmetic. !> Cure: Increase the PARAMETER , !> recompile, and try again. !> |
!> FUDGE REAL, default = 2 !> A to widen the Gershgorin intervals. Ideally, !> a value of 1 should work, but on machines with sloppy !> arithmetic, this needs to be larger. The default for !> publicly released versions should be large enough to handle !> the worst machine around. Note that this has no effect !> on accuracy of the solution. !>
Definition at line 325 of file slarrd.f.
| subroutine slarre | ( | character | range, |
| integer | n, | ||
| real | vl, | ||
| real | vu, | ||
| integer | il, | ||
| integer | iu, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( * ) | e2, | ||
| real | rtol1, | ||
| real | rtol2, | ||
| real | spltol, | ||
| integer | nsplit, | ||
| integer, dimension( * ) | isplit, | ||
| integer | m, | ||
| real, dimension( * ) | w, | ||
| real, dimension( * ) | werr, | ||
| real, dimension( * ) | wgap, | ||
| integer, dimension( * ) | iblock, | ||
| integer, dimension( * ) | indexw, | ||
| real, dimension( * ) | gers, | ||
| real | pivmin, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
SLARRE given the tridiagonal matrix T, sets small off-diagonal elements to zero and for each unreduced block Ti, finds base representations and eigenvalues.
Download SLARRE + dependencies [TGZ] [ZIP] [TXT]
!> !> To find the desired eigenvalues of a given real symmetric !> tridiagonal matrix T, SLARRE sets any off-diagonal !> elements to zero, and for each unreduced block T_i, it finds !> (a) a suitable shift at one end of the block's spectrum, !> (b) the base representation, T_i - sigma_i I = L_i D_i L_i^T, and !> (c) eigenvalues of each L_i D_i L_i^T. !> The representations and eigenvalues found are then used by !> SSTEMR to compute the eigenvectors of T. !> The accuracy varies depending on whether bisection is used to !> find a few eigenvalues or the dqds algorithm (subroutine SLASQ2) to !> conpute all and then discard any unwanted one. !> As an added benefit, SLARRE also outputs the n !> Gerschgorin intervals for the matrices L_i D_i L_i^T. !>
| [in] | RANGE | !> RANGE is CHARACTER*1 !> = 'A': () all eigenvalues will be found. !> = 'V': () all eigenvalues in the half-open interval !> (VL, VU] will be found. !> = 'I': () the IL-th through IU-th eigenvalues (of the !> entire matrix) will be found. !> |
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in,out] | VL | !> VL is REAL !> If RANGE='V', the lower bound for the eigenvalues. !> Eigenvalues less than or equal to VL, or greater than VU, !> will not be returned. VL < VU. !> If RANGE='I' or ='A', SLARRE computes bounds on the desired !> part of the spectrum. !> |
| [in,out] | VU | !> VU is REAL !> If RANGE='V', the upper bound for the eigenvalues. !> Eigenvalues less than or equal to VL, or greater than VU, !> will not be returned. VL < VU. !> If RANGE='I' or ='A', SLARRE computes bounds on the desired !> part of the spectrum. !> |
| [in] | IL | !> IL is INTEGER !> If RANGE='I', the index of the !> smallest eigenvalue to be returned. !> 1 <= IL <= IU <= N. !> |
| [in] | IU | !> IU is INTEGER !> If RANGE='I', the index of the !> largest eigenvalue to be returned. !> 1 <= IL <= IU <= N. !> |
| [in,out] | D | !> D is REAL array, dimension (N) !> On entry, the N diagonal elements of the tridiagonal !> matrix T. !> On exit, the N diagonal elements of the diagonal !> matrices D_i. !> |
| [in,out] | E | !> E is REAL array, dimension (N) !> On entry, the first (N-1) entries contain the subdiagonal !> elements of the tridiagonal matrix T; E(N) need not be set. !> On exit, E contains the subdiagonal elements of the unit !> bidiagonal matrices L_i. The entries E( ISPLIT( I ) ), !> 1 <= I <= NSPLIT, contain the base points sigma_i on output. !> |
| [in,out] | E2 | !> E2 is REAL array, dimension (N) !> On entry, the first (N-1) entries contain the SQUARES of the !> subdiagonal elements of the tridiagonal matrix T; !> E2(N) need not be set. !> On exit, the entries E2( ISPLIT( I ) ), !> 1 <= I <= NSPLIT, have been set to zero !> |
| [in] | RTOL1 | !> RTOL1 is REAL !> |
| [in] | RTOL2 | !> RTOL2 is REAL !> Parameters for bisection. !> An interval [LEFT,RIGHT] has converged if !> RIGHT-LEFT < MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) ) !> |
| [in] | SPLTOL | !> SPLTOL is REAL !> The threshold for splitting. !> |
| [out] | NSPLIT | !> NSPLIT is INTEGER !> The number of blocks T splits into. 1 <= NSPLIT <= N. !> |
| [out] | ISPLIT | !> ISPLIT is INTEGER array, dimension (N) !> The splitting points, at which T breaks up into blocks. !> The first block consists of rows/columns 1 to ISPLIT(1), !> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), !> etc., and the NSPLIT-th consists of rows/columns !> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. !> |
| [out] | M | !> M is INTEGER !> The total number of eigenvalues (of all L_i D_i L_i^T) !> found. !> |
| [out] | W | !> W is REAL array, dimension (N) !> The first M elements contain the eigenvalues. The !> eigenvalues of each of the blocks, L_i D_i L_i^T, are !> sorted in ascending order ( SLARRE may use the !> remaining N-M elements as workspace). !> |
| [out] | WERR | !> WERR is REAL array, dimension (N) !> The error bound on the corresponding eigenvalue in W. !> |
| [out] | WGAP | !> WGAP is REAL array, dimension (N) !> The separation from the right neighbor eigenvalue in W. !> The gap is only with respect to the eigenvalues of the same block !> as each block has its own representation tree. !> Exception: at the right end of a block we store the left gap !> |
| [out] | IBLOCK | !> IBLOCK is INTEGER array, dimension (N) !> The indices of the blocks (submatrices) associated with the !> corresponding eigenvalues in W; IBLOCK(i)=1 if eigenvalue !> W(i) belongs to the first block from the top, =2 if W(i) !> belongs to the second block, etc. !> |
| [out] | INDEXW | !> INDEXW is INTEGER array, dimension (N) !> The indices of the eigenvalues within each block (submatrix); !> for example, INDEXW(i)= 10 and IBLOCK(i)=2 imply that the !> i-th eigenvalue W(i) is the 10-th eigenvalue in block 2 !> |
| [out] | GERS | !> GERS is REAL array, dimension (2*N) !> The N Gerschgorin intervals (the i-th Gerschgorin interval !> is (GERS(2*i-1), GERS(2*i)). !> |
| [out] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot in the Sturm sequence for T. !> |
| [out] | WORK | !> WORK is REAL array, dimension (6*N) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (5*N) !> Workspace. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> > 0: A problem occurred in SLARRE. !> < 0: One of the called subroutines signaled an internal problem. !> Needs inspection of the corresponding parameter IINFO !> for further information. !> !> =-1: Problem in SLARRD. !> = 2: No base representation could be found in MAXTRY iterations. !> Increasing MAXTRY and recompilation might be a remedy. !> =-3: Problem in SLARRB when computing the refined root !> representation for SLASQ2. !> =-4: Problem in SLARRB when preforming bisection on the !> desired part of the spectrum. !> =-5: Problem in SLASQ2. !> =-6: Problem in SLASQ2. !> |
!> !> The base representations are required to suffer very little !> element growth and consequently define all their eigenvalues to !> high relative accuracy. !>
Definition at line 301 of file slarre.f.
| subroutine slarrf | ( | integer | n, |
| real, dimension( * ) | d, | ||
| real, dimension( * ) | l, | ||
| real, dimension( * ) | ld, | ||
| integer | clstrt, | ||
| integer | clend, | ||
| real, dimension( * ) | w, | ||
| real, dimension( * ) | wgap, | ||
| real, dimension( * ) | werr, | ||
| real | spdiam, | ||
| real | clgapl, | ||
| real | clgapr, | ||
| real | pivmin, | ||
| real | sigma, | ||
| real, dimension( * ) | dplus, | ||
| real, dimension( * ) | lplus, | ||
| real, dimension( * ) | work, | ||
| integer | info ) |
SLARRF finds a new relatively robust representation such that at least one of the eigenvalues is relatively isolated.
Download SLARRF + dependencies [TGZ] [ZIP] [TXT]
!> !> Given the initial representation L D L^T and its cluster of close !> eigenvalues (in a relative measure), W( CLSTRT ), W( CLSTRT+1 ), ... !> W( CLEND ), SLARRF finds a new relatively robust representation !> L D L^T - SIGMA I = L(+) D(+) L(+)^T such that at least one of the !> eigenvalues of L(+) D(+) L(+)^T is relatively isolated. !>
| [in] | N | !> N is INTEGER !> The order of the matrix (subblock, if the matrix split). !> |
| [in] | D | !> D is REAL array, dimension (N) !> The N diagonal elements of the diagonal matrix D. !> |
| [in] | L | !> L is REAL array, dimension (N-1) !> The (N-1) subdiagonal elements of the unit bidiagonal !> matrix L. !> |
| [in] | LD | !> LD is REAL array, dimension (N-1) !> The (N-1) elements L(i)*D(i). !> |
| [in] | CLSTRT | !> CLSTRT is INTEGER !> The index of the first eigenvalue in the cluster. !> |
| [in] | CLEND | !> CLEND is INTEGER !> The index of the last eigenvalue in the cluster. !> |
| [in] | W | !> W is REAL array, dimension !> dimension is >= (CLEND-CLSTRT+1) !> The eigenvalue APPROXIMATIONS of L D L^T in ascending order. !> W( CLSTRT ) through W( CLEND ) form the cluster of relatively !> close eigenalues. !> |
| [in,out] | WGAP | !> WGAP is REAL array, dimension !> dimension is >= (CLEND-CLSTRT+1) !> The separation from the right neighbor eigenvalue in W. !> |
| [in] | WERR | !> WERR is REAL array, dimension !> dimension is >= (CLEND-CLSTRT+1) !> WERR contain the semiwidth of the uncertainty !> interval of the corresponding eigenvalue APPROXIMATION in W !> |
| [in] | SPDIAM | !> SPDIAM is REAL !> estimate of the spectral diameter obtained from the !> Gerschgorin intervals !> |
| [in] | CLGAPL | !> CLGAPL is REAL !> |
| [in] | CLGAPR | !> CLGAPR is REAL !> absolute gap on each end of the cluster. !> Set by the calling routine to protect against shifts too close !> to eigenvalues outside the cluster. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot allowed in the Sturm sequence. !> |
| [out] | SIGMA | !> SIGMA is REAL !> The shift used to form L(+) D(+) L(+)^T. !> |
| [out] | DPLUS | !> DPLUS is REAL array, dimension (N) !> The N diagonal elements of the diagonal matrix D(+). !> |
| [out] | LPLUS | !> LPLUS is REAL array, dimension (N-1) !> The first (N-1) elements of LPLUS contain the subdiagonal !> elements of the unit bidiagonal matrix L(+). !> |
| [out] | WORK | !> WORK is REAL array, dimension (2*N) !> Workspace. !> |
| [out] | INFO | !> INFO is INTEGER !> Signals processing OK (=0) or failure (=1) !> |
Definition at line 189 of file slarrf.f.
| subroutine slarrj | ( | integer | n, |
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e2, | ||
| integer | ifirst, | ||
| integer | ilast, | ||
| real | rtol, | ||
| integer | offset, | ||
| real, dimension( * ) | w, | ||
| real, dimension( * ) | werr, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| real | pivmin, | ||
| real | spdiam, | ||
| integer | info ) |
SLARRJ performs refinement of the initial estimates of the eigenvalues of the matrix T.
Download SLARRJ + dependencies [TGZ] [ZIP] [TXT]
!> !> Given the initial eigenvalue approximations of T, SLARRJ !> does bisection to refine the eigenvalues of T, !> W( IFIRST-OFFSET ) through W( ILAST-OFFSET ), to more accuracy. Initial !> guesses for these eigenvalues are input in W, the corresponding estimate !> of the error in these guesses in WERR. During bisection, intervals !> [left, right] are maintained by storing their mid-points and !> semi-widths in the arrays W and WERR respectively. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The N diagonal elements of T. !> |
| [in] | E2 | !> E2 is REAL array, dimension (N-1) !> The Squares of the (N-1) subdiagonal elements of T. !> |
| [in] | IFIRST | !> IFIRST is INTEGER !> The index of the first eigenvalue to be computed. !> |
| [in] | ILAST | !> ILAST is INTEGER !> The index of the last eigenvalue to be computed. !> |
| [in] | RTOL | !> RTOL is REAL !> Tolerance for the convergence of the bisection intervals. !> An interval [LEFT,RIGHT] has converged if !> RIGHT-LEFT < RTOL*MAX(|LEFT|,|RIGHT|). !> |
| [in] | OFFSET | !> OFFSET is INTEGER !> Offset for the arrays W and WERR, i.e., the IFIRST-OFFSET !> through ILAST-OFFSET elements of these arrays are to be used. !> |
| [in,out] | W | !> W is REAL array, dimension (N) !> On input, W( IFIRST-OFFSET ) through W( ILAST-OFFSET ) are !> estimates of the eigenvalues of L D L^T indexed IFIRST through !> ILAST. !> On output, these estimates are refined. !> |
| [in,out] | WERR | !> WERR is REAL array, dimension (N) !> On input, WERR( IFIRST-OFFSET ) through WERR( ILAST-OFFSET ) are !> the errors in the estimates of the corresponding elements in W. !> On output, these errors are refined. !> |
| [out] | WORK | !> WORK is REAL array, dimension (2*N) !> Workspace. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (2*N) !> Workspace. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot in the Sturm sequence for T. !> |
| [in] | SPDIAM | !> SPDIAM is REAL !> The spectral diameter of T. !> |
| [out] | INFO | !> INFO is INTEGER !> Error flag. !> |
Definition at line 165 of file slarrj.f.
| subroutine slarrk | ( | integer | n, |
| integer | iw, | ||
| real | gl, | ||
| real | gu, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e2, | ||
| real | pivmin, | ||
| real | reltol, | ||
| real | w, | ||
| real | werr, | ||
| integer | info ) |
SLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy.
Download SLARRK + dependencies [TGZ] [ZIP] [TXT]
!> !> SLARRK computes one eigenvalue of a symmetric tridiagonal !> matrix T to suitable accuracy. This is an auxiliary code to be !> called from SSTEMR. !> !> To avoid overflow, the matrix must be scaled so that its !> largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest !> accuracy, it should not be much smaller than that. !> !> See W. Kahan , Report CS41, Computer Science Dept., Stanford !> University, July 21, 1966. !>
| [in] | N | !> N is INTEGER !> The order of the tridiagonal matrix T. N >= 0. !> |
| [in] | IW | !> IW is INTEGER !> The index of the eigenvalues to be returned. !> |
| [in] | GL | !> GL is REAL !> |
| [in] | GU | !> GU is REAL !> An upper and a lower bound on the eigenvalue. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The n diagonal elements of the tridiagonal matrix T. !> |
| [in] | E2 | !> E2 is REAL array, dimension (N-1) !> The (n-1) squared off-diagonal elements of the tridiagonal matrix T. !> |
| [in] | PIVMIN | !> PIVMIN is REAL !> The minimum pivot allowed in the Sturm sequence for T. !> |
| [in] | RELTOL | !> RELTOL is REAL !> The minimum relative width of an interval. When an interval !> is narrower than RELTOL times the larger (in !> magnitude) endpoint, then it is considered to be !> sufficiently small, i.e., converged. Note: this should !> always be at least radix*machine epsilon. !> |
| [out] | W | !> W is REAL !> |
| [out] | WERR | !> WERR is REAL !> The error bound on the corresponding eigenvalue approximation !> in W. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: Eigenvalue converged !> = -1: Eigenvalue did NOT converge !> |
!> FUDGE REAL , default = 2 !> A to widen the Gershgorin intervals. !>
Definition at line 143 of file slarrk.f.
| subroutine slarrr | ( | integer | n, |
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| integer | info ) |
SLARRR performs tests to decide whether the symmetric tridiagonal matrix T warrants expensive computations which guarantee high relative accuracy in the eigenvalues.
Download SLARRR + dependencies [TGZ] [ZIP] [TXT]
!> !> Perform tests to decide whether the symmetric tridiagonal matrix T !> warrants expensive computations which guarantee high relative accuracy !> in the eigenvalues. !>
| [in] | N | !> N is INTEGER !> The order of the matrix. N > 0. !> |
| [in] | D | !> D is REAL array, dimension (N) !> The N diagonal elements of the tridiagonal matrix T. !> |
| [in,out] | E | !> E is REAL array, dimension (N) !> On entry, the first (N-1) entries contain the subdiagonal !> elements of the tridiagonal matrix T; E(N) is set to ZERO. !> |
| [out] | INFO | !> INFO is INTEGER !> INFO = 0(default) : the matrix warrants computations preserving !> relative accuracy. !> INFO = 1 : the matrix warrants computations guaranteeing !> only absolute accuracy. !> |
Definition at line 93 of file slarrr.f.
| subroutine slartg | ( | real(wp) | f, |
| real(wp) | g, | ||
| real(wp) | c, | ||
| real(wp) | s, | ||
| real(wp) | r ) |
SLARTG generates a plane rotation with real cosine and real sine.
!> !> SLARTG generates a plane rotation so that !> !> [ C S ] . [ F ] = [ R ] !> [ -S C ] [ G ] [ 0 ] !> !> where C**2 + S**2 = 1. !> !> The mathematical formulas used for C and S are !> R = sign(F) * sqrt(F**2 + G**2) !> C = F / R !> S = G / R !> Hence C >= 0. The algorithm used to compute these quantities !> incorporates scaling to avoid overflow or underflow in computing the !> square root of the sum of squares. !> !> This version is discontinuous in R at F = 0 but it returns the same !> C and S as SLARTG for complex inputs (F,0) and (G,0). !> !> This is a more accurate version of the BLAS1 routine SROTG, !> with the following other differences: !> F and G are unchanged on return. !> If G=0, then C=1 and S=0. !> If F=0 and (G .ne. 0), then C=0 and S=sign(1,G) without doing any !> floating point operations (saves work in SBDSQR when !> there are zeros on the diagonal). !> !> If F exceeds G in magnitude, C will be positive. !> !> Below, wp=>sp stands for single precision from LA_CONSTANTS module. !>
| [in] | F | !> F is REAL(wp) !> The first component of vector to be rotated. !> |
| [in] | G | !> G is REAL(wp) !> The second component of vector to be rotated. !> |
| [out] | C | !> C is REAL(wp) !> The cosine of the rotation. !> |
| [out] | S | !> S is REAL(wp) !> The sine of the rotation. !> |
| [out] | R | !> R is REAL(wp) !> The nonzero component of the rotated vector. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !>
Definition at line 112 of file slartg.f90.
| subroutine slartgp | ( | real | f, |
| real | g, | ||
| real | cs, | ||
| real | sn, | ||
| real | r ) |
SLARTGP generates a plane rotation so that the diagonal is nonnegative.
Download SLARTGP + dependencies [TGZ] [ZIP] [TXT]
!> !> SLARTGP generates a plane rotation so that !> !> [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. !> [ -SN CS ] [ G ] [ 0 ] !> !> This is a slower, more accurate version of the Level 1 BLAS routine SROTG, !> with the following other differences: !> F and G are unchanged on return. !> If G=0, then CS=(+/-)1 and SN=0. !> If F=0 and (G .ne. 0), then CS=0 and SN=(+/-)1. !> !> The sign is chosen so that R >= 0. !>
| [in] | F | !> F is REAL !> The first component of vector to be rotated. !> |
| [in] | G | !> G is REAL !> The second component of vector to be rotated. !> |
| [out] | CS | !> CS is REAL !> The cosine of the rotation. !> |
| [out] | SN | !> SN is REAL !> The sine of the rotation. !> |
| [out] | R | !> R is REAL !> The nonzero component of the rotated vector. !> !> This version has a few statements commented out for thread safety !> (machine parameters are computed on each entry). 10 feb 03, SJH. !> |
Definition at line 94 of file slartgp.f.
| subroutine slaruv | ( | integer, dimension( 4 ) | iseed, |
| integer | n, | ||
| real, dimension( n ) | x ) |
SLARUV returns a vector of n random real numbers from a uniform distribution.
Download SLARUV + dependencies [TGZ] [ZIP] [TXT]
!> !> SLARUV returns a vector of n random real numbers from a uniform (0,1) !> distribution (n <= 128). !> !> This is an auxiliary routine called by SLARNV and CLARNV. !>
| [in,out] | ISEED | !> ISEED is INTEGER array, dimension (4) !> On entry, the seed of the random number generator; the array !> elements must be between 0 and 4095, and ISEED(4) must be !> odd. !> On exit, the seed is updated. !> |
| [in] | N | !> N is INTEGER !> The number of random numbers to be generated. N <= 128. !> |
| [out] | X | !> X is REAL array, dimension (N) !> The generated random numbers. !> |
!> !> This routine uses a multiplicative congruential method with modulus !> 2**48 and multiplier 33952834046453 (see G.S.Fishman, !> 'Multiplicative congruential random number generators with modulus !> 2**b: an exhaustive analysis for b = 32 and a partial analysis for !> b = 48', Math. Comp. 189, pp 331-344, 1990). !> !> 48-bit integers are stored in 4 integer array elements with 12 bits !> per element. Hence the routine is portable across machines with !> integers of 32 bits or more. !>
Definition at line 94 of file slaruv.f.
| subroutine slas2 | ( | real | f, |
| real | g, | ||
| real | h, | ||
| real | ssmin, | ||
| real | ssmax ) |
SLAS2 computes singular values of a 2-by-2 triangular matrix.
Download SLAS2 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLAS2 computes the singular values of the 2-by-2 matrix !> [ F G ] !> [ 0 H ]. !> On return, SSMIN is the smaller singular value and SSMAX is the !> larger singular value. !>
| [in] | F | !> F is REAL !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | G | !> G is REAL !> The (1,2) element of the 2-by-2 matrix. !> |
| [in] | H | !> H is REAL !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | SSMIN | !> SSMIN is REAL !> The smaller singular value. !> |
| [out] | SSMAX | !> SSMAX is REAL !> The larger singular value. !> |
!> !> Barring over/underflow, all output quantities are correct to within !> a few units in the last place (ulps), even in the absence of a guard !> digit in addition/subtraction. !> !> In IEEE arithmetic, the code works correctly if one matrix element is !> infinite. !> !> Overflow will not occur unless the largest singular value itself !> overflows, or is within a few ulps of overflow. (On machines with !> partial overflow, like the Cray, overflow may occur if the largest !> singular value is within a factor of 2 of overflow.) !> !> Underflow is harmless if underflow is gradual. Otherwise, results !> may correspond to a matrix modified by perturbations of size near !> the underflow threshold. !>
Definition at line 106 of file slas2.f.
| subroutine slascl | ( | character | type, |
| integer | kl, | ||
| integer | ku, | ||
| real | cfrom, | ||
| real | cto, | ||
| integer | m, | ||
| integer | n, | ||
| real, dimension( lda, * ) | a, | ||
| integer | lda, | ||
| integer | info ) |
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Download SLASCL + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASCL multiplies the M by N real matrix A by the real scalar !> CTO/CFROM. This is done without over/underflow as long as the final !> result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that !> A may be full, upper triangular, lower triangular, upper Hessenberg, !> or banded. !>
| [in] | TYPE | !> TYPE is CHARACTER*1 !> TYPE indices the storage type of the input matrix. !> = 'G': A is a full matrix. !> = 'L': A is a lower triangular matrix. !> = 'U': A is an upper triangular matrix. !> = 'H': A is an upper Hessenberg matrix. !> = 'B': A is a symmetric band matrix with lower bandwidth KL !> and upper bandwidth KU and with the only the lower !> half stored. !> = 'Q': A is a symmetric band matrix with lower bandwidth KL !> and upper bandwidth KU and with the only the upper !> half stored. !> = 'Z': A is a band matrix with lower bandwidth KL and upper !> bandwidth KU. See SGBTRF for storage details. !> |
| [in] | KL | !> KL is INTEGER !> The lower bandwidth of A. Referenced only if TYPE = 'B', !> 'Q' or 'Z'. !> |
| [in] | KU | !> KU is INTEGER !> The upper bandwidth of A. Referenced only if TYPE = 'B', !> 'Q' or 'Z'. !> |
| [in] | CFROM | !> CFROM is REAL !> |
| [in] | CTO | !> CTO is REAL !> !> The matrix A is multiplied by CTO/CFROM. A(I,J) is computed !> without over/underflow if the final result CTO*A(I,J)/CFROM !> can be represented without over/underflow. CFROM must be !> nonzero. !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in,out] | A | !> A is REAL array, dimension (LDA,N) !> The matrix to be multiplied by CTO/CFROM. See TYPE for the !> storage type. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. !> If TYPE = 'G', 'L', 'U', 'H', LDA >= max(1,M); !> TYPE = 'B', LDA >= KL+1; !> TYPE = 'Q', LDA >= KU+1; !> TYPE = 'Z', LDA >= 2*KL+KU+1. !> |
| [out] | INFO | !> INFO is INTEGER !> 0 - successful exit !> <0 - if INFO = -i, the i-th argument had an illegal value. !> |
Definition at line 142 of file slascl.f.
| subroutine slasd0 | ( | integer | n, |
| integer | sqre, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| real, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| integer | smlsiz, | ||
| integer, dimension( * ) | iwork, | ||
| real, dimension( * ) | work, | ||
| integer | info ) |
SLASD0 computes the singular values of a real upper bidiagonal n-by-m matrix B with diagonal d and off-diagonal e. Used by sbdsdc.
Download SLASD0 + dependencies [TGZ] [ZIP] [TXT]
!> !> Using a divide and conquer approach, SLASD0 computes the singular !> value decomposition (SVD) of a real upper bidiagonal N-by-M !> matrix B with diagonal D and offdiagonal E, where M = N + SQRE. !> The algorithm computes orthogonal matrices U and VT such that !> B = U * S * VT. The singular values S are overwritten on D. !> !> A related subroutine, SLASDA, computes only the singular values, !> and optionally, the singular vectors in compact form. !>
| [in] | N | !> N is INTEGER !> On entry, the row dimension of the upper bidiagonal matrix. !> This is also the dimension of the main diagonal array D. !> |
| [in] | SQRE | !> SQRE is INTEGER !> Specifies the column dimension of the bidiagonal matrix. !> = 0: The bidiagonal matrix has column dimension M = N; !> = 1: The bidiagonal matrix has column dimension M = N+1; !> |
| [in,out] | D | !> D is REAL array, dimension (N) !> On entry D contains the main diagonal of the bidiagonal !> matrix. !> On exit D, if INFO = 0, contains its singular values. !> |
| [in,out] | E | !> E is REAL array, dimension (M-1) !> Contains the subdiagonal entries of the bidiagonal matrix. !> On exit, E has been destroyed. !> |
| [out] | U | !> U is REAL array, dimension (LDU, N) !> On exit, U contains the left singular vectors. !> |
| [in] | LDU | !> LDU is INTEGER !> On entry, leading dimension of U. !> |
| [out] | VT | !> VT is REAL array, dimension (LDVT, M) !> On exit, VT**T contains the right singular vectors. !> |
| [in] | LDVT | !> LDVT is INTEGER !> On entry, leading dimension of VT. !> |
| [in] | SMLSIZ | !> SMLSIZ is INTEGER !> On entry, maximum size of the subproblems at the !> bottom of the computation tree. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (8*N) !> |
| [out] | WORK | !> WORK is REAL array, dimension (3*M**2+2*M) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 148 of file slasd0.f.
| subroutine slasd1 | ( | integer | nl, |
| integer | nr, | ||
| integer | sqre, | ||
| real, dimension( * ) | d, | ||
| real | alpha, | ||
| real | beta, | ||
| real, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| real, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | iwork, | ||
| real, dimension( * ) | work, | ||
| integer | info ) |
SLASD1 computes the SVD of an upper bidiagonal matrix B of the specified size. Used by sbdsdc.
Download SLASD1 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASD1 computes the SVD of an upper bidiagonal N-by-M matrix B, !> where N = NL + NR + 1 and M = N + SQRE. SLASD1 is called from SLASD0. !> !> A related subroutine SLASD7 handles the case in which the singular !> values (and the singular vectors in factored form) are desired. !> !> SLASD1 computes the SVD as follows: !> !> ( D1(in) 0 0 0 ) !> B = U(in) * ( Z1**T a Z2**T b ) * VT(in) !> ( 0 0 D2(in) 0 ) !> !> = U(out) * ( D(out) 0) * VT(out) !> !> where Z**T = (Z1**T a Z2**T b) = u**T VT**T, and u is a vector of dimension M !> with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros !> elsewhere; and the entry b is empty if SQRE = 0. !> !> The left singular vectors of the original matrix are stored in U, and !> the transpose of the right singular vectors are stored in VT, and the !> singular values are in D. The algorithm consists of three stages: !> !> The first stage consists of deflating the size of the problem !> when there are multiple singular values or when there are zeros in !> the Z vector. For each such occurrence the dimension of the !> secular equation problem is reduced by one. This stage is !> performed by the routine SLASD2. !> !> The second stage consists of calculating the updated !> singular values. This is done by finding the square roots of the !> roots of the secular equation via the routine SLASD4 (as called !> by SLASD3). This routine also calculates the singular vectors of !> the current problem. !> !> The final stage consists of computing the updated singular vectors !> directly using the updated singular values. The singular vectors !> for the current problem are multiplied with the singular vectors !> from the overall problem. !>
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has row dimension N = NL + NR + 1, !> and column dimension M = N + SQRE. !> |
| [in,out] | D | !> D is REAL array, dimension (NL+NR+1). !> N = NL+NR+1 !> On entry D(1:NL,1:NL) contains the singular values of the !> upper block; and D(NL+2:N) contains the singular values of !> the lower block. On exit D(1:N) contains the singular values !> of the modified matrix. !> |
| [in,out] | ALPHA | !> ALPHA is REAL !> Contains the diagonal element associated with the added row. !> |
| [in,out] | BETA | !> BETA is REAL !> Contains the off-diagonal element associated with the added !> row. !> |
| [in,out] | U | !> U is REAL array, dimension (LDU,N) !> On entry U(1:NL, 1:NL) contains the left singular vectors of !> the upper block; U(NL+2:N, NL+2:N) contains the left singular !> vectors of the lower block. On exit U contains the left !> singular vectors of the bidiagonal matrix. !> |
| [in] | LDU | !> LDU is INTEGER !> The leading dimension of the array U. LDU >= max( 1, N ). !> |
| [in,out] | VT | !> VT is REAL array, dimension (LDVT,M) !> where M = N + SQRE. !> On entry VT(1:NL+1, 1:NL+1)**T contains the right singular !> vectors of the upper block; VT(NL+2:M, NL+2:M)**T contains !> the right singular vectors of the lower block. On exit !> VT**T contains the right singular vectors of the !> bidiagonal matrix. !> |
| [in] | LDVT | !> LDVT is INTEGER !> The leading dimension of the array VT. LDVT >= max( 1, M ). !> |
| [in,out] | IDXQ | !> IDXQ is INTEGER array, dimension (N) !> This contains the permutation which will reintegrate the !> subproblem just solved back into sorted order, i.e. !> D( IDXQ( I = 1, N ) ) will be in ascending order. !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (4*N) !> |
| [out] | WORK | !> WORK is REAL array, dimension (3*M**2+2*M) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 202 of file slasd1.f.
| subroutine slasd2 | ( | integer | nl, |
| integer | nr, | ||
| integer | sqre, | ||
| integer | k, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | z, | ||
| real | alpha, | ||
| real | beta, | ||
| real, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| real, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| real, dimension( * ) | dsigma, | ||
| real, dimension( ldu2, * ) | u2, | ||
| integer | ldu2, | ||
| real, dimension( ldvt2, * ) | vt2, | ||
| integer | ldvt2, | ||
| integer, dimension( * ) | idxp, | ||
| integer, dimension( * ) | idx, | ||
| integer, dimension( * ) | idxc, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | coltyp, | ||
| integer | info ) |
SLASD2 merges the two sets of singular values together into a single sorted set. Used by sbdsdc.
Download SLASD2 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASD2 merges the two sets of singular values together into a single !> sorted set. Then it tries to deflate the size of the problem. !> There are two ways in which deflation can occur: when two or more !> singular values are close together or if there is a tiny entry in the !> Z vector. For each such occurrence the order of the related secular !> equation problem is reduced by one. !> !> SLASD2 is called from SLASD1. !>
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [out] | K | !> K is INTEGER !> Contains the dimension of the non-deflated matrix, !> This is the order of the related secular equation. 1 <= K <=N. !> |
| [in,out] | D | !> D is REAL array, dimension (N) !> On entry D contains the singular values of the two submatrices !> to be combined. On exit D contains the trailing (N-K) updated !> singular values (those which were deflated) sorted into !> increasing order. !> |
| [out] | Z | !> Z is REAL array, dimension (N) !> On exit Z contains the updating row vector in the secular !> equation. !> |
| [in] | ALPHA | !> ALPHA is REAL !> Contains the diagonal element associated with the added row. !> |
| [in] | BETA | !> BETA is REAL !> Contains the off-diagonal element associated with the added !> row. !> |
| [in,out] | U | !> U is REAL array, dimension (LDU,N) !> On entry U contains the left singular vectors of two !> submatrices in the two square blocks with corners at (1,1), !> (NL, NL), and (NL+2, NL+2), (N,N). !> On exit U contains the trailing (N-K) updated left singular !> vectors (those which were deflated) in its last N-K columns. !> |
| [in] | LDU | !> LDU is INTEGER !> The leading dimension of the array U. LDU >= N. !> |
| [in,out] | VT | !> VT is REAL array, dimension (LDVT,M) !> On entry VT**T contains the right singular vectors of two !> submatrices in the two square blocks with corners at (1,1), !> (NL+1, NL+1), and (NL+2, NL+2), (M,M). !> On exit VT**T contains the trailing (N-K) updated right singular !> vectors (those which were deflated) in its last N-K columns. !> In case SQRE =1, the last row of VT spans the right null !> space. !> |
| [in] | LDVT | !> LDVT is INTEGER !> The leading dimension of the array VT. LDVT >= M. !> |
| [out] | DSIGMA | !> DSIGMA is REAL array, dimension (N) !> Contains a copy of the diagonal elements (K-1 singular values !> and one zero) in the secular equation. !> |
| [out] | U2 | !> U2 is REAL array, dimension (LDU2,N) !> Contains a copy of the first K-1 left singular vectors which !> will be used by SLASD3 in a matrix multiply (SGEMM) to solve !> for the new left singular vectors. U2 is arranged into four !> blocks. The first block contains a column with 1 at NL+1 and !> zero everywhere else; the second block contains non-zero !> entries only at and above NL; the third contains non-zero !> entries only below NL+1; and the fourth is dense. !> |
| [in] | LDU2 | !> LDU2 is INTEGER !> The leading dimension of the array U2. LDU2 >= N. !> |
| [out] | VT2 | !> VT2 is REAL array, dimension (LDVT2,N) !> VT2**T contains a copy of the first K right singular vectors !> which will be used by SLASD3 in a matrix multiply (SGEMM) to !> solve for the new right singular vectors. VT2 is arranged into !> three blocks. The first block contains a row that corresponds !> to the special 0 diagonal element in SIGMA; the second block !> contains non-zeros only at and before NL +1; the third block !> contains non-zeros only at and after NL +2. !> |
| [in] | LDVT2 | !> LDVT2 is INTEGER !> The leading dimension of the array VT2. LDVT2 >= M. !> |
| [out] | IDXP | !> IDXP is INTEGER array, dimension (N) !> This will contain the permutation used to place deflated !> values of D at the end of the array. On output IDXP(2:K) !> points to the nondeflated D-values and IDXP(K+1:N) !> points to the deflated singular values. !> |
| [out] | IDX | !> IDX is INTEGER array, dimension (N) !> This will contain the permutation used to sort the contents of !> D into ascending order. !> |
| [out] | IDXC | !> IDXC is INTEGER array, dimension (N) !> This will contain the permutation used to arrange the columns !> of the deflated U matrix into three groups: the first group !> contains non-zero entries only at and above NL, the second !> contains non-zero entries only below NL+2, and the third is !> dense. !> |
| [in,out] | IDXQ | !> IDXQ is INTEGER array, dimension (N) !> This contains the permutation which separately sorts the two !> sub-problems in D into ascending order. Note that entries in !> the first hlaf of this permutation must first be moved one !> position backward; and entries in the second half !> must first have NL+1 added to their values. !> |
| [out] | COLTYP | !> COLTYP is INTEGER array, dimension (N) !> As workspace, this will contain a label which will indicate !> which of the following types a column in the U2 matrix or a !> row in the VT2 matrix is: !> 1 : non-zero in the upper half only !> 2 : non-zero in the lower half only !> 3 : dense !> 4 : deflated !> !> On exit, it is an array of dimension 4, with COLTYP(I) being !> the dimension of the I-th type columns. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> |
Definition at line 266 of file slasd2.f.
| subroutine slasd3 | ( | integer | nl, |
| integer | nr, | ||
| integer | sqre, | ||
| integer | k, | ||
| real, dimension( * ) | d, | ||
| real, dimension( ldq, * ) | q, | ||
| integer | ldq, | ||
| real, dimension( * ) | dsigma, | ||
| real, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| real, dimension( ldu2, * ) | u2, | ||
| integer | ldu2, | ||
| real, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| real, dimension( ldvt2, * ) | vt2, | ||
| integer | ldvt2, | ||
| integer, dimension( * ) | idxc, | ||
| integer, dimension( * ) | ctot, | ||
| real, dimension( * ) | z, | ||
| integer | info ) |
SLASD3 finds all square roots of the roots of the secular equation, as defined by the values in D and Z, and then updates the singular vectors by matrix multiplication. Used by sbdsdc.
Download SLASD3 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASD3 finds all the square roots of the roots of the secular !> equation, as defined by the values in D and Z. It makes the !> appropriate calls to SLASD4 and then updates the singular !> vectors by matrix multiplication. !> !> This code makes very mild assumptions about floating point !> arithmetic. It will work on machines with a guard digit in !> add/subtract, or on those binary machines without guard digits !> which subtract like the Cray XMP, Cray YMP, Cray C 90, or Cray 2. !> It could conceivably fail on hexadecimal or decimal machines !> without guard digits, but we know of none. !> !> SLASD3 is called from SLASD1. !>
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [in] | K | !> K is INTEGER !> The size of the secular equation, 1 =< K = < N. !> |
| [out] | D | !> D is REAL array, dimension(K) !> On exit the square roots of the roots of the secular equation, !> in ascending order. !> |
| [out] | Q | !> Q is REAL array, dimension (LDQ,K) !> |
| [in] | LDQ | !> LDQ is INTEGER !> The leading dimension of the array Q. LDQ >= K. !> |
| [in,out] | DSIGMA | !> DSIGMA is REAL array, dimension(K) !> The first K elements of this array contain the old roots !> of the deflated updating problem. These are the poles !> of the secular equation. !> |
| [out] | U | !> U is REAL array, dimension (LDU, N) !> The last N - K columns of this matrix contain the deflated !> left singular vectors. !> |
| [in] | LDU | !> LDU is INTEGER !> The leading dimension of the array U. LDU >= N. !> |
| [in] | U2 | !> U2 is REAL array, dimension (LDU2, N) !> The first K columns of this matrix contain the non-deflated !> left singular vectors for the split problem. !> |
| [in] | LDU2 | !> LDU2 is INTEGER !> The leading dimension of the array U2. LDU2 >= N. !> |
| [out] | VT | !> VT is REAL array, dimension (LDVT, M) !> The last M - K columns of VT**T contain the deflated !> right singular vectors. !> |
| [in] | LDVT | !> LDVT is INTEGER !> The leading dimension of the array VT. LDVT >= N. !> |
| [in,out] | VT2 | !> VT2 is REAL array, dimension (LDVT2, N) !> The first K columns of VT2**T contain the non-deflated !> right singular vectors for the split problem. !> |
| [in] | LDVT2 | !> LDVT2 is INTEGER !> The leading dimension of the array VT2. LDVT2 >= N. !> |
| [in] | IDXC | !> IDXC is INTEGER array, dimension (N) !> The permutation used to arrange the columns of U (and rows of !> VT) into three groups: the first group contains non-zero !> entries only at and above (or before) NL +1; the second !> contains non-zero entries only at and below (or after) NL+2; !> and the third is dense. The first column of U and the row of !> VT are treated separately, however. !> !> The rows of the singular vectors found by SLASD4 !> must be likewise permuted before the matrix multiplies can !> take place. !> |
| [in] | CTOT | !> CTOT is INTEGER array, dimension (4) !> A count of the total number of the various types of columns !> in U (or rows in VT), as described in IDXC. The fourth column !> type is any column which has been deflated. !> |
| [in,out] | Z | !> Z is REAL array, dimension (K) !> The first K elements of this array contain the components !> of the deflation-adjusted updating row vector. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 221 of file slasd3.f.
| subroutine slasd4 | ( | integer | n, |
| integer | i, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | z, | ||
| real, dimension( * ) | delta, | ||
| real | rho, | ||
| real | sigma, | ||
| real, dimension( * ) | work, | ||
| integer | info ) |
SLASD4 computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by sbdsdc.
Download SLASD4 + dependencies [TGZ] [ZIP] [TXT]
!> !> This subroutine computes the square root of the I-th updated !> eigenvalue of a positive symmetric rank-one modification to !> a positive diagonal matrix whose entries are given as the squares !> of the corresponding entries in the array d, and that !> !> 0 <= D(i) < D(j) for i < j !> !> and that RHO > 0. This is arranged by the calling routine, and is !> no loss in generality. The rank-one modified system is thus !> !> diag( D ) * diag( D ) + RHO * Z * Z_transpose. !> !> where we assume the Euclidean norm of Z is 1. !> !> The method consists of approximating the rational functions in the !> secular equation by simpler interpolating rational functions. !>
| [in] | N | !> N is INTEGER !> The length of all arrays. !> |
| [in] | I | !> I is INTEGER !> The index of the eigenvalue to be computed. 1 <= I <= N. !> |
| [in] | D | !> D is REAL array, dimension ( N ) !> The original eigenvalues. It is assumed that they are in !> order, 0 <= D(I) < D(J) for I < J. !> |
| [in] | Z | !> Z is REAL array, dimension ( N ) !> The components of the updating vector. !> |
| [out] | DELTA | !> DELTA is REAL array, dimension ( N ) !> If N .ne. 1, DELTA contains (D(j) - sigma_I) in its j-th !> component. If N = 1, then DELTA(1) = 1. The vector DELTA !> contains the information necessary to construct the !> (singular) eigenvectors. !> |
| [in] | RHO | !> RHO is REAL !> The scalar in the symmetric updating formula. !> |
| [out] | SIGMA | !> SIGMA is REAL !> The computed sigma_I, the I-th updated eigenvalue. !> |
| [out] | WORK | !> WORK is REAL array, dimension ( N ) !> If N .ne. 1, WORK contains (D(j) + sigma_I) in its j-th !> component. If N = 1, then WORK( 1 ) = 1. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit !> > 0: if INFO = 1, the updating process failed. !> |
!> Logical variable ORGATI (origin-at-i?) is used for distinguishing !> whether D(i) or D(i+1) is treated as the origin. !> !> ORGATI = .true. origin at i !> ORGATI = .false. origin at i+1 !> !> Logical variable SWTCH3 (switch-for-3-poles?) is for noting !> if we are working with THREE poles! !> !> MAXIT is the maximum number of iterations allowed for each !> eigenvalue. !>
Definition at line 152 of file slasd4.f.
| subroutine slasd5 | ( | integer | i, |
| real, dimension( 2 ) | d, | ||
| real, dimension( 2 ) | z, | ||
| real, dimension( 2 ) | delta, | ||
| real | rho, | ||
| real | dsigma, | ||
| real, dimension( 2 ) | work ) |
SLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification of a 2-by-2 diagonal matrix. Used by sbdsdc.
Download SLASD5 + dependencies [TGZ] [ZIP] [TXT]
!> !> This subroutine computes the square root of the I-th eigenvalue !> of a positive symmetric rank-one modification of a 2-by-2 diagonal !> matrix !> !> diag( D ) * diag( D ) + RHO * Z * transpose(Z) . !> !> The diagonal entries in the array D are assumed to satisfy !> !> 0 <= D(i) < D(j) for i < j . !> !> We also assume RHO > 0 and that the Euclidean norm of the vector !> Z is one. !>
| [in] | I | !> I is INTEGER !> The index of the eigenvalue to be computed. I = 1 or I = 2. !> |
| [in] | D | !> D is REAL array, dimension (2) !> The original eigenvalues. We assume 0 <= D(1) < D(2). !> |
| [in] | Z | !> Z is REAL array, dimension (2) !> The components of the updating vector. !> |
| [out] | DELTA | !> DELTA is REAL array, dimension (2) !> Contains (D(j) - sigma_I) in its j-th component. !> The vector DELTA contains the information necessary !> to construct the eigenvectors. !> |
| [in] | RHO | !> RHO is REAL !> The scalar in the symmetric updating formula. !> |
| [out] | DSIGMA | !> DSIGMA is REAL !> The computed sigma_I, the I-th updated eigenvalue. !> |
| [out] | WORK | !> WORK is REAL array, dimension (2) !> WORK contains (D(j) + sigma_I) in its j-th component. !> |
Definition at line 115 of file slasd5.f.
| subroutine slasd6 | ( | integer | icompq, |
| integer | nl, | ||
| integer | nr, | ||
| integer | sqre, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | vf, | ||
| real, dimension( * ) | vl, | ||
| real | alpha, | ||
| real | beta, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | perm, | ||
| integer | givptr, | ||
| integer, dimension( ldgcol, * ) | givcol, | ||
| integer | ldgcol, | ||
| real, dimension( ldgnum, * ) | givnum, | ||
| integer | ldgnum, | ||
| real, dimension( ldgnum, * ) | poles, | ||
| real, dimension( * ) | difl, | ||
| real, dimension( * ) | difr, | ||
| real, dimension( * ) | z, | ||
| integer | k, | ||
| real | c, | ||
| real | s, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
SLASD6 computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used by sbdsdc.
Download SLASD6 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASD6 computes the SVD of an updated upper bidiagonal matrix B !> obtained by merging two smaller ones by appending a row. This !> routine is used only for the problem which requires all singular !> values and optionally singular vector matrices in factored form. !> B is an N-by-M matrix with N = NL + NR + 1 and M = N + SQRE. !> A related subroutine, SLASD1, handles the case in which all singular !> values and singular vectors of the bidiagonal matrix are desired. !> !> SLASD6 computes the SVD as follows: !> !> ( D1(in) 0 0 0 ) !> B = U(in) * ( Z1**T a Z2**T b ) * VT(in) !> ( 0 0 D2(in) 0 ) !> !> = U(out) * ( D(out) 0) * VT(out) !> !> where Z**T = (Z1**T a Z2**T b) = u**T VT**T, and u is a vector of dimension M !> with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros !> elsewhere; and the entry b is empty if SQRE = 0. !> !> The singular values of B can be computed using D1, D2, the first !> components of all the right singular vectors of the lower block, and !> the last components of all the right singular vectors of the upper !> block. These components are stored and updated in VF and VL, !> respectively, in SLASD6. Hence U and VT are not explicitly !> referenced. !> !> The singular values are stored in D. The algorithm consists of two !> stages: !> !> The first stage consists of deflating the size of the problem !> when there are multiple singular values or if there is a zero !> in the Z vector. For each such occurrence the dimension of the !> secular equation problem is reduced by one. This stage is !> performed by the routine SLASD7. !> !> The second stage consists of calculating the updated !> singular values. This is done by finding the roots of the !> secular equation via the routine SLASD4 (as called by SLASD8). !> This routine also updates VF and VL and computes the distances !> between the updated singular values and the old singular !> values. !> !> SLASD6 is called from SLASDA. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed in !> factored form: !> = 0: Compute singular values only. !> = 1: Compute singular vectors in factored form as well. !> |
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has row dimension N = NL + NR + 1, !> and column dimension M = N + SQRE. !> |
| [in,out] | D | !> D is REAL array, dimension (NL+NR+1). !> On entry D(1:NL,1:NL) contains the singular values of the !> upper block, and D(NL+2:N) contains the singular values !> of the lower block. On exit D(1:N) contains the singular !> values of the modified matrix. !> |
| [in,out] | VF | !> VF is REAL array, dimension (M) !> On entry, VF(1:NL+1) contains the first components of all !> right singular vectors of the upper block; and VF(NL+2:M) !> contains the first components of all right singular vectors !> of the lower block. On exit, VF contains the first components !> of all right singular vectors of the bidiagonal matrix. !> |
| [in,out] | VL | !> VL is REAL array, dimension (M) !> On entry, VL(1:NL+1) contains the last components of all !> right singular vectors of the upper block; and VL(NL+2:M) !> contains the last components of all right singular vectors of !> the lower block. On exit, VL contains the last components of !> all right singular vectors of the bidiagonal matrix. !> |
| [in,out] | ALPHA | !> ALPHA is REAL !> Contains the diagonal element associated with the added row. !> |
| [in,out] | BETA | !> BETA is REAL !> Contains the off-diagonal element associated with the added !> row. !> |
| [in,out] | IDXQ | !> IDXQ is INTEGER array, dimension (N) !> This contains the permutation which will reintegrate the !> subproblem just solved back into sorted order, i.e. !> D( IDXQ( I = 1, N ) ) will be in ascending order. !> |
| [out] | PERM | !> PERM is INTEGER array, dimension ( N ) !> The permutations (from deflation and sorting) to be applied !> to each block. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVPTR | !> GIVPTR is INTEGER !> The number of Givens rotations which took place in this !> subproblem. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVCOL | !> GIVCOL is INTEGER array, dimension ( LDGCOL, 2 ) !> Each pair of numbers indicates a pair of columns to take place !> in a Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGCOL | !> LDGCOL is INTEGER !> leading dimension of GIVCOL, must be at least N. !> |
| [out] | GIVNUM | !> GIVNUM is REAL array, dimension ( LDGNUM, 2 ) !> Each number indicates the C or S value to be used in the !> corresponding Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGNUM | !> LDGNUM is INTEGER !> The leading dimension of GIVNUM and POLES, must be at least N. !> |
| [out] | POLES | !> POLES is REAL array, dimension ( LDGNUM, 2 ) !> On exit, POLES(1,*) is an array containing the new singular !> values obtained from solving the secular equation, and !> POLES(2,*) is an array containing the poles in the secular !> equation. Not referenced if ICOMPQ = 0. !> |
| [out] | DIFL | !> DIFL is REAL array, dimension ( N ) !> On exit, DIFL(I) is the distance between I-th updated !> (undeflated) singular value and the I-th (undeflated) old !> singular value. !> |
| [out] | DIFR | !> DIFR is REAL array, !> dimension ( LDDIFR, 2 ) if ICOMPQ = 1 and !> dimension ( K ) if ICOMPQ = 0. !> On exit, DIFR(I,1) = D(I) - DSIGMA(I+1), DIFR(K,1) is not !> defined and will not be referenced. !> !> If ICOMPQ = 1, DIFR(1:K,2) is an array containing the !> normalizing factors for the right singular vector matrix. !> !> See SLASD8 for details on DIFL and DIFR. !> |
| [out] | Z | !> Z is REAL array, dimension ( M ) !> The first elements of this array contain the components !> of the deflation-adjusted updating row vector. !> |
| [out] | K | !> K is INTEGER !> Contains the dimension of the non-deflated matrix, !> This is the order of the related secular equation. 1 <= K <=N. !> |
| [out] | C | !> C is REAL !> C contains garbage if SQRE =0 and the C-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | S | !> S is REAL !> S contains garbage if SQRE =0 and the S-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | WORK | !> WORK is REAL array, dimension ( 4 * M ) !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension ( 3 * N ) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 309 of file slasd6.f.
| subroutine slasd7 | ( | integer | icompq, |
| integer | nl, | ||
| integer | nr, | ||
| integer | sqre, | ||
| integer | k, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | z, | ||
| real, dimension( * ) | zw, | ||
| real, dimension( * ) | vf, | ||
| real, dimension( * ) | vfw, | ||
| real, dimension( * ) | vl, | ||
| real, dimension( * ) | vlw, | ||
| real | alpha, | ||
| real | beta, | ||
| real, dimension( * ) | dsigma, | ||
| integer, dimension( * ) | idx, | ||
| integer, dimension( * ) | idxp, | ||
| integer, dimension( * ) | idxq, | ||
| integer, dimension( * ) | perm, | ||
| integer | givptr, | ||
| integer, dimension( ldgcol, * ) | givcol, | ||
| integer | ldgcol, | ||
| real, dimension( ldgnum, * ) | givnum, | ||
| integer | ldgnum, | ||
| real | c, | ||
| real | s, | ||
| integer | info ) |
SLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to deflate the size of the problem. Used by sbdsdc.
Download SLASD7 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASD7 merges the two sets of singular values together into a single !> sorted set. Then it tries to deflate the size of the problem. There !> are two ways in which deflation can occur: when two or more singular !> values are close together or if there is a tiny entry in the Z !> vector. For each such occurrence the order of the related !> secular equation problem is reduced by one. !> !> SLASD7 is called from SLASD6. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed !> in compact form, as follows: !> = 0: Compute singular values only. !> = 1: Compute singular vectors of upper !> bidiagonal matrix in compact form. !> |
| [in] | NL | !> NL is INTEGER !> The row dimension of the upper block. NL >= 1. !> |
| [in] | NR | !> NR is INTEGER !> The row dimension of the lower block. NR >= 1. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: the lower block is an NR-by-NR square matrix. !> = 1: the lower block is an NR-by-(NR+1) rectangular matrix. !> !> The bidiagonal matrix has !> N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [out] | K | !> K is INTEGER !> Contains the dimension of the non-deflated matrix, this is !> the order of the related secular equation. 1 <= K <=N. !> |
| [in,out] | D | !> D is REAL array, dimension ( N ) !> On entry D contains the singular values of the two submatrices !> to be combined. On exit D contains the trailing (N-K) updated !> singular values (those which were deflated) sorted into !> increasing order. !> |
| [out] | Z | !> Z is REAL array, dimension ( M ) !> On exit Z contains the updating row vector in the secular !> equation. !> |
| [out] | ZW | !> ZW is REAL array, dimension ( M ) !> Workspace for Z. !> |
| [in,out] | VF | !> VF is REAL array, dimension ( M ) !> On entry, VF(1:NL+1) contains the first components of all !> right singular vectors of the upper block; and VF(NL+2:M) !> contains the first components of all right singular vectors !> of the lower block. On exit, VF contains the first components !> of all right singular vectors of the bidiagonal matrix. !> |
| [out] | VFW | !> VFW is REAL array, dimension ( M ) !> Workspace for VF. !> |
| [in,out] | VL | !> VL is REAL array, dimension ( M ) !> On entry, VL(1:NL+1) contains the last components of all !> right singular vectors of the upper block; and VL(NL+2:M) !> contains the last components of all right singular vectors !> of the lower block. On exit, VL contains the last components !> of all right singular vectors of the bidiagonal matrix. !> |
| [out] | VLW | !> VLW is REAL array, dimension ( M ) !> Workspace for VL. !> |
| [in] | ALPHA | !> ALPHA is REAL !> Contains the diagonal element associated with the added row. !> |
| [in] | BETA | !> BETA is REAL !> Contains the off-diagonal element associated with the added !> row. !> |
| [out] | DSIGMA | !> DSIGMA is REAL array, dimension ( N ) !> Contains a copy of the diagonal elements (K-1 singular values !> and one zero) in the secular equation. !> |
| [out] | IDX | !> IDX is INTEGER array, dimension ( N ) !> This will contain the permutation used to sort the contents of !> D into ascending order. !> |
| [out] | IDXP | !> IDXP is INTEGER array, dimension ( N ) !> This will contain the permutation used to place deflated !> values of D at the end of the array. On output IDXP(2:K) !> points to the nondeflated D-values and IDXP(K+1:N) !> points to the deflated singular values. !> |
| [in] | IDXQ | !> IDXQ is INTEGER array, dimension ( N ) !> This contains the permutation which separately sorts the two !> sub-problems in D into ascending order. Note that entries in !> the first half of this permutation must first be moved one !> position backward; and entries in the second half !> must first have NL+1 added to their values. !> |
| [out] | PERM | !> PERM is INTEGER array, dimension ( N ) !> The permutations (from deflation and sorting) to be applied !> to each singular block. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVPTR | !> GIVPTR is INTEGER !> The number of Givens rotations which took place in this !> subproblem. Not referenced if ICOMPQ = 0. !> |
| [out] | GIVCOL | !> GIVCOL is INTEGER array, dimension ( LDGCOL, 2 ) !> Each pair of numbers indicates a pair of columns to take place !> in a Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGCOL | !> LDGCOL is INTEGER !> The leading dimension of GIVCOL, must be at least N. !> |
| [out] | GIVNUM | !> GIVNUM is REAL array, dimension ( LDGNUM, 2 ) !> Each number indicates the C or S value to be used in the !> corresponding Givens rotation. Not referenced if ICOMPQ = 0. !> |
| [in] | LDGNUM | !> LDGNUM is INTEGER !> The leading dimension of GIVNUM, must be at least N. !> |
| [out] | C | !> C is REAL !> C contains garbage if SQRE =0 and the C-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | S | !> S is REAL !> S contains garbage if SQRE =0 and the S-value of a Givens !> rotation related to the right null space if SQRE = 1. !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> |
Definition at line 276 of file slasd7.f.
| subroutine slasd8 | ( | integer | icompq, |
| integer | k, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | z, | ||
| real, dimension( * ) | vf, | ||
| real, dimension( * ) | vl, | ||
| real, dimension( * ) | difl, | ||
| real, dimension( lddifr, * ) | difr, | ||
| integer | lddifr, | ||
| real, dimension( * ) | dsigma, | ||
| real, dimension( * ) | work, | ||
| integer | info ) |
SLASD8 finds the square roots of the roots of the secular equation, and stores, for each element in D, the distance to its two nearest poles. Used by sbdsdc.
Download SLASD8 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASD8 finds the square roots of the roots of the secular equation, !> as defined by the values in DSIGMA and Z. It makes the appropriate !> calls to SLASD4, and stores, for each element in D, the distance !> to its two nearest poles (elements in DSIGMA). It also updates !> the arrays VF and VL, the first and last components of all the !> right singular vectors of the original bidiagonal matrix. !> !> SLASD8 is called from SLASD6. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed in !> factored form in the calling routine: !> = 0: Compute singular values only. !> = 1: Compute singular vectors in factored form as well. !> |
| [in] | K | !> K is INTEGER !> The number of terms in the rational function to be solved !> by SLASD4. K >= 1. !> |
| [out] | D | !> D is REAL array, dimension ( K ) !> On output, D contains the updated singular values. !> |
| [in,out] | Z | !> Z is REAL array, dimension ( K ) !> On entry, the first K elements of this array contain the !> components of the deflation-adjusted updating row vector. !> On exit, Z is updated. !> |
| [in,out] | VF | !> VF is REAL array, dimension ( K ) !> On entry, VF contains information passed through DBEDE8. !> On exit, VF contains the first K components of the first !> components of all right singular vectors of the bidiagonal !> matrix. !> |
| [in,out] | VL | !> VL is REAL array, dimension ( K ) !> On entry, VL contains information passed through DBEDE8. !> On exit, VL contains the first K components of the last !> components of all right singular vectors of the bidiagonal !> matrix. !> |
| [out] | DIFL | !> DIFL is REAL array, dimension ( K ) !> On exit, DIFL(I) = D(I) - DSIGMA(I). !> |
| [out] | DIFR | !> DIFR is REAL array, !> dimension ( LDDIFR, 2 ) if ICOMPQ = 1 and !> dimension ( K ) if ICOMPQ = 0. !> On exit, DIFR(I,1) = D(I) - DSIGMA(I+1), DIFR(K,1) is not !> defined and will not be referenced. !> !> If ICOMPQ = 1, DIFR(1:K,2) is an array containing the !> normalizing factors for the right singular vector matrix. !> |
| [in] | LDDIFR | !> LDDIFR is INTEGER !> The leading dimension of DIFR, must be at least K. !> |
| [in,out] | DSIGMA | !> DSIGMA is REAL array, dimension ( K ) !> On entry, the first K elements of this array contain the old !> roots of the deflated updating problem. These are the poles !> of the secular equation. !> On exit, the elements of DSIGMA may be very slightly altered !> in value. !> |
| [out] | WORK | !> WORK is REAL array, dimension (3*K) !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 164 of file slasd8.f.
| subroutine slasda | ( | integer | icompq, |
| integer | smlsiz, | ||
| integer | n, | ||
| integer | sqre, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| real, dimension( ldu, * ) | vt, | ||
| integer, dimension( * ) | k, | ||
| real, dimension( ldu, * ) | difl, | ||
| real, dimension( ldu, * ) | difr, | ||
| real, dimension( ldu, * ) | z, | ||
| real, dimension( ldu, * ) | poles, | ||
| integer, dimension( * ) | givptr, | ||
| integer, dimension( ldgcol, * ) | givcol, | ||
| integer | ldgcol, | ||
| integer, dimension( ldgcol, * ) | perm, | ||
| real, dimension( ldu, * ) | givnum, | ||
| real, dimension( * ) | c, | ||
| real, dimension( * ) | s, | ||
| real, dimension( * ) | work, | ||
| integer, dimension( * ) | iwork, | ||
| integer | info ) |
SLASDA computes the singular value decomposition (SVD) of a real upper bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc.
Download SLASDA + dependencies [TGZ] [ZIP] [TXT]
!> !> Using a divide and conquer approach, SLASDA computes the singular !> value decomposition (SVD) of a real upper bidiagonal N-by-M matrix !> B with diagonal D and offdiagonal E, where M = N + SQRE. The !> algorithm computes the singular values in the SVD B = U * S * VT. !> The orthogonal matrices U and VT are optionally computed in !> compact form. !> !> A related subroutine, SLASD0, computes the singular values and !> the singular vectors in explicit form. !>
| [in] | ICOMPQ | !> ICOMPQ is INTEGER !> Specifies whether singular vectors are to be computed !> in compact form, as follows !> = 0: Compute singular values only. !> = 1: Compute singular vectors of upper bidiagonal !> matrix in compact form. !> |
| [in] | SMLSIZ | !> SMLSIZ is INTEGER !> The maximum size of the subproblems at the bottom of the !> computation tree. !> |
| [in] | N | !> N is INTEGER !> The row dimension of the upper bidiagonal matrix. This is !> also the dimension of the main diagonal array D. !> |
| [in] | SQRE | !> SQRE is INTEGER !> Specifies the column dimension of the bidiagonal matrix. !> = 0: The bidiagonal matrix has column dimension M = N; !> = 1: The bidiagonal matrix has column dimension M = N + 1. !> |
| [in,out] | D | !> D is REAL array, dimension ( N ) !> On entry D contains the main diagonal of the bidiagonal !> matrix. On exit D, if INFO = 0, contains its singular values. !> |
| [in] | E | !> E is REAL array, dimension ( M-1 ) !> Contains the subdiagonal entries of the bidiagonal matrix. !> On exit, E has been destroyed. !> |
| [out] | U | !> U is REAL array, !> dimension ( LDU, SMLSIZ ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, U contains the left !> singular vector matrices of all subproblems at the bottom !> level. !> |
| [in] | LDU | !> LDU is INTEGER, LDU = > N. !> The leading dimension of arrays U, VT, DIFL, DIFR, POLES, !> GIVNUM, and Z. !> |
| [out] | VT | !> VT is REAL array, !> dimension ( LDU, SMLSIZ+1 ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, VT**T contains the right !> singular vector matrices of all subproblems at the bottom !> level. !> |
| [out] | K | !> K is INTEGER array, dimension ( N ) !> if ICOMPQ = 1 and dimension 1 if ICOMPQ = 0. !> If ICOMPQ = 1, on exit, K(I) is the dimension of the I-th !> secular equation on the computation tree. !> |
| [out] | DIFL | !> DIFL is REAL array, dimension ( LDU, NLVL ), !> where NLVL = floor(log_2 (N/SMLSIZ))). !> |
| [out] | DIFR | !> DIFR is REAL array, !> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1 and !> dimension ( N ) if ICOMPQ = 0. !> If ICOMPQ = 1, on exit, DIFL(1:N, I) and DIFR(1:N, 2 * I - 1) !> record distances between singular values on the I-th !> level and singular values on the (I -1)-th level, and !> DIFR(1:N, 2 * I ) contains the normalizing factors for !> the right singular vector matrix. See SLASD8 for details. !> |
| [out] | Z | !> Z is REAL array, !> dimension ( LDU, NLVL ) if ICOMPQ = 1 and !> dimension ( N ) if ICOMPQ = 0. !> The first K elements of Z(1, I) contain the components of !> the deflation-adjusted updating row vector for subproblems !> on the I-th level. !> |
| [out] | POLES | !> POLES is REAL array, !> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, POLES(1, 2*I - 1) and !> POLES(1, 2*I) contain the new and old singular values !> involved in the secular equations on the I-th level. !> |
| [out] | GIVPTR | !> GIVPTR is INTEGER array, !> dimension ( N ) if ICOMPQ = 1, and not referenced if !> ICOMPQ = 0. If ICOMPQ = 1, on exit, GIVPTR( I ) records !> the number of Givens rotations performed on the I-th !> problem on the computation tree. !> |
| [out] | GIVCOL | !> GIVCOL is INTEGER array, !> dimension ( LDGCOL, 2 * NLVL ) if ICOMPQ = 1, and not !> referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I, !> GIVCOL(1, 2 *I - 1) and GIVCOL(1, 2 *I) record the locations !> of Givens rotations performed on the I-th level on the !> computation tree. !> |
| [in] | LDGCOL | !> LDGCOL is INTEGER, LDGCOL = > N. !> The leading dimension of arrays GIVCOL and PERM. !> |
| [out] | PERM | !> PERM is INTEGER array, dimension ( LDGCOL, NLVL ) !> if ICOMPQ = 1, and not referenced !> if ICOMPQ = 0. If ICOMPQ = 1, on exit, PERM(1, I) records !> permutations done on the I-th level of the computation tree. !> |
| [out] | GIVNUM | !> GIVNUM is REAL array, !> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not !> referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I, !> GIVNUM(1, 2 *I - 1) and GIVNUM(1, 2 *I) record the C- and S- !> values of Givens rotations performed on the I-th level on !> the computation tree. !> |
| [out] | C | !> C is REAL array, !> dimension ( N ) if ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. !> If ICOMPQ = 1 and the I-th subproblem is not square, on exit, !> C( I ) contains the C-value of a Givens rotation related to !> the right null space of the I-th subproblem. !> |
| [out] | S | !> S is REAL array, dimension ( N ) if !> ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. If ICOMPQ = 1 !> and the I-th subproblem is not square, on exit, S( I ) !> contains the S-value of a Givens rotation related to !> the right null space of the I-th subproblem. !> |
| [out] | WORK | !> WORK is REAL array, dimension !> (6 * N + (SMLSIZ + 1)*(SMLSIZ + 1)). !> |
| [out] | IWORK | !> IWORK is INTEGER array, dimension (7*N). !> |
| [out] | INFO | !> INFO is INTEGER !> = 0: successful exit. !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = 1, a singular value did not converge !> |
Definition at line 270 of file slasda.f.
| subroutine slasdq | ( | character | uplo, |
| integer | sqre, | ||
| integer | n, | ||
| integer | ncvt, | ||
| integer | nru, | ||
| integer | ncc, | ||
| real, dimension( * ) | d, | ||
| real, dimension( * ) | e, | ||
| real, dimension( ldvt, * ) | vt, | ||
| integer | ldvt, | ||
| real, dimension( ldu, * ) | u, | ||
| integer | ldu, | ||
| real, dimension( ldc, * ) | c, | ||
| integer | ldc, | ||
| real, dimension( * ) | work, | ||
| integer | info ) |
SLASDQ computes the SVD of a real bidiagonal matrix with diagonal d and off-diagonal e. Used by sbdsdc.
Download SLASDQ + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASDQ computes the singular value decomposition (SVD) of a real !> (upper or lower) bidiagonal matrix with diagonal D and offdiagonal !> E, accumulating the transformations if desired. Letting B denote !> the input bidiagonal matrix, the algorithm computes orthogonal !> matrices Q and P such that B = Q * S * P**T (P**T denotes the transpose !> of P). The singular values S are overwritten on D. !> !> The input matrix U is changed to U * Q if desired. !> The input matrix VT is changed to P**T * VT if desired. !> The input matrix C is changed to Q**T * C if desired. !> !> See by J. Demmel and W. Kahan, !> LAPACK Working Note #3, for a detailed description of the algorithm. !>
| [in] | UPLO | !> UPLO is CHARACTER*1 !> On entry, UPLO specifies whether the input bidiagonal matrix !> is upper or lower bidiagonal, and whether it is square are !> not. !> UPLO = 'U' or 'u' B is upper bidiagonal. !> UPLO = 'L' or 'l' B is lower bidiagonal. !> |
| [in] | SQRE | !> SQRE is INTEGER !> = 0: then the input matrix is N-by-N. !> = 1: then the input matrix is N-by-(N+1) if UPLU = 'U' and !> (N+1)-by-N if UPLU = 'L'. !> !> The bidiagonal matrix has !> N = NL + NR + 1 rows and !> M = N + SQRE >= N columns. !> |
| [in] | N | !> N is INTEGER !> On entry, N specifies the number of rows and columns !> in the matrix. N must be at least 0. !> |
| [in] | NCVT | !> NCVT is INTEGER !> On entry, NCVT specifies the number of columns of !> the matrix VT. NCVT must be at least 0. !> |
| [in] | NRU | !> NRU is INTEGER !> On entry, NRU specifies the number of rows of !> the matrix U. NRU must be at least 0. !> |
| [in] | NCC | !> NCC is INTEGER !> On entry, NCC specifies the number of columns of !> the matrix C. NCC must be at least 0. !> |
| [in,out] | D | !> D is REAL array, dimension (N) !> On entry, D contains the diagonal entries of the !> bidiagonal matrix whose SVD is desired. On normal exit, !> D contains the singular values in ascending order. !> |
| [in,out] | E | !> E is REAL array. !> dimension is (N-1) if SQRE = 0 and N if SQRE = 1. !> On entry, the entries of E contain the offdiagonal entries !> of the bidiagonal matrix whose SVD is desired. On normal !> exit, E will contain 0. If the algorithm does not converge, !> D and E will contain the diagonal and superdiagonal entries !> of a bidiagonal matrix orthogonally equivalent to the one !> given as input. !> |
| [in,out] | VT | !> VT is REAL array, dimension (LDVT, NCVT) !> On entry, contains a matrix which on exit has been !> premultiplied by P**T, dimension N-by-NCVT if SQRE = 0 !> and (N+1)-by-NCVT if SQRE = 1 (not referenced if NCVT=0). !> |
| [in] | LDVT | !> LDVT is INTEGER !> On entry, LDVT specifies the leading dimension of VT as !> declared in the calling (sub) program. LDVT must be at !> least 1. If NCVT is nonzero LDVT must also be at least N. !> |
| [in,out] | U | !> U is REAL array, dimension (LDU, N) !> On entry, contains a matrix which on exit has been !> postmultiplied by Q, dimension NRU-by-N if SQRE = 0 !> and NRU-by-(N+1) if SQRE = 1 (not referenced if NRU=0). !> |
| [in] | LDU | !> LDU is INTEGER !> On entry, LDU specifies the leading dimension of U as !> declared in the calling (sub) program. LDU must be at !> least max( 1, NRU ) . !> |
| [in,out] | C | !> C is REAL array, dimension (LDC, NCC) !> On entry, contains an N-by-NCC matrix which on exit !> has been premultiplied by Q**T dimension N-by-NCC if SQRE = 0 !> and (N+1)-by-NCC if SQRE = 1 (not referenced if NCC=0). !> |
| [in] | LDC | !> LDC is INTEGER !> On entry, LDC specifies the leading dimension of C as !> declared in the calling (sub) program. LDC must be at !> least 1. If NCC is nonzero, LDC must also be at least N. !> |
| [out] | WORK | !> WORK is REAL array, dimension (4*N) !> Workspace. Only referenced if one of NCVT, NRU, or NCC is !> nonzero, and if N is at least 2. !> |
| [out] | INFO | !> INFO is INTEGER !> On exit, a value of 0 indicates a successful exit. !> If INFO < 0, argument number -INFO is illegal. !> If INFO > 0, the algorithm did not converge, and INFO !> specifies how many superdiagonals did not converge. !> |
Definition at line 209 of file slasdq.f.
| subroutine slasdt | ( | integer | n, |
| integer | lvl, | ||
| integer | nd, | ||
| integer, dimension( * ) | inode, | ||
| integer, dimension( * ) | ndiml, | ||
| integer, dimension( * ) | ndimr, | ||
| integer | msub ) |
SLASDT creates a tree of subproblems for bidiagonal divide and conquer. Used by sbdsdc.
Download SLASDT + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASDT creates a tree of subproblems for bidiagonal divide and !> conquer. !>
| [in] | N | !> N is INTEGER !> On entry, the number of diagonal elements of the !> bidiagonal matrix. !> |
| [out] | LVL | !> LVL is INTEGER !> On exit, the number of levels on the computation tree. !> |
| [out] | ND | !> ND is INTEGER !> On exit, the number of nodes on the tree. !> |
| [out] | INODE | !> INODE is INTEGER array, dimension ( N ) !> On exit, centers of subproblems. !> |
| [out] | NDIML | !> NDIML is INTEGER array, dimension ( N ) !> On exit, row dimensions of left children. !> |
| [out] | NDIMR | !> NDIMR is INTEGER array, dimension ( N ) !> On exit, row dimensions of right children. !> |
| [in] | MSUB | !> MSUB is INTEGER !> On entry, the maximum row dimension each subproblem at the !> bottom of the tree can be of. !> |
Definition at line 104 of file slasdt.f.
| subroutine slaset | ( | character | uplo, |
| integer | m, | ||
| integer | n, | ||
| real | alpha, | ||
| real | beta, | ||
| real, dimension( lda, * ) | a, | ||
| integer | lda ) |
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
Download SLASET + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASET initializes an m-by-n matrix A to BETA on the diagonal and !> ALPHA on the offdiagonals. !>
| [in] | UPLO | !> UPLO is CHARACTER*1 !> Specifies the part of the matrix A to be set. !> = 'U': Upper triangular part is set; the strictly lower !> triangular part of A is not changed. !> = 'L': Lower triangular part is set; the strictly upper !> triangular part of A is not changed. !> Otherwise: All of the matrix A is set. !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. M >= 0. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. N >= 0. !> |
| [in] | ALPHA | !> ALPHA is REAL !> The constant to which the offdiagonal elements are to be set. !> |
| [in] | BETA | !> BETA is REAL !> The constant to which the diagonal elements are to be set. !> |
| [out] | A | !> A is REAL array, dimension (LDA,N) !> On exit, the leading m-by-n submatrix of A is set as follows: !> !> if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, !> if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, !> otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, !> !> and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
Definition at line 109 of file slaset.f.
| subroutine slasr | ( | character | side, |
| character | pivot, | ||
| character | direct, | ||
| integer | m, | ||
| integer | n, | ||
| real, dimension( * ) | c, | ||
| real, dimension( * ) | s, | ||
| real, dimension( lda, * ) | a, | ||
| integer | lda ) |
SLASR applies a sequence of plane rotations to a general rectangular matrix.
Download SLASR + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASR applies a sequence of plane rotations to a real matrix A, !> from either the left or the right. !> !> When SIDE = 'L', the transformation takes the form !> !> A := P*A !> !> and when SIDE = 'R', the transformation takes the form !> !> A := A*P**T !> !> where P is an orthogonal matrix consisting of a sequence of z plane !> rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', !> and P**T is the transpose of P. !> !> When DIRECT = 'F' (Forward sequence), then !> !> P = P(z-1) * ... * P(2) * P(1) !> !> and when DIRECT = 'B' (Backward sequence), then !> !> P = P(1) * P(2) * ... * P(z-1) !> !> where P(k) is a plane rotation matrix defined by the 2-by-2 rotation !> !> R(k) = ( c(k) s(k) ) !> = ( -s(k) c(k) ). !> !> When PIVOT = 'V' (Variable pivot), the rotation is performed !> for the plane (k,k+1), i.e., P(k) has the form !> !> P(k) = ( 1 ) !> ( ... ) !> ( 1 ) !> ( c(k) s(k) ) !> ( -s(k) c(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> !> where R(k) appears as a rank-2 modification to the identity matrix in !> rows and columns k and k+1. !> !> When PIVOT = 'T' (Top pivot), the rotation is performed for the !> plane (1,k+1), so P(k) has the form !> !> P(k) = ( c(k) s(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> ( -s(k) c(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> !> where R(k) appears in rows and columns 1 and k+1. !> !> Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is !> performed for the plane (k,z), giving P(k) the form !> !> P(k) = ( 1 ) !> ( ... ) !> ( 1 ) !> ( c(k) s(k) ) !> ( 1 ) !> ( ... ) !> ( 1 ) !> ( -s(k) c(k) ) !> !> where R(k) appears in rows and columns k and z. The rotations are !> performed without ever forming P(k) explicitly. !>
| [in] | SIDE | !> SIDE is CHARACTER*1 !> Specifies whether the plane rotation matrix P is applied to !> A on the left or the right. !> = 'L': Left, compute A := P*A !> = 'R': Right, compute A:= A*P**T !> |
| [in] | PIVOT | !> PIVOT is CHARACTER*1 !> Specifies the plane for which P(k) is a plane rotation !> matrix. !> = 'V': Variable pivot, the plane (k,k+1) !> = 'T': Top pivot, the plane (1,k+1) !> = 'B': Bottom pivot, the plane (k,z) !> |
| [in] | DIRECT | !> DIRECT is CHARACTER*1 !> Specifies whether P is a forward or backward sequence of !> plane rotations. !> = 'F': Forward, P = P(z-1)*...*P(2)*P(1) !> = 'B': Backward, P = P(1)*P(2)*...*P(z-1) !> |
| [in] | M | !> M is INTEGER !> The number of rows of the matrix A. If m <= 1, an immediate !> return is effected. !> |
| [in] | N | !> N is INTEGER !> The number of columns of the matrix A. If n <= 1, an !> immediate return is effected. !> |
| [in] | C | !> C is REAL array, dimension !> (M-1) if SIDE = 'L' !> (N-1) if SIDE = 'R' !> The cosines c(k) of the plane rotations. !> |
| [in] | S | !> S is REAL array, dimension !> (M-1) if SIDE = 'L' !> (N-1) if SIDE = 'R' !> The sines s(k) of the plane rotations. The 2-by-2 plane !> rotation part of the matrix P(k), R(k), has the form !> R(k) = ( c(k) s(k) ) !> ( -s(k) c(k) ). !> |
| [in,out] | A | !> A is REAL array, dimension (LDA,N) !> The M-by-N matrix A. On exit, A is overwritten by P*A if !> SIDE = 'R' or by A*P**T if SIDE = 'L'. !> |
| [in] | LDA | !> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,M). !> |
Definition at line 198 of file slasr.f.
| subroutine slassq | ( | integer | n, |
| real(wp), dimension(*) | x, | ||
| integer | incx, | ||
| real(wp) | scl, | ||
| real(wp) | sumsq ) |
SLASSQ updates a sum of squares represented in scaled form.
Download SLASSQ + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASSQ returns the values scl and smsq such that !> !> ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, !> !> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is !> assumed to be non-negative. !> !> scale and sumsq must be supplied in SCALE and SUMSQ and !> scl and smsq are overwritten on SCALE and SUMSQ respectively. !> !> If scale * sqrt( sumsq ) > tbig then !> we require: scale >= sqrt( TINY*EPS ) / sbig on entry, !> and if 0 < scale * sqrt( sumsq ) < tsml then !> we require: scale <= sqrt( HUGE ) / ssml on entry, !> where !> tbig -- upper threshold for values whose square is representable; !> sbig -- scaling constant for big numbers; \see la_constants.f90 !> tsml -- lower threshold for values whose square is representable; !> ssml -- scaling constant for small numbers; \see la_constants.f90 !> and !> TINY*EPS -- tiniest representable number; !> HUGE -- biggest representable number. !> !>
| [in] | N | !> N is INTEGER !> The number of elements to be used from the vector x. !> |
| [in] | X | !> X is REAL array, dimension (1+(N-1)*abs(INCX)) !> The vector for which a scaled sum of squares is computed. !> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. !> |
| [in] | INCX | !> INCX is INTEGER !> The increment between successive values of the vector x. !> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n !> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n !> If INCX = 0, x isn't a vector so there is no need to call !> this subroutine. If you call it anyway, it will count x(1) !> in the vector norm N times. !> |
| [in,out] | SCALE | !> SCALE is REAL !> On entry, the value scale in the equation above. !> On exit, SCALE is overwritten with scl , the scaling factor !> for the sum of squares. !> |
| [in,out] | SUMSQ | !> SUMSQ is REAL !> On entry, the value sumsq in the equation above. !> On exit, SUMSQ is overwritten with smsq , the basic sum of !> squares from which scl has been factored out. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !> Blue, James L. (1978) !> A Portable Fortran Program to Find the Euclidean Norm of a Vector !> ACM Trans Math Softw 4:15--23 !> https://doi.org/10.1145/355769.355771 !> !>
Definition at line 136 of file slassq.f90.
| subroutine slasv2 | ( | real | f, |
| real | g, | ||
| real | h, | ||
| real | ssmin, | ||
| real | ssmax, | ||
| real | snr, | ||
| real | csr, | ||
| real | snl, | ||
| real | csl ) |
SLASV2 computes the singular value decomposition of a 2-by-2 triangular matrix.
Download SLASV2 + dependencies [TGZ] [ZIP] [TXT]
!> !> SLASV2 computes the singular value decomposition of a 2-by-2 !> triangular matrix !> [ F G ] !> [ 0 H ]. !> On return, abs(SSMAX) is the larger singular value, abs(SSMIN) is the !> smaller singular value, and (CSL,SNL) and (CSR,SNR) are the left and !> right singular vectors for abs(SSMAX), giving the decomposition !> !> [ CSL SNL ] [ F G ] [ CSR -SNR ] = [ SSMAX 0 ] !> [-SNL CSL ] [ 0 H ] [ SNR CSR ] [ 0 SSMIN ]. !>
| [in] | F | !> F is REAL !> The (1,1) element of the 2-by-2 matrix. !> |
| [in] | G | !> G is REAL !> The (1,2) element of the 2-by-2 matrix. !> |
| [in] | H | !> H is REAL !> The (2,2) element of the 2-by-2 matrix. !> |
| [out] | SSMIN | !> SSMIN is REAL !> abs(SSMIN) is the smaller singular value. !> |
| [out] | SSMAX | !> SSMAX is REAL !> abs(SSMAX) is the larger singular value. !> |
| [out] | SNL | !> SNL is REAL !> |
| [out] | CSL | !> CSL is REAL !> The vector (CSL, SNL) is a unit left singular vector for the !> singular value abs(SSMAX). !> |
| [out] | SNR | !> SNR is REAL !> |
| [out] | CSR | !> CSR is REAL !> The vector (CSR, SNR) is a unit right singular vector for the !> singular value abs(SSMAX). !> |
!> !> Any input parameter may be aliased with any output parameter. !> !> Barring over/underflow and assuming a guard digit in subtraction, all !> output quantities are correct to within a few units in the last !> place (ulps). !> !> In IEEE arithmetic, the code works correctly if one matrix element is !> infinite. !> !> Overflow will not occur unless the largest singular value itself !> overflows or is within a few ulps of overflow. (On machines with !> partial overflow, like the Cray, overflow may occur if the largest !> singular value is within a factor of 2 of overflow.) !> !> Underflow is harmless if underflow is gradual. Otherwise, results !> may correspond to a matrix modified by perturbations of size near !> the underflow threshold. !>
Definition at line 137 of file slasv2.f.
| subroutine xerbla | ( | character*(*) | srname, |
| integer | info ) |
XERBLA
Download XERBLA + dependencies [TGZ] [ZIP] [TXT]
!> !> XERBLA is an error handler for the LAPACK routines. !> It is called by an LAPACK routine if an input parameter has an !> invalid value. A message is printed and execution stops. !> !> Installers may consider modifying the STOP statement in order to !> call system-specific exception-handling facilities. !>
| [in] | SRNAME | !> SRNAME is CHARACTER*(*) !> The name of the routine which called XERBLA. !> |
| [in] | INFO | !> INFO is INTEGER !> The position of the invalid parameter in the parameter list !> of the calling routine. !> |
Definition at line 69 of file xerbla.f.
| subroutine xerbla_array | ( | character(1), dimension(srname_len) | srname_array, |
| integer | srname_len, | ||
| integer | info ) |
XERBLA_ARRAY
Download XERBLA_ARRAY + dependencies [TGZ] [ZIP] [TXT]
!>
!> XERBLA_ARRAY assists other languages in calling XERBLA, the LAPACK
!> and BLAS error handler. Rather than taking a Fortran string argument
!> as the function's name, XERBLA_ARRAY takes an array of single
!> characters along with the array's length. XERBLA_ARRAY then copies
!> up to 32 characters of that array into a Fortran string and passes
!> that to XERBLA. If called with a non-positive SRNAME_LEN,
!> XERBLA_ARRAY will call XERBLA with a string of all blank characters.
!>
!> Say some macro or other device makes XERBLA_ARRAY available to C99
!> by a name lapack_xerbla and with a common Fortran calling convention.
!> Then a C99 program could invoke XERBLA via:
!> {
!> int flen = strlen(__func__);
!> lapack_xerbla(__func__, &flen, &info);
!> }
!>
!> Providing XERBLA_ARRAY is not necessary for intercepting LAPACK
!> errors. XERBLA_ARRAY calls XERBLA.
!> | [in] | SRNAME_ARRAY | !> SRNAME_ARRAY is CHARACTER(1) array, dimension (SRNAME_LEN) !> The name of the routine which called XERBLA_ARRAY. !> |
| [in] | SRNAME_LEN | !> SRNAME_LEN is INTEGER !> The length of the name in SRNAME_ARRAY. !> |
| [in] | INFO | !> INFO is INTEGER !> The position of the invalid parameter in the parameter list !> of the calling routine. !> |
Definition at line 89 of file xerbla_array.f.
ZLARTG generates a plane rotation with real cosine and complex sine.
!>
!> ZLARTG generates a plane rotation so that
!>
!> [ C S ] . [ F ] = [ R ]
!> [ -conjg(S) C ] [ G ] [ 0 ]
!>
!> where C is real and C**2 + |S|**2 = 1.
!>
!> The mathematical formulas used for C and S are
!>
!> sgn(x) = { x / |x|, x != 0
!> { 1, x = 0
!>
!> R = sgn(F) * sqrt(|F|**2 + |G|**2)
!>
!> C = |F| / sqrt(|F|**2 + |G|**2)
!>
!> S = sgn(F) * conjg(G) / sqrt(|F|**2 + |G|**2)
!>
!> When F and G are real, the formulas simplify to C = F/R and
!> S = G/R, and the returned values of C, S, and R should be
!> identical to those returned by DLARTG.
!>
!> The algorithm used to compute these quantities incorporates scaling
!> to avoid overflow or underflow in computing the square root of the
!> sum of squares.
!>
!> This is a faster version of the BLAS1 routine ZROTG, except for
!> the following differences:
!> F and G are unchanged on return.
!> If G=0, then C=1 and S=0.
!> If F=0, then C=0 and S is chosen so that R is real.
!>
!> Below, wp=>dp stands for double precision from LA_CONSTANTS module.
!> | [in] | F | !> F is COMPLEX(wp) !> The first component of vector to be rotated. !> |
| [in] | G | !> G is COMPLEX(wp) !> The second component of vector to be rotated. !> |
| [out] | C | !> C is REAL(wp) !> The cosine of the rotation. !> |
| [out] | S | !> S is COMPLEX(wp) !> The sine of the rotation. !> |
| [out] | R | !> R is COMPLEX(wp) !> The nonzero component of the rotated vector. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !>
Definition at line 117 of file zlartg.f90.
| subroutine zlassq | ( | integer | n, |
| complex(wp), dimension(*) | x, | ||
| integer | incx, | ||
| real(wp) | scl, | ||
| real(wp) | sumsq ) |
ZLASSQ updates a sum of squares represented in scaled form.
Download ZLASSQ + dependencies [TGZ] [ZIP] [TXT]
!> !> ZLASSQ returns the values scl and smsq such that !> !> ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, !> !> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is !> assumed to be non-negative. !> !> scale and sumsq must be supplied in SCALE and SUMSQ and !> scl and smsq are overwritten on SCALE and SUMSQ respectively. !> !> If scale * sqrt( sumsq ) > tbig then !> we require: scale >= sqrt( TINY*EPS ) / sbig on entry, !> and if 0 < scale * sqrt( sumsq ) < tsml then !> we require: scale <= sqrt( HUGE ) / ssml on entry, !> where !> tbig -- upper threshold for values whose square is representable; !> sbig -- scaling constant for big numbers; \see la_constants.f90 !> tsml -- lower threshold for values whose square is representable; !> ssml -- scaling constant for small numbers; \see la_constants.f90 !> and !> TINY*EPS -- tiniest representable number; !> HUGE -- biggest representable number. !> !>
| [in] | N | !> N is INTEGER !> The number of elements to be used from the vector x. !> |
| [in] | X | !> X is DOUBLE COMPLEX array, dimension (1+(N-1)*abs(INCX)) !> The vector for which a scaled sum of squares is computed. !> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. !> |
| [in] | INCX | !> INCX is INTEGER !> The increment between successive values of the vector x. !> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n !> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n !> If INCX = 0, x isn't a vector so there is no need to call !> this subroutine. If you call it anyway, it will count x(1) !> in the vector norm N times. !> |
| [in,out] | SCALE | !> SCALE is DOUBLE PRECISION !> On entry, the value scale in the equation above. !> On exit, SCALE is overwritten with scl , the scaling factor !> for the sum of squares. !> |
| [in,out] | SUMSQ | !> SUMSQ is DOUBLE PRECISION !> On entry, the value sumsq in the equation above. !> On exit, SUMSQ is overwritten with smsq , the basic sum of !> squares from which scl has been factored out. !> |
!> !> Anderson E. (2017) !> Algorithm 978: Safe Scaling in the Level 1 BLAS !> ACM Trans Math Softw 44:1--28 !> https://doi.org/10.1145/3061665 !> !> Blue, James L. (1978) !> A Portable Fortran Program to Find the Euclidean Norm of a Vector !> ACM Trans Math Softw 4:15--23 !> https://doi.org/10.1145/355769.355771 !> !>
Definition at line 136 of file zlassq.f90.