From ripley at stats.ox.ac.uk  Sat Jun 12 09:01:47 2010
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 12 Jun 2010 08:01:47 +0100 (BST)
Subject: [Rd] support for radix order() over entire range of integers
In-Reply-To: <AANLkTikOwah7qZJX5dw8IjpAEIXrSaYaEuiQ5YyYS8S7@mail.gmail.com>
References: <AANLkTikOwah7qZJX5dw8IjpAEIXrSaYaEuiQ5YyYS8S7@mail.gmail.com>
Message-ID: <alpine.LFD.2.00.1006120741150.6580@gannet.stats.ox.ac.uk>

On Fri, 11 Jun 2010, Michael Lawrence wrote:

> Hi,
>
> Is there any good reason not to allow radix sorting via order() over the
> entire range of R (32bit) integers, instead of setting a hard limit at
> 100,000? Many machines have plenty of memory to support this. Seems like it

Really?  That's 16Gb on my understanding of your proposal (2^32-1 
4-byte uints). Not 'many machines' in my experience, but some.  But 
the limit was set in 2003 when that code was written, and it was added 
for speed with factors, where 100,000 was plenty.

> is just a matter of dynamic allocating the bucket array instead of the
> current static allocation.

Hmm, it is currently automatically allocated: it would need to be 
malloc-ed.  Might be worth keeping automatic allocation for smaller 
ranges.

> This would really help with e.g. sorting positions in the genome.
>
> I'm happy to submit a patch if this sounds sensible.

Yes please.

> Thanks,
> Michael
>
> 	[[alternative HTML version deleted]]

Please don't send HTML.

>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] support for radix order() over entire range of integers
Prof Brian Ripley