Message290017
See also:
https://en.wikipedia.org/wiki/Hamming_weight
As that says, there are a number of languages and processors with first class support for a popcount function. I've frequently implemented it in Python when using integers as integer bitsets (`i` is in the set if and only if bit `2**i` is set in the integer), which often - except for finding the cardinality - runs much faster than using general Python sets. |
|
Date |
User |
Action |
Args |
2017-03-22 22:00:39 | tim.peters | set | recipients:
+ tim.peters, mark.dickinson, serhiy.storchaka, Jim Fasarakis-Hilliard, niklasf |
2017-03-22 22:00:39 | tim.peters | set | messageid: <1490220039.01.0.937350375479.issue29882@psf.upfronthosting.co.za> |
2017-03-22 22:00:38 | tim.peters | link | issue29882 messages |
2017-03-22 22:00:38 | tim.peters | create | |
|