Molassembler  3.0.1
Molecule graph and conformer library
Stereopermutation.h
Go to the documentation of this file.
1 
11 #ifndef INCLUDE_MOLASSEMBLER_STEREOPERMUTATIONS_STEREOPERMUTATION_H
12 #define INCLUDE_MOLASSEMBLER_STEREOPERMUTATIONS_STEREOPERMUTATION_H
13 
16 
17 namespace Scine {
18 namespace Molassembler {
19 
21 namespace Stereopermutations {
22 
24 struct rank_tag;
27 
36 class MASM_EXPORT Stereopermutation : public Temple::Crtp::LexicographicComparable<Stereopermutation> {
37 public:
42 
44  using Link = std::pair<Shapes::Vertex, Shapes::Vertex>;
45 
47  using OrderedLinks = std::vector<Link>;
49 
52 
57  const Occupation& occupation,
58  const Shapes::Permutation& permutation
59  );
60 
61  static Occupation occupationFromChars(const std::string& chars);
62 
68  const OrderedLinks& links,
69  const Shapes::Permutation& permutation
70  );
72 
80 
84  Stereopermutation() = default;
93  Occupation passOccupation,
94  OrderedLinks passLinks = {}
95  );
97 
100 
105 
107  std::string toString() const;
109 
113  inline auto tie() const {
114  return std::tie(occupation, links);
115  }
117 };
118 
119 PURITY_WEAK MASM_EXPORT std::size_t hash_value(const Stereopermutation& assignment);
120 
121 } // namespace Stereopermutations
122 } // namespace Molassembler
123 } // namespace Scine
124 
125 #endif
Centralizes basic shape data in runtime types.
#define PURITY_WEAK
Definition: Preprocessor.h:36
Strongly typed index permutations.
Represent abstract stereopermutation around atom center.
Definition: Stereopermutation.h:36
OrderedLinks links
Links between shape vertices.
Definition: Stereopermutation.h:78
static Occupation permuteOccupation(const Occupation &occupation, const Shapes::Permutation &permutation)
Rotate characters.
auto tie() const
Yields members tied to tuple for crtp operator suppliers.
Definition: Stereopermutation.h:113
Stereopermutation applyPermutation(const Shapes::Permutation &permutation) const
Applies a shape vertex permutation.
std::string toString() const
A string for display.
Stereopermutation()=default
Empty default-init (invalid state)
static OrderedLinks permuteLinks(const OrderedLinks &links, const Shapes::Permutation &permutation)
Rotate links.
std::pair< Shapes::Vertex, Shapes::Vertex > Link
Type used to represent a link between shape vertices.
Definition: Stereopermutation.h:44
std::vector< Link > OrderedLinks
Unordered type, but kept ordered by member functions.
Definition: Stereopermutation.h:47
Stereopermutation(Occupation passOccupation, OrderedLinks passLinks={})
Construct an Stereopermutation from an occupation and a a list of bonded shape vertices.
static Occupation occupationFromChars(const std::string &chars)
Rotate characters.
Occupation occupation
Occupation of shape vertices by site rank.
Definition: Stereopermutation.h:76
Type helper for creating strong index types that are type-level distinct from their fundamental types...
Definition: StrongIndex.h:37
std::vector< Vertex > Permutation
Representation of a shape vertex permutation.
Definition: Data.h:36
Generates all operators using a method returning a tuple.
Definition: OperatorSuppliers.h:78