BGL wrapper to help with distance bounds smoothing. More...
#include <ExplicitBoundsGraph.h>
Public Member Functions | |
Special member functions | |
ExplicitBoundsGraph (const PrivateGraph &inner, const DistanceBoundsMatrix &bounds) | |
Construct from distance bounds matrix. More... | |
ExplicitBoundsGraph (const PrivateGraph &inner, const BoundsMatrix &bounds) | |
Construct from bounds matrix. More... | |
Modifiers | |
void | addBound (VertexDescriptor a, VertexDescriptor b, const ValueBounds &bound) |
Adds a bound between outer vertex indices to the graph. More... | |
double | lowerBound (VertexDescriptor a, VertexDescriptor b) const |
Fetches the lower bound between outer vertex indices from the graph. More... | |
double | upperBound (VertexDescriptor a, VertexDescriptor b) const |
Fetches the upper bound between outer vertex indices from the graph. More... | |
Result< Eigen::MatrixXd > | makeDistanceMatrix (Random::Engine &engine) noexcept |
Generate a distance matrix. More... | |
Result< Eigen::MatrixXd > | makeDistanceMatrix (Random::Engine &engine, Partiality partiality) noexcept |
Information | |
double | maximalImplicitLowerBound (VertexDescriptor i) const |
Returns the length of the maximal implicit lower bound outgoing from a left vertex. More... | |
const GraphType & | graph () const |
Nonmodifiable access to underlying graph. More... | |
Result< Eigen::MatrixXd > | makeDistanceBounds () const noexcept |
Make smooth distance bounds. More... | |
Static Public Member Functions | |
Static member functions | |
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. More... | |
static bool | isLeft (const VertexDescriptor i) noexcept |
Check whether a vertex is part of the left subgraph. More... | |
static bool | sameSide (const VertexDescriptor i, const VertexDescriptor j) noexcept |
Explain contradictions between distance bounds on a path. More... | |
static VertexDescriptor | left (const VertexDescriptor a) noexcept |
Get the left subgraph vertex descriptor corresponding to an outer index. More... | |
static VertexDescriptor | right (const VertexDescriptor a) noexcept |
Get the right subgraph vertex descriptor corresponding to an outer index. More... | |
Private Attributes | |
GraphType | graph_ |
const PrivateGraph & | inner_ |
std::array< Utils::ElementType, 2 > | heaviestAtoms_ |
Stores the two heaviest element types. | |
BGL wrapper to help with distance bounds smoothing.
A class that helps with lower complexity determination of distance bounds compatible with the triangle inequality limits via reinterpretation as a graph shortest paths calculation.
The main idea is to transfer all ValueBounds collected by a SpatialModel to this class. The compatible triangle inequality bounds to this set of ValueBounds should then be extracted as a DistanceBoundsMatrix and kept for refinement. For every new conformation, the underlying graph containing the information from the ValueBounds needs to be copied and generateDistanceMatrix called upon it. This procedure modifies the underlying graph and hence cannot be called repeatedly.
The underlying data structure is a fully explicit BGL graph containing all edges and edge weights.
Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::ExplicitBoundsGraph | ( | const PrivateGraph & | inner, |
const DistanceBoundsMatrix & | bounds | ||
) |
Construct from distance bounds matrix.
Complexity \(\Theta(N^2)\)
Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::ExplicitBoundsGraph | ( | const PrivateGraph & | inner, |
const BoundsMatrix & | bounds | ||
) |
Construct from bounds matrix.
Complexity \(\Theta(N^2)\)
void Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::addBound | ( | VertexDescriptor | a, |
VertexDescriptor | b, | ||
const ValueBounds & | bound | ||
) |
Adds a bound between outer vertex indices to the graph.
This is represented by six edges:
Complexity \(\Theta(1)\)
|
static |
Explain contradictions between distance bounds on a path.
Complexity linear in the length of the path between a
and b
const GraphType& Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::graph | ( | ) | const |
Nonmodifiable access to underlying graph.
Complexity \(\Theta(1)\)
|
inlinestaticnoexcept |
Check whether a vertex is part of the left subgraph.
Complexity \(\Theta(1)\)
|
inlinestaticnoexcept |
Get the left subgraph vertex descriptor corresponding to an outer index.
Complexity \(\Theta(1)\)
double Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::lowerBound | ( | VertexDescriptor | a, |
VertexDescriptor | b | ||
) | const |
Fetches the lower bound between outer vertex indices from the graph.
Complexity \(\Theta(1)\)
|
noexcept |
Make smooth distance bounds.
Complexity \(\Theta(V \cdot E)\)
|
noexcept |
Generate a distance matrix.
Generates a distances matrix conforming to the triangle inequality bounds while modifying state information. Can only be called once!
Complexity \(O(V^2 \cdot E)\)
|
noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
double Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::maximalImplicitLowerBound | ( | VertexDescriptor | i | ) | const |
Returns the length of the maximal implicit lower bound outgoing from a left vertex.
Complexity \(\Theta(1)\)
|
inlinestaticnoexcept |
Get the right subgraph vertex descriptor corresponding to an outer index.
Complexity \(\Theta(1)\)
|
inlinestaticnoexcept |
Explain contradictions between distance bounds on a path.
Complexity linear in the length of the path between a
and b
double Scine::Molassembler::DistanceGeometry::ExplicitBoundsGraph::upperBound | ( | VertexDescriptor | a, |
VertexDescriptor | b | ||
) | const |
Fetches the upper bound between outer vertex indices from the graph.
Complexity \(\Theta(1)\)