|
Boost : |
From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-05-06 03:44:32
----- Original Message -----
From: "Matthias Troyer" <troyer_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, May 06, 2002 9:57 AM
Subject: Re: [boost] ublas: matrix clear() and operator=
>
> On Saturday, May 4, 2002, at 08:13 PM, Toon Knapen wrote:
>
> > On Friday 03 May 2002 16:18, Joerg Walter wrote:
> >> If we use a scalar
> >> assignment operator, we could assume a matrix layout. It seems
> >> reasonable
> >> to assume a dense layout. The main point now is, that the proposed
> >> assignment operator is rather useless, if one assigns a non zero
> >> scalar to
> >> a sparse matrix assuming dense matrix layout.
> >>
> >> IOW I'd like to keep scalars, vectors and matrices separate ;-)
> > Thinking of it again, I agree with you.
> > I was looking at the BLAST specs to get some inspiration but found no
> > similar
> > operation directly (of course you can get the same result doing m*= 0
> > but
> > this is doubtly the best way to do it).
>
> No, m*=0 does not work, as far as I know. At least in my experience
> (but it might be a broken implementation), if the uninitialized
> matrix contains NaN, multiplying the NaN with 0 is still NaN and not 0.
Yep, this seems rather dangerous. But Toon is right, if he mentions, that
ublas clear() doesn't have the same semantics as STL clear(). Shouldn't we
better use the name zeroize() instead of clear()?
Regards
Joerg
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk