Boost logo

Ublas :

From: Georg Baum (Georg.Baum_at_[hidden])
Date: 2005-02-22 07:55:44


Am Freitag, 18. Februar 2005 13:52 schrieb Andreas Klöckner:
> Hi there,
>
> when trying to copy-construct a sparse matrix of complex<double> entries
> from one of double entries (for example), the matrix assignment code
> calls the assign functor, which is already set to a "complex = double"
> assignment, with matrix_type::value_type(0) (which is complex<>) as the
> second argument. Which fails.
>
> The attached patch against Boost 1.32 fixes this.

Hi Andreas, Michael,

I stumbled over the same problem when I switched from a pre 1.32 CVS version
(approx. aug 2004, boost CVS, not ublas CVS) to recent CVS HEAD. I use a
mixed product that did not work anymore:

matrix<double> a;
matrix<complex<double> > b;
matrix<complex<double> > c;

c = prod(a, b);

Attached is an updated version of the patch that applies to current CVS.
I retained the constructor from zero (argument2_type(0)) and did not use
argument2_type(), because it makes no difference for me, but you might need
to change this.

Georg