ExplicitBitVect: Add +operator to concatenate two ExplicitBitVects

This commit is contained in:
Schneider
2014-08-19 12:59:22 +02:00
parent 6d9d74daff
commit 3af5ba223c
4 changed files with 65 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
// $Id$
//
// Copyright (C) 2001-2010 Greg Landrum and Rational Discovery LLC
// Copyright (C) 2001-2014 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
@@ -1296,6 +1296,17 @@ void test13BitVectAllOnes() {
}
}
void test18BitVectConcatenation() {
{
ExplicitBitVect bv(32, false);
ExplicitBitVect bv2(32, true);
ExplicitBitVect bv3 = bv + bv2;
TEST_ASSERT(bv3.getNumBits() == 64);
TEST_ASSERT(bv3.getNumOnBits() == 32);
TEST_ASSERT(bv3.getNumOffBits() == 32);
}
}
int main(){
RDLog::InitLogs();
try{
@@ -1363,6 +1374,9 @@ int main(){
BOOST_LOG(rdInfoLog) << " Test BitVect with all ones -------------------------------" << std::endl;
test13BitVectAllOnes();
BOOST_LOG(rdInfoLog) << " Test Explicit BitVects: Concatenation Operation -------------------------------" << std::endl;
test18BitVectConcatenation();
return 0;
}