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 DistanceGeometry {
28 static constexpr
double defaultLower = 0.0;
29 static constexpr
double defaultUpper = 100.0;
53 static void smooth(Eigen::Ref<Eigen::MatrixXd> matrix);
58 using BoundsMatrix = Eigen::MatrixXd;
77 template<
typename PrivateGraph>
81 ) : matrix_(std::move(bounds)) {
87 if(matrix_(j, i) == 0) {
95 if(matrix_(i, j) == 0.0) {
96 matrix_(i, j) = defaultUpper;
122 return matrix_(i, j);
125 return matrix_(j, i);
134 return matrix_(j, i);
137 return matrix_(i, j);
150 const Eigen::MatrixXd&
access()
const;
178 Eigen::MatrixXd matrix_;
bool setUpperBound(AtomIndex i, AtomIndex j, double newUpperBound)
Smoothes the underlying matrix using smooth(Eigen::Ref<Eigen::MatrixXd>)
Vertex V() const
Number of vertices in the graph.
Definition: DistanceBoundsMatrix.h:26
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:120
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:33
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:41
Library internal graph class wrapping BGL types.
Definition: PrivateGraph.h:26
unsigned boundInconsistencies() const
Checks for cases in which the lower bound is greater than the upper bound.
DistanceBoundsMatrix(const PrivateGraph &inner, BoundsMatrix bounds)
Constructs a bounds matrix from a graph and a bounds matrix.
Definition: DistanceBoundsMatrix.h:78
Result< Eigen::MatrixXd > makeDistanceMatrix(Random::Engine &engine, Partiality partiality=Partiality::All) const noexcept
Generate a distance matrix.
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:132
Partiality
Limit triangle inequality bounds smoothing to a subset of all atoms.
Definition: Conformers.h:42