Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/CyclicStructureAnalysis.cpp

    r3bdb6d r07a47e  
    3131#include "molecule.hpp"
    3232
    33 CyclicStructureAnalysis::CyclicStructureAnalysis()
     33CyclicStructureAnalysis::CyclicStructureAnalysis(const enum HydrogenSaturation _saturation) :
     34  saturation(_saturation)
    3435{}
    3536
     
    101102      if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder)
    102103        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    103 #ifdef ADDHYDROGEN
    104         if (OtherAtom->getType()->getAtomicNumber() != 1) {
    105 #endif
    106         LOG(2, "INFO: Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
    107         if (ColorList[OtherAtom->getNr()] == GraphEdge::white) {
    108           TouchedStack.push_front(OtherAtom);
    109           ColorList[OtherAtom->getNr()] = GraphEdge::lightgray;
    110           PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor
    111           ShortestPathList[OtherAtom->getNr()] = ShortestPathList[Walker->getNr()] + 1;
    112           LOG(2, "INFO: Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl);
    113           //if (ShortestPathList[OtherAtom->getNr()] < MinimumRingSize[Walker->GetTrueFather()->getNr()]) { // Check for maximum distance
    114           LOG(3, "ACCEPT: Putting OtherAtom into queue." << endl);
    115           BFSStack.push_front(OtherAtom);
    116           //}
     104        if ((saturation == DontSaturate) || (OtherAtom->getType()->getAtomicNumber() != 1)) {
     105          LOG(2, "INFO: Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
     106          if (ColorList[OtherAtom->getNr()] == GraphEdge::white) {
     107            TouchedStack.push_front(OtherAtom);
     108            ColorList[OtherAtom->getNr()] = GraphEdge::lightgray;
     109            PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor
     110            ShortestPathList[OtherAtom->getNr()] = ShortestPathList[Walker->getNr()] + 1;
     111            LOG(2, "INFO: Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl);
     112            //if (ShortestPathList[OtherAtom->getNr()] < MinimumRingSize[Walker->GetTrueFather()->getNr()]) { // Check for maximum distance
     113            LOG(3, "ACCEPT: Putting OtherAtom into queue." << endl);
     114            BFSStack.push_front(OtherAtom);
     115            //}
     116          } else {
     117            LOG(3, "REJECT: Not Adding, has already been visited." << endl);
     118          }
     119          if (OtherAtom == Root)
     120            break;
    117121        } else {
    118           LOG(3, "REJECT: Not Adding, has already been visited." << endl);
     122          LOG(2, "INFO: Skipping hydrogen atom " << *OtherAtom << "." << endl);
     123          ColorList[OtherAtom->getNr()] = GraphEdge::black;
    119124        }
    120         if (OtherAtom == Root)
    121           break;
    122 #ifdef ADDHYDROGEN
    123       } else {
    124         LOG(2, "INFO: Skipping hydrogen atom " << *OtherAtom << "." << endl);
    125         ColorList[OtherAtom->getNr()] = GraphEdge::black;
    126       }
    127 #endif
    128125      } else {
    129126        LOG(2, "REJECT: Bond " << *(*Runner) << " not Visiting, is the back edge." << endl);
Note: See TracChangeset for help on using the changeset viewer.