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

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


Le 11/05/2010 17:07, Benoit Jacob a écrit :
> 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!
>   
According to: 

http://www.codeproject.com/KB/cpp/size_t-and-ptrdiff_t.aspx
definitely, it's ptrdiff_t for array indexing.

Robert

> 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
>>
>>
>>
>>
>>
>>     
>
>
>   


-- 
Robert Bocquier
Tel: +33 438 022 624

ARTURIA
4 chemin de Malacher
38240 Meylan - France
Tel: +33 438 020 555
Fax: +33 438 020 525

http://www.arturia.com





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