Re: [eigen] Indexes: why signed instead of unsigned?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2010/5/11 Mark Borgerding <mark@xxxxxxxxxxxxxx>:
> Is there any reason why sparse matrices backed by distributed storage

This distributed storage idea was for dense, not sparse matrices, IIRC.

> need
> to use the same indexing integer data type as the more common dense storage
> in memory?

They shouldn't have to. Right now, due to a limitation in Eigen's
design, the 'int' type is hardcoded everywhere. The idea of letting
that either be defined in the ei_traits, or let that be inferred from
the StorageKind (as Joel suggests, and I agree with him it's the
better way), changes that, so they will be decoupled. Distributed
storage will be able to use its own index type, regardless of the
default.

>
> Beware bending a design to meet the edge case.

Sure is good to keep in mind!

Benoit

>
>
> Benoit Jacob wrote:
>>
>> Note: the distribute storage case is an example where one might want
>> 64bit indices even if the CPU architecture is 32bit. Indeed, since the
>> array doesn't need anymore to fit in RAM...
>>
>> So it's an example where ptrdiff_t may not be the right choice.
>>
>> Benoit
>>
>> 2010/5/11 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
>>
>>>
>>> grrr, i had forgotten but a while ago someone inquired about the
>>> possibility to use eigen with distributed storage, and we took that
>>> into account when doing the big class-hierarchy-refactorings, to
>>> ensure it's possible to plug in a new storage system, see
>>> StorageKind... so it would be a bit too bad to restrict the indices
>>> types to int.
>>>
>>> This actually suggests that no matter what the default is, the indices
>>> type should be something that the Storage can control. This would also
>>> allow Sparse matrices to use different index types. We could make it a
>>> typedef in ei_traits, that is propagated to nested expressions, ...
>>>
>>> Gael, what's your opinion?
>>>
>>> Benoit
>>>
>>> 2010/5/11 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
>>>
>>>>
>>>> 2010/5/11 Rui Maciel <rui.maciel@xxxxxxxxx>:
>>>>
>>>>>
>>>>> On 11 May 2010 16:47, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>>>>
>>>>>>
>>>>>> I just had a diabolic idea, if we agree that bigger-than-2^31-support
>>>>>> is not a top priority and will at most be used by relatively few
>>>>>> people, then we can keep things unchanged for now, so keep 'int' in
>>>>>> Eigen 3.0, and later on, when actual people actually need it (perhaps
>>>>>> in eigen 3.45), add a non-default compile-time option
>>>>>> EIGEN_USE_LONG_INDICES. Such an option would then break the ABI of
>>>>>> Eigen classes, so it couldn't become default.
>>>>>>
>>>>>> Question - is BLAS/LAPACK using int or ptrdiff_t ?
>>>>>>
>>>>>> Benoit
>>>>>>
>>>>>
>>>>> As this move will break the ABI then why not implement it right on the
>>>>> 3.0 release instead of pushing it to a point release in the future?
>>>>>
>>>>
>>>> Because we've a lot on our plates already now.
>>>>
>>>> Benoit
>>>>
>>>>
>>>>>
>>>>> Rui Maciel
>>>>>
>>>>>
>>>>>
>>>>>
>>
>>
>
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/