1CGGGLM(1) LAPACK driver routine (version 3.2) CGGGLM(1)
2
3
4
6 CGGGLM - solves a general Gauss-Markov linear model (GLM) problem
7
9 SUBROUTINE CGGGLM( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK, INFO
10 )
11
12 INTEGER INFO, LDA, LDB, LWORK, M, N, P
13
14 COMPLEX A( LDA, * ), B( LDB, * ), D( * ), WORK( * ), X( * ),
15 Y( * )
16
18 CGGGLM solves a general Gauss-Markov linear model (GLM) problem:
19 minimize || y ||_2 subject to d = A*x + B*y
20 x
21 where A is an N-by-M matrix, B is an N-by-P matrix, and d is a given N-
22 vector. It is assumed that M <= N <= M+P, and
23 rank(A) = M and rank( A B ) = N.
24 Under these assumptions, the constrained equation is always consistent,
25 and there is a unique solution x and a minimal 2-norm solution y, which
26 is obtained using a generalized QR factorization of the matrices (A, B)
27 given by
28 A = Q*(R), B = Q*T*Z.
29 (0)
30 In particular, if matrix B is square nonsingular, then the problem GLM
31 is equivalent to the following weighted linear least squares problem
32 minimize || inv(B)*(d-A*x) ||_2
33 x
34 where inv(B) denotes the inverse of B.
35
37 N (input) INTEGER
38 The number of rows of the matrices A and B. N >= 0.
39
40 M (input) INTEGER
41 The number of columns of the matrix A. 0 <= M <= N.
42
43 P (input) INTEGER
44 The number of columns of the matrix B. P >= N-M.
45
46 A (input/output) COMPLEX array, dimension (LDA,M)
47 On entry, the N-by-M matrix A. On exit, the upper triangular
48 part of the array A contains the M-by-M upper triangular matrix
49 R.
50
51 LDA (input) INTEGER
52 The leading dimension of the array A. LDA >= max(1,N).
53
54 B (input/output) COMPLEX array, dimension (LDB,P)
55 On entry, the N-by-P matrix B. On exit, if N <= P, the upper
56 triangle of the subarray B(1:N,P-N+1:P) contains the N-by-N
57 upper triangular matrix T; if N > P, the elements on and above
58 the (N-P)th subdiagonal contain the N-by-P upper trapezoidal
59 matrix T.
60
61 LDB (input) INTEGER
62 The leading dimension of the array B. LDB >= max(1,N).
63
64 D (input/output) COMPLEX array, dimension (N)
65 On entry, D is the left hand side of the GLM equation. On
66 exit, D is destroyed.
67
68 X (output) COMPLEX array, dimension (M)
69 Y (output) COMPLEX array, dimension (P) On exit, X and Y
70 are the solutions of the GLM problem.
71
72 WORK (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))
73 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
74
75 LWORK (input) INTEGER
76 The dimension of the array WORK. LWORK >= max(1,N+M+P). For
77 optimum performance, LWORK >= M+min(N,P)+max(N,P)*NB, where NB
78 is an upper bound for the optimal blocksizes for CGEQRF,
79 CGERQF, CUNMQR and CUNMRQ. If LWORK = -1, then a workspace
80 query is assumed; the routine only calculates the optimal size
81 of the WORK array, returns this value as the first entry of the
82 WORK array, and no error message related to LWORK is issued by
83 XERBLA.
84
85 INFO (output) INTEGER
86 = 0: successful exit.
87 < 0: if INFO = -i, the i-th argument had an illegal value.
88 = 1: the upper triangular factor R associated with A in the
89 generalized QR factorization of the pair (A, B) is singular, so
90 that rank(A) < M; the least squares solution could not be com‐
91 puted. = 2: the bottom (N-M) by (N-M) part of the upper
92 trapezoidal factor T associated with B in the generalized QR
93 factorization of the pair (A, B) is singular, so that rank( A B
94 ) < N; the least squares solution could not be computed.
95
96
97
98 LAPACK driver routine (version 3.N2o)vember 2008 CGGGLM(1)