Boost logo

Ublas :

Subject: Re: [ublas] [BLAS bindings] help appreciated on using trmv and gbmv
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2012-10-09 03:53:31


On 2012-10-08 14:33, Florent Teichteil wrote:
>
> You're right, computations with trmv are correct with values of
> reasonable magnitudes, let say between -500 and 500 for instance.
> Actually, I figured out why it didn't work with very large values up to
> RAND_MAX: depending on the computations performed by gemv or trmv, some
> temporary values exceeded the maximum value that can be represented by a
> double number (for instance, RAND_MAX * RAND_MAX can not be represented
> using double precision numbers).
>
> That said... The bindings for banded matrices, i.e. gbmv, still give
> incorrect results with matrices and vectors filled with reasonable
> values. Moreover, the only transpose operator that makes sense
> (according to your previous post), does not compile with
> banded_adaptors. So:
>
> 1. How can I get correct results with gbmv (even with matrices and
> vectors filled with the same value of 1.0)?
>
> 2. How can I transpose a banded-adapted matrix before calling gbmv,
> using boost::numeric::bindings::trans?
>
> Cheers,
> Florent
>

Hello Florent,

1) you don't clear the banded matrix B, in my case M != B. If you do
that, the routines using the packed banded storage start to work.
blas::gbmv assumes packed storage.

2) The banded adaptor of the dense matrix doesn't work with blas::gbmv
because the memory model isn't compatible. Maybe we can apply a trick to
the memory model, such as passing a* = begin_value(A)-kl and lda += 1?
We would need to check that. Until then, it is not supported.

Regards,

Rutger