Molassembler  1.1.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
15 
16 namespace Scine {
17 namespace Molassembler {
18 
20 namespace Stereopermutations {
21 
30 class MASM_EXPORT Stereopermutation : public Temple::Crtp::LexicographicComparable<Stereopermutation> {
31 public:
35  using CharacterOccupation = std::vector<char>;
36 
38  using Link = std::pair<Shapes::Vertex, Shapes::Vertex>;
39 
41  using OrderedLinks = std::vector<Link>;
43 
46 
50  static CharacterOccupation permuteCharacters(
51  const CharacterOccupation& characters,
52  const Shapes::Permutation& permutation
53  );
54 
59  static OrderedLinks permuteLinks(
60  const OrderedLinks& links,
61  const Shapes::Permutation& permutation
62  );
64 
72 
76  Stereopermutation() = default;
86  CharacterOccupation passCharacters,
87  OrderedLinks passLinks = {}
88  );
90 
93 
97  Stereopermutation applyPermutation(const Shapes::Permutation& permutation) const;
98 
100  std::string toString() const;
102 
106  inline auto tie() const {
107  return std::tie(characters, links);
108  }
110 };
111 
112 PURITY_WEAK MASM_EXPORT std::size_t hash_value(const Stereopermutation& assignment);
113 
114 } // namespace Stereopermutations
115 } // namespace Molassembler
116 } // namespace Scine
117 
118 #endif
std::pair< Shapes::Vertex, Shapes::Vertex > Link
Type used to represent a link between shape vertices.
Definition: Stereopermutation.h:38
Generates all operators using a method returning a tuple.
Definition: OperatorSuppliers.h:84
Represent abstract stereopermutation around atom center.
Definition: Stereopermutation.h:30
#define PURITY_WEAK
Definition: Preprocessor.h:36
Centralizes basic shape data in runtime types.
std::vector< Vertex > Permutation
Representation of a shape vertex permutation.
Definition: Data.h:35
Permutation applyPermutation(const Permutation &occupation, const Permutation &permutation)
Rotates a passed list of indices with a specified rotation vector.
auto tie() const
Yields members tied to tuple for crtp operator suppliers.
Definition: Stereopermutation.h:106
std::vector< char > CharacterOccupation
Character occupations.
Definition: Stereopermutation.h:35
std::vector< Link > OrderedLinks
Unordered type, but kept ordered by member functions.
Definition: Stereopermutation.h:41
CharacterOccupation characters
Abstract representation of ranked substituents.
Definition: Stereopermutation.h:68
OrderedLinks links
Links between characters.
Definition: Stereopermutation.h:70