Boost logo

Ublas :

From: Paul Thompson (p.thompson_at_[hidden])
Date: 2007-03-14 03:31:32


For _rectangular_ dense matrices, my calls to atlas::gemv(...) were failing
with an incorrect leading dimension of A (LDA).
This problem may not have been noticed since it is indifferent to square
matrices.

I'm using the CVS head from both the bindings sandbox and the boost main CVS.

The bug appears to be in the traits in the bindings,
in ublas_matrix.hpp,
in boost::numeric::bindings::traits::matrix_detail_traits

static int leading_dimension (matrix_type& m) {
      // g++ 2.95.4 and 3.0.4 (with -pedantic) dislike
      // identifier_type::functor_type::size2()
      //return functor_t::size_M (m.size1(), m.size2());
      //should be:
        return functor_t::size_m (m.size1(), m.size2());
    }

    

For an element in a row in a row major matrix, the element on the next row is
ahead in memory by the Column Size (the minor size)

For an element in a column in a column major matrix, the element on the next
column is ahead in memory by the Row Size (the minor size)

Paul Thompson.