Boost logo

Ublas :

Subject: [ublas] axpy_prod of matrix with vector - initialization of result v
From: Hoerentrup Jobst (jobst.hoerentrup_at_[hidden])
Date: 2012-05-04 03:27:38

Dear ublas experts,

I am a newbie to ublas, but I have the impression there might be a bug in axpy_prod:

operation.hpp, line 76:

Instead of

        if (init)
            v.assign (zero_vector<value_type> (e1.size1 ()));

I believe it should rather be

        if (init)
            v.assign (zero_vector<value_type> (e1.size2 ()));

Reason: The length of the result vector should match the number
of matrix columns, not rows.

Line 76 is just one example, there are a few more places
with the same potential bug.

Ublas looks relatively mature to me, so am I missing something?

Many thanks,


Jobst Hörentrup
Technicolor R&I Germany 
Deutsche Thomson OHG
Karl-Wiechert-Allee 74 
30625 Hannover, Germany
Offene Handelsgesellschaft, Sitz Hannover,
Registergericht Hannover HRA 24616
David Christophe Chambeaud, Dr. Peter Jax,
Horst Kuhn, Vincent Rimbeau
Persönlich haftende Gesellschafterinnen:
Société Francaise d' Investissement et d 'Arbitrage
S.O.F.I.A. Issy-les-Moulineaux, Handelsregister R.C.S. Nanterre 785610932
Technicolor International SAS, Issy-les-Moulineaux,
Handelsregister R.C.S. Nanterre 439290735