8 #ifndef INCLUDE_MOLASSEMBLER_MOLECULE_IMPL_H
9 #define INCLUDE_MOLASSEMBLER_MOLECULE_IMPL_H
20 namespace Molassembler {
24 const std::vector<AtomIndex>& canonicalizationIndexMap,
32 boost::optional<AtomStereopermutator> makePermutator(
35 const boost::optional<AngstromPositions>& maybePositions = boost::none,
36 const boost::optional<SubstitutionsGenerator::SubstitutionMap>& maybeSubstitutions = boost::none
39 boost::optional<BondStereopermutator> makePermutator(
42 const boost::optional<AngstromPositions>& maybePositions = boost::none,
43 const boost::optional<SubstitutionsGenerator::SubstitutionMap>& maybeSubstitutions = boost::none,
82 const boost::optional<
83 std::vector<BondIndex>
84 >& bondStereopermutatorCandidatesOptional = boost::none,
85 const boost::optional<PeriodicBoundaryDuplicates>& periodics = boost::none
92 boost::optional<AtomEnvironmentComponents> canonicalComponentsOption
100 Utils::ElementType elementType,
136 const boost::optional<unsigned>& assignment
154 const boost::optional<unsigned>& assignment
256 Utils::ElementType elementType
305 std::size_t
hash()
const;
312 const boost::optional<
313 std::vector<BondIndex>
314 >& explicitBondStereopermutatorCandidatesOption = boost::none,
315 boost::optional<
const std::unordered_set<AtomIndex>&> uninteresting = boost::none,
316 const boost::optional<SubstitutionsGenerator::SubstitutionMap>& substitutions = boost::none
332 std::string
str()
const;
336 const std::vector<AtomIndex>& excludeAdjacent = {},
337 const boost::optional<AngstromPositions>& positionsOption = boost::none
353 boost::optional<AtomEnvironmentComponents> canonicalComponentsOption_;
bool canonicalCompare(const Impl &other, AtomEnvironmentComponents componentBitmask) const
Compares two canonical instances with one another.
StereopermutatorList detectStereopermutators_() const
Generates a list of stereopermutators based on graph properties alone.
std::string dumpGraphviz() const
Returns a graphivz string representation of the molecule.
void setElementType(AtomIndex a, Utils::ElementType elementType)
Changes an existing atom's element type.
Impl() noexcept
Default constructor.
Drives a PRNG.
Definition: Prng.h:24
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...
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.
boost::optional< AtomEnvironmentComponents > canonicalComponents() const
Yield which components were used in canonicalization.
Definition: MoleculeImpl.h:22
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:54
AtomEnvironmentComponents
For bitmasks grouping components of immediate atom environments.
Definition: Types.h:103
RankingInformation rankPriority(AtomIndex a, const std::vector< AtomIndex > &excludeAdjacent={}, const boost::optional< AngstromPositions > &positionsOption=boost::none) const
Yield which components were used in canonicalization.
Extras for dealing with periodic boundaries.
bool isValidIndex_(AtomIndex index) const
Returns whether the specified index is valid or not.
void applyPermutation(const std::vector< AtomIndex > &permutation)
Applies an index permutation to all member state.
const StereopermutatorList & stereopermutators() const
Provides read-only access to the list of stereopermutators.
At least two shape vertices eclipse one another along the axis.
Molecule class interface.
Handles specific relative arrangements of two atom stereopermutators joined by a bond.
Definition: BondStereopermutator.h:46
void thermalizeStereopermutator(AtomIndex a, bool thermalization)
Alters thermalization state of an atom stereopermutator.
std::string str() const
Returns a command-line interface information string.
BondIndex addBond(AtomIndex a, AtomIndex b, BondType bondType)
Adds a bond between existing atoms.
Manages all stereopermutators that are part of a Molecule.
Definition: StereopermutatorList.h:30
std::vector< AtomIndex > canonicalize(AtomEnvironmentComponents componentBitmask)
Canonicalizes the graph, invalidating all atom and bond indices.
const Graph & graph() const
Provides read-only access to the graph member.
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
StereopermutatorList inferStereopermutatorsFromPositions(const AngstromPositions &angstromWrapper, const boost::optional< std::vector< BondIndex > > &explicitBondStereopermutatorCandidatesOption=boost::none, boost::optional< const std::unordered_set< AtomIndex > & > uninteresting=boost::none, const boost::optional< SubstitutionsGenerator::SubstitutionMap > &substitutions=boost::none) const
Yield which components were used in canonicalization.
BondType
Discrete bond type numeration.
Definition: Types.h:26
Type used to refer to particular bonds. Orders first < second.
Definition: Types.h:54
boost::optional< Shapes::Shape > inferShape(AtomIndex index, const RankingInformation &ranking) const
Interface class for the molecular graph.
void assignStereopermutatorRandomly(AtomIndex a, Random::Engine &engine)
void propagateGraphChange_()
Updates the molecule's StereopermutatorList after a graph modification.
AtomIndex addAtom(Utils::ElementType elementType, AtomIndex adjacentTo, BondType bondType)
Adds an atom by attaching it to an existing atom.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
boost::optional< std::vector< AtomIndex > > modularIsomorphism(const Impl &other, AtomEnvironmentComponents componentBitmask) const
Modular comparison of this Impl with another.
static bool isGraphBasedBondStereopermutatorCandidate_(BondType bondType)
Returns whether an edge is double, triple or higher bond order.
bool setBondType(AtomIndex a, AtomIndex b, BondType bondType)
Changes an existing bond's type.
const BondStereopermutator & addPermutator(const BondIndex &bond, BondStereopermutator::Alignment alignment)
Add a new BondStereopermutator to the molecule.
void removeBond(AtomIndex a, AtomIndex b)
std::size_t hash() const
Convolutional hash.
Boost Graph Library wrapper to help in concealing underlying type.
void setShapeAtAtom(AtomIndex a, Shapes::Shape shape)
Owning class storing all stereopermutators in a molecule.
Alignment
How dihedrals are aligned in the generation of stereopermutations.
Definition: BondStereopermutator.h:53
void ensureModelInvariants_() const
Ensures basic expectations about what constitutes a Molecule are met.
bool operator!=(const Impl &other) const
Negates.
void removeAtom(AtomIndex a)
bool operator==(const Impl &other) const
Equality operator, performs most strict equality comparison.
bool removePermutator(const BondIndex &bond)
Removes the BondStereopermutator on a specified edge, if present.
void assignStereopermutator(AtomIndex a, const boost::optional< unsigned > &assignment)