XLPack 6.1
Excel Worksheet Function Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ WZgglse2()

Function WZgglse2 ( M As  Long,
N As  Long,
P As  Long,
A As  Variant,
B As  Variant,
C As  Variant,
D As  Variant 
)

Linear equality-constrained least squares (LSE) problem of complex matrices (complex numbers in pairs of cells)

Purpose
WZgglse2 solves the linear equality-constrained least squares (LSE) problem:
minimize || c - Ax ||_2 subject to B*x = d
where A is an M x N matrix, B is a P x N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M + P, and
rank(B) = P and rank( (A) ) = N
( (B) )
These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given by
B = (0 R)*Q, A = Z*T*Q

To represent complex numbers, a real part and an imaginary part are stored in a pair of adjacent cells (a real part in a left cell, and an imaginary part in a right cell). The computed results are stored in the same way.
Returns
N+1 x 2
Column 1Column 2
Rows 1 to NLeast squares solution vector x (real part)Least squares solution vector x (imaginary part)
Row N+12-norm of residual sum of squaresReturn code

Return code
= 0: Successful exit
= 1: The least squares solution could not be computed. The upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is singular, so that rank(B) < P.
= 2: The least squares solution could not be computed. The N-P x N-P part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is singular, so that rank((A^T B^T)^T) < N.
Parameters
[in]MNumber of rows of the matrix A. (M >= 1)
[in]NNumber of columns of the matrices A and B. (N >= 1)
[in]PNumber of rows of the matrix B. (1 <= P <= N <= M + P)
[in]A(M x 2N) M x N coefficient matrix A of the least squares part of the LSE problem.
[in]B(P x 2N) P x N coefficient matrix B of the constrained equation.
[in]C(M x 2) Right hand side vector c for the least squares part of the LSE problem.
[in]D(P x 2) Right hand side vector d for the constrained equation.
Reference
LAPACK
Example
Solve the linear equality-constrained least squares (LSE) problem, i.e. minimize || c - Ax ||_2 subject to B*x = d, where
( -0.82+0.83i 0.18-0.94i -0.18-0.12i )
A = ( -0.76-0.24i 0.57-0.16i -0.08-0.27i )
( 1.90+0.26i -0.98+0.54i 0.21+0.28i )
( 0.50-0.30i -0.31+0.37i 0.22+0.19i )
( 0.57-0.91i -0.28-0.45i 0.25+0.91i )
B = ( 0.83+0.46i 0.63-0.19i -0.69+0.09i )
( 0.24-1.33i -0.56-0.67i 0.90+1.25i )
( 1.7126-0.6648i )
c = ( 0.8697+0.7604i )
( -2.1048-1.6171i )
( -0.9297+0.1252i )
( -1.5111+0.3107i )
d = ( -0.0941-1.2737i )
( -1.5579+1.0462i )

WZgglse2