8 #ifndef INCLUDE_MOLASSEMBLER_MOLECULE_IMPL_H
9 #define INCLUDE_MOLASSEMBLER_MOLECULE_IMPL_H
19 namespace Molassembler {
23 const std::vector<AtomIndex>& canonicalizationIndexMap,
29 boost::optional<AtomEnvironmentComponents> canonicalComponentsOption_;
32 void tryAddAtomStereopermutator_(
37 void tryAddBondStereopermutator_(
80 const boost::optional<
81 std::vector<BondIndex>
82 >& bondStereopermutatorCandidatesOptional = boost::none
89 boost::optional<AtomEnvironmentComponents> canonicalComponentsOption
97 Utils::ElementType elementType,
127 const boost::optional<unsigned>& assignment
145 const boost::optional<unsigned>& assignment
241 Utils::ElementType elementType
287 std::size_t
hash()
const;
294 const boost::optional<
295 std::vector<BondIndex>
296 >& explicitBondStereopermutatorCandidatesOption = boost::none
312 std::string
str()
const;
316 const std::vector<AtomIndex>& excludeAdjacent = {},
317 const boost::optional<AngstromPositions>& positionsOption = boost::none
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:21
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:57
AtomEnvironmentComponents
For bitmasks grouping components of immediate atom environments.
Definition: Types.h:103
StereopermutatorList inferStereopermutatorsFromPositions(const AngstromPositions &angstromWrapper, const boost::optional< std::vector< BondIndex > > &explicitBondStereopermutatorCandidatesOption=boost::none) const
Yield which components were used in canonicalization.
bool isGraphBasedBondStereopermutatorCandidate_(BondType bondType) const
Returns whether an edge is double, triple or higher bond order.
RankingInformation rankPriority(AtomIndex a, const std::vector< AtomIndex > &excludeAdjacent={}, const boost::optional< AngstromPositions > &positionsOption=boost::none) const
Yield which components were used in canonicalization.
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.
Molecule class interface.
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
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.
bool setBondType(AtomIndex a, AtomIndex b, BondType bondType)
Changes an existing bond's type.
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.
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.
void assignStereopermutator(AtomIndex a, const boost::optional< unsigned > &assignment)