本文整理汇总了C++中Mol::endQueryAtoms方法的典型用法代码示例。如果您正苦于以下问题:C++ Mol::endQueryAtoms方法的具体用法?C++ Mol::endQueryAtoms怎么用?C++ Mol::endQueryAtoms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mol
的用法示例。
在下文中一共展示了Mol::endQueryAtoms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test4
void test4() {
string smi = "C1COCCNCOCNSCC1";
unsigned int heteros1[] = {2, 7};
Mol *m = SmilesToMol(smi);
QueryAtom *q = new QueryAtom();
q->setQuery(makeAtomNumQuery(8));
{
unsigned int nSeen = 0;
for (Mol::QueryAtomIterator queryIt = m->beginQueryAtoms(q);
queryIt != m->endQueryAtoms(); queryIt++) {
CHECK_INVARIANT((*queryIt)->getIdx() == heteros1[nSeen], "bad query");
nSeen++;
}
}
{
Mol::QueryAtomIterator queryIt = m->beginQueryAtoms(q);
queryIt++;
queryIt--;
CHECK_INVARIANT((*queryIt)->getIdx() == heteros1[0], "bad query");
CHECK_INVARIANT((*++queryIt)->getIdx() == heteros1[1], "bad query");
CHECK_INVARIANT((*queryIt)->getIdx() == heteros1[1], "bad query");
}
{
Mol::QueryAtomIterator queryIt = m->beginQueryAtoms(q);
queryIt++;
queryIt--;
Mol::QueryAtomIterator queryIt2 = queryIt;
CHECK_INVARIANT((*queryIt2)->getIdx() == heteros1[0], "bad query");
CHECK_INVARIANT((*++queryIt2)->getIdx() == heteros1[1], "bad query");
CHECK_INVARIANT((*queryIt2)->getIdx() == heteros1[1], "bad query");
}
smi = "CC(C)CC(C)CC(C)CC(C)C";
unsigned int heteros2[] = {1, 4, 7, 10};
m = SmilesToMol(smi);
// m->debugMol(cout);
q->setQuery(makeAtomImplicitValenceQuery(1));
{
unsigned int nSeen = 0;
for (Mol::QueryAtomIterator queryIt = m->beginQueryAtoms(q);
queryIt != m->endQueryAtoms(); ++queryIt) {
CHECK_INVARIANT((*queryIt)->getIdx() == heteros2[nSeen], "bad query");
nSeen++;
}
}
BOOST_LOG(rdInfoLog) << "test4 done" << endl;
};
示例2: test8
void test8() {
{
string smi = "CC1CC2CC1C2";
Mol *m = SmilesToMol(smi);
QueryAtom *q = new QueryAtom();
q->setQuery(makeAtomExplicitDegreeQuery(3));
q->expandQuery(makeAtomRingBondCountQuery(2));
unsigned int nSeen = 0;
for (Mol::QueryAtomIterator queryIt = m->beginQueryAtoms(q);
queryIt != m->endQueryAtoms(); ++queryIt) {
TEST_ASSERT((*queryIt)->getIdx() == 1);
nSeen++;
}
TEST_ASSERT(nSeen == 1);
delete m;
delete q;
}
BOOST_LOG(rdInfoLog) << "test8 done" << endl;
};