MayaFlux 0.5.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 572 of file ProximityGraphs.cpp.

575{
576 switch (config.mode) {
577
578 case ProximityMode::SEQUENTIAL:
579 return sequential_chain(points);
580
581 case ProximityMode::K_NEAREST:
582 return k_nearest_neighbors(points, config.k_neighbors);
583
584 case ProximityMode::RADIUS_THRESHOLD:
585 return radius_threshold_graph(points, config.radius);
586
587 case ProximityMode::MINIMUM_SPANNING_TREE:
589
590 case ProximityMode::GABRIEL_GRAPH:
591 return gabriel_graph(points);
592
593 case ProximityMode::NEAREST_NEIGHBOR:
595
596 case ProximityMode::RELATIVE_NEIGHBORHOOD_GRAPH:
598
599 case ProximityMode::CUSTOM:
601
602 default:
603 return {};
604 }
605}
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: