A question about mpz_popcount

jdevoto.uba at gmail.com jdevoto.uba at gmail.com
Wed Feb 27 23:09:56 CET 2008


I haven't used gmp for many years so my question might have an obvoius

I have some millions of numbers of 7296 bits (a multiple of 16). I
would like to count the bits in each of the 16 equal parts of the
number. For example I have one part from bit 0 to bit 456, a second
one from bit 457 to bit ... etc. And I would like to produce a number

b_15 b_14 ... b_0

were each one of the bits b_j is the quantity of bits in part j.

I know a way of doing this, but it is too slow.  Speed here is very

Any help will be welcomed.


Jorge Devoto
University of Buenos Aires

More information about the gmp-discuss mailing list