Boost logo

Ublas :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2004-12-30 04:19:54


Karl Meerbergen wrote:

> [...] I think that the concept of size_type should be revisited: the
> size_type of the sparse matrix is not necessarily the same as the
> size_type of the index_array_type and value_array_type. As far as I can
> see, no distinction is currently made.

There are two related problems here. First is the size_type and
signed/unsigned comparison which leads to conversion of *values*.
Warning is annoying but conversion is IMHO not very dangerous
(sizes are always positive, aren't they?).

Second and, I am afraid, much worse problem is the type of indices
held in the index_array. Parameter of std::vector::operator[] and
ublas::vector::operator[] is size_type (which is size_t which is
unsigned), so it seems `natural' that components of index_array are
unsigned, too. Therefore default template parameter in ublas vectors
and matrices is ublas::unbounded_array<unsigned>. But indices in umfpack
and superlu are int's and function parameters are pointers to int.
Therefore we need conversion of *pointers* (i.e. unsigned* -> int*),
which in `pure C++' is, as I said in previous mail, not allowed.

fres