Ignore:
Timestamp:
Jul 28, 2008, 2:41:22 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
d49416
Parents:
3f805d
Message:

CyclicStructureAnalysis: BUGFIX - MinimumRingSize of non-loop atoms was wrong

  • new bool atom:IsCyclic states whether atoms is part of a cycle or not, this is set in CyclicStructureAnalysis()
  • MinimumRingSize was set to MinimumRingSize plus ShortestPath thereto. This gives correct results only if this goes to a loop-member. However the if-condition was phrased in such a manner, that it became possible that non-loop members (with MinimumRingSize set below AtomCount) would now also be regarded als loop members. This is sort of a triangle inequality problem :), path of A to B plus path from B to C is probably not the same as path from A to C in terms of length
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.cpp

    r3f805d r126934  
    18781878      NumCycles++;
    18791879      RingSize = 1;
    1880       Walker = Root;
     1880      Root->GetTrueFather()->IsCyclic = true;
    18811881      *out << Verbose(1) << "Found ring contains: ";
    18821882      while (Walker != BackEdge->rightatom) {
    18831883        *out << Walker->Name << " <-> ";
    18841884        Walker = PredecessorList[Walker->nr];
     1885        Walker->GetTrueFather()->IsCyclic = true;
    18851886        RingSize++;
    18861887      }
     
    19361937                ShortestPathList[OtherAtom->nr] = ShortestPathList[Walker->nr]+1;
    19371938                //*out << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl;
    1938                 if (MinimumRingSize[OtherAtom->GetTrueFather()->nr] != AtomCount) { // if the other atom is connected to a ring
     1939                if (OtherAtom->GetTrueFather()->IsCyclic) { // if the other atom is connected to a ring
    19391940                  MinimumRingSize[Root->GetTrueFather()->nr] = ShortestPathList[OtherAtom->nr]+MinimumRingSize[OtherAtom->GetTrueFather()->nr];
    19401941                  OtherAtom = NULL; //break;
Note: See TracChangeset for help on using the changeset viewer.