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

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




On Tue, May 11, 2010 at 5:07 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
I tend to agree that we need ptrdiff_t instead of int. I'd suggest:

typedef std::ptrdiff_t idx;

so we get something short to type.

There remains the question of signed vs. unsigned. In other words,
ptrdiff_t vs. size_t. I'm totally unable to decide either way. Help!

It would be nice to see if there is consensus in this respect among other linear algebra packages. What do the more common alternatives use?
Here's a couple of examples I found by a quick search:
- blas uses signed integers: http://www-sfb288.math.tu-berlin.de/~jtem/blas/api/index.html
- boost::numeric::ublas uses unsigned integers: http://www.boost.org/doc/libs/1_43_0/libs/numeric/ublas/doc/matrix.htm
- OpenCV use signed integers: http://opencv.willowgarage.com/documentation/cpp/basic_structures.html#mat

Adolfo


Benoit

2010/5/11 joel falcou <joel.falcou@xxxxxx>:
> Rohit Garg wrote:
>>
>> This will become an issue when people start using bigger datasets than
>> 2GB. At a minimum, we need a eigen_size_t typedef somewhere for easy
>> portability. Using long throughout in 32 bit machines doesn't make
>> sense.
>>
>
> Isn't it what ptrdiff_t supposed to be ? biggest signed int on the platform
> .
>
> --
> ___________________________________________
> Joel Falcou - Assistant Professor
> PARALL Team - LRI - Universite Paris Sud XI
> Tel : (+33)1 69 15 66 35
>
>
>
>
>




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