Equality-constrained Least Squares¶
The following routines support the solution of dense and sparse-direct instances of the Equality-constrained Least Squares problem
Dense algorithm¶
For dense instances of the problem, a Generalized RQ factorization can be employed as long as \(A\) is \(m \times n\), \(B\) is \(p \times n\), and \(p \le n \le m+p\). It is assumed that \(B\) has full row rank, \(p\), and \(\begin{pmatrix} A \\ B \end{pmatrix}\) has full column rank, \(n\).
A Generalized RQ factorization of \((B,A)\),
where \(Q\) and \(Z\) are unitary and \(R\) and \(T\) are upper-trapezoidal, allows us to re-express the constraint
as
where \(y = Q x\), which only requires the solution of the upper-triangular system
The objective can be rewritten as
which, defining \(g = Z^H c\), can be partitioned as
Since \(y_2\) is fixed by the constraint, the norm is minimized by setting the top term to zero, which involves solving the upper-triangular system
On exit of the internal dense routine, \(A\) and \(B\) are overwritten with their implicit Generalized RQ factorization of \((B,A)\), and, optionally, \(C\) is overwritten with the rotated residual matrix
where \(R_{2,2}\) is an upper-trapezoidal (not necessarily triangular) matrix. Note that essentially the same scheme is used in LAPACK’s {S,D,C,Z}GGLSE.
Sparse-direct algorithm¶
For sparse instances of the LSE problem, the symmetric quasi-semidefinite augmented system
is formed, equilibrated, and then a priori regularization is added in order to make the system sufficiently quasi-definite. A Cholesky-like factorization of this regularized system is then used as a preconditioner for FGMRES(k).
C++ API¶
-
void
LSE
(const Matrix<F> &A, const Matrix<F> &B, const Matrix<F> &C, const Matrix<F> &D, Matrix<F> &X)¶
-
void
LSE
(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B, const AbstractDistMatrix<F> &C, const AbstractDistMatrix<F> &D, AbstractDistMatrix<F> &X)¶
-
void
LSE
(const SparseMatrix<F> &A, const SparseMatrix<F> &B, const Matrix<F> &C, const Matrix<F> &D, Matrix<F> &X, const LeastSquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())¶
-
void
LSE
(const DistSparseMatrix<F> &A, const DistSparseMatrix<F> &B, const DistMultiVec<F> &C, const DistMultiVec<F> &D, DistMultiVec<F> &X, const LeastSquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())¶
Dense versions which overwrite their input¶
-
void
lse
::
Overwrite
(Matrix<F> &A, Matrix<F> &B, Matrix<F> &C, Matrix<F> &D, Matrix<F> &X, bool computeResidual = false)¶
-
void
lse
::
Overwrite
(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B, AbstractDistMatrix<F> &C, AbstractDistMatrix<F> &D, AbstractDistMatrix<F> &X, bool computeResidual = false)¶
C API¶
Standard interface¶
Single-precision¶
-
ElError
ElLSE_s
(ElConstMatrix_s A, ElConstMatrix_s B, ElConstMatrix_s C, ElConstMatrix_s D, ElMatrix_s X)¶
-
ElError
ElLSEDist_s
(ElConstDistMatrix_s A, ElConstDistMatrix_s B, ElConstDistMatrix_s C, ElConstDistMatrix_s D, ElDistMatrix_s X)¶
Double-precision¶
-
ElError
ElLSE_d
(ElConstMatrix_d A, ElConstMatrix_d B, ElConstMatrix_d C, ElConstMatrix_d D, ElMatrix_d X)¶
-
ElError
ElLSEDist_d
(ElConstDistMatrix_d A, ElConstDistMatrix_d B, ElConstDistMatrix_d C, ElConstDistMatrix_d D, ElDistMatrix_d X)¶
Single-precision complex¶
-
ElError
ElLSE_c
(ElConstMatrix_c A, ElConstMatrix_c B, ElConstMatrix_c C, ElConstMatrix_c D, ElMatrix_c X)¶
-
ElError
ElLSEDist_c
(ElConstDistMatrix_c A, ElConstDistMatrix_c B, ElConstDistMatrix_c C, ElConstDistMatrix_c D, ElDistMatrix_c X)¶
Double-precision complex¶
-
ElError
ElLSE_z
(ElConstMatrix_z A, ElConstMatrix_z B, ElConstMatrix_z C, ElConstMatrix_z D, ElMatrix_z X)¶
-
ElError
ElLSEDist_z
(ElConstDistMatrix_z A, ElConstDistMatrix_z B, ElConstDistMatrix_z C, ElConstDistMatrix_z D, ElDistMatrix_z X)¶