Registered Member
|
Hey guys,
I have a big matrix that is not sparse, has 3 column and a lot of rows ( a lot = >> max(int)). Looking at the doc and reading around, i decided to change my index type to unsigned int ( to go from a max of 2,147,483,647 to a max of 4,294,967,295) :
That worked fine because in the _init2 functino of PlainObjectBase, i previously had negative row ( because of the int overflow) and with the change, i have the good number. The only problem now is with the function internal::check_rows_cols_for_overflow, it computes a max number of row assuming that the type is signed, so the change of index type doesn't change anything for this function.
Is this a normal behaviour, or it's something I didn't understand (Why would an index be signed anyway ??) I'll try using a map object to a pointer for now, but i am curious to see what you think about it. Cheers |
Registered Member
|
I guess there should be something like
|
Moderator
|
The index type is indeed assumed to be signed, I'm not sure everything will work if that's not the case, even if we use std::numeric_limits<Index>::max() here. The rational is that loosing 1 bit is not a big deal because if someone need sizes larger than 2^31, then better moving to long int. By default, we use std::ptrdiff_t. Since you are having troubles I guess you are running on a 32 bit system ?
|
Registered Member
|
I am on a 64 bits machine, but our software is still only in 32 bits
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]