Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ContinuousMeasures.h
Go to the documentation of this file.
1 
8 #ifndef INCLUDE_MOLASSEMBLER_SHAPES_CONTINUOUS_MEASURES_H
9 #define INCLUDE_MOLASSEMBLER_SHAPES_CONTINUOUS_MEASURES_H
10 
13 
14 namespace Scine {
15 namespace Molassembler {
16 namespace Shapes {
17 
19 namespace Continuous {
20 
21 using PositionCollection = Eigen::Matrix<double, 3, Eigen::Dynamic>;
22 
28 MASM_EXPORT PositionCollection normalize(const PositionCollection& positions);
29 
31 namespace Fixed {
32 
45 MASM_EXPORT double element(
46  const PositionCollection& normalizedPositions,
47  const Elements::Rotation& rotation
48 );
49 
58 MASM_EXPORT double element(
59  const PositionCollection& normalizedPositions,
60  const Elements::Reflection& reflection
61 );
62 
71 MASM_EXPORT double Cinf(
72  const PositionCollection& normalizedPositions,
73  const Eigen::Vector3d& axis
74 );
75 
76 } // namespace Fixed
77 
82 MASM_EXPORT std::pair<double, Elements::Rotation> element(
83  const PositionCollection& normalizedPositions,
84  Elements::Rotation rotation
85 );
86 
91 MASM_EXPORT std::pair<double, Elements::Reflection> element(
92  const PositionCollection& normalizedPositions,
93  Elements::Reflection reflection
94 );
95 
100 MASM_EXPORT double element(
101  const PositionCollection& normalizedPositions,
102  const Elements::Inversion& /* inversion */
103 );
104 
107 MASM_EXPORT double Cinf(const PositionCollection& normalizedPositions);
108 
122 MASM_EXPORT double pointGroup(
123  const PositionCollection& normalizedPositions,
125 );
126 
128 struct MASM_EXPORT ShapeResult {
130  std::vector<Vertex> mapping;
132  double measure;
133 };
134 
148  const PositionCollection& normalizedPositions,
149  Shape shape
150 );
151 
174  const PositionCollection& normalizedPositions,
175  Shape shape
176 );
177 
180  const PositionCollection& normalizedPositions,
181  Shape shape
182 );
183 
214 MASM_EXPORT ShapeResult shapeHeuristics(
215  const PositionCollection& normalizedPositions,
216  Shape shape
217 );
218 
221  const PositionCollection& normalizedPositions,
222  Shape shape
223 );
224 
233 MASM_EXPORT ShapeResult shape(
234  const PositionCollection& normalizedPositions,
235  Shape shape
236 );
237 
239 MASM_EXPORT ShapeResult shapeCentroidLast(
240  const PositionCollection& normalizedPositions,
241  const Shape shape
242 );
243 
255 MASM_EXPORT double minimumDistortionAngle(Shape a, Shape b);
256 
275 MASM_EXPORT double minimalDistortionPathDeviation(
276  const PositionCollection& positions,
277  Shape a,
278  Shape b,
279  const double minimumDistortionAngle
280 );
281 
286 MASM_EXPORT double minimalDistortionPathDeviation(const PositionCollection& positions, Shape a, Shape b);
287 
304 MASM_EXPORT std::array<double, 4> randomCloudDistributionParameters(
305  Shape shape,
306  unsigned N,
307  unsigned seed
308 );
309 
328 MASM_EXPORT boost::optional<double> probabilityRandomCloud(double measure, Shape shape);
329 
330 } // namespace Continuous
331 } // namespace Shapes
332 } // namespace Molassembler
333 } // namespace Scine
334 
335 #endif
ShapeResult shapeHeuristics(const PositionCollection &normalizedPositions, Shape shape)
Calculates the continuous shape measure of a set of coordinates with respect to a particular shape us...
double minimalDistortionPathDeviation(const PositionCollection &positions, Shape a, Shape b, const double minimumDistortionAngle)
Calculates deviation of positions from minimal distortion path between two shapes.
double element(const PositionCollection &normalizedPositions, const Elements::Rotation &rotation)
Returns the CSM for a Rotation symmetry element along the rotation axis without optimizing the coordi...
ShapeResult shape(const PositionCollection &normalizedPositions, Shape shape)
Forwarding function to calculate the continuous shape measure.
ShapeResult shapeFaithfulPaperImplementation(const PositionCollection &normalizedPositions, Shape shape)
Faithful implementation of the continuous shape measure calculation algorithm from the paper...
PointGroup
Point groups.
Definition: PointGroups.h:20
Centralizes basic shape data in runtime types.
boost::optional< double > probabilityRandomCloud(double measure, Shape shape)
Probability that shape measure in set of measures for random point clouds.
double minimumDistortionAngle(Shape a, Shape b)
Calculates minimum distortion angle in radians for shapes A and B.
double Cinf(const PositionCollection &normalizedPositions, const Eigen::Vector3d &axis)
Returns the CSM for a fixed-axis infinite order rotation axis.
ShapeResult shapeAlternateImplementation(const PositionCollection &normalizedPositions, Shape shape)
Slightly optimized implmentation of the continuous shape measure calculation algorithm.
std::vector< Vertex > mapping
Lowest value mapping from position indices to shape indices.
Definition: ContinuousMeasures.h:130
i symmetry element
Definition: PointGroupElements.h:54
double measure
Continuous shape measure value.
Definition: ContinuousMeasures.h:132
ShapeResult shapeAlternateImplementationCentroidLast(const PositionCollection &normalizedPositions, Shape shape)
Like shapeAlternateImplementation, but the centroid is the last position.
Abstraction of Cn and Sn symmetry elements.
Definition: PointGroupElements.h:63
double Cinf(const PositionCollection &normalizedPositions)
Calculates the continuous symmetry measure for an infinite order rotation axis.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
Point group symmetry elements.
ShapeResult shapeHeuristicsCentroidLast(const PositionCollection &normalizedPositions, Shape shape)
Same as shapeHeuristics(), except with set centroid mapping, so faster.
std::array< double, 4 > randomCloudDistributionParameters(Shape shape, unsigned N, unsigned seed)
Beta distribution parameters of shape measures of random point clouds.
PositionCollection normalize(const PositionCollection &positions)
Normalize positions for continuous symmetry measure analysis.
Result of a continuous shape measure calculation.
Definition: ContinuousMeasures.h:128
double pointGroup(const PositionCollection &normalizedPositions, PointGroup pointGroup)
Calculates the continuous symmetry measure for a set of particles and a particular point group...
ShapeResult shapeCentroidLast(const PositionCollection &normalizedPositions, const Shape shape)
Same as shape(), except with set centroid mapping.
Reflection by a plane symmetry element.
Definition: PointGroupElements.h:99
std::pair< double, Elements::Rotation > element(const PositionCollection &normalizedPositions, Elements::Rotation rotation)
Optimizes the axis of a rotational symmetry element and calculates the continuous symmetry measure...