RDKit
Open-source cheminformatics and machine learning.
Graph.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2014 Novartis Institutes for BioMedical Research
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 
11 // graph topology in terms of indices in source molecule
12 #include <RDGeneral/export.h>
13 #pragma once
15 #include <boost/graph/adjacency_list.hpp>
17 
18 namespace RDKit {
19 namespace FMCS {
20 typedef unsigned AtomIdx_t;
21 typedef unsigned BondIdx_t;
22 typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
25 
27  public:
28  typedef edge_iterator EDGE_ITER;
29  typedef std::pair<EDGE_ITER, EDGE_ITER> BOND_ITER_PAIR;
30 
31  void addAtom(unsigned atom) {
32  Graph::vertex_descriptor which = boost::add_vertex(*this);
33  (*this)[which] = atom;
34  }
35  void addBond(unsigned bond, unsigned beginAtom, unsigned endAtom) {
36  bool res;
37  Graph_t::edge_descriptor which;
38  boost::tie(which, res) = boost::add_edge(beginAtom, endAtom, *this);
39  (*this)[which] = bond;
40  }
41 };
42 } // namespace FMCS
43 } // namespace RDKit
void addBond(unsigned bond, unsigned beginAtom, unsigned endAtom)
Definition: Graph.h:35
edge_iterator EDGE_ITER
Definition: Graph.h:28
std::pair< EDGE_ITER, EDGE_ITER > BOND_ITER_PAIR
Definition: Graph.h:29
void addAtom(unsigned atom)
Definition: Graph.h:31
#define RDKIT_FMCS_EXPORT
Definition: export.h:153
unsigned AtomIdx_t
Definition: Graph.h:20
unsigned BondIdx_t
Definition: Graph.h:21
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, AtomIdx_t, BondIdx_t > Graph_t
Definition: Graph.h:24
Std stuff.
Definition: Abbreviations.h:19