Boost logo

Ublas :

Subject: [ublas] Getting bit by ormqr.hpp
From: Jeremy Conlin (jeremit0_at_[hidden])
Date: 2008-10-16 08:54:07

I have been using ormqr.hpp and recently got an error message saying:
Parameter 2 to routine ZUNMQR was incorrect

This parameter indicates whether a conjugate transpose is to be taken when
applying a matrix Q. The valid options for the complex version are 'N' or
'C' (standing for No transpose or Conjugate transpose respectively) while
for the single or double version, [DS]ORMQR the valid options are 'N' or 'T'
(for No transpose or Transpose respectively). Now the reason I had a
problem was because I passed 'T' to the complex version.

In ormqr.hpp there is an assert statment to ensure only valid options are
passed to ormqr generally:

        assert ( trans=='N' || trans=='C' || trans=='T' );

This obviously didn't catch my problem. It is easy to move this assertion
into the more specific functions of ormqr that just call the LAPACK
versions. This way you would have one of the two statements below and could
avoid the error I got this morning.

        assert ( trans=='N' || trans=='T'); // For single or double
        assert ( trans=='N' || trans=='C'); // For complex numbers

I can make this change and submit a patch, but I wanted to get others'
opinions. It seems like the specific functions "want" to remain clean and
only make the call to LAPACK and nothing else. That is why I hesitate to
put the assert in them.

What do you think is the best thing to do? I hope my explanation was clear

Jeremy Conlin