systematize use of popcnt

This commit is contained in:
Greg Landrum
2016-01-01 08:41:57 +01:00
parent 6bd2c20ac0
commit 0015f853ac
3 changed files with 22 additions and 10 deletions

View File

@@ -775,6 +775,14 @@ template std::string BitVectToBinaryText(const ExplicitBitVect&);
template void UpdateBitVectFromBinaryText(SparseBitVect&, const std::string&);
template void UpdateBitVectFromBinaryText(ExplicitBitVect&, const std::string&);
// from here:
// http://stackoverflow.com/questions/3849337/msvc-equivalent-to-builtin-popcount
#ifdef __MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define USE_BUILTIN_POPCOUNT 1
// the Bitmap Tanimoto and Dice similarity code is adapted
// from Andrew Dalke's chem-fingerprints code
// http://code.google.com/p/chem-fingerprints/