Molassembler  1.0.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 #include <map>
17 
18 namespace Scine {
19 namespace Molassembler {
20 
22 namespace Stereopermutations {
23 
32 class MASM_EXPORT Stereopermutation : public Temple::Crtp::LexicographicComparable<Stereopermutation> {
33 public:
37  using CharacterOccupation = std::vector<char>;
38 
40  using Link = std::pair<Shapes::Vertex, Shapes::Vertex>;
41 
43  using OrderedLinks = std::vector<Link>;
45 
48 
52  static CharacterOccupation permuteCharacters(
53  const CharacterOccupation& characters,
54  const Shapes::Permutation& permutation
55  );
56 
61  static OrderedLinks permuteLinks(
62  const OrderedLinks& links,
63  const Shapes::Permutation& permutation
64  );
66 
74 
77  // Do not default instantiate
78  Stereopermutation() = delete;
88  CharacterOccupation passCharacters,
89  OrderedLinks passLinks = {}
90  );
92 
95 
99  Stereopermutation applyPermutation(const Shapes::Permutation& permutation) const;
100 
102  std::map<
103  char,
104  std::vector<unsigned>
105  > getCharMap() const;
106 
108  std::string toString() const;
110 
114  inline auto tie() const {
115  return std::tie(characters, links);
116  }
118 };
119 
120 PURITY_WEAK MASM_EXPORT std::size_t hash_value(const Stereopermutation& assignment);
121 
122 } // namespace Stereopermutations
123 } // namespace Molassembler
124 } // namespace Scine
125 
126 #endif
std::pair< Shapes::Vertex, Shapes::Vertex > Link
Type used to represent a link between shape vertices.
Definition: Stereopermutation.h:40
Generates all operators using a method returning a tuple.
Definition: OperatorSuppliers.h:84
Represent abstract stereopermutation around atom center.
Definition: Stereopermutation.h:32
#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:114
std::vector< char > CharacterOccupation
Character occupations.
Definition: Stereopermutation.h:37
constexpr auto map(const ArrayType< T, size > &array, UnaryFunction &&function)
Maps all elements of any array-like container with a unary function.
Definition: Containers.h:62
std::vector< Link > OrderedLinks
Unordered type, but kept ordered by member functions.
Definition: Stereopermutation.h:43
CharacterOccupation characters
Abstract representation of ranked substituents.
Definition: Stereopermutation.h:70
OrderedLinks links
Links between characters.
Definition: Stereopermutation.h:72