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

[ Thread Index | Date Index | More Archives ]

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.

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

Mail converted by MHonArc 2.6.19+