Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-05-03 11:11:06

At Wednesday 2002/05/01 12:17, you wrote:
>----- Original Message -----
>From: "Toon Knapen" <toon.knapen_at_[hidden]>
>To: <boost_at_[hidden]>
>Sent: Tuesday, April 30, 2002 6:09 PM
>Subject: [boost] ublas: matrix clear() and operator=
> > Currently, the matrices can be clear()-ed such that all elements are set
> > 0. I would find it even more convenient to be able to use
> > operator=(some_value_type) to assign a specific value to all the entries
> > the matrix.
>How would you define the semantics of such an assignment operator for sparse

It seems to me the whether the matrix is implemented as a 2D array or held
in some sparse implementation, ALL of the entries should now have

As an implementation detail for the sparse representation, there is nothing
sacred about calling the value of an unheld entry zero(0), it could be any
value. One possible implementation of this operator would to be to "empty"
the sparse cells which exist and set the "default value" appropriately.

> > But I figure there's some good reason one has to use clear()
> > instead of operator=() ?
>Do you think, it would be worthy to add something like zero_vector<> and
>zero_matrix<> to allow for syntactic sugar like m = zero_matrix<>()?
>Unsubscribe & other changes:

Victor A. Wagner Jr.
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
               "There oughta be a law"

Boost list run by bdawes at, gregod at, cpdaniel at, john at