|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:26:57 -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=hk4mJrU9SKOs6oMmaBrMaDm+nHGRkLtAcuyuqaS+msc=; b=gi5z3NmXHOe1aJTeerp3i3bMO15mTR/AGrdYkJoyMHjrozByWEGxUM55dw5NooyQBb +Kj4plabnCvKwv17ZcccTS8fmo/bJp8UWX/wt9w0bCqnoFYOWULhODm/GT16u5yTrJtt QVyM8mkN2rEzZM87ZvOW6h5Nru+zyMhSEtg0o=
- 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=IS9P7rVVuaPGQei45gHdtGLhje9YFbFG356GEREz5XtOfy/ooZpGdy7PnC0f95ezle xte2GHEIynVCFO9ZXfreJ7RrYLlFkJBb9Pa9zRcKktgJhc9C8/LzTk/2Sf7/D3pPA9aB iKpx2iVXTewaasbGlEJMucsoZKOjSMXvcv7u0=
2010/5/11 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> 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;
> Please don't use 'idx'. :) How about idx_type or such... it should be
> more explicit.
How about idx_t ?
>> 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!
> I am still in favor of signed types because of the loop reasons.
> Similar things as Mark described happened to me too and I don't really
> see the advantages we gain by using unsigned types.
It's interesting to get this input from you, from Mark and from
Benjamin. So we all have quite the same experiencee: unsigned indexing
led to strange bugs for each of us. I was starting to wonder if I was
the only person to whom this happens...
> There is another thing regarding OpenMP... IIRC, it does not like
> 'unsigned int's in for loops and will not parallelize those. But maybe
> it even does not like anything but 'int' -- I have to double check
> that. Though I agree that this is not a strong argument.
> p.s. I am wondering what the scenario of multiple 2GB vectors, not to
> say of matrices with multiple 2GB rows could be...