/* * CyclicStructureAnalysis.hpp * * Created on: Feb 16, 2011 * Author: heber */ #ifndef CYCLICSTRUCTUREANALYSIS_HPP_ #define CYCLICSTRUCTUREANALYSIS_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "Bond/bond.hpp" #include "Bond/GraphEdge.hpp" #include "Fragmentation/KeySet.hpp" #include "Fragmentation/HydrogenSaturation_enum.hpp" #include "Helpers/defs.hpp" #include "types.hpp" class atom; class molecule; class CyclicStructureAnalysis { public: //!> typedef for specifying a cycle typedef KeySet cycle_t; //!> typedef for specifying many cycles typedef std::vector< cycle_t > cycles_t; explicit CyclicStructureAnalysis(const enum HydrogenTreatment _treatment); ~CyclicStructureAnalysis(); void Reset(); void operator()(std::deque * BackEdgeStack); const std::map& getMinimumRingSize() const; /** Getter for all found cycles. * */ cycles_t getAllCycles() const { return allcycles; } private: // init or reset void InitNode(atomId_t atom_id); void CleanAllTouched(); void InitializeToRoot(atom *&Walker); // performing tasks void CyclicBFSFromRootToRoot(atom *&OtherAtom, bond::ptr &BackEdge); void RetrieveCycleMembers(atom *&OtherAtom, bond::ptr &BackEdge, int &MinRingSize, int &NumCycles); void BFSToNextCycle(atom *Walker); void AssignRingSizetoNonCycleMembers(const int MinRingSize, const int NumCycles); // output void OutputAlreadyVisited(int *list); std::map PredecessorList; std::map ShortestPathList; std::map ColorList; std::map MinimumRingSize; std::deque BFSStack; std::deque TouchedStack; int BondOrder; atom *Root; //!> container for all found cycles, note that these are global ids cycles_t allcycles; //!> whether to treat hydrogen special or not const enum HydrogenTreatment treatment; bool BackStepping; int CurrentGraphNr; int ComponentNr; }; #endif /* CYCLICSTRUCTUREANALYSIS_HPP_ */