Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AtomStereopermutator.h
Go to the documentation of this file.
1 
17 #ifndef INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_H
18 #define INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_H
19 
23 
24 #include <array>
25 #include <memory>
26 
27 namespace Scine {
28 namespace Molassembler {
29 
30 /* Forward declarations */
31 struct RankingInformation;
32 class AngstromPositions;
33 class Graph;
34 
35 namespace Stereopermutators {
36 struct Abstract;
37 struct Feasible;
38 } // namespace Stereopermutators
39 
40 namespace Random {
41 class Engine;
42 } // namespace Random
43 
44 namespace DistanceGeometry {
45 
46 class SpatialModel;
47 struct ChiralConstraint;
48 
49 } // namespace DistanceGeometry
50 
79 class MASM_EXPORT AtomStereopermutator {
80 public:
82 
84  using PropagatedState = std::tuple<
88  ShapeMap
89  >;
90 
95  using MinimalChiralConstraint = std::array<boost::optional<SiteIndex>, 4>;
96 
100  AtomStereopermutator& operator = (AtomStereopermutator&& other) noexcept;
102  AtomStereopermutator& operator = (const AtomStereopermutator& other);
104 
122  const Graph& graph,
123  Shapes::Shape shape,
124  AtomIndex centerAtom,
125  RankingInformation ranking
126  );
128 
131 
137  static Shapes::Shape up(Shapes::Shape shape);
138 
146  static Shapes::Shape down(Shapes::Shape shape, Shapes::Vertex removedVertex);
148 
151 
160  void assign(boost::optional<unsigned> assignment);
161 
178  void assignRandom(Random::Engine& engine);
179 
186  void applyPermutation(const std::vector<AtomIndex>& permutation);
187 
204  boost::optional<ShapeMap> fit(
205  const Graph& graph,
206  const AngstromPositions& angstromWrapper
207  );
208 
218  MASM_NO_EXPORT boost::optional<PropagatedState> propagate(
219  const Graph& graph,
220  RankingInformation newRanking,
221  boost::optional<Shapes::Shape> shapeOption
222  );
223 
231  void propagateVertexRemoval(AtomIndex removedIndex);
232 
241  void setShape(
242  Shapes::Shape shape,
243  const Graph& graph
244  );
246 
249 
263  double angle(SiteIndex i, SiteIndex j) const;
264 
272  boost::optional<unsigned> assigned() const;
273 
278  AtomIndex placement() const;
279 
288  boost::optional<unsigned> indexOfPermutation() const;
289 
306  std::vector<MinimalChiralConstraint> minimalChiralConstraints(bool enforce = false) const;
307 
312  std::string info() const;
313 
318  std::string rankInfo() const;
319 
328  std::vector<std::vector<SiteIndex>> siteGroups() const;
329 
335  MASM_NO_EXPORT const Stereopermutators::Abstract& getAbstract() const;
336 
342  MASM_NO_EXPORT const Stereopermutators::Feasible& getFeasible() const;
343 
348  const RankingInformation& getRanking() const;
349 
354  Shapes::Shape getShape() const;
355 
361  const ShapeMap& getShapePositionMap() const;
362 
384  unsigned numAssignments() const;
385 
407  unsigned numStereopermutations() const;
409 
410 
413 
421  bool operator == (const AtomStereopermutator& other) const;
423  bool operator != (const AtomStereopermutator& other) const;
424 
433  bool operator < (const AtomStereopermutator& other) const;
435 
436 private:
437  class Impl;
438  std::unique_ptr<Impl> pImpl_;
439 };
440 
441 } // namespace Molassembler
442 } // namespace Scine
443 
444 #endif
std::array< boost::optional< SiteIndex >, 4 > MinimalChiralConstraint
Site index sequence defining a chiral constraint. If a site index is None, then it denotes the positi...
Definition: AtomStereopermutator.h:95
Ranking data of substituents around a central vertex.
Definition: RankingInformation.h:23
Type helper for creating strong index types that are type-level distinct from their fundamental types...
Definition: StrongIndex.h:37
Drives a PRNG.
Definition: Prng.h:24
A wrapper class around Utils&#39; PositionCollection to emphasize that the positions stored therein are i...
Definition: AngstromPositions.h:25
ShapeResult shape(const PositionCollection &normalizedPositions, Shape shape)
Forwarding function to calculate the continuous shape measure.
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:57
Class performing spatial modeling of molecules.
Definition: SpatialModel.h:39
Definition: AtomStereopermutatorImpl.h:28
Centralizes basic shape data in runtime types.
Handles the steric permutation of substituents of a non-terminal central atom.
Definition: AtomStereopermutator.h:79
std::tuple< RankingInformation, Stereopermutators::Abstract, Stereopermutators::Feasible, ShapeMap > PropagatedState
Old state dumped upon propagation.
Definition: AtomStereopermutator.h:89
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
Permutation applyPermutation(const Permutation &occupation, const Permutation &permutation)
Rotates a passed list of indices with a specified rotation vector.
Class to compute the set of abstract permutations from ranking and shape.
Definition: AbstractPermutations.h:24
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
Definition: FeasiblePermutations.h:24
Data struct representing a chiral constraint.
Definition: DistanceGeometry.h:32
Data struct storing results of ranking and local graph algorithms.
Class for flat maps between strong indices.