mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-04 21:54:27 +08:00
onbit counts in results of operator&, operator|, operator^, etc. were incorrect
This commit is contained in:
@@ -79,28 +79,28 @@ ExplicitBitVect::ExplicitBitVect(const char *data,const unsigned int dataLen)
|
||||
ExplicitBitVect ExplicitBitVect::operator^ (const ExplicitBitVect &other) const {
|
||||
ExplicitBitVect ans(d_size);
|
||||
*(ans.dp_bits) = (*dp_bits) ^ *(other.dp_bits);
|
||||
ans.d_numOnBits=dp_bits->count();
|
||||
ans.d_numOnBits=ans.dp_bits->count();
|
||||
return(ans);
|
||||
};
|
||||
|
||||
ExplicitBitVect ExplicitBitVect::operator& (const ExplicitBitVect &other) const {
|
||||
ExplicitBitVect ans(d_size);
|
||||
*(ans.dp_bits) = (*dp_bits) & *(other.dp_bits);
|
||||
ans.d_numOnBits=dp_bits->count();
|
||||
ans.d_numOnBits=ans.dp_bits->count();
|
||||
return(ans);
|
||||
};
|
||||
|
||||
ExplicitBitVect ExplicitBitVect::operator| (const ExplicitBitVect &other) const {
|
||||
ExplicitBitVect ans(d_size);
|
||||
*(ans.dp_bits) = (*dp_bits) | *(other.dp_bits);
|
||||
ans.d_numOnBits=dp_bits->count();
|
||||
ans.d_numOnBits=ans.dp_bits->count();
|
||||
return(ans);
|
||||
};
|
||||
|
||||
ExplicitBitVect ExplicitBitVect::operator~ () const {
|
||||
ExplicitBitVect ans(d_size);
|
||||
*(ans.dp_bits) = ~(*dp_bits);
|
||||
ans.d_numOnBits=dp_bits->count();
|
||||
ans.d_numOnBits=ans.dp_bits->count();
|
||||
return(ans);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user