|
Ublas : |
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-11-21 11:11:14
On Monday 20 November 2006 16:29, Max Weinberg wrote:
> For 1): If I get you right, the index type used for matrix and vector has
> to be identical. That sounds logical. There has to be a template parameter
> for IA that specifies the difference_type (now difference_type is taken
> from the allocator, which makes no sense at all).
>
> For 2): No, a cast from IA::value_type to size_t makes no sense.
>
> There is another type "array_size_type" that you didn't mention. It is
> intended to be used for indexing values in the index array. This could be a
> small integer for most applications, since it is related to the number of
> non-zeros you want to store in a sparse container.
> If you want to store elements with big coordinates, you need a big integer
> type for the index type (which is IA::value_type and matrix::size_type).
> Unfortunately, in the current code array_size_type and size_type are not
> used properly.
So lets collect the requirements for the matrix class:
size/difference type for data containers: usually native size_t, ptr_diff_t
index type: IA::value_type
matrix::size_type := index type
matrix::difference_type := signed version of index type
this matrix should work together with a vector class that has the same
size_type and difference_type. These types should be used by the underlying
storage array as well.
Maybe I have time to examine the current strategy tonight. Any help is
welcome.
mfg
Gunter