本文整理汇总了C++中Mol::beginBonds方法的典型用法代码示例。如果您正苦于以下问题:C++ Mol::beginBonds方法的具体用法?C++ Mol::beginBonds怎么用?C++ Mol::beginBonds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mol
的用法示例。
在下文中一共展示了Mol::beginBonds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test5
void test5() {
string smi = "CCCC";
Mol *m = SmilesToMol(smi);
Mol::BondIterator bondIt;
unsigned int idx = 0;
for (bondIt = m->beginBonds(); bondIt != m->endBonds(); bondIt++) {
CHECK_INVARIANT((*bondIt)->getIdx() == idx, "bad idx");
idx++;
}
CHECK_INVARIANT(idx == 3, "bad idx");
idx = 0;
for (bondIt = m->beginBonds(); bondIt != m->endBonds(); bondIt++) {
CHECK_INVARIANT((*bondIt)->getIdx() == idx, "bad idx");
idx++;
}
CHECK_INVARIANT(idx == 3, "bad idx");
idx = 0;
Mol::BondIterator beginP(m->beginBonds());
Mol::BondIterator endP(m->endBonds());
for (bondIt = beginP; bondIt != endP; bondIt++) {
CHECK_INVARIANT((*bondIt)->getIdx() == idx, "bad idx");
idx++;
}
CHECK_INVARIANT(idx == 3, "bad idx");
BOOST_LOG(rdInfoLog) << "test5 done" << endl;
}
示例2: test2
void test2() {
string smi = "C1COC1";
Mol *m = SmilesToMol(smi);
Mol::BondIterator bondIt;
unsigned int idx = 0;
for (bondIt = m->beginBonds(); bondIt != m->endBonds(); bondIt++) {
CHECK_INVARIANT((*bondIt)->getIdx() == idx, "bad idx");
idx++;
}
bondIt = m->beginBonds();
Mol::BondIterator bondIt2 = m->beginBonds();
CHECK_INVARIANT(bondIt == bondIt2, "iterators don't compare equal");
bondIt++;
CHECK_INVARIANT((*bondIt)->getIdx() == 1, "bad idx");
bondIt++;
bondIt++;
bondIt--;
CHECK_INVARIANT((*bondIt)->getIdx() == 2, "bad idx");
CHECK_INVARIANT(bondIt != bondIt2, "iterators don't compare different");
bondIt--;
--bondIt;
CHECK_INVARIANT((*bondIt)->getIdx() == 0, "bad idx");
CHECK_INVARIANT(bondIt == bondIt2, "iterator inequality failed");
bondIt++;
++bondIt;
CHECK_INVARIANT((*bondIt)->getIdx() == 2, "bad idx");
// past the end stuff
bondIt2 = m->endBonds();
bondIt = m->beginBonds();
bondIt--;
BOOST_LOG(rdInfoLog) << "test2 done" << endl;
};
示例3: testIssue263
void testIssue263() {
string smi = "c1ccccc1C";
#if 1
Mol *m = SmilesToMol(smi);
Mol::AtomIterator atomIt;
unsigned int idx = 0;
for (atomIt = m->beginAtoms(); atomIt != m->endAtoms(); ++atomIt) {
TEST_ASSERT((*atomIt)->getIdx() == idx);
idx++;
}
TEST_ASSERT(idx == 7);
Mol::BondIterator bondIt;
idx = 0;
for (bondIt = m->beginBonds(); bondIt != m->endBonds(); ++bondIt) {
CHECK_INVARIANT((*bondIt)->getIdx() == idx, "bad idx");
idx++;
}
CHECK_INVARIANT(idx == 7, "bad idx");
#endif
BOOST_LOG(rdInfoLog) << "testIssue263 done" << endl;
}