1SGEQP3(1) LAPACK routine (version 3.2) SGEQP3(1)
2
3
4
6 SGEQP3 - computes a QR factorization with column pivoting of a matrix A
7
9 SUBROUTINE SGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO )
10
11 INTEGER INFO, LDA, LWORK, M, N
12
13 INTEGER JPVT( * )
14
15 REAL A( LDA, * ), TAU( * ), WORK( * )
16
18 SGEQP3 computes a QR factorization with column pivoting of a matrix A:
19 A*P = Q*R using Level 3 BLAS.
20
22 M (input) INTEGER
23 The number of rows of the matrix A. M >= 0.
24
25 N (input) INTEGER
26 The number of columns of the matrix A. N >= 0.
27
28 A (input/output) REAL array, dimension (LDA,N)
29 On entry, the M-by-N matrix A. On exit, the upper triangle of
30 the array contains the min(M,N)-by-N upper trapezoidal matrix
31 R; the elements below the diagonal, together with the array
32 TAU, represent the orthogonal matrix Q as a product of min(M,N)
33 elementary reflectors.
34
35 LDA (input) INTEGER
36 The leading dimension of the array A. LDA >= max(1,M).
37
38 JPVT (input/output) INTEGER array, dimension (N)
39 On entry, if JPVT(J).ne.0, the J-th column of A is permuted to
40 the front of A*P (a leading column); if JPVT(J)=0, the J-th
41 column of A is a free column. On exit, if JPVT(J)=K, then the
42 J-th column of A*P was the the K-th column of A.
43
44 TAU (output) REAL array, dimension (min(M,N))
45 The scalar factors of the elementary reflectors.
46
47 WORK (workspace/output) REAL array, dimension (MAX(1,LWORK))
48 On exit, if INFO=0, WORK(1) returns the optimal LWORK.
49
50 LWORK (input) INTEGER
51 The dimension of the array WORK. LWORK >= 3*N+1. For optimal
52 performance LWORK >= 2*N+( N+1 )*NB, where NB is the optimal
53 blocksize. If LWORK = -1, then a workspace query is assumed;
54 the routine only calculates the optimal size of the WORK array,
55 returns this value as the first entry of the WORK array, and no
56 error message related to LWORK is issued by XERBLA.
57
58 INFO (output) INTEGER
59 = 0: successful exit.
60 < 0: if INFO = -i, the i-th argument had an illegal value.
61
63 The matrix Q is represented as a product of elementary reflectors
64 Q = H(1) H(2) . . . H(k), where k = min(m,n).
65 Each H(i) has the form
66 H(i) = I - tau * v * v'
67 where tau is a real/complex scalar, and v is a real/complex vector with
68 v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
69 and tau in TAU(i).
70 Based on contributions by
71 G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
72 X. Sun, Computer Science Dept., Duke University, USA
73
74
75
76 LAPACK routine (version 3.2) November 2008 SGEQP3(1)