Double factorial and primorial
Joerg Arndt
arndt at jjj.de
Tue Dec 20 16:09:53 CET 2011
* Niels Möller <nisse at lysator.liu.se> [Dec 20. 2011 16:05]:
> Torbjorn Granlund <tg at gmplib.org> writes:
>
> > then one could sort the indexes using a minheap.
>
> Clever!
>
A bit of a warning: I once used a heap to do essentially the same
thing, it turned that using a simple array was significantly faster
(factor 20 or so). The array definitely needs to fit into level-1
cache.
More information about the gmp-devel
mailing list