|
Ublas : |
Subject: Re: [ublas] [bindings] Redundant parameters in lapack::orm* functions
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-08-23 04:25:01
On Mon, Aug 23, 2010 at 9:29 AM, Rutger ter Borg <rutger_at_[hidden]> wrote:
> Marco Guazzone wrote:
>
>> Thank you, Rutger!
>>
>> Unfortunately, this time I have problem to specify parameter when I
>> want to use the transpose variant of the product (i.e., when in
>> LAPACK::?ORMQL functions parameter TRANS == 'T').
>>
>> I've tried to use bindings::trans but with no success.
>>
>> I attach a sample file.
>> If you try to compile it, you'll get a lot of errors, which disappear
>> if you comment the "transpose" cases (lines 62 and 84)
>>
>> My compiler is GCC 4.4.4 and my compiler options are:
>> -Wall -ansi -pedantic -lm -llapack
>>
>> Can you help me to fix this problem?
>>
>> Thank you very much!!
>>
>> Cheers,
>>
>
> The LAPACK documentation seems to be wrong for ormql,
>
> A (input) DOUBLE PRECISION array, dimension (LDA,K)
> The i-th column must contain the vector which defines the
> elementary reflector H(i), for i = 1,2,...,k, as returned by
> DGEQLF in the last k columns of its array argument A.
> A is modified by the routine but restored on exit
>
> the bindings assumed A to be const in this case (due to "(input)"), but the
> last sentence clearly says it needs read/write access. So it may be
> considered (input/workspace), and in other cases (gejsv) we've modified the
> argument to an LValue.
>
> I've added an override for this in the generator, and committed the results
> to svn.
>
> Could you please try your code with adjusted constness for A?
>
It works perfectly.
In the previously posted code, I've removed the "const" identifier
from "QL" parameter of the "prod" function.
I've not tried but I think a similar problem applies to the other
ORM?? (QR, RQ, ...) functions.
Just to be a little pedantic :P ... I get some warnings (see attachment).
So in the future, when you have time, it would be great if you work in
order to remove them.
Thank you very much!!!
Cheers,
-- Marco