Compile-time calculation of shape classes' properties. More...
Data Structures | |
struct | AngleBoundsFunctor |
Metafunction calculating the smallest and largest angle that exist in a shape. More... | |
struct | minAngleFunctor |
Functor to find out the minimum angle among all shape class types passed as template arguments. More... | |
struct | allRotationPeriodicities |
Calculate the multiplicities of all rotations of a shape. More... | |
struct | maxShapeSizeFunctor |
Finds the largest size value of a set of symmetries. More... | |
struct | MappingsReturnType |
Data struct to collect the results of calculating the ideal index mappings between pairs of indices. More... | |
Typedefs | |
template<typename T , size_t size> | |
using | ArrayType = std::array< T, size > |
using | AngleFunctionPtr = double(*)(const unsigned, const unsigned) |
template<typename ShapeClass > | |
using | IndicesList = ArrayType< unsigned, ShapeClass::size > |
using | IndexListStorageType = unsigned |
template<typename ShapeClass > | |
using | RotationsSetType = Temple::DynamicSet< IndicesList< ShapeClass >, maxRotations< ShapeClass >()*2 > |
template<typename ShapeClass > | |
using | ChainStructuresArrayType = Temple::DynamicArray< IndicesList< ShapeClass >, maxRotations< ShapeClass >()*2 > |
template<typename ShapeClass > | |
using | ChainArrayType = Temple::DynamicArray< unsigned, maxRotations< ShapeClass >()*2 > |
Functions | |
template<typename ShapeClass > | |
constexpr double | calculateSmallestAngle () |
Calculates the minimum angle returned in a shape class. More... | |
template<typename ShapeClass > | |
constexpr auto | startingIndexSequence () |
Generate an integer sequence to use with stereopermutations. | |
template<typename ShapeClass , size_t... Indices> | |
constexpr ArrayType< unsigned, ShapeClass::size > | applyRotationImpl (const ArrayType< unsigned, ShapeClass::size > &indices, const unsigned rotationFunctionIndex, std::index_sequence< Indices...>) |
Helper to perform applyRotation in constexpr fashion. | |
template<typename ShapeClass > | |
constexpr ArrayType< unsigned, ShapeClass::size > | applyRotation (const ArrayType< unsigned, ShapeClass::size > &indices, const unsigned rotationFunctionIndex) |
Applies a shape group rotation to an array of indices. More... | |
template<typename ShapeClass , unsigned rotationFunctionIndex> | |
constexpr unsigned | rotationPeriodicityImpl (const ArrayType< unsigned, ShapeClass::size > &runningIndices, const unsigned count) |
Helper to perform rotationPeriodicity in constexpr fashion. | |
template<typename ShapeClass , unsigned rotationFunctionIndex> | |
constexpr unsigned | rotationPeriodicity () |
Determines the multiplicity of a shape group rotation. More... | |
template<typename ShapeClass , size_t... Inds> | |
constexpr ArrayType< unsigned, ShapeClass::rotations.size()> | rotationPeriodicitiesImpl (std::index_sequence< Inds...>) |
Helper function to calculate all rotation periodicities. | |
template<typename ShapeClass > | |
constexpr ArrayType< unsigned, ShapeClass::rotations.size()> | rotationPeriodicities () |
Calculates all multiplicities of a shape group's rotations. | |
template<typename ShapeClass > | |
constexpr Temple::Vector | getCoordinates (const unsigned indexInSymmetry) |
Fetches the coordinates of an index in a shape. More... | |
constexpr double | getTetrahedronVolume (const Temple::Vector &i, const Temple::Vector &j, const Temple::Vector &k, const Temple::Vector &l) |
Calculates the volume of a tetrahedron spanned by four positions. More... | |
template<size_t size> | |
constexpr double | calculateAngularDistortion (const ArrayType< unsigned, size > &indexMapping, const size_t sourceSymmetrySize, const AngleFunctionPtr sourceAngleFunction, const AngleFunctionPtr targetAngleFunction) |
Calculates angular distortion caused by a shape transition mapping. More... | |
template<size_t size> | |
constexpr unsigned | propagateSymmetryPosition (const unsigned symmetryPosition, const ArrayType< unsigned, size > &indexMapping) |
Propagates shape positions trhough an index mapping. More... | |
template<typename ShapeClassFrom , typename ShapeClassTo > | |
constexpr double | calculateChiralDistortion (const ArrayType< unsigned, Temple::Math::max(ShapeClassFrom::size, ShapeClassTo::size) > &indexMapping) |
Calculates the chiral distortion caused by a shape transition. More... | |
template<size_t size> | |
constexpr ArrayType< unsigned, size > | symPosMapping (const ArrayType< unsigned, size > &mapping) |
Transform shape positions through a mapping. More... | |
template<typename ShapeClass > | |
constexpr unsigned | maxRotations () |
template<typename ShapeClass > | |
constexpr auto | generateAllRotations (const IndicesList< ShapeClass > &indices) |
Generates all rotations of a sequence of indices within a shape group. More... | |
template<class ShapeClassFrom , class ShapeClassTo > | |
constexpr auto | symmetryTransitionMappings () |
Calculates ideal index mappings for +1, 0 size transitions. More... | |
template<class ShapeClassFrom , class ShapeClassTo > | |
constexpr auto | ligandLossMappings (const unsigned deletedSymmetryPosition) |
Find index mappings for ligand loss situations. More... | |
template<typename SymmetrySource , typename SymmetryTarget > | |
constexpr std::enable_if_t < (SymmetryTarget::size <=7 &&(SymmetrySource::size==SymmetryTarget::size||SymmetrySource::size+1==SymmetryTarget::size)), Temple::Optional < MappingsReturnType >> | calculateMapping () |
If symmetries are adjacent, calculate their shape transition mapping. | |
template<typename SymmetrySource , typename SymmetryTarget > | |
constexpr std::enable_if_t < !(SymmetryTarget::size <=7 &&(SymmetrySource::size==SymmetryTarget::size||SymmetrySource::size+1==SymmetryTarget::size)), Temple::Optional < MappingsReturnType >> | calculateMapping () |
If symmetries are not adjacent, return a None. | |
template<typename ShapeClass > | |
constexpr unsigned | numUnlinkedStereopermutations (const unsigned nIdenticalLigands) |
Calculate stereopermutations for an unlinked shape. More... | |
template<typename ShapeClass > | |
constexpr bool | hasMultipleUnlinkedStereopermutations (const unsigned nIdenticalLigands) |
Calculates whether a shape has multiple stereopermutations. More... | |
Variables | |
constexpr double | floatingPointEqualityTolerance = 1e-4 |
constexpr unsigned | maxShapeSize |
The largest shape size defined in the library. More... | |
Compile-time calculation of shape classes' properties.
Here we calculate various properties of shape classes (i.e. classes that fulfill the concepts::ShapeClass concept). Also, transition mappings can be calculated at compile time using functions in this namespace.
Data from Primitives.h takes two paths through this library: Shape classes, whose equivalent data members may have different type signatures, can be processed directly here and transformed. The data available in the shape classes is made available to runtime functions by smoothing over the type signatures, which are merely differences in array lengths, into static runtime datatypes such as vectors. Then, runtime functions can calculate the same properties as these available here, but by referring to shapes by their Name, not by the shape class type itself.
constexpr ArrayType<unsigned, ShapeClass::size> Scine::Molassembler::Shapes::ConstexprProperties::applyRotation | ( | const ArrayType< unsigned, ShapeClass::size > & | indices, |
const unsigned | rotationFunctionIndex | ||
) |
Applies a shape group rotation to an array of indices.
Complexity \(\Theta(S)\)
constexpr double Scine::Molassembler::Shapes::ConstexprProperties::calculateAngularDistortion | ( | const ArrayType< unsigned, size > & | indexMapping, |
const size_t | sourceSymmetrySize, | ||
const AngleFunctionPtr | sourceAngleFunction, | ||
const AngleFunctionPtr | targetAngleFunction | ||
) |
Calculates angular distortion caused by a shape transition mapping.
Complexity \(\Theta(S^2)\)
indexMapping | An integer sequence specifying how indices from the source shape are mapped to the target shape |
sourceSymmetrySize | The size of the source shape |
sourceAngleFunction | A pointer to the source shape's angle function |
targetAngleFunction | A pointer to the target shape's angle function |
constexpr double Scine::Molassembler::Shapes::ConstexprProperties::calculateChiralDistortion | ( | const ArrayType< unsigned, Temple::Math::max(ShapeClassFrom::size, ShapeClassTo::size) > & | indexMapping | ) |
Calculates the chiral distortion caused by a shape transition.
Calculate the chiral distortion between the source shape and the target shape specified by an index mapping.
Complexity \(\Theta(T)\) where \(T\) is the number of tetrahedra for the shape, typically small
indexMapping | The index mapping that specifies how indices are mapped from a source shape to a target shape |
constexpr double Scine::Molassembler::Shapes::ConstexprProperties::calculateSmallestAngle | ( | ) |
Calculates the minimum angle returned in a shape class.
ShapeClass | A shape class |
Complexity \(\Theta(S^2)\)
constexpr auto Scine::Molassembler::Shapes::ConstexprProperties::generateAllRotations | ( | const IndicesList< ShapeClass > & | indices | ) |
Generates all rotations of a sequence of indices within a shape group.
ShapeClass | a model of concepts::ShapeClass |
Complexity At most maxRotation iterations
constexpr Temple::Vector Scine::Molassembler::Shapes::ConstexprProperties::getCoordinates | ( | const unsigned | indexInSymmetry | ) |
Fetches the coordinates of an index in a shape.
Fetches the coordinates of an index in a shape, properly handling the boost::none -> origin mapping.
Complexity \(\Theta(1)\)
constexpr double Scine::Molassembler::Shapes::ConstexprProperties::getTetrahedronVolume | ( | const Temple::Vector & | i, |
const Temple::Vector & | j, | ||
const Temple::Vector & | k, | ||
const Temple::Vector & | l | ||
) |
Calculates the volume of a tetrahedron spanned by four positions.
Complexity \(\Theta(1)\)
constexpr bool Scine::Molassembler::Shapes::ConstexprProperties::hasMultipleUnlinkedStereopermutations | ( | const unsigned | nIdenticalLigands | ) |
Calculates whether a shape has multiple stereopermutations.
Complexity \(\Theta(S!)\)
ShapeClass | The shape for which to calculate this property. |
nIdenticalLigands | The number of ligands whose ranking is identical. E.g. 0 generates ABCDEF, 3 generates AAABCD, etc. for octahedral. |
constexpr auto Scine::Molassembler::Shapes::ConstexprProperties::ligandLossMappings | ( | const unsigned | deletedSymmetryPosition | ) |
Find index mappings for ligand loss situations.
Complexity \(\Theta(S!)\)
ShapeClassFrom | A model of concepts::ShapeClass |
ShapeClassTo | A model of concepts::ShapeClass |
constexpr unsigned Scine::Molassembler::Shapes::ConstexprProperties::maxRotations | ( | ) |
Calculate a lower bound on non-superimposable rotations a shape class can produce for entirely unequal indices
Complexity \(\Theta(R M S)\) where \(R\) is the number of rotations of the shape, \(M\) is the largest multiplicity of those rotations and \(S\) is the size of the shape
ShapeClass | A shape class as defined in Primitives.h |
constexpr unsigned Scine::Molassembler::Shapes::ConstexprProperties::numUnlinkedStereopermutations | ( | const unsigned | nIdenticalLigands | ) |
Calculate stereopermutations for an unlinked shape.
Complexity \(\Theta(S!)\)
ShapeClass | A model of concepts::ShapeClass |
nIdenticalLigands | The number of ligands whose ranking is identical. E.g. 0 generates ABCDEF, 3 generates AAABCD, etc. for octahedral. |
constexpr unsigned Scine::Molassembler::Shapes::ConstexprProperties::propagateSymmetryPosition | ( | const unsigned | symmetryPosition, |
const ArrayType< unsigned, size > & | indexMapping | ||
) |
Propagates shape positions trhough an index mapping.
Propagates a source shape position through an index mapping, properly handling the origin placeholder special unsigned value.
Complexity \(\Theta(S)\)
symmetryPosition | The shape position to be mapped |
indexMapping | The index mapping that specifies how indices are mapped from a source shape to a target shape |
constexpr unsigned Scine::Molassembler::Shapes::ConstexprProperties::rotationPeriodicity | ( | ) |
Determines the multiplicity of a shape group rotation.
Calculates the multiplicity of a shape group's rotation specified via an index in that shape's list of rotations
Complexity \(\Theta(M S)\) where \(M\) is the multiplicity of the rotation and \(S\) is the shape size
ShapeClass | a model of concepts::ShapeClass |
constexpr auto Scine::Molassembler::Shapes::ConstexprProperties::symmetryTransitionMappings | ( | ) |
Calculates ideal index mappings for +1, 0 size transitions.
Calculates the ideal index mappings for transitions in which a ligand is added or the shape size stays the same.
Complexity \(\Theta(S!)\)
ShapeClassFrom | A model of concepts::ShapeClass |
ShapeClassTo | A model of concepts::ShapeClass |
constexpr ArrayType<unsigned, size> Scine::Molassembler::Shapes::ConstexprProperties::symPosMapping | ( | const ArrayType< unsigned, size > & | mapping | ) |
Transform shape positions through a mapping.
Writes the indices of the original shape in the mapping into the target shape's indexing scheme.
Complexity \(\Theta(S)\)
mapping | An index mapping that specifies how indices are mapped from a source shape to a target shape |
constexpr unsigned Scine::Molassembler::Shapes::ConstexprProperties::maxShapeSize |
The largest shape size defined in the library.