This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Functions for computing the population count (aka Hamming weight) of an array | |
in-place using the built-in popcount routine. | |
Works with any integer datatype 64 bit-width or smaller. | |
Compile with gcc flag -mpopcnt | |
Adapted from | |
https://gist.github.com/aldro61/f604a3fa79b3dec5436a by Alexandre Drouin | |
""" | |
import numpy as np | |
cimport numpy as np |