Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Properties.h
Go to the documentation of this file.
1 
10 #ifndef INCLUDE_SHAPE_PROPERTIES_H
11 #define INCLUDE_SHAPE_PROPERTIES_H
12 
14 
15 #include <set>
16 
17 namespace Scine {
18 namespace Molassembler {
19 namespace Shapes {
20 
22 namespace Properties {
23 
24 constexpr double floatingPointEqualityThreshold [[gnu::unused]] = 1e-4;
25 
30 MASM_EXPORT Permutation applyPermutation(
31  const Permutation& occupation,
32  const Permutation& permutation
33 );
34 
39 MASM_EXPORT std::vector<Vertex> applyRotation(
40  const Permutation& occupation,
41  Shape shape,
42  unsigned rotationFunctionIndex
43 );
44 
50 MASM_EXPORT unsigned rotationPeriodicity(
51  Shape shape,
52  const Permutation& rotation
53 );
54 
59 PURITY_WEAK MASM_EXPORT std::vector<std::vector<Vertex>> positionGroups(Shape shape);
60 
71 MASM_EXPORT std::vector<char> positionGroupCharacters(Shape shape);
72 
80 MASM_EXPORT Permutation inverseRotation(const Permutation& rotation);
81 
89 MASM_EXPORT Eigen::Vector3d getCoordinates(
90  Shape shape,
91  const boost::optional<Vertex>& vertexOption
92 );
93 
101 MASM_EXPORT double getTetrahedronVolume(
102  const Eigen::Vector3d& i,
103  const Eigen::Vector3d& j,
104  const Eigen::Vector3d& k,
105  const Eigen::Vector3d& l
106 );
107 
116 MASM_EXPORT double calculateAngleDistortion(
117  Shape from,
118  Shape to,
119  const std::vector<Vertex>& indexMapping
120 );
121 
131 MASM_EXPORT boost::optional<Vertex> propagateIndexOptionalThroughMapping(
132  const boost::optional<Vertex>& indexOptional,
133  const std::vector<Vertex>& indexMapping
134 );
135 
145 MASM_EXPORT double calculateChiralDistortion(
146  Shape from,
147  Shape to,
148  const std::vector<Vertex>& indexMapping
149 );
150 
155 MASM_EXPORT
156 std::set<
157  std::vector<Vertex>
159  Shape shape,
160  const std::vector<Vertex>& indices
161 );
162 
174 MASM_EXPORT std::vector<Vertex> applyIndexMapping(
175  Shape to,
176  const std::vector<Vertex>& mapping
177 );
178 
182 struct MASM_EXPORT DistortionInfo {
183  std::vector<Vertex> indexMapping;
184  double angularDistortion;
185  double chiralDistortion;
186 
188  std::vector<Vertex> passIndexMapping,
189  double passAngularDistortion,
190  double passChiralDistortion
191  );
192 };
193 
208 MASM_EXPORT std::vector<DistortionInfo> shapeTransitionMappings(
209  Shape from,
210  Shape to
211 );
212 
226 MASM_EXPORT std::vector<DistortionInfo> ligandLossTransitionMappings(
227  Shape from,
228  Shape to,
229  Vertex positionInSourceShape
230 );
231 
233 struct MASM_EXPORT ShapeTransitionGroup {
238  std::vector<
239  std::vector<Vertex>
241  double angularDistortion;
242  double chiralDistortion;
243 
245  std::vector<
246  std::vector<Vertex>
247  > passIndexMappings,
248  double passAngleDistortion,
249  double passChiralDistortion
250  );
251 
252  ShapeTransitionGroup() = default;
253 };
254 
264  const std::vector<DistortionInfo>& distortions
265 );
266 
273 PURITY_WEAK MASM_EXPORT unsigned numUnlinkedStereopermutations(
274  Shape shape,
275  unsigned nIdenticalLigands
276 );
277 
285  Shape shape,
286  unsigned nIdenticalLigands
287 );
288 
293 PURITY_WEAK MASM_EXPORT Shape mostSymmetric(std::vector<Shape> selection);
294 
299 PURITY_WEAK MASM_EXPORT Shape mostSymmetric(unsigned shapeSize);
300 
301 } // namespace Properties
302 } // namespace Shapes
303 } // namespace Molassembler
304 } // namespace Scine
305 
306 #endif
std::set< std::vector< Vertex >> generateAllRotations(Shape shape, const std::vector< Vertex > &indices)
Generates all rotations of a sequence of indices within a shape.
A grouping of index mappings of equal angular and chiral distortion.
Definition: Properties.h:233
Permutation inverseRotation(const Permutation &rotation)
Generate the inverse rotation to a shape&#39;s rotation.
boost::optional< Vertex > propagateIndexOptionalThroughMapping(const boost::optional< Vertex > &indexOptional, const std::vector< Vertex > &indexMapping)
Propagates an index optional through an index mapping.
double calculateAngleDistortion(Shape from, Shape to, const std::vector< Vertex > &indexMapping)
Calculates angular distorition for an index mapping between shapes.
#define PURITY_WEAK
Definition: Preprocessor.h:36
Data type grouping distortions between shapes.
Definition: Properties.h:182
ShapeResult shape(const PositionCollection &normalizedPositions, Shape shape)
Forwarding function to calculate the continuous shape measure.
std::vector< char > positionGroupCharacters(Shape shape)
Generate a character representation of a shape&#39;s position groups.
Centralizes basic shape data in runtime types.
std::vector< Vertex > applyIndexMapping(Shape to, const std::vector< Vertex > &mapping)
Transform shape positions through a mapping.
PURITY_WEAK std::vector< std::vector< Vertex > > positionGroups(Shape shape)
Group shape vertices according to whether they can be interconverted by rotation. ...
std::vector< Vertex > Permutation
Representation of a shape vertex permutation.
Definition: Data.h:35
std::vector< Vertex > applyRotation(const Permutation &occupation, Shape shape, unsigned rotationFunctionIndex)
Rotates a passed list of indices of a specific shape.
Eigen::Vector3d getCoordinates(Shape shape, const boost::optional< Vertex > &vertexOption)
Gets the coordinates of an indexOptional for a specific shape.
Permutation applyPermutation(const Permutation &occupation, const Permutation &permutation)
Rotates a passed list of indices with a specified rotation vector.
std::vector< DistortionInfo > ligandLossTransitionMappings(Shape from, Shape to, Vertex positionInSourceShape)
Calculates ideal index mappings for ligand loss transitions.
PURITY_WEAK unsigned numUnlinkedStereopermutations(Shape shape, unsigned nIdenticalLigands)
Calculates the number of stereopermutations in a specific shape and a number of identical ligands...
double getTetrahedronVolume(const Eigen::Vector3d &i, const Eigen::Vector3d &j, const Eigen::Vector3d &k, const Eigen::Vector3d &l)
Tetrahedron volume spanned by four positions.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
double calculateChiralDistortion(Shape from, Shape to, const std::vector< Vertex > &indexMapping)
Calculates chiral distortion for a transition between shapes.
std::vector< std::vector< Vertex > > indexMappings
A list of index mappings that share the same angularDistortion and chiralDistortion.
Definition: Properties.h:240
PURITY_WEAK Shape mostSymmetric(std::vector< Shape > selection)
Yields the shape with the most rotations from a selection.
PURITY_WEAK bool hasMultipleUnlinkedStereopermutations(Shape shape, unsigned nIdenticalLigands)
Calculates if there are multiple unlinked stereopermutations in a specific shape for a number of iden...
std::vector< DistortionInfo > shapeTransitionMappings(Shape from, Shape to)
Calculates ideal index mappings for +1, 0 size transitions.
ShapeTransitionGroup selectBestTransitionMappings(const std::vector< DistortionInfo > &distortions)
Selects the best transition mapping from many DistortionInfos.
unsigned rotationPeriodicity(Shape shape, const Permutation &rotation)
Calculate the periodicty of a shape&#39;s index rotation.