Boost logo

Ublas :

Subject: Re: [ublas] [BLAS bindings] help appreciated on using trmv and gbmv
From: Florent Teichteil (florent.teichteil_at_[hidden])
Date: 2012-10-07 15:22:21


Le 7 oct. 2012 à 21:12, Rutger ter Borg <rutger_at_[hidden]> a écrit :

> On 2012-10-07 19:03, Florent Teichteil wrote:
>> Hi all,
>>
>> OK, the previous code works: I get R1==R2. But not if I change the
>> storage to row_major. I can understand it, since BLAS requires
>> column_major storage, so the bindings API should prevent from using
>> row_storage by producing a compilation error, which it doesn't.
>
> If you use a backend that supports row major (e.g., ATLAS), the bindings will have no problem with matrices in row_major format. If you pass a row_major matrix to an implementation that does not support row_major, the bindings automatically tries to pass it as a transposed column_major matrix.
>
> In short: whenever possible, row_major is supported by the bindings.
>
> Cheers,
>
> Rutger
>
I'm actually using ATLAS as a backend, so I don't understand why I get
the correct result with column_major but not with row_major (for the
first test case, since all other tests, either with transposed
triangular matrices or with banded matrices, give wrong results
anyway).

Do you observe the same thing on your computer with the code given in
my post? (replace M(i,j) == std::rand with M(i,j) = std::rand , and dM
with M, they were copy/paste errors).

Cheers
Florent