Ignore:
Timestamp:
Jul 28, 2008, 2:18:25 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
126934
Parents:
39651f
Message:

CyclicStructureAnalysis: BUGFIX - MinimumRingSize was not set correctly

  • During BFS search from non-loop members to loops, Walker was pushed instead of Root at start of BFS
  • if Backedge lead to a terminal hydrogen, this hydrogen ended up with AtomCount MinimumRingSize instead of correct one.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.cpp

    r39651f r3f805d  
    18881888      // walk through all and set MinimumRingSize
    18891889      Walker = Root;
     1890      MinimumRingSize[Walker->GetTrueFather()->nr] = RingSize;
    18901891      while (Walker != BackEdge->rightatom) {
    18911892        Walker = PredecessorList[Walker->nr];
     
    19141915     
    19151916      if (MinimumRingSize[Root->GetTrueFather()->nr] == AtomCount) { // check whether MinimumRingSize is set, if not BFS to next where it is
     1917        Walker = Root;
    19161918        ShortestPathList[Walker->nr] = 0;
    19171919        BFSStack->ClearStack();  // start with empty BFS stack
     
    19201922        //*out << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl;
    19211923        OtherAtom = Walker;
    1922         while ((Walker != Root) && (OtherAtom != NULL)) {  // look for Root
     1924        while (OtherAtom != NULL) {  // look for Root
    19231925          Walker = BFSStack->PopFirst();
    19241926          //*out << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *Root << "." << endl;
    19251927          for(int i=0;i<NumberOfBondsPerAtom[Walker->nr];i++) {
    19261928            Binder = ListOfBondsPerAtom[Walker->nr][i];
    1927             if (Binder != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder)
     1929            if ((Binder != BackEdge) || (NumberOfBondsPerAtom[Walker->nr] == 1)) { // only walk along DFS spanning tree (otherwise we always find SP of 1 being backedge Binder), but terminal hydrogens may be connected via backedge, hence extra check
    19281930              OtherAtom = Binder->GetOtherAtom(Walker);
    19291931              //*out << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *Binder << "." << endl;
Note: See TracChangeset for help on using the changeset viewer.