Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BondStereopermutator.h
Go to the documentation of this file.
1 
11 #ifndef INCLUDE_MOLASSEMBLER_BOND_STEREOPERMUTATOR_H
12 #define INCLUDE_MOLASSEMBLER_BOND_STEREOPERMUTATOR_H
13 
15 
16 #include <string>
17 
18 namespace Scine {
19 namespace Molassembler {
20 
21 /* Forward-declarations */
22 namespace Stereopermutations {
23 class Composite;
24 } // namespace Stereopermutations
25 
26 namespace Random {
27 class Engine;
28 } // namespace Random
29 
30 class AngstromPositions;
31 class PrivateGraph;
32 class StereopermutatorList;
33 
34 namespace DistanceGeometry {
35 class SpatialModel;
36 struct ChiralConstraint;
37 } // namespace DistanceGeometry
38 
46 class MASM_EXPORT BondStereopermutator {
47 public:
50 
53  enum class Alignment {
55  Eclipsed,
57  Staggered,
59  EclipsedAndStaggered,
61  BetweenEclipsedAndStaggered
62  };
63 
67  enum class FittingMode {
69  Thresholded,
71  Nearest
72  };
74 
77 
87  static constexpr double assignmentAcceptanceParameter = 0.1;
89 
92 
97  static std::vector<unsigned> notObviouslyInfeasibleStereopermutations(
98  const PrivateGraph& graph,
99  const AtomStereopermutator& stereopermutatorA,
100  const AtomStereopermutator& stereopermutatorB,
101  const Stereopermutations::Composite& composite
102  );
104 
107  BondStereopermutator(BondStereopermutator&& other) noexcept;
108  BondStereopermutator& operator = (BondStereopermutator&& other) noexcept;
110  BondStereopermutator& operator = (const BondStereopermutator& other);
113 
116  BondStereopermutator() = delete;
125  const AtomStereopermutator& stereopermutatorA,
126  const AtomStereopermutator& stereopermutatorB,
127  const BondIndex& edge,
128  Alignment alignment = Alignment::Eclipsed
129  );
130 
138  const PrivateGraph& graph,
139  const StereopermutatorList& stereopermutators,
140  const BondIndex& edge,
141  Alignment alignment = Alignment::Eclipsed
142  );
144 
147 
156  void assign(boost::optional<unsigned> assignment);
157 
167  void assignRandom(Random::Engine& engine);
168 
174  void applyPermutation(const std::vector<AtomIndex>& permutation);
175 
177  const AtomStereopermutator& stereopermutator;
178  const AtomStereopermutator::ShapeMap& shapeMap;
179  };
180 
198  void fit(
199  const AngstromPositions& angstromWrapper,
200  std::pair<FittingReferences, FittingReferences> fittingReferences,
201  FittingMode mode = FittingMode::Thresholded
202  );
203 
219  void propagateGraphChange(
220  const AtomStereopermutator::PropagatedState& oldPermutator,
221  const AtomStereopermutator& newPermutator,
222  const PrivateGraph& inner,
223  const StereopermutatorList& permutators
224  );
226 
229 
233  Alignment alignment() const;
234 
241  boost::optional<unsigned> assigned() const;
242 
247  const Stereopermutations::Composite& composite() const;
248 
261  double dihedral(
262  const AtomStereopermutator& stereopermutatorA,
263  SiteIndex siteIndexA,
264  const AtomStereopermutator& stereopermutatorB,
265  SiteIndex siteIndexB
266  ) const;
267 
273  bool hasSameCompositeOrientation(const BondStereopermutator& other) const;
274 
279  boost::optional<unsigned> indexOfPermutation() const;
280 
285  unsigned numAssignments() const;
286 
291  unsigned numStereopermutations() const;
292 
297  std::string info() const;
298 
303  std::string rankInfo() const;
304 
309  BondIndex placement() const;
311 
314  bool operator < (const BondStereopermutator& other) const;
319  bool operator == (const BondStereopermutator& other) const;
321  bool operator != (const BondStereopermutator& other) const;
323 
324 private:
325  struct Impl;
326  std::unique_ptr<Impl> pImpl_;
327 };
328 
329 } // namespace Molassembler
330 } // namespace Scine
331 
332 #endif
Definition: BondStereopermutatorImpl.h:23
Type helper for creating strong index types that are type-level distinct from their fundamental types...
Definition: StrongIndex.h:37
A wrapper class around Utils&#39; PositionCollection to emphasize that the positions stored therein are i...
Definition: AngstromPositions.h:25
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
Handle arrangements of substituents at corners of an atom-centered shape.
Handles specific relative arrangements of two atom stereopermutators joined by a bond.
Definition: BondStereopermutator.h:46
Manages all stereopermutators that are part of a Molecule.
Definition: StereopermutatorList.h:30
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.
Library internal graph class wrapping BGL types.
Definition: PrivateGraph.h:24
Type used to refer to particular bonds. Orders first &lt; second.
Definition: Types.h:54
FittingMode
Differentiates how viable assignments are chosen during fitting.
Definition: BondStereopermutator.h:67
Alignment
How dihedrals are aligned in the generation of stereopermutations.
Definition: BondStereopermutator.h:53
Represents the composite of two shapes joined by a bond at arbitrary shape vertices.
Definition: Composites.h:33