|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: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Tue, 11 May 2010 17:19:45 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=ShduJVw1O6HWufQ20lUbTO1fMoRCKuUylF4N07wrnj4=; b=VnDcMev30TrjMkuuB6V3OZscc1iPKR0/pOOFjcKFdLmseuCf/kcrOZzCczveNcLDRq PYX5V6ZYyvApKfAT21mDU1+EP73zz4bqL9EGuh19IGer7zbLIQSrTU2nIlCnIbGv11p/ 9rMe1621WCpy43fwEPKIRSnM5AsxNS5I8nDnk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Okts0V3gJdXYxq4YlmXWqNZSV8TwJfy7tCI5vHdjV84fqYvlvKCCmXwh37Hb6mWHlY G/XOkSZcJMCqgYMGzo+NYXYXRrdT+8waREb7U43to9kZHU4i31YHYnnzw8dVHFqNpm6c BxfAKhvbpRdxkFT2wId0F+M2t61ZkwugxHkWI=
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
> 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.
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...