QR decomp for complex matrix

Open discussion regarding features, bugs, issues, vendors, etc.

QR decomp for complex matrix

I'm used to the functions dgeqrf and dorgqr for real matrices. Recently I've been working with complex matrices, and I see there's a zgeqrf, but no zorgqr to construct the m x n Q matrix from the raw materials provided by zgeqrf. I guess there must be a reason for that -- can you tell me what it is?

(I've written code which does the job on Q for the complex case, but I'm sure it's horribly inefficient compared with the clever stuff that dorgqr does.)
cottrell

Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm

Re: QR decomp for complex matrix

ZUNGQR
Julien Langou

Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: QR decomp for complex matrix

Perfect! I missed that, needless to say, but then most z* functions have the same name as the corresponding d* ones, apart from the first letter.
cottrell

Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm

Re: QR decomp for complex matrix

Ah, but now I see: ZUNGQR does not have the same signature as DORGQR (data types aside).

However, it would be helpful if the doc for ZGEQRF had a cross reference to ZUNGQR.
cottrell

Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm

Re: QR decomp for complex matrix

Oof, sorry, too hasty! Actually the signatures of DORGQR and ZUNGQR are the same, modulo the data types for A, TAU and WORK. So (a less pressing question) is there a reason why the names of the functions differ, other than in their first letter as usual?
cottrell

Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm

Re: QR decomp for complex matrix

OR = Orthogonal
UN = unitary

In general we say orthogonal for real matrices, and we say unitary for complex matrices.

( For the record, my preference would be to use DUNxxx and ZUNxxx. )
Julien Langou

Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: QR decomp for complex matrix

Thanks for the explanation, Julien. My only remaining point is that it would be nice to have cross-references from the primary QR functions to those that extract or construct the actual Q matrix, in the online LAPACK documentation.
cottrell

Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm