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

◆ sequential_chain()

MAYAFLUX_API 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 234 of file ProximityGraphs.cpp.

235{
236 Eigen::Index n = points.cols();
237 if (n < 2) {
238 return {};
239 }
240
241 EdgeList edges;
242 edges.reserve(n - 1);
243
244 for (Eigen::Index i = 0; i < n - 1; ++i) {
245 edges.emplace_back(static_cast<size_t>(i), static_cast<size_t>(i + 1));
246 }
247
248 MF_DEBUG(Journal::Component::Kinesis, Journal::Context::Runtime,
249 "sequential_chain: {} points, generated {} edges", n, edges.size());
250
251 return edges;
252}
#define MF_DEBUG(comp, ctx,...)
std::vector< glm::vec2 > * points

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

Referenced by generate_proximity_graph().

+ Here is the caller graph for this function: