LAPACK 3.3.0
|
00001 SUBROUTINE CLAPLL( 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 REAL SSMIN 00011 * .. 00012 * .. Array Arguments .. 00013 COMPLEX 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 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 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) REAL 00049 * The smallest singular value of the N-by-2 matrix A = ( X Y ). 00050 * 00051 * ===================================================================== 00052 * 00053 * .. Parameters .. 00054 REAL ZERO 00055 PARAMETER ( ZERO = 0.0E+0 ) 00056 COMPLEX CONE 00057 PARAMETER ( CONE = ( 1.0E+0, 0.0E+0 ) ) 00058 * .. 00059 * .. Local Scalars .. 00060 REAL SSMAX 00061 COMPLEX A11, A12, A22, C, TAU 00062 * .. 00063 * .. Intrinsic Functions .. 00064 INTRINSIC ABS, CONJG 00065 * .. 00066 * .. External Functions .. 00067 COMPLEX CDOTC 00068 EXTERNAL CDOTC 00069 * .. 00070 * .. External Subroutines .. 00071 EXTERNAL CAXPY, CLARFG, SLAS2 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 CLARFG( N, X( 1 ), X( 1+INCX ), INCX, TAU ) 00085 A11 = X( 1 ) 00086 X( 1 ) = CONE 00087 * 00088 C = -CONJG( TAU )*CDOTC( N, X, INCX, Y, INCY ) 00089 CALL CAXPY( N, C, X, INCX, Y, INCY ) 00090 * 00091 CALL CLARFG( 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 SLAS2( ABS( A11 ), ABS( A12 ), ABS( A22 ), SSMIN, SSMAX ) 00099 * 00100 RETURN 00101 * 00102 * End of CLAPLL 00103 * 00104 END