Index refactoring: StorageIndex must be used for storage only (and locally when it make sense). In all other cases use the global Index type.

This commit is contained in:
Gael Guennebaud
2015-02-13 18:57:41 +01:00
parent fe51319980
commit fc202bab39
78 changed files with 514 additions and 564 deletions

View File

@@ -292,10 +292,10 @@ class RandomSetter
/** \returns a reference to the coefficient at given coordinates \a row, \a col */
Scalar& operator() (Index row, Index col)
{
const StorageIndex outer = internal::convert_index<StorageIndex>(SetterRowMajor ? row : col);
const StorageIndex inner = internal::convert_index<StorageIndex>(SetterRowMajor ? col : row);
const StorageIndex outerMajor = outer >> OuterPacketBits; // index of the packet/map
const StorageIndex outerMinor = outer & OuterPacketMask; // index of the inner vector in the packet
const Index outer = SetterRowMajor ? row : col;
const Index inner = SetterRowMajor ? col : row;
const Index outerMajor = outer >> OuterPacketBits; // index of the packet/map
const Index outerMinor = outer & OuterPacketMask; // index of the inner vector in the packet
const KeyType key = (KeyType(outerMinor)<<m_keyBitsOffset) | inner;
return m_hashmaps[outerMajor][key].value;
}