MCPcopy Create free account
hub / github.com/cutdigital/mcut / dfs_cc

Function dfs_cc

source/kernel.cpp:226–235  ·  view source on GitHub ↗

dfs(node u) for each node v connected to u : if v is not visited : visited[v] = true dfs(v) */

Source from the content-addressed store, hash-verified

224 dfs(v)
225*/
226void dfs_cc(vd_t u, const hmesh_t& mesh, std::vector<int>& visited, int connected_component_id)
227{
228 std::vector<vd_t> verts = mesh.get_vertices_around_vertex(u);
229 for (std::vector<vd_t>::const_iterator v = verts.cbegin(); v != verts.cend(); ++v) {
230 if (SAFE_ACCESS(visited, *v) == -1) {
231 visited[*v] = connected_component_id;
232 dfs_cc(*v, mesh, visited, connected_component_id);
233 }
234 }
235}
236
237int find_connected_components(
238#if defined(MCUT_WITH_COMPUTE_HELPER_THREADPOOL)

Callers

nothing calls this directly

Calls 3

cbeginMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected