mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-04 21:54:27 +08:00
fix a pathological symmetry case by modifying the atom invariants
This commit is contained in:
@@ -93,6 +93,6 @@ rdkit_test(graphmoltestPickler testPickler.cpp
|
||||
rdkit_test(graphmolIterTest itertest.cpp LINK_LIBRARIES SmilesParse GraphMol RDGeometryLib RDGeneral)
|
||||
|
||||
rdkit_test(hanoiTest hanoitest.cpp LINK_LIBRARIES SmilesParse_static FileParsers_static GraphMol_static
|
||||
RDGeometryLib_static RDGeneral_static )
|
||||
RDGeometryLib_static RDGeneral_static ${RDKit_THREAD_LIBS} )
|
||||
|
||||
|
||||
|
||||
@@ -812,6 +812,7 @@ void test7(){
|
||||
"C[C@H]1C[C@H](C1)N1CCN(C)CC1",
|
||||
"CN1CCN(CC1)[C@H]1C[C@H](C1)c1ncc2c(N)nccn12",
|
||||
"CN1CCN(CC1)[C@H]1C[C@H](C1)c1nc(-c2ccc3ccc(nc3c2)-c2ccccc2)c2c(N)nccn12",
|
||||
"*12*3*1*3*4*5*4*52",
|
||||
"EOS"
|
||||
};
|
||||
unsigned int i=0;
|
||||
|
||||
@@ -291,8 +291,12 @@ namespace RDKit {
|
||||
return 1;
|
||||
|
||||
// ring membership
|
||||
ivi=dp_mol->getRingInfo()->numAtomRings(dp_atoms[i].atom->getIdx())!=0;
|
||||
ivj=dp_mol->getRingInfo()->numAtomRings(dp_atoms[j].atom->getIdx())!=0;
|
||||
// initial passes at this were just checking "isInRing" to allow
|
||||
// a possible future more efficient check. These break on this
|
||||
// lovely double-diamond pathological case:
|
||||
// *12*3*1*3*4*5*4*52
|
||||
ivi=dp_mol->getRingInfo()->numAtomRings(dp_atoms[i].atom->getIdx());
|
||||
ivj=dp_mol->getRingInfo()->numAtomRings(dp_atoms[j].atom->getIdx());
|
||||
if(ivi<ivj)
|
||||
return -1;
|
||||
else if(ivi>ivj)
|
||||
|
||||
Reference in New Issue
Block a user