本文整理汇总了C++中OBBitVec::SetBitOff方法的典型用法代码示例。如果您正苦于以下问题:C++ OBBitVec::SetBitOff方法的具体用法?C++ OBBitVec::SetBitOff怎么用?C++ OBBitVec::SetBitOff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBBitVec
的用法示例。
在下文中一共展示了OBBitVec::SetBitOff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testAutomorphismMask
void testAutomorphismMask() {
// read file: 3 6-rings
//
// /\ /\ /\
// | | | |
// \/ \/ \/
//
cout << "testAutomorphismMask" << endl;
OBMol mol;
OBConversion conv;
conv.SetInFormat("cml");
std::ifstream ifs(OBTestUtil::GetFilename("isomorphism1.cml").c_str());
OB_REQUIRE( ifs );
conv.Read(&mol, &ifs);
OBIsomorphismMapper::Mappings maps;
// First of all, how many automorphisms are there without any mask?
// This takes about 20 seconds, so you may want to comment this out while debugging
FindAutomorphisms(&mol, maps);
cout << maps.size() << endl;
OB_ASSERT( maps.size() == 4 );
// Now, let's remove the bridge (atomId 6) of the central ring.
//
// /\ /\ /\
// | | | |
// \/ \/
// both rings can be flipped around exocyclic bond, the whole molecule can be mirrored
// horizontally, this results in 2 x 2 x 2 = 8 automorphisms
OBBitVec mask;
mask.SetRangeOn(1, mol.NumAtoms());
mask.SetBitOff(6+1);
FindAutomorphisms(&mol, maps, mask);
cout << maps.size() << endl;
for (unsigned int i = 0; i < maps.size(); ++i) {
OBIsomorphismMapper::Mapping::const_iterator j;
for (j = maps[i].begin(); j != maps[i].end(); ++j)
cout << j->second << " ";
cout << endl;
}
OB_ASSERT( maps.size() == 8 );
// Verify that atom Id 6 does not occur anywhere in the mappings
OBIsomorphismMapper::Mappings::const_iterator a;
OBIsomorphismMapper::Mapping::const_iterator b;
for (a = maps.begin(); a != maps.end(); ++a)
for (b = a->begin(); b!= a->end(); ++b) {
OB_ASSERT( b->first != 6 );
OB_ASSERT( b->second != 6 );
}
}