RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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
18namespace RDKit {
19namespace FMCS {
20typedef unsigned int AtomIdx_t;
21typedef unsigned int BondIdx_t;
22typedef 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 int atom) {
32 Graph::vertex_descriptor which = boost::add_vertex(*this);
33 (*this)[which] = atom;
34 }
35 void addBond(unsigned int bond, unsigned int beginAtom,
36 unsigned int endAtom) {
37 bool res;
38 Graph_t::edge_descriptor which;
39 boost::tie(which, res) = boost::add_edge(beginAtom, endAtom, *this);
40 (*this)[which] = bond;
41 }
42};
43} // namespace FMCS
44} // namespace RDKit
void addBond(unsigned int bond, unsigned int beginAtom, unsigned int endAtom)
Definition Graph.h:35
edge_iterator EDGE_ITER
Definition Graph.h:28
void addAtom(unsigned int atom)
Definition Graph.h:31
std::pair< EDGE_ITER, EDGE_ITER > BOND_ITER_PAIR
Definition Graph.h:29
#define RDKIT_FMCS_EXPORT
Definition export.h:153
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, AtomIdx_t, BondIdx_t > Graph_t
Definition Graph.h:24
unsigned int AtomIdx_t
Definition Graph.h:20
unsigned int BondIdx_t
Definition Graph.h:21
Std stuff.