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