Graph.h
Go to the documentation of this file.
//
// Copyright (C) 2014 Novartis Institutes for BioMedical Research
//
// @@ 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.
//
// graph topology in terms of indices in source molecule
#include <RDGeneral/export.h>
#pragma once
#include <RDGeneral/BoostStartInclude.h>
#include <boost/graph/adjacency_list.hpp>
#include <RDGeneral/BoostEndInclude.h>
namespace RDKit {
namespace FMCS {
typedef unsigned AtomIdx_t;
typedef unsigned BondIdx_t;
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
AtomIdx_t, BondIdx_t>
Graph_t;
class RDKIT_FMCS_EXPORT Graph : public Graph_t {
public:
typedef edge_iterator EDGE_ITER;
typedef std::pair<EDGE_ITER, EDGE_ITER> BOND_ITER_PAIR;
void addAtom(unsigned atom) {
Graph::vertex_descriptor which = boost::add_vertex(*this);
(*this)[which] = atom;
}
void addBond(unsigned bond, unsigned beginAtom, unsigned endAtom) {
bool res;
Graph_t::edge_descriptor which;
boost::tie(which, res) = boost::add_edge(beginAtom, endAtom, *this);
(*this)[which] = bond;
}
};
} // namespace FMCS
} // namespace RDKit
BoostEndInclude.h
BoostStartInclude.h
RDKit::FMCS::Graph
Definition: Graph.h:26
RDKit::FMCS::Graph::addBond
void addBond(unsigned bond, unsigned beginAtom, unsigned endAtom)
Definition: Graph.h:35
RDKit::FMCS::Graph::EDGE_ITER
edge_iterator EDGE_ITER
Definition: Graph.h:28
RDKit::FMCS::Graph::BOND_ITER_PAIR
std::pair< EDGE_ITER, EDGE_ITER > BOND_ITER_PAIR
Definition: Graph.h:29
RDKit::FMCS::Graph::addAtom
void addAtom(unsigned atom)
Definition: Graph.h:31
export.h
RDKIT_FMCS_EXPORT
#define RDKIT_FMCS_EXPORT
Definition: export.h:145
RDKit::FMCS::AtomIdx_t
unsigned AtomIdx_t
Definition: Graph.h:20
RDKit::FMCS::BondIdx_t
unsigned BondIdx_t
Definition: Graph.h:21
RDKit::FMCS::Graph_t
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, AtomIdx_t, BondIdx_t > Graph_t
Definition: Graph.h:24
RDKit
Std stuff.
Definition: Abbreviations.h:18