MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ generate_proximity_graph()

MAYAFLUX_API EdgeList MayaFlux::Kinesis::generate_proximity_graph ( const Eigen::MatrixXd &  points,
const ProximityConfig &  config 
)

Generate proximity graph using specified mode.

Parameters
pointsDxN matrix where each column is a point
configConfiguration specifying mode and parameters
Returns
Edge list

Definition at line 570 of file ProximityGraphs.cpp.

573{
574 switch (config.mode) {
575
576 case ProximityMode::SEQUENTIAL:
577 return sequential_chain(points);
578
579 case ProximityMode::K_NEAREST:
580 return k_nearest_neighbors(points, config.k_neighbors);
581
582 case ProximityMode::RADIUS_THRESHOLD:
583 return radius_threshold_graph(points, config.radius);
584
585 case ProximityMode::MINIMUM_SPANNING_TREE:
587
588 case ProximityMode::GABRIEL_GRAPH:
589 return gabriel_graph(points);
590
591 case ProximityMode::NEAREST_NEIGHBOR:
593
594 case ProximityMode::RELATIVE_NEIGHBORHOOD_GRAPH:
596
597 case ProximityMode::CUSTOM:
599
600 default:
601 return {};
602 }
603}
std::vector< glm::vec2 > * points
EdgeList sequential_chain(const Eigen::MatrixXd &points)
Compute sequential chain graph.
EdgeList custom_proximity_graph(const Eigen::MatrixXd &points, const std::function< EdgeList(const Eigen::MatrixXd &)> &connection_function)
Custom proximity graph via user function.
EdgeList relative_neighborhood_graph(const Eigen::MatrixXd &points)
Compute relative neighborhood graph.
EdgeList minimum_spanning_tree(const Eigen::MatrixXd &points)
Compute minimum spanning tree (Prim's algorithm)
EdgeList gabriel_graph(const Eigen::MatrixXd &points)
Compute Gabriel graph.
EdgeList k_nearest_neighbors(const Eigen::MatrixXd &points, size_t k)
Compute K-nearest neighbors graph.
EdgeList radius_threshold_graph(const Eigen::MatrixXd &points, double radius)
Compute radius threshold graph.
EdgeList nearest_neighbor_graph(const Eigen::MatrixXd &points)
Compute nearest neighbor graph.
std::function< EdgeList(const Eigen::MatrixXd &)> custom_function

References CUSTOM, MayaFlux::Kinesis::ProximityConfig::custom_function, custom_proximity_graph(), gabriel_graph(), GABRIEL_GRAPH, K_NEAREST, k_nearest_neighbors(), MayaFlux::Kinesis::ProximityConfig::k_neighbors, minimum_spanning_tree(), MINIMUM_SPANNING_TREE, MayaFlux::Kinesis::ProximityConfig::mode, NEAREST_NEIGHBOR, nearest_neighbor_graph(), points, MayaFlux::Kinesis::ProximityConfig::radius, RADIUS_THRESHOLD, radius_threshold_graph(), relative_neighborhood_graph(), RELATIVE_NEIGHBORHOOD_GRAPH, SEQUENTIAL, and sequential_chain().

Referenced by MayaFlux::Nodes::GpuSync::TopologyGeneratorNode::regenerate_topology().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: