8 #ifndef INCLUDE_MOLASSEMBLER_DISTANCE_GEOMETRY_DISTANCE_BOUNDS_MATRIX_H
9 #define INCLUDE_MOLASSEMBLER_DISTANCE_GEOMETRY_DISTANCE_BOUNDS_MATRIX_H
18 namespace Molassembler {
24 namespace outcome = OUTCOME_V2_NAMESPACE;
26 namespace DistanceGeometry {
30 static constexpr
double defaultLower = 0.0;
31 static constexpr
double defaultUpper = 100.0;
55 static void smooth(Eigen::Ref<Eigen::MatrixXd> matrix);
60 using BoundsMatrix = Eigen::MatrixXd;
79 template<
typename PrivateGraph>
83 ) : matrix_(std::move(bounds)) {
89 if(matrix_(j, i) == 0) {
97 if(matrix_(i, j) == 0.0) {
98 matrix_(i, j) = defaultUpper;
124 return matrix_(i, j);
127 return matrix_(j, i);
136 return matrix_(j, i);
139 return matrix_(i, j);
152 const Eigen::MatrixXd&
access()
const;
180 Eigen::MatrixXd matrix_;
bool setUpperBound(AtomIndex i, AtomIndex j, double newUpperBound)
Smoothes the underlying matrix using smooth(Eigen::Ref<Eigen::MatrixXd>)
Definition: DistanceBoundsMatrix.h:28
Drives a PRNG.
Definition: Prng.h:24
double vdwRadius(Utils::ElementType elementType)
Accessor function to fetch the vdw radius directly from elementData.
Eigen::MatrixXd makeSquaredBoundsMatrix() const
Squares all bounds and returns a new matrix.
const Eigen::MatrixXd & access() const
Nonmodifiable access to bounds matrix.
double upperBound(AtomIndex i, AtomIndex j) const
Access to upper bound of unordered indices.
Definition: DistanceBoundsMatrix.h:122
Vertex N() const
Number of vertices in the graph.
Element type information classes.
static double & lowerBound(Eigen::Ref< Eigen::MatrixXd > matrix, const AtomIndex i, const AtomIndex j)
Uses Floyd's algorithm to smooth the matrix.
Definition: DistanceBoundsMatrix.h:35
Perform smoothing after all distance choices.
void smooth()
Smoothes the underlying matrix using smooth(Eigen::Ref<Eigen::MatrixXd>)
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
bool setLowerBound(AtomIndex i, AtomIndex j, double newLowerBound)
Smoothes the underlying matrix using smooth(Eigen::Ref<Eigen::MatrixXd>)
unsigned N() const
Yields the number of particles.
static double & upperBound(Eigen::Ref< Eigen::MatrixXd > matrix, const AtomIndex i, const AtomIndex j)
Uses Floyd's algorithm to smooth the matrix.
Definition: DistanceBoundsMatrix.h:43
Library internal graph class wrapping BGL types.
Definition: PrivateGraph.h:24
unsigned boundInconsistencies() const
Checks for cases in which the lower bound is greater than the upper bound.
outcome::result< Eigen::MatrixXd > makeDistanceMatrix(Random::Engine &engine, Partiality partiality=Partiality::All) const noexcept
Generate a distance matrix.
DistanceBoundsMatrix(const PrivateGraph &inner, BoundsMatrix bounds)
Constructs a bounds matrix from a graph and a bounds matrix.
Definition: DistanceBoundsMatrix.h:80
Data struct to store chiral constraints for DG.
Utils::ElementType & elementType(Vertex a)
Fetches the element type of a vertex.
DistanceBoundsMatrix()
Initializes nothing.
double lowerBound(AtomIndex i, AtomIndex j) const
Access to lower bound of unordered indices.
Definition: DistanceBoundsMatrix.h:134
Partiality
Limit triangle inequality bounds smoothing to a subset of all atoms.
Definition: Conformers.h:44