Accessing Q in Householder Decomposition

54 views
Skip to first unread message

David Emerson

unread,
Apr 17, 2018, 11:11:51 AM4/17/18
to deal.II User Group
Hello,

I have a FullMatrix A on which I'd like to perform a QR factorization and then access a few columns of the resulting orthogonal matrix Q. In looking for some internal options within deal.II, I came across the Householder class. After taking a pass at the source, it looks like the class has an optimized approach to storing information about the QR factorization in the form of a single full matrix and a diagonal vector. However, in looking at how the decomposition is being computed and how the least squares problem is being solved, I haven't been immediately able to tell how I might go about constructing Q from the information stored after initialize has run in the Householder object. I may have missed something and the Householder (full matrix) object does indeed simply store Q, but it seems it might be doing something different/optimized.

In any case, I'm simply looking for some advice as to how one might construct (or extract) Q from the Householder object. Thank you in advance for the help.

Best,
David

Wolfgang Bangerth

unread,
Apr 18, 2018, 6:29:53 PM4/18/18
to dea...@googlegroups.com

David,
Reading through the code a bit, the class does not in fact store the Q
and R factors explicitly. It does store R, but the Q factor is stored as
the product of Householder reflections of the form Q_i = I-v_i v_i^T
where the vectors v_i are so that they can be stored in the
lower-triangular part of the underlying matrix, whereas R is stored in
the upper triangular part.

The v_i vectors and the R matrix now are in conflict because they both
want to use the diagonal entry of the matrix, but we can only store one
in these positions, of course. Consequently, the entries (v_i)_i are
stored separately in the `diagonal` vector.

I'm not sure this is helpful in extracting this information, but that's
what the class appears to be doing.

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

David Emerson

unread,
Apr 21, 2018, 7:28:27 PM4/21/18
to deal.II User Group
Hi Wolfgang,

Thank you for the response and taking a look at the algorithm. I'll see if I can use some of your observations along with my own to do a reconstruction of Q. Thank you again!

David
Reply all
Reply to author
Forward
0 new messages