8 #ifndef INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_IMPL_H
9 #define INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_IMPL_H
17 #include "boost/optional.hpp"
20 namespace Molassembler {
23 namespace Properties {
24 struct ShapeTransitionGroup;
87 const std::vector<std::vector<SiteIndex>>&
siteGroups = {});
91 void assign(boost::optional<unsigned> assignment,
92 const std::vector<std::vector<SiteIndex>>&
siteGroups = {});
98 void assign(std::vector<Shapes::Vertex> vertexMapping);
115 boost::optional<ShapeMap>
fit(
126 boost::optional<PropagatedState>
propagate(
128 boost::optional<Shapes::Shape> shapeOption,
144 const std::vector<std::vector<SiteIndex>>&
siteGroups = {}
161 boost::optional<unsigned>
assigned()
const;
191 std::string
info()
const;
204 std::vector<std::vector<SiteIndex>>
siteGroups()
const;
209 const std::vector<std::pair<AtomIndex, AtomIndex>>& substitutions = {}
212 inline bool thermalized()
const {
256 inline auto tie()
const {
ShapeMap shapePositionMap_
Derived property of assignmentOption_.
Definition: AtomStereopermutatorImpl.h:281
std::function< bool(AtomIndex, Shapes::Shape, const RankingInformation &)> ThermalizationPredicate
Predicate to decide whether an atom stereopermutator is thermalized.
Definition: AtomStereopermutator.h:88
A grouping of index mappings of equal angular and chiral distortion.
Definition: Properties.h:233
boost::optional< ShapeMap > fit(const SiteCentroids ¢roids, const FeasiblesGenerator &feasibility, const ThermalizationPredicate &thermalization)
Compute the set of abstract permutations.
AtomIndex placement() const
Returns a single-element vector containing the central atom.
boost::optional< unsigned > indexOfPermutation() const
Returns IOP within the set of symbolic ligand permutations.
Generates all operators using a method returning a tuple.
Definition: OperatorSuppliers.h:78
Drives a PRNG.
Definition: Prng.h:24
static bool thermalized(AtomIndex centerAtom, Shapes::Shape shape, const RankingInformation &ranking, const Graph &graph)
Whether the stereopermutations interconvert rapidly at selected temp.
const std::vector< unsigned > & getFeasible() const
Returns the list of feasible abstract permutations.
A wrapper class around Utils' PositionCollection to emphasize that the positions stored therein are i...
Definition: AngstromPositions.h:25
ShapeResult shape(const PositionCollection &normalizedPositions, Shape shape)
Forwarding function to calculate the continuous shape measure.
unsigned numAssignments() const
Returns the number of possible permutations.
ChiralStatePreservation
Specifies the effects of graph modifications on chiral centers.
Definition: Options.h:129
const RankingInformation & getRanking() const
Returns the underlying ranking.
Eigen::Matrix< double, 3, Eigen::Dynamic > SiteCentroids
Spatial positions of the centroids of sites.
Definition: AtomStereopermutator.h:85
void assignRandom(Random::Engine &engine)
Assigns the Stereopermutator randomly using relative stereopermutation weights.
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:54
static boost::optional< std::vector< Shapes::Vertex > > selectTransitionMapping(const Shapes::Properties::ShapeTransitionGroup &mappingsGroup, const ChiralStatePreservation &preservationOption)
Selects a shape vertex mapping from a shape transition group.
void applyPermutation(const std::vector< AtomIndex > &permutation)
Applies an atom index permutation.
Definition: AtomStereopermutatorImpl.h:28
Decide which stereopermutations are feasible.
const Stereopermutators::Abstract & getAbstract() const
Returns the underlying AbstractStereopermutation.
std::vector< unsigned > feasibles_
List of abstract permutation indices that are feasible in three dimensions.
Definition: AtomStereopermutatorImpl.h:275
Impl(const Graph &graph, Shapes::Shape shape, AtomIndex centerAtom, RankingInformation ranking)
Constructor.
Handle arrangements of substituents at corners of an atom-centered shape.
boost::optional< unsigned > assignmentOption_
The current state of assignment (if or not, and if so, which)
Definition: AtomStereopermutatorImpl.h:278
AtomIndex centerAtom_
Central atom of the Stereopermutator.
Definition: AtomStereopermutatorImpl.h:263
std::function< std::vector< unsigned >(const Stereopermutators::Abstract &abstract, Shapes::Shape shape, AtomIndex placement, const RankingInformation &ranking, std::vector< std::vector< SiteIndex >> siteGroups) > FeasiblesGenerator
Generator function to list spatially feasible permutation indices.
Definition: AtomStereopermutator.h:99
Shapes::Shape getShape() const
Returns the underlying shape.
const ShapeMap & getShapePositionMap() const
Yields the mapping from site indices to shape positions.
void propagateVertexRemoval(AtomIndex removedIndex)
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
std::vector< MinimalChiralConstraint > minimalChiralConstraints(bool enforce=false) const
Returns a minimal representation of chiral constraints.
void thermalize(bool thermalization)
Unconditionally alter the thermalization of stereopermutations.
SiteCentroids sitePositions(const AngstromPositions &wrapper, const std::vector< std::pair< AtomIndex, AtomIndex >> &substitutions={}) const
Generate site centroid positions from a whole-molecule set of positions.
std::string info() const
Returns an information string for diagnostic purposes.
bool thermalized_
Whether all feasible assignments interconvert thermally.
Definition: AtomStereopermutatorImpl.h:284
boost::optional< PropagatedState > propagate(RankingInformation newRanking, boost::optional< Shapes::Shape > shapeOption, const FeasiblesGenerator &feasibility, const ThermalizationPredicate &thermalization)
Shapes::Shape shape_
The shape the stereopermutator represents.
Definition: AtomStereopermutatorImpl.h:266
unsigned numStereopermutations() const
Returns the number of symbolic ligand permutations.
Class to compute the set of abstract permutations from ranking and shape.
Definition: AbstractPermutations.h:24
double angle(SiteIndex i, SiteIndex j) const
Returns the angle between two site indices in the idealized shape.
static Shapes::Shape down(Shapes::Shape shape, Shapes::Vertex removedVertex)
Picks a shape retaining as much chiral state as possible on a shape size decrease.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
Data struct to store chiral constraints for DG.
static Shapes::Shape up(Shapes::Shape shape)
Picks a shape retaining as much chiral state as possible on a shape size increase.
void assign(boost::optional< unsigned > assignment, const std::vector< std::vector< SiteIndex >> &siteGroups={})
Changes the assignment of the stereopermutator.
boost::optional< unsigned > assigned() const
Returns the permutation index within the set of possible permutations, if set.
Stereopermutators::Abstract abstract_
Abstract stereopermutations and intermediate state.
Definition: AtomStereopermutatorImpl.h:272
std::string rankInfo() const
Returns an information string for ranking equality checking purposes.
std::vector< std::vector< SiteIndex > > siteGroups() const
Returns site indices grouped by rotational interconversion.
void setShape(Shapes::Shape shape, const FeasiblesGenerator &feasibility, const ThermalizationPredicate &thermalization, const std::vector< std::vector< SiteIndex >> &siteGroups={})
If the shape is changed, we must adapt.
RankingInformation ranking_
Ranking information of substituents.
Definition: AtomStereopermutatorImpl.h:269