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

◆ sequential_chain()

EdgeList MayaFlux::Kinesis::sequential_chain ( const Eigen::MatrixXd &  points)

Compute sequential chain graph.

Parameters
pointsDx N matrix where each column is a point
Returns
Edge list (point index pairs)

Connects points in order: (0,1), (1,2), ..., (n-2, n-1). Undirected graph: each edge appears once.

Complexity: O(n)

Definition at line 26 of file ProximityGraphs.cpp.

27{
28 Eigen::Index n = points.cols();
29 if (n < 2) {
30 return {};
31 }
32
33 EdgeList edges;
34 edges.reserve(n - 1);
35
36 for (Eigen::Index i = 0; i < n - 1; ++i) {
37 edges.emplace_back(static_cast<size_t>(i), static_cast<size_t>(i + 1));
38 }
39
40 MF_DEBUG(Journal::Component::Kinesis, Journal::Context::Runtime,
41 "sequential_chain: {} points, generated {} edges", n, edges.size());
42
43 return edges;
44}
#define MF_DEBUG(comp, ctx,...)

References MayaFlux::Journal::Kinesis, MF_DEBUG, and MayaFlux::Journal::Runtime.

Referenced by generate_proximity_graph().

+ Here is the caller graph for this function: