120#ifndef TTK_ENABLE_KAMIKAZE
125 SimplexId const vertexNumber = triangulation->getNumberOfVertices();
131#ifdef TTK_ENABLE_OPENMP
132#pragma omp parallel for num_threads(threadNumber_)
134 for(
SimplexId i = 0; i < vertexNumber; i++) {
141 SimplexId const edgeNumber = triangulation->getNumberOfEdges();
144#ifdef TTK_ENABLE_OPENMP
145#pragma omp parallel for num_threads(threadNumber_)
147 for(
SimplexId i = 0; i < edgeNumber; i++) {
153 && (triangulation->getDimensionality() == 3)) {
155 SimplexId const triangleNumber = triangulation->getNumberOfTriangles();
158#ifdef TTK_ENABLE_OPENMP
159#pragma omp parallel for num_threads(threadNumber_)
161 for(
SimplexId i = 0; i < triangleNumber; i++) {
162 (*triangleLinkComponentNumber_)[i]
163 = triangulation->getTriangleLinkNumber(i);
167 printMsg(
"Processed " + std::to_string(vertexNumber) +
" vertices", 1,
177 const triangulationType *triangulation,
const SimplexId &vertexId)
const {
179 SimplexId const linkSize = triangulation->getVertexLinkNumber(vertexId);
181 if(triangulation->getDimensionality() == 1)
184 std::vector<SimplexId> linkNeighbors;
186 for(
SimplexId i = 0; i < linkSize; i++) {
188 triangulation->getVertexLink(vertexId, i, linkId);
193 if(triangulation->getDimensionality() == 2) {
194 triangulation->getEdgeVertex(linkId, 0, neighborId);
197 if(linkNeighbors[j] == neighborId) {
203 linkNeighbors.push_back(neighborId);
205 triangulation->getEdgeVertex(linkId, 1, neighborId);
208 if(linkNeighbors[j] == neighborId) {
214 linkNeighbors.push_back(neighborId);
216 if(triangulation->getDimensionality() == 3) {
217 triangulation->getTriangleVertex(linkId, 0, neighborId);
220 if(linkNeighbors[j] == neighborId) {
226 linkNeighbors.push_back(neighborId);
228 triangulation->getTriangleVertex(linkId, 1, neighborId);
231 if(linkNeighbors[j] == neighborId) {
237 linkNeighbors.push_back(neighborId);
239 triangulation->getTriangleVertex(linkId, 2, neighborId);
242 if(linkNeighbors[j] == neighborId) {
248 linkNeighbors.push_back(neighborId);
252 std::vector<UnionFind> seeds(linkNeighbors.size());
253 std::vector<UnionFind *> seedList(linkNeighbors.size());
256 seedList[i] = &(seeds[i]);
259 for(
SimplexId i = 0; i < linkSize; i++) {
262 triangulation->getVertexLink(vertexId, i, linkId);
264 SimplexId neighborId0 = -1, neighborId1 = -1, neighborId2 = -1;
267 if(triangulation->getDimensionality() == 2) {
268 triangulation->getEdgeVertex(linkId, 0, neighborId0);
269 triangulation->getEdgeVertex(linkId, 1, neighborId1);
273 if(linkNeighbors[j] == neighborId0) {
279 if(linkNeighbors[j] == neighborId1) {
286 seedList[uf1] = seedList[uf0];
289 if(triangulation->getDimensionality() == 3) {
290 triangulation->getTriangleVertex(linkId, 0, neighborId0);
291 triangulation->getTriangleVertex(linkId, 1, neighborId1);
292 triangulation->getTriangleVertex(linkId, 2, neighborId2);
296 if(linkNeighbors[j] == neighborId0) {
302 if(linkNeighbors[j] == neighborId1) {
308 if(linkNeighbors[j] == neighborId2) {
316 seedList[uf1] = seedList[uf0];
317 seedList[uf2] = seedList[uf0];
325 seedList[i] = seedList[i]->find();
328 std::vector<UnionFind *>::iterator it;
329 sort(seedList.begin(), seedList.end());
330 it = unique(seedList.begin(), seedList.end());
331 seedList.resize(distance(seedList.begin(), it));
338 const triangulationType *triangulation,
const SimplexId &edgeId)
const {
340 SimplexId const linkSize = triangulation->getEdgeLinkNumber(edgeId);
342 if(triangulation->getDimensionality() == 2)
345 std::vector<SimplexId> linkNeighbors;
347 for(
SimplexId i = 0; i < linkSize; i++) {
349 triangulation->getEdgeLink(edgeId, i, linkId);
354 triangulation->getEdgeVertex(linkId, 0, neighborId);
357 if(linkNeighbors[j] == neighborId) {
363 linkNeighbors.push_back(neighborId);
365 triangulation->getEdgeVertex(linkId, 1, neighborId);
368 if(linkNeighbors[j] == neighborId) {
374 linkNeighbors.push_back(neighborId);
377 std::vector<UnionFind> seeds(linkNeighbors.size());
378 std::vector<UnionFind *> seedList(linkNeighbors.size());
381 seedList[i] = &(seeds[i]);
384 for(
SimplexId i = 0; i < linkSize; i++) {
387 triangulation->getEdgeLink(edgeId, i, linkId);
389 SimplexId neighborId0 = -1, neighborId1 = -1;
392 triangulation->getEdgeVertex(linkId, 0, neighborId0);
393 triangulation->getEdgeVertex(linkId, 1, neighborId1);
397 if(linkNeighbors[j] == neighborId0) {
403 if(linkNeighbors[j] == neighborId1) {
410 seedList[uf1] = seedList[uf0];
417 seedList[i] = seedList[i]->find();
420 std::vector<UnionFind *>::iterator it;
421 sort(seedList.begin(), seedList.end());
422 it = unique(seedList.begin(), seedList.end());
423 seedList.resize(distance(seedList.begin(), it));