LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
clapll.f
Go to the documentation of this file.
1 *> \brief \b CLAPLL measures the linear dependence of two vectors.
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
9 *> Download CLAPLL + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clapll.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clapll.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clapll.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE CLAPLL( N, X, INCX, Y, INCY, SSMIN )
22 *
23 * .. Scalar Arguments ..
24 * INTEGER INCX, INCY, N
25 * REAL SSMIN
26 * ..
27 * .. Array Arguments ..
28 * COMPLEX X( * ), Y( * )
29 * ..
30 *
31 *
32 *> \par Purpose:
33 * =============
34 *>
35 *> \verbatim
36 *>
37 *> Given two column vectors X and Y, let
38 *>
39 *> A = ( X Y ).
40 *>
41 *> The subroutine first computes the QR factorization of A = Q*R,
42 *> and then computes the SVD of the 2-by-2 upper triangular matrix R.
43 *> The smaller singular value of R is returned in SSMIN, which is used
44 *> as the measurement of the linear dependency of the vectors X and Y.
45 *> \endverbatim
46 *
47 * Arguments:
48 * ==========
49 *
50 *> \param[in] N
51 *> \verbatim
52 *> N is INTEGER
53 *> The length of the vectors X and Y.
54 *> \endverbatim
55 *>
56 *> \param[in,out] X
57 *> \verbatim
58 *> X is COMPLEX array, dimension (1+(N-1)*INCX)
59 *> On entry, X contains the N-vector X.
60 *> On exit, X is overwritten.
61 *> \endverbatim
62 *>
63 *> \param[in] INCX
64 *> \verbatim
65 *> INCX is INTEGER
66 *> The increment between successive elements of X. INCX > 0.
67 *> \endverbatim
68 *>
69 *> \param[in,out] Y
70 *> \verbatim
71 *> Y is COMPLEX array, dimension (1+(N-1)*INCY)
72 *> On entry, Y contains the N-vector Y.
73 *> On exit, Y is overwritten.
74 *> \endverbatim
75 *>
76 *> \param[in] INCY
77 *> \verbatim
78 *> INCY is INTEGER
79 *> The increment between successive elements of Y. INCY > 0.
80 *> \endverbatim
81 *>
82 *> \param[out] SSMIN
83 *> \verbatim
84 *> SSMIN is REAL
85 *> The smallest singular value of the N-by-2 matrix A = ( X Y ).
86 *> \endverbatim
87 *
88 * Authors:
89 * ========
90 *
91 *> \author Univ. of Tennessee
92 *> \author Univ. of California Berkeley
93 *> \author Univ. of Colorado Denver
94 *> \author NAG Ltd.
95 *
96 *> \date September 2012
97 *
98 *> \ingroup complexOTHERauxiliary
99 *
100 * =====================================================================
101  SUBROUTINE clapll( N, X, INCX, Y, INCY, SSMIN )
102 *
103 * -- LAPACK auxiliary routine (version 3.4.2) --
104 * -- LAPACK is a software package provided by Univ. of Tennessee, --
105 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
106 * September 2012
107 *
108 * .. Scalar Arguments ..
109  INTEGER INCX, INCY, N
110  REAL SSMIN
111 * ..
112 * .. Array Arguments ..
113  COMPLEX X( * ), Y( * )
114 * ..
115 *
116 * =====================================================================
117 *
118 * .. Parameters ..
119  REAL ZERO
120  parameter ( zero = 0.0e+0 )
121  COMPLEX CONE
122  parameter ( cone = ( 1.0e+0, 0.0e+0 ) )
123 * ..
124 * .. Local Scalars ..
125  REAL SSMAX
126  COMPLEX A11, A12, A22, C, TAU
127 * ..
128 * .. Intrinsic Functions ..
129  INTRINSIC abs, conjg
130 * ..
131 * .. External Functions ..
132  COMPLEX CDOTC
133  EXTERNAL cdotc
134 * ..
135 * .. External Subroutines ..
136  EXTERNAL caxpy, clarfg, slas2
137 * ..
138 * .. Executable Statements ..
139 *
140 * Quick return if possible
141 *
142  IF( n.LE.1 ) THEN
143  ssmin = zero
144  RETURN
145  END IF
146 *
147 * Compute the QR factorization of the N-by-2 matrix ( X Y )
148 *
149  CALL clarfg( n, x( 1 ), x( 1+incx ), incx, tau )
150  a11 = x( 1 )
151  x( 1 ) = cone
152 *
153  c = -conjg( tau )*cdotc( n, x, incx, y, incy )
154  CALL caxpy( n, c, x, incx, y, incy )
155 *
156  CALL clarfg( n-1, y( 1+incy ), y( 1+2*incy ), incy, tau )
157 *
158  a12 = y( 1 )
159  a22 = y( 1+incy )
160 *
161 * Compute the SVD of 2-by-2 Upper triangular matrix.
162 *
163  CALL slas2( abs( a11 ), abs( a12 ), abs( a22 ), ssmin, ssmax )
164 *
165  RETURN
166 *
167 * End of CLAPLL
168 *
169  END
subroutine slas2(F, G, H, SSMIN, SSMAX)
SLAS2 computes singular values of a 2-by-2 triangular matrix.
Definition: slas2.f:109
subroutine clapll(N, X, INCX, Y, INCY, SSMIN)
CLAPLL measures the linear dependence of two vectors.
Definition: clapll.f:102
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY
Definition: caxpy.f:53
subroutine clarfg(N, ALPHA, X, INCX, TAU)
CLARFG generates an elementary reflector (Householder matrix).
Definition: clarfg.f:108