template<typename VectorType>
class QR< VectorType >
A class to compute and store the QR factorization of a matrix represented by a set of column vectors.
The class is design to update a given (possibly empty) QR factorization of a matrix A (constructed incrementally by providing its columns) due to the addition of a new column vector to A. This is equivalent to constructing an orthonormal basis by the Gram-Schmidt procedure. The class also provides update functionality when the first column is removed.
The VectorType
template argument may either be a parallel and serial vector, and only need to have basic operations such as additions, scalar product, etc. It also needs to have a copy-constructor.
See sections 6.5.2-6.5.3 on pp. 335-338 in
@Book{Golub2013,
title = {Matrix computations},
publisher = {Johns Hopkins University Press},
year = {2013},
author = {Golub, Gene H and Van Loan, Charles F},
edition = {4},
}
as well as
@article{Daniel1976,
author = {Daniel, James W and Gragg, Walter Bill and Kaufman, Linda and Stewart, Gilbert W},
title = {{Reorthogonalization and stable algorithms for updating the Gram-Schmidt QR factorization}},
journal = {Mathematics of Computation},
year = {1976},
volume = {30},
number = {136},
pages = {772--795},
}
@Article{Reichel1990,
author = {Reichel, L. and Gragg, W. B.},
title = {{Algorithm 686: FORTRAN Subroutines for Updating the QR Decomposition}},
journal = {ACM Trans. Math. Softw.},
year = {1990},
volume = {16},
number = {4},
pages = {369--377},
month = dec,
issn = {0098-3500},
acmid = {98291},
address = {New York, NY, USA},
doi = {10.1145/98267.98291},
issue_date = {Dec. 1990},
numpages = {9},
publisher = {ACM},
url = {http://doi.acm.org/10.1145/98267.98291},
}
Definition at line 240 of file qr.h.
template<typename VectorType >
virtual void QR< VectorType >::remove_column |
( |
const unsigned int |
k = 0 | ) |
|
|
virtual |
Remove first column and update QR factorization.
Starting from the given QR decomposition QR= A = [a_1\,\dots a_n], \quad a_i \in {\mathbb R}^m we aim at computing factorization of \tilde Q \tilde R= \tilde A = [a_2\,\dots a_n], \quad a_i \in {\mathbb
R}^m.
The standard approach is to partition R as
R =
\begin{bmatrix}
r_{11} & w^T \\
0 & R_{33}
\end{bmatrix}
It then follows that
Q^T \tilde A =
\begin{bmatrix}
0 & w^T \\
0 & R_{33}
\end{bmatrix}
is upper Hessenberg where unwanted sub-diagonal elements can be zeroed by a sequence of Givens rotations.
Note that \tilde R^T \tilde R = \tilde A^T \tilde A, where the RHS is included in A^T A = R^T R. Therefore \tilde R can be obtained by Cholesky decomposition.
Implements BaseQR< VectorType >.