本文整理汇总了C++中BaseMolecule::findEdgeIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseMolecule::findEdgeIndex方法的具体用法?C++ BaseMolecule::findEdgeIndex怎么用?C++ BaseMolecule::findEdgeIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseMolecule
的用法示例。
在下文中一共展示了BaseMolecule::findEdgeIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isAutomorphism
bool MoleculeCisTrans::isAutomorphism (BaseMolecule &mol, const Array<int> &mapping, const Filter *edge_filter)
{
for (int i = mol.edgeBegin(); i != mol.edgeEnd(); i = mol.edgeNext(i))
{
if (edge_filter && !edge_filter->valid(i))
continue;
const Edge &edge = mol.getEdge(i);
int parity = mol.cis_trans.getParity(i);
int parity2 = MoleculeCisTrans::applyMapping(parity, mol.cis_trans.getSubstituents(i),
mapping.ptr(), false);
int i2 = mol.findEdgeIndex(mapping[edge.beg], mapping[edge.end]);
if (mol.cis_trans.getParity(i2) != parity2)
return false;
}
return true;
}
示例2: findAromaticAtoms
void MoleculeAromatizer::findAromaticAtoms (BaseMolecule &mol, Array<int> *atoms, Array<int> *bonds, const AromaticityOptions &options)
{
AutoPtr<BaseMolecule> clone;
QS_DEF(Array<int>, mapping);
clone.reset(mol.neu());
mapping.clear();
if (atoms != 0)
{
atoms->clear_resize(mol.vertexEnd());
atoms->zerofill();
}
if (bonds != 0)
{
bonds->clear_resize(mol.edgeEnd());
bonds->zerofill();
}
clone->clone(mol, &mapping, 0);
clone->aromatize(options);
for (int i = clone->edgeBegin(); i != clone->edgeEnd(); i = clone->edgeNext(i))
{
if (clone->getBondOrder(i) == BOND_AROMATIC)
{
const Edge &edge = clone->getEdge(i);
if (atoms != 0)
{
atoms->at(mapping[edge.beg]) = 1;
atoms->at(mapping[edge.end]) = 1;
}
if (bonds != 0)
bonds->at(mol.findEdgeIndex(mapping[edge.beg], mapping[edge.end])) = 1;
}
}
}