|Re: [eigen] Indexes: why signed instead of unsigned?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Indexes: why signed instead of unsigned?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 11 May 2010 11:33:43 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=OaNJbaecn7X4iUGIFfbEpeSIRZSJ2e3Huw34hA2S4YI=; b=mo3z0eIBQ8X0OqXDk+lbA4n6y3yCYIaq5fdgS/M6rm+ZOa6xgPC6bfzfzdc6cd8Ir4 5EWNwDg7kQqnjvu4Nzr/xyIcPmJET2QxBlpUTvziqbnMfdKHZ5ghgx1NtAHSD+Pqrgrk sIUCu5+F6Hd8NZrOUWMMSK64giU1JnP8ebdic=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=b2fouGFh4PLsrFHoJB8CVfJy/Hy1X+5E5zFE9/kYyrSs3xwWV4xXr1vcUBwpeGZA9N L8v0McgP9QWxHbSSZK1/GteNoglzkpxVIVvy+1B+u6UvoqDMScEfr3MY73Tbmaf173xs y615322MkUYpfGbEvB9MAnM9N3BqrNqgbxr28=
2010/5/11 Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx>:
> On Tue, 11 May 2010, Benoit Jacob wrote:
>> What about the other debate, between int (32bit) and ptrdiff_t (same
>> size as void*) ?
> A disadvantage of the potentially bigger ptrdiff_t is that it costs more
> memory. I guess this is usually not an issue, but it does make a difference
> for sparse matrices.
Right, I had completely overlooked the Sparse case.
Though if we agree that dense vectors may potentially be larger than
2e+9, then sparse vectors may too! In other words, the arguments in
favor of ptrdiff_t also apply to the Sparse case, only this time there
is the downside of memory usage. Maybe it's important to let the index
type be easily configurable for Sparse objects.
> In fact, we earlier had somebody who wanted to use
> 16-bit instead of 32-bit for this reason:
OK so we need to make that configurable.
> The performance hit of using 64-bit indices may not be so big,
Let's be clear: ptrdiff_t is only 64bit on 64bit platforms. So it
should not give any performance hit at all. As for the memory usage
hit, it is negligible in the Dense case, it's only an issue in the
> but we never
> had somebody complain about eigen using only 32-bit indices. And on a
> practical note, it seems rather short before the planned beta tagging to
> make such a radical change.
True. This is not optimal. On the other hand, releasing a beta with
int and getting people to complain about that later, would be even
> No opinion on the signed/unsigned debate.