Chemical Data Processing Library C++ API - Version 1.2.0
ExtendedSSSR.hpp
Go to the documentation of this file.
1 /*
2  * ExtendedSSSR.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CHEM_EXTENDEDSSSR_HPP
30 #define CDPL_CHEM_EXTENDEDSSSR_HPP
31 
32 #include <memory>
33 #include <vector>
34 #include <utility>
35 
36 #include "CDPL/Chem/APIPrefix.hpp"
38 #include "CDPL/Util/BitSet.hpp"
39 
40 
41 namespace CDPL
42 {
43 
44  namespace Chem
45  {
46 
51  {
52 
53  public:
57  typedef std::shared_ptr<ExtendedSSSR> SharedPointer;
58 
63 
68  ExtendedSSSR(const MolecularGraph& molgraph);
69 
74  void perceive(const MolecularGraph& molgraph);
75 
76  private:
77  void init(const MolecularGraph& molgraph);
78 
79  bool findRingContainingBonds(const Bond& bond1, const Bond& bond2) const;
80 
81  void perceiveRings(const MolecularGraph& molgraph, const Atom& curr_atom, const Atom& start_atom);
82  void processFoundRing(const MolecularGraph& molgraph);
83 
84  const char* getClassName() const
85  {
86  return "ExtendedSSSR";
87  }
88 
89  typedef std::vector<std::pair<const Atom*, const Bond*> > AtomBondList;
90 
91  Util::BitSet ringBonds;
92  AtomBondList atomRingNbrs;
93  Util::BitSet currBondPath;
94  Util::BitSet smallestRingBonds;
95  std::size_t smallestRingSize;
96  };
97  } // namespace Chem
98 } // namespace CDPL
99 
100 #endif // CDPL_CHEM_EXTENDEDSSSR_HPP
Definition of the type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Chem::FragmentList.
Atom.
Definition: Atom.hpp:52
Bond.
Definition: Bond.hpp:50
Implements the perception of the Extended Smallest Set of Smallest Rings (ESSSR) of a molecular graph...
Definition: ExtendedSSSR.hpp:51
ExtendedSSSR(const MolecularGraph &molgraph)
Construct a ExtendedSSSR instance that represents the ESSSR of the molecular graph molgraph.
std::shared_ptr< ExtendedSSSR > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ExtendedSSSR instances.
Definition: ExtendedSSSR.hpp:57
ExtendedSSSR()
Constructs an empty ExtendedSSSR instance.
Definition: ExtendedSSSR.hpp:62
void perceive(const MolecularGraph &molgraph)
Replaces the current set of rings by the ESSSR of the molecular graph molgraph.
A data type for the storage of Chem::Fragment objects.
Definition: FragmentList.hpp:49
MolecularGraph.
Definition: MolecularGraph.hpp:52
CDPL_CHEM_API FragmentList::SharedPointer perceiveRings(const MolecularGraph &molgraph)
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.