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]>
>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: http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr. http://rudbek.com
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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk