RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
1
//
2
//
3
// Copyright (C) 2020 Schrödinger, LLC
4
//
5
// @@ All Rights Reserved @@
6
// This file is part of the RDKit.
7
// The contents are covered by the terms of the BSD license
8
// which is included in the file license.txt, found at the root
9
// of the RDKit source tree.
10
//
11
#pragma once
12
13
#include <cstdint>
14
#include <vector>
15
16
#include "
Descriptor.h
"
17
#include "
Mancude.h
"
18
#include "
Edge.h
"
19
20
namespace
RDKit
{
21
22
class
Atom
;
23
24
namespace
CIPLabeler
{
25
26
class
Digraph
;
27
28
class
Node
{
29
public
:
30
/**
31
* Flag indicates whether the node has been expanded.
32
*/
33
static
constexpr
uint8_t
EXPANDED
= 0x1;
34
35
/**
36
* Flag indicates whether the node was duplicated
37
* at a ring closure.
38
*/
39
static
constexpr
uint8_t
RING_DUPLICATE
= 0x2;
40
41
/**
42
* Flag indicates whether the node was duplicated
43
* at a bond with order > 1.
44
*/
45
static
constexpr
uint8_t
BOND_DUPLICATE
= 0x4;
46
47
/**
48
* Mask to check if a node is duplicated.
49
*/
50
51
static
constexpr
uint8_t
DUPLICATE
=
RING_DUPLICATE
|
BOND_DUPLICATE
;
52
53
/**
54
* Node was created for an implicit hydrogen,
55
* the 'atom' value will be null.
56
*/
57
static
constexpr
uint8_t
IMPL_HYDROGEN
= 0x8;
58
59
/**
60
* Mask to check if a node is duplicated or created for an implicit H (not a
61
* primary node).
62
*/
63
static
constexpr
uint8_t
DUPLICATE_OR_H
=
64
RING_DUPLICATE
|
BOND_DUPLICATE
|
IMPL_HYDROGEN
;
65
66
Node
() =
delete
;
67
Node
(
const
Node
&) =
delete
;
68
Node
&
operator=
(
const
Node
&) =
delete
;
69
70
Node
(
Digraph
*g, std::vector<std::uint32_t> &&visit,
Atom
*atom,
71
boost::rational<int> &&frac,
int
dist, uint8_t flags);
72
73
Digraph
*
getDigraph
()
const
;
74
75
Atom
*
getAtom
()
const
;
76
77
unsigned
int
getAtomIdx
()
const
;
78
79
int
getDistance
()
const
;
80
81
boost::rational<int>
getAtomicNumFraction
()
const
;
82
83
int
getAtomicNum
()
const
;
84
85
unsigned
getMassNum
()
const
;
86
87
double
getAtomicMass
()
const
;
88
89
Descriptor
getAux
()
const
;
90
91
bool
isSet
(uint8_t mask)
const
;
92
93
bool
isDuplicate
()
const
;
94
95
bool
isDuplicateOrH
()
const
;
96
97
bool
isTerminal
()
const
;
98
99
bool
isExpanded
()
const
;
100
101
bool
isVisited
(
int
idx)
const
;
102
103
Node
*
newChild
(
int
idx,
Atom
*atom)
const
;
104
105
Node
*
newBondDuplicateChild
(
int
idx,
Atom
*atom)
const
;
106
107
Node
*
newRingDuplicateChild
(
int
idx,
Atom
*atom)
const
;
108
109
Node
*
newImplicitHydrogenChild
()
const
;
110
111
void
add
(
Edge
*e);
112
113
void
setAux
(
Descriptor
desc);
114
115
const
std::vector<Edge *> &
getEdges
()
const
;
116
117
std::vector<Edge *>
getEdges
(
Atom
*end)
const
;
118
119
std::vector<Edge *>
getNonTerminalOutEdges
()
const
;
120
121
private
:
122
Digraph
*dp_g;
123
Atom
*dp_atom;
124
int
d_dist;
125
boost::rational<int> d_atomic_num;
126
double
d_atomic_mass;
127
Descriptor
d_aux =
Descriptor::NONE
;
128
uint8_t d_flags = 0x0;
129
130
std::vector<Edge *> d_edges;
131
132
std::vector<std::uint32_t> d_visit;
133
134
Node
*newTerminalChild(
int
idx,
Atom
*atom, uint8_t flags)
const
;
135
};
136
137
}
// namespace CIPLabeler
138
}
// namespace RDKit
Descriptor.h
Edge.h
Mancude.h
RDKit::Atom
The class for representing atoms.
Definition
Atom.h:75
RDKit::CIPLabeler::Digraph
Definition
Digraph.h:49
RDKit::CIPLabeler::Edge
Definition
Edge.h:23
RDKit::CIPLabeler::Node::getAtomicNum
int getAtomicNum() const
RDKit::CIPLabeler::Node::newRingDuplicateChild
Node * newRingDuplicateChild(int idx, Atom *atom) const
RDKit::CIPLabeler::Node::getAtomicMass
double getAtomicMass() const
RDKit::CIPLabeler::Node::newBondDuplicateChild
Node * newBondDuplicateChild(int idx, Atom *atom) const
RDKit::CIPLabeler::Node::Node
Node(const Node &)=delete
RDKit::CIPLabeler::Node::operator=
Node & operator=(const Node &)=delete
RDKit::CIPLabeler::Node::isDuplicateOrH
bool isDuplicateOrH() const
RDKit::CIPLabeler::Node::getDigraph
Digraph * getDigraph() const
RDKit::CIPLabeler::Node::newImplicitHydrogenChild
Node * newImplicitHydrogenChild() const
RDKit::CIPLabeler::Node::DUPLICATE_OR_H
static constexpr uint8_t DUPLICATE_OR_H
Definition
Node.h:63
RDKit::CIPLabeler::Node::setAux
void setAux(Descriptor desc)
RDKit::CIPLabeler::Node::getAtomIdx
unsigned int getAtomIdx() const
RDKit::CIPLabeler::Node::BOND_DUPLICATE
static constexpr uint8_t BOND_DUPLICATE
Definition
Node.h:45
RDKit::CIPLabeler::Node::getEdges
const std::vector< Edge * > & getEdges() const
RDKit::CIPLabeler::Node::EXPANDED
static constexpr uint8_t EXPANDED
Definition
Node.h:33
RDKit::CIPLabeler::Node::DUPLICATE
static constexpr uint8_t DUPLICATE
Definition
Node.h:51
RDKit::CIPLabeler::Node::getAtom
Atom * getAtom() const
RDKit::CIPLabeler::Node::getNonTerminalOutEdges
std::vector< Edge * > getNonTerminalOutEdges() const
RDKit::CIPLabeler::Node::newChild
Node * newChild(int idx, Atom *atom) const
RDKit::CIPLabeler::Node::RING_DUPLICATE
static constexpr uint8_t RING_DUPLICATE
Definition
Node.h:39
RDKit::CIPLabeler::Node::getAux
Descriptor getAux() const
RDKit::CIPLabeler::Node::isSet
bool isSet(uint8_t mask) const
RDKit::CIPLabeler::Node::getEdges
std::vector< Edge * > getEdges(Atom *end) const
RDKit::CIPLabeler::Node::IMPL_HYDROGEN
static constexpr uint8_t IMPL_HYDROGEN
Definition
Node.h:57
RDKit::CIPLabeler::Node::getDistance
int getDistance() const
RDKit::CIPLabeler::Node::getMassNum
unsigned getMassNum() const
RDKit::CIPLabeler::Node::Node
Node(Digraph *g, std::vector< std::uint32_t > &&visit, Atom *atom, boost::rational< int > &&frac, int dist, uint8_t flags)
RDKit::CIPLabeler::Node::add
void add(Edge *e)
RDKit::CIPLabeler::Node::isTerminal
bool isTerminal() const
RDKit::CIPLabeler::Node::isDuplicate
bool isDuplicate() const
RDKit::CIPLabeler::Node::Node
Node()=delete
RDKit::CIPLabeler::Node::getAtomicNumFraction
boost::rational< int > getAtomicNumFraction() const
RDKit::CIPLabeler::Node::isVisited
bool isVisited(int idx) const
RDKit::CIPLabeler::Node::isExpanded
bool isExpanded() const
RDKit::CIPLabeler
Definition
CIPLabeler.h:27
RDKit::CIPLabeler::Descriptor
Descriptor
Definition
Descriptor.h:26
RDKit::CIPLabeler::Descriptor::NONE
@ NONE
Definition
Descriptor.h:27
RDKit
Std stuff.
Definition
Abbreviations.h:19
GraphMol
CIPLabeler
Node.h
Generated on
for RDKit by
1.17.0