Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::Stereopermutations::Composite::OrientationState Struct Reference

Encompasses the orientation of a shape along a fused bond. More...

#include <Composites.h>

Inheritance diagram for Scine::Molassembler::Stereopermutations::Composite::OrientationState:

Public Member Functions

 OrientationState (Shapes::Shape passShape, Shapes::Vertex passFusedVertex, std::vector< char > passCharacters, std::size_t passIdentifier)
 Member initializing constructor.
 
std::vector< char > applyCharacterRotation (const std::vector< Shapes::Vertex > &rotation) const
 Applies a rotation to the fused position and ranking characters. More...
 
Shapes::Vertex lowestEqualVertexInShape () const
 Smallest shape vertex from the same group as the fused position. More...
 
std::vector< Shapes::VertexfindReductionMapping (Shapes::Vertex reducedFusedVertex) const
 Calculates the required reduction mapping to the canonical form. More...
 
std::vector< Shapes::VertextransformToCanonical ()
 Transforms the OrientationState to a canonical form. More...
 
void revert (const std::vector< Shapes::Vertex > &reversionMapping)
 Reverts the OrientationState to a non-canonical form. More...
 
AngleGroup smallestAngleGroup () const
 Collects all coplanar indices that are closest to the fused shape vertex. More...
 
auto tie () const
 Full tuple-like lexicographical comparison of members in order of declaration.
 
- Public Member Functions inherited from Scine::Molassembler::Temple::Crtp::LexicographicComparable< OrientationState >
constexpr bool operator== (const LexicographicComparable &other) const
 
constexpr bool operator!= (const LexicographicComparable &other) const
 
constexpr bool operator< (const LexicographicComparable &other) const
 
constexpr bool operator<= (const LexicographicComparable &other) const
 
constexpr bool operator> (const LexicographicComparable &other) const
 
constexpr bool operator>= (const LexicographicComparable &other) const
 

Data Fields

Shapes::Shape shape
 The shape of either positional shape.
 
Shapes::Vertex fusedVertex
 The shape vertex of the local shape that the other is fused at.
 
std::vector< char > characters
 Abstract ranking-characters of the sites at their shape vertices.
 
std::size_t identifier
 An identifier to the shape source. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Scine::Molassembler::Temple::Crtp::LexicographicComparable< OrientationState >
static constexpr const
OrientationState & 
getDerived (const LexicographicComparable &base)
 

Detailed Description

Encompasses the orientation of a shape along a fused bond.

Comparison is based upon lexicographic comparison of its struct members in order of declaration.

Member Function Documentation

std::vector<char> Scine::Molassembler::Stereopermutations::Composite::OrientationState::applyCharacterRotation ( const std::vector< Shapes::Vertex > &  rotation) const

Applies a rotation to the fused position and ranking characters.

Complexity \(\Theta(N)\)

std::vector<Shapes::Vertex> Scine::Molassembler::Stereopermutations::Composite::OrientationState::findReductionMapping ( Shapes::Vertex  reducedFusedVertex) const

Calculates the required reduction mapping to the canonical form.

Complexity \(O(S!)\) where \(S\) is the size of the shape. More precisely, this function scales linearly with the number of unlinked stereopermutations if all substituents are different, but that itself probably scales factorially in the size of the shape.

Shapes::Vertex Scine::Molassembler::Stereopermutations::Composite::OrientationState::lowestEqualVertexInShape ( ) const

Smallest shape vertex from the same group as the fused position.

Complexity \(\Theta(S^2)\)

void Scine::Molassembler::Stereopermutations::Composite::OrientationState::revert ( const std::vector< Shapes::Vertex > &  reversionMapping)

Reverts the OrientationState to a non-canonical form.

Call this with the result of transformToCanonical()!

Complexity \(\Theta(S)\)

AngleGroup Scine::Molassembler::Stereopermutations::Composite::OrientationState::smallestAngleGroup ( ) const

Collects all coplanar indices that are closest to the fused shape vertex.

Complexity \(\Theta(S)\)

Postcondition
AngleGroup's shape positions are sorted
std::vector<Shapes::Vertex> Scine::Molassembler::Stereopermutations::Composite::OrientationState::transformToCanonical ( )

Transforms the OrientationState to a canonical form.

Transforms the OrientationState by applying a reduction mapping to the smallest shape vertex from the same group as the fused position. Returns the mapping needed to revert the OrientationState back to its original data values.

Note
To transform back to the original state, keep the result of this function and call revert() with it.

Complexity \(O(S!)\) where \(S\) is the size of the shape (see findReductionMapping)

Field Documentation

std::size_t Scine::Molassembler::Stereopermutations::Composite::OrientationState::identifier

An identifier to the shape source.

Since OrientationState is used internally in an ordered pair which may swap elements on changes, an identifier can be useful in reassociating the OrientationState with its data source.


The documentation for this struct was generated from the following file: