12 #ifndef INCLUDE_MOLASSEMBLER_DG_EXPLICIT_BOUNDS_GRAPH_H
13 #define INCLUDE_MOLASSEMBLER_DG_EXPLICIT_BOUNDS_GRAPH_H
17 #include "boost/graph/adjacency_list.hpp"
25 namespace Molassembler {
34 namespace DistanceGeometry {
37 class DistanceBoundsMatrix;
61 using EdgeWeightProperty = boost::property<boost::edge_weight_t, double>;
62 using GraphType = boost::adjacency_list<
69 using VertexDescriptor = GraphType::vertex_descriptor;
70 using EdgeDescriptor = GraphType::edge_descriptor;
72 using BoundsMatrix = Eigen::MatrixXd;
92 const BoundsMatrix& bounds
105 const std::vector<VertexDescriptor>& predecessors,
106 const std::vector<double>& distances
113 [[gnu::const]]
static inline bool isLeft(
const VertexDescriptor i) noexcept {
117 [[gnu::const]]
static inline bool sameSide(
const VertexDescriptor i,
const VertexDescriptor j) noexcept {
118 return i % 2 == j % 2;
125 [[gnu::const]]
static inline VertexDescriptor
left(
const VertexDescriptor a) noexcept {
133 [[gnu::const]]
static inline VertexDescriptor
right(
const VertexDescriptor a) noexcept {
162 double lowerBound(VertexDescriptor a, VertexDescriptor b)
const;
168 double upperBound(VertexDescriptor a, VertexDescriptor b)
const;
210 void updateOrAddEdge_(
216 void updateGraphWithFixedDistance_(
Data struct for storing a numeric interval.
Definition: DistanceBoundsMatrix.h:26
BGL wrapper to help with distance bounds smoothing.
Definition: ExplicitBoundsGraph.h:57
Result< Eigen::MatrixXd > makeDistanceMatrix(Random::Engine &engine, Partiality partiality) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
ExplicitBoundsGraph(const PrivateGraph &inner, const BoundsMatrix &bounds)
Construct from bounds matrix.
void addBound(VertexDescriptor a, VertexDescriptor b, const ValueBounds &bound)
Adds a bound between outer vertex indices to the graph.
static void explainContradictionPaths(VertexDescriptor a, VertexDescriptor b, const std::vector< VertexDescriptor > &predecessors, const std::vector< double > &distances)
Explain contradictions between distance bounds on a path.
double upperBound(VertexDescriptor a, VertexDescriptor b) const
Fetches the upper bound between outer vertex indices from the graph.
Result< Eigen::MatrixXd > makeDistanceMatrix(Random::Engine &engine) noexcept
Generate a distance matrix.
double lowerBound(VertexDescriptor a, VertexDescriptor b) const
Fetches the lower bound between outer vertex indices from the graph.
ExplicitBoundsGraph(const PrivateGraph &inner, const DistanceBoundsMatrix &bounds)
Construct from distance bounds matrix.
Result< Eigen::MatrixXd > makeDistanceBounds() const noexcept
Make smooth distance bounds.
static VertexDescriptor left(const VertexDescriptor a) noexcept
Get the left subgraph vertex descriptor corresponding to an outer index.
Definition: ExplicitBoundsGraph.h:125
double maximalImplicitLowerBound(VertexDescriptor i) const
Returns the length of the maximal implicit lower bound outgoing from a left vertex.
const GraphType & graph() const
Nonmodifiable access to underlying graph.
std::array< Utils::ElementType, 2 > heaviestAtoms_
Stores the two heaviest element types.
Definition: ExplicitBoundsGraph.h:208
static bool isLeft(const VertexDescriptor i) noexcept
Check whether a vertex is part of the left subgraph.
Definition: ExplicitBoundsGraph.h:113
static VertexDescriptor right(const VertexDescriptor a) noexcept
Get the right subgraph vertex descriptor corresponding to an outer index.
Definition: ExplicitBoundsGraph.h:133
static bool sameSide(const VertexDescriptor i, const VertexDescriptor j) noexcept
Explain contradictions between distance bounds on a path.
Definition: ExplicitBoundsGraph.h:117
Library internal graph class wrapping BGL types.
Definition: PrivateGraph.h:26
Drives a PRNG.
Definition: Prng.h:24
Partiality
Limit triangle inequality bounds smoothing to a subset of all atoms.
Definition: Conformers.h:42
Data class for bounded values.
Definition: ValueBounds.h:23