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

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


I must confess that back in the day I asked myself the question of why eigen uses signed integers instead of unsigned ones for indices. The latter seemed a more natural choice, but then again using signed integers has its advantages, as pointed in previous posts. I have to say that the discussion on this topic has been an interesting read. Anyway, I'm not tipping the balance either way. I currently get away with casts when needed.

Adolfo

On Tue, May 11, 2010 at 3:18 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
(I'm starting to lean towards size_t myself as the frequent comments
we get suggest it's what the rest of the world has standardized on,
and there's no huge reason not to do that...)

Benoit

2010/5/11 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> There's a new thread on the forum about that (sigh).
> http://forum.kde.org/viewtopic.php?f=74&t=87883
>
> Let's settle this once and for all. There are 2 debates:
> 1) signed or unsigned?
> 2) int (that is 32 bits) or same-sizeof-as-pointers (e.g. 64bit on
> 64bit platforms)?
>
> For 2) signed, we could do ptrdiff_t, i guess. Unless you're sure that
> 'long' is actually on all platforms the size of a pointer. I still
> dont know whether 2) matters. Certainly not for cubic-complexity
> algorithms (would take forever). But for plain "level 1" operations,
> perhaps it's plausible. Feels like we shouldn't arbitrarily restrict
> sizes to 32 bits. Opinions?
>
> For 1), I don't know. the forum poster mentions a reasonable way to
> write decreasing for loops. It's true that such loops are not too
> frequent anyway. I dont know. Asking for opinions. Dont want to impose
> upon you a decision made 3 years ago when I was a "noob".
>
> Gael? Hauke? Jitse? Thomas? everybody?
>
> Benoit
>





--
Adolfo Rodríguez Tsouroukdissian, Ph. D.

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, o el empleado encargado de su entrega a dicha persona, por favor, notifíquelo inmediatamente y remita el mensaje original a la dirección de correo electrónico indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida.

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited.  If you have received this e-mail in error, please immediately notify the sender at the above e-mail address.


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