diff --git a/src/storage/BitVector.h b/src/storage/BitVector.h index 801ec2bb2..e6d0add3e 100644 --- a/src/storage/BitVector.h +++ b/src/storage/BitVector.h @@ -392,6 +392,23 @@ public: return result; } + /*! + * Checks whether all bits that are set in the current bit vector are also set in the given bit + * vector. + * @param bv A reference to the bit vector whose bits are (possibly) a superset of the bits of + * the current bit vector. + * @returns True iff all bits that are set in the current bit vector are also set in the given bit + * vector. + */ + bool isContainedIn(BitVector const& bv) const { + for (uint_fast64_t i = 0; i < this->bucketCount; ++i) { + if ((this->bucketArray[i] & bv.bucketArray[i]) != bv.bucketArray[i]) { + return false; + } + } + return true; + } + /*! * Adds all indices of bits set to one to the provided list. * @param list The list to which to append the indices.