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

237{
238 Eigen::Index n = points.cols();
239 if (n < 2) {
240 return {};
241 }
242
243 EdgeList edges;
244 edges.reserve(n - 1);
245
246 for (Eigen::Index i = 0; i < n - 1; ++i) {
247 edges.emplace_back(static_cast<size_t>(i), static_cast<size_t>(i + 1));
248 }
249
250 MF_DEBUG(Journal::Component::Kinesis, Journal::Context::Runtime,
251 "sequential_chain: {} points, generated {} edges", n, edges.size());
252
253 return edges;
254}
#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: