Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _RD_RINGINFO_H
00011 #define _RD_RINGINFO_H
00012
00013 #include <map>
00014 #include <vector>
00015
00016 namespace RDKit {
00017
00018
00019
00020
00021 class RingInfo {
00022 friend class MolPickler;
00023 public:
00024 typedef std::vector<int> MemberType;
00025 typedef std::vector<MemberType > DataType;
00026 typedef std::vector<int> INT_VECT;
00027 typedef std::vector< INT_VECT > VECT_INT_VECT;
00028
00029 RingInfo() : df_init(false) {};
00030 RingInfo(const RingInfo &other) : df_init(other.df_init),
00031 d_atomMembers(other.d_atomMembers),
00032 d_bondMembers(other.d_bondMembers),
00033 d_atomRings(other.d_atomRings),
00034 d_bondRings(other.d_bondRings) {};
00035
00036
00037 bool isInitialized() const { return df_init; };
00038
00039 void initialize();
00040
00041
00042 void reset();
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 unsigned int addRing(const INT_VECT &atomIndices,const INT_VECT &bondIndices);
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 bool isAtomInRingOfSize(unsigned int idx,unsigned int size) const;
00068
00069
00070
00071
00072
00073 unsigned int numAtomRings(unsigned int idx) const;
00074
00075
00076
00077
00078
00079 unsigned int minAtomRingSize(unsigned int idx) const;
00080
00081
00082
00083
00084
00085
00086 const VECT_INT_VECT &atomRings() const { return d_atomRings; };
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 bool isBondInRingOfSize(unsigned int idx,unsigned int size) const;
00099
00100
00101
00102
00103
00104 unsigned int numBondRings(unsigned int idx) const;
00105
00106
00107
00108
00109
00110 unsigned int minBondRingSize(unsigned int idx) const;
00111
00112
00113
00114
00115
00116
00117 unsigned int numRings() const;
00118
00119
00120
00121
00122
00123
00124 const VECT_INT_VECT &bondRings() const { return d_bondRings; };
00125
00126
00127
00128 private:
00129
00130 void preallocate(unsigned int numAtoms,unsigned int numBonds);
00131
00132 bool df_init;
00133 DataType d_atomMembers,d_bondMembers;
00134 VECT_INT_VECT d_atomRings,d_bondRings;
00135 };
00136 }
00137
00138 #endif