XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zggglm()

void zggglm ( int  n,
int  m,
int  p,
int  lda,
doublecomplex  a[],
int  ldb,
doublecomplex  b[],
doublecomplex  d[],
doublecomplex  x[],
doublecomplex  y[],
doublecomplex  work[],
int  lwork,
int *  info 
)

General Gauss-Markov linear model (GLM) problem of complex matrices

Purpose
This routine solves a general Gauss-Markov linear model (GLM) problem:
minimize || y ||_2 subject to d = A*x + B*y
x
where A is an n x m matrix, B is an n x p matrix, and d is a given n-vector. It is assumed that m <= n <= m+p, and
rank(A) = m and rank(A B) = n
Under these assumptions, the constrained equation is always consistent, and there is a unique solution x and a minimal 2-norm solution y, which is obtained using a generalized QR factorization of the matrices (A, B) given by
A = Q*(R), B = Q*T*Z
(0)
In particular, if matrix B is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problem
minimize || inv(B)*(d - A*x) ||_2
x
Parameters
[in]nNumber of rows of the matrices A and B. (n >= 0) (If n = 0, returns without computation)
[in]mNumber of columns of the matrix A. (0 <= m <= n)
[in]pNumber of columns of the matrix B. (p >= n - m)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= m)
[in] n x m matrix A.
[out] The upper triangular part of the array a[][] contains the m x m upper triangular matrix R.
[in]ldbLeading dimension of the two dimensional array b[][]. (ldb >= max(1, n))
[in,out]b[][]Array b[lb][ldb] (lb >= p)
[in] n x p matrix B.
[out] n <= p: The upper triangle of the subarray b[p-n to p-1][0 to n-1] contains the n x n upper triangular matrix T.
  n > p: The elements on and above the (n-p)th sub-diagonal contain the n x p upper trapezoidal matrix T.
[in,out]d[]Array d[ld] (ld >= n)
[in] d[] is the left hand side of the GLM equation.
[out] d[] is destroyed.
[out]x[]Array x[lx] (lx >= m)
[out]y[]Array y[ly] (ly >= p)
x[] and y[] are the solutions of the GLM problem.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork >= max(1, n+m+p))
For optimum performance, lwork >= max(1, m + min(n, p) + max(n, p)*nb), where nb is the upper bound for the optimal block sizes.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0].
[out]info= 0: Successful exit
= -1: The argument n had an illegal value (n < 0)
= -2: The argument m had an illegal value (m < 0 or m > n)
= -3: The argument p had an illegal value (p < 0 or p < n - m)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -6: The argument ldb had an illegal value (ldb < max(1, n))
= -12: The argument lwork had an illegal value (lwork too small)
= 1: The upper triangular factor R associated with A in the generalized QR factorization of the pair (A, B) is singular, so that rank(A) < m. The least squares solution could not be computed.
= 2: The bottom n-m x n-m part of the upper trapezoidal factor T associated with B in the generalized QR factorization of the pair (A, B) is singular, so that rank(A B) < n. The least squares solution could not be computed.
Reference
LAPACK