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-08 04:29:08


On 2012-10-07 22:50, Florent Teichteil wrote:
>>
>> OK, but for the moment, it would be wonderful if binding functions
>> like trmv and gbmv work properly with dense matrices and triangular
>> and banded adaptors. (Perhaps they work properly, but I'm misusing
>> them, see my attached test files).
>>
>> Cheers
>> Florent
>>

Hey Florent,

not sure why it compiles, but

ublas::some_triangular_adaptor<>( bindings::trans( .. ) )

isn't supposed to work. The bindings meta-machinery isn't understood by
ublas, but the other way around in many cases it is. Please try
bindings::lower( bindings::trans( M ) ) to achieve the same.

As for the test cases, after some checking, I think it has to do with
accumulation of error. The results print to identical values, but
norm_inf shows differences (due to std::rand() being large). If you
replace std::rand() with, say, 1.0, all results become identical and
tests say "CORRECT". I would have to check "What Every Computer
Scientist Should Know About Floating Point Arithmetic", but I am sure
the answer can be found in that direction.

Cheers,

Rutger