RDKit
Open-source cheminformatics and machine learning.
Rule4b.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 <vector>
14 
15 #include "SequenceRule.h"
16 
17 namespace RDKit {
18 namespace CIPLabeler {
19 
20 /**
21  * A descriptor pair rule. This rule defines that like descriptor pairs have
22  * priority over unlike descriptor pairs.
23  *
24  */
25 class Rule4b : public SequenceRule {
26 
27 public:
28  Rule4b();
29 
31 
32  int compare(const Edge *a, const Edge *b) const override;
33 
34 private:
35  const Descriptor d_ref = Descriptor::NONE;
36 
37  std::vector<Descriptor> getReferenceDescriptors(const Node *node) const;
38 
39  bool hasDescriptors(const Node *node) const;
40 
41  bool getReference(const std::vector<const Node *> &nodes,
42  std::vector<Descriptor> &result) const;
43 
44  std::vector<std::vector<const Node *>> initialLevel(const Node *node) const;
45 
46  std::vector<std::vector<const Node *>>
47  getNextLevel(const std::vector<std::vector<const Node *>> &prevLevel) const;
48 
49  std::vector<const Node *>
50  toNodeList(const std::vector<Edge *> &eqEdges) const;
51 
52  std::vector<PairList>
53  newPairLists(const std::vector<Descriptor> &descriptors) const;
54 
55  void fillPairs(const Node *beg, PairList &plist) const;
56 
57  int comparePairs(const Node *a, const Node *b, Descriptor refA,
58  Descriptor refB) const;
59 
60  Sort getRefSorter(const SequenceRule *replacement_rule) const;
61 };
62 
63 } // namespace CIPLabeler
64 } // namespace RDKit
Rule4b(Descriptor ref)
int compare(const Edge *a, const Edge *b) const override
Std stuff.
Definition: Abbreviations.h:17