LAPACK 3.3.0

zlapll.f

Go to the documentation of this file.
00001       SUBROUTINE ZLAPLL( N, X, INCX, Y, INCY, SSMIN )
00002 *
00003 *  -- LAPACK auxiliary routine (version 3.2) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *     November 2006
00007 *
00008 *     .. Scalar Arguments ..
00009       INTEGER            INCX, INCY, N
00010       DOUBLE PRECISION   SSMIN
00011 *     ..
00012 *     .. Array Arguments ..
00013       COMPLEX*16         X( * ), Y( * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  Given two column vectors X and Y, let
00020 *
00021 *                       A = ( X Y ).
00022 *
00023 *  The subroutine first computes the QR factorization of A = Q*R,
00024 *  and then computes the SVD of the 2-by-2 upper triangular matrix R.
00025 *  The smaller singular value of R is returned in SSMIN, which is used
00026 *  as the measurement of the linear dependency of the vectors X and Y.
00027 *
00028 *  Arguments
00029 *  =========
00030 *
00031 *  N       (input) INTEGER
00032 *          The length of the vectors X and Y.
00033 *
00034 *  X       (input/output) COMPLEX*16 array, dimension (1+(N-1)*INCX)
00035 *          On entry, X contains the N-vector X.
00036 *          On exit, X is overwritten.
00037 *
00038 *  INCX    (input) INTEGER
00039 *          The increment between successive elements of X. INCX > 0.
00040 *
00041 *  Y       (input/output) COMPLEX*16 array, dimension (1+(N-1)*INCY)
00042 *          On entry, Y contains the N-vector Y.
00043 *          On exit, Y is overwritten.
00044 *
00045 *  INCY    (input) INTEGER
00046 *          The increment between successive elements of Y. INCY > 0.
00047 *
00048 *  SSMIN   (output) DOUBLE PRECISION
00049 *          The smallest singular value of the N-by-2 matrix A = ( X Y ).
00050 *
00051 *  =====================================================================
00052 *
00053 *     .. Parameters ..
00054       DOUBLE PRECISION   ZERO
00055       PARAMETER          ( ZERO = 0.0D+0 )
00056       COMPLEX*16         CONE
00057       PARAMETER          ( CONE = ( 1.0D+0, 0.0D+0 ) )
00058 *     ..
00059 *     .. Local Scalars ..
00060       DOUBLE PRECISION   SSMAX
00061       COMPLEX*16         A11, A12, A22, C, TAU
00062 *     ..
00063 *     .. Intrinsic Functions ..
00064       INTRINSIC          ABS, DCONJG
00065 *     ..
00066 *     .. External Functions ..
00067       COMPLEX*16         ZDOTC
00068       EXTERNAL           ZDOTC
00069 *     ..
00070 *     .. External Subroutines ..
00071       EXTERNAL           DLAS2, ZAXPY, ZLARFG
00072 *     ..
00073 *     .. Executable Statements ..
00074 *
00075 *     Quick return if possible
00076 *
00077       IF( N.LE.1 ) THEN
00078          SSMIN = ZERO
00079          RETURN
00080       END IF
00081 *
00082 *     Compute the QR factorization of the N-by-2 matrix ( X Y )
00083 *
00084       CALL ZLARFG( N, X( 1 ), X( 1+INCX ), INCX, TAU )
00085       A11 = X( 1 )
00086       X( 1 ) = CONE
00087 *
00088       C = -DCONJG( TAU )*ZDOTC( N, X, INCX, Y, INCY )
00089       CALL ZAXPY( N, C, X, INCX, Y, INCY )
00090 *
00091       CALL ZLARFG( N-1, Y( 1+INCY ), Y( 1+2*INCY ), INCY, TAU )
00092 *
00093       A12 = Y( 1 )
00094       A22 = Y( 1+INCY )
00095 *
00096 *     Compute the SVD of 2-by-2 Upper triangular matrix.
00097 *
00098       CALL DLAS2( ABS( A11 ), ABS( A12 ), ABS( A22 ), SSMIN, SSMAX )
00099 *
00100       RETURN
00101 *
00102 *     End of ZLAPLL
00103 *
00104       END
 All Files Functions