Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-11-07 03:45:34


On Monday 06 November 2006 20:16, Steve Taylor wrote:
> Hi.
>
> I'm trying to store a rather large dataset into a 480189 x 17770
> mapped_matrix. The problem is that mapped_matrix generates a key to the
> element by multiplying the row index by the row width and adding the column
> index. This causes a bad_index exception to be raised from functional.hpp
> (line 1397 in boost 1.33.1).
>
> One of two things should be changed:
> 1. When creating a mapped_matrix of specified dimensions, those dimensions
> should be checked in the same way as in line 1397 of functional.hpp.
> 2. Another template parameter should be added to allow a different type
> other than std::size_type to be used.

I suggest using option 3:

coordinate_matrix<T, F, IB, IA, TA>

this matrix stores 3 arrays: IA index1, index2; TA value;
Thus you can (theoretically) use a matrix of size 2^31*2^31
and you can explicitly set the types of the index array (IA) and the value
array (TA = array of T)

mfg
Gunter