/usr/include/rdkit/GraphMol/RingInfo.h is in librdkit-dev 201603.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | //
// Copyright (C) 2004-2006 Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#ifndef _RD_RINGINFO_H
#define _RD_RINGINFO_H
#include <map>
#include <vector>
namespace RDKit {
//! A class to store information about a molecule's rings
/*!
*/
class RingInfo {
friend class MolPickler;
public:
typedef std::vector<int> MemberType;
typedef std::vector<MemberType> DataType;
typedef std::vector<int> INT_VECT;
typedef std::vector<INT_VECT> VECT_INT_VECT;
RingInfo() : df_init(false){};
RingInfo(const RingInfo &other)
: df_init(other.df_init),
d_atomMembers(other.d_atomMembers),
d_bondMembers(other.d_bondMembers),
d_atomRings(other.d_atomRings),
d_bondRings(other.d_bondRings){};
//! checks to see if we've been properly initialized
bool isInitialized() const { return df_init; };
//! does initialization
void initialize();
//! blows out all current data and de-initializes
void reset();
//! adds a ring to our data
/*!
\param atomIndices the integer indices of the atoms involved in the ring
\param bondIndices the integer indices of the bonds involved in the ring,
this must be the same size as \c atomIndices.
\return the number of rings
<b>Notes:</b>
- the object must be initialized before calling this
*/
unsigned int addRing(const INT_VECT &atomIndices,
const INT_VECT &bondIndices);
//! \name Atom information
//@{
//! returns whether or not the atom with index \c idx is in a \c size - ring.
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
bool isAtomInRingOfSize(unsigned int idx, unsigned int size) const;
//! returns the number of rings atom \c idx is involved in
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
unsigned int numAtomRings(unsigned int idx) const;
//! returns the size of the smallest ring atom \c idx is involved in
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
unsigned int minAtomRingSize(unsigned int idx) const;
//! returns our \c atom-rings vectors
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
const VECT_INT_VECT &atomRings() const { return d_atomRings; };
//@}
//! \name Bond information
//@{
//! returns whether or not the bond with index \c idx is in a \c size - ring.
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
bool isBondInRingOfSize(unsigned int idx, unsigned int size) const;
//! returns the number of rings bond \c idx is involved in
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
unsigned int numBondRings(unsigned int idx) const;
//! returns the size of the smallest ring bond \c idx is involved in
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
unsigned int minBondRingSize(unsigned int idx) const;
//! returns the total number of rings
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
unsigned int numRings() const;
//! returns our \c bond-rings vectors
/*!
<b>Notes:</b>
- the object must be initialized before calling this
*/
const VECT_INT_VECT &bondRings() const { return d_bondRings; };
//@}
private:
//! pre-allocates some memory to save time later
void preallocate(unsigned int numAtoms, unsigned int numBonds);
bool df_init;
DataType d_atomMembers, d_bondMembers;
VECT_INT_VECT d_atomRings, d_bondRings;
};
}
#endif
|