Boost logo

Ublas :

From: Jens Seidel (jensseidel_at_[hidden])
Date: 2008-03-16 12:42:58


On Sun, Mar 16, 2008 at 05:42:38PM +1100, Paul C. Leopardi wrote:
> On Sun, 16 Mar 2008, Paul C. Leopardi wrote:
> > Hi all,
> > I'm getting strange results (below) with iterators in storage_sparse.hpp
> > and was wondering if this was a know issue in gcc 4.3.0?
>
> I've narrowed the bug down to a few lines of operator*= in matrix_mult_imp.h
> in my own GluCat code:
>
> 440 // Operate only within a common frame
> 441 const index_set_t our_frame = lhs.m_frame | rhs.m_frame;
> 442 const multivector_t& lhs_ref = (lhs.m_frame == our_frame)
> 443 ? lhs
> 444 : multivector_t(framed_multi_t(lhs), our_frame, true);
> 445 const multivector_t& rhs_ref = (rhs.m_frame == our_frame)
> 446 ? rhs
> 447 : multivector_t(framed_multi_t(rhs), our_frame, true);
>
> Here multivector_t is a class containing a member of type
> ublas::compressed_matrix< Scalar_T, orientation_t >.
>
> When I change const multivector_t& rhs_ref to const multivector_t rhs_ref
> the code works. This looks like a compiler bug to me.

The code looks legal C++ code under the assumption that the type
multivector_t has a copy contructor which is required (compare e.g.
http://www.gnu.org/software/gcc/bugs.html, "Copy constructor access
check while initializing a reference."). Otherwise you should also get
a compile time error ...

Jens