11 bool alreadyConnected =
false;
12 for(
size_t i = 0; i < data.sheet3List_[sheet3Id].sheet0List_.size(); i++) {
13 if(data.sheet3List_[sheet3Id].sheet0List_[i] == sheet0Id) {
15 alreadyConnected =
true;
20 data.sheet3List_[sheet3Id].sheet0List_.push_back(sheet0Id);
22 for(
size_t i = 0; i < data.sheet0List_[sheet0Id].sheet3List_.size(); i++) {
23 if(data.sheet0List_[sheet0Id].sheet3List_[i] == sheet3Id)
27 data.sheet0List_[sheet0Id].sheet3List_.push_back(sheet3Id);
36 bool alreadyConnected =
false;
37 for(
size_t i = 0; i < data.sheet3List_[sheet3Id].sheet1List_.size(); i++) {
38 if(data.sheet3List_[sheet3Id].sheet1List_[i] == sheet1Id) {
40 alreadyConnected =
true;
45 data.sheet3List_[sheet3Id].sheet1List_.push_back(sheet1Id);
47 for(
size_t i = 0; i < data.sheet1List_[sheet1Id].sheet3List_.size(); i++) {
48 if(data.sheet1List_[sheet1Id].sheet3List_[i] == sheet3Id)
52 data.sheet1List_[sheet1Id].sheet3List_.push_back(sheet3Id);
61 bool alreadyConnected =
false;
62 for(
size_t i = 0; i < data.sheet3List_[sheet3Id].sheet2List_.size(); i++) {
63 if(data.sheet3List_[sheet3Id].sheet2List_[i] == sheet2Id) {
65 alreadyConnected =
true;
70 data.sheet3List_[sheet3Id].sheet2List_.push_back(sheet2Id);
72 for(
size_t i = 0; i < data.sheet2List_[sheet2Id].sheet3List_.size(); i++) {
73 if(data.sheet2List_[sheet2Id].sheet3List_[i] == sheet3Id)
77 data.sheet2List_[sheet2Id].sheet3List_.push_back(sheet3Id);
86 if(sheet3Id == otherSheet3Id)
89 bool alreadyConnected =
false;
90 for(
size_t i = 0; i < data.sheet3List_[sheet3Id].sheet3List_.size(); i++) {
91 if(data.sheet3List_[sheet3Id].sheet3List_[i] == otherSheet3Id) {
93 alreadyConnected =
true;
98 data.sheet3List_[sheet3Id].sheet3List_.push_back(otherSheet3Id);
100 for(
size_t i = 0; i < data.sheet3List_[otherSheet3Id].sheet3List_.size();
102 if(data.sheet3List_[otherSheet3Id].sheet3List_[i] == sheet3Id)
106 data.sheet3List_[otherSheet3Id].sheet3List_.push_back(sheet3Id);
116 std::vector<SimplexId> newList;
118 newList.reserve(data.sheet0List_[sheet0Id].sheet1List_.size());
120 for(
size_t i = 0; i < data.sheet0List_[sheet0Id].sheet1List_.size(); i++) {
122 if(data.sheet0List_[sheet0Id].sheet1List_[i] != sheet1Id) {
123 newList.push_back(data.sheet0List_[sheet0Id].sheet1List_[i]);
127 if(data.sheet0List_[sheet0Id].sheet1List_.empty()) {
128 data.sheet0List_[sheet0Id].pruned_ =
true;
129 data.vertex2sheet3_[data.sheet0List_[sheet0Id].vertexId_] = biggerId;
139 std::vector<SimplexId> newList;
141 newList.reserve(data.sheet0List_[sheet0Id].sheet3List_.size());
142 for(
size_t i = 0; i < data.sheet0List_[sheet0Id].sheet3List_.size(); i++) {
143 if(data.sheet0List_[sheet0Id].sheet3List_[i] != sheet3Id)
144 newList.push_back(data.sheet0List_[sheet0Id].sheet3List_[i]);
147 data.sheet0List_[sheet0Id].sheet3List_ = newList;
156 std::vector<SimplexId> newList;
158 newList.reserve(data.sheet2List_[sheet2Id].sheet3List_.size());
159 for(
size_t i = 0; i < data.sheet2List_[sheet2Id].sheet3List_.size(); i++) {
160 if(data.sheet2List_[sheet2Id].sheet3List_[i] != sheet3Id)
161 newList.push_back(data.sheet2List_[sheet2Id].sheet3List_[i]);
164 data.sheet2List_[sheet2Id].sheet3List_ = newList;
173 std::vector<SimplexId> newList;
175 newList.reserve(data.sheet3List_[other3SheetId].sheet3List_.size());
176 for(
size_t i = 0; i < data.sheet3List_[other3SheetId].sheet3List_.size();
178 if(data.sheet3List_[other3SheetId].sheet3List_[i] != sheet3Id)
179 newList.push_back(data.sheet3List_[other3SheetId].sheet3List_[i]);
182 data.sheet3List_[other3SheetId].sheet3List_ = newList;
191 for(
size_t i = 0; i < originalData_.sheet3List_[sheetId0].vertexList_.size();
194 = originalData_.sheet3List_[sheetId0].vertexList_[i];
195 originalData_.sheet3List_[sheetId1].vertexList_.push_back(vertexId);
196 originalData_.vertex2sheet3_[vertexId] = sheetId1;
198 for(
size_t i = 0; i < originalData_.sheet3List_[sheetId0].tetList_.size();
200 SimplexId const tetId = originalData_.sheet3List_[sheetId0].tetList_[i];
201 originalData_.sheet3List_[sheetId1].tetList_.push_back(tetId);
202 originalData_.tet2sheet3_[tetId] = sheetId1;
206 originalData_.sheet3List_[sheetId1].domainVolume_
207 += originalData_.sheet3List_[sheetId0].domainVolume_;
208 originalData_.sheet3List_[sheetId1].rangeArea_
209 += originalData_.sheet3List_[sheetId0].rangeArea_;
210 originalData_.sheet3List_[sheetId1].hyperVolume_
211 += originalData_.sheet3List_[sheetId0].hyperVolume_;
213 originalData_.sheet3List_[sheetId0].pruned_ =
true;
214 originalData_.sheet3List_[sheetId0].preMerger_ = sheetId1;
215 originalData_.sheet3List_[sheetId1].preMergedSheets_.push_back(sheetId0);
228 currentData_.tet2sheet3_ = originalData_.tet2sheet3_;
229 currentData_.vertex2sheet0_ = originalData_.vertex2sheet0_;
230 currentData_.vertex2sheet3_ = originalData_.vertex2sheet3_;
231 currentData_.edge2sheet1_ = originalData_.edge2sheet1_;
232 currentData_.edgeTypes_ = originalData_.edgeTypes_;
234 currentData_.sheet0List_ = originalData_.sheet0List_;
235 currentData_.sheet1List_ = originalData_.sheet1List_;
236 currentData_.sheet3List_ = originalData_.sheet3List_;
238 currentData_.sheet2List_.resize(originalData_.sheet2List_.size());
240#ifdef TTK_ENABLE_OPENMP
241#pragma omp parallel for num_threads(threadNumber_)
243 for(
size_t i = 0; i < currentData_.sheet2List_.size(); i++) {
244 currentData_.sheet2List_[i].sheet1Id_
245 = originalData_.sheet2List_[i].sheet1Id_;
246 currentData_.sheet2List_[i].sheet3List_
247 = originalData_.sheet2List_[i].sheet3List_;
250 for(
size_t i = 0; i < currentData_.sheet3List_.size(); i++) {
251 currentData_.sheet3List_[i].simplificationId_
252 = currentData_.sheet3List_[i].Id_;
255 for(
size_t i = 0; i < currentData_.sheet1List_.size(); i++) {
256 if((currentData_.sheet1List_[i].hasSaddleEdges_)
257 && (currentData_.sheet1List_[i].sheet3List_.size() == 1)) {
259 currentData_.sheet1List_[i].pruned_ =
true;
260 currentData_.sheet2List_[i].pruned_ =
true;
262 for(
size_t j = 0; j < currentData_.sheet1List_[i].sheet0List_.size();
264 SimplexId const sheet0Id = currentData_.sheet1List_[i].sheet0List_[j];
265 currentData_.sheet0List_[sheet0Id].pruned_ =
true;
271 this->threadNumber_);
281 std::stringstream msg;
283 msg <<
"Connectivity..." << std::endl;
285 msg << data.sheet0List_.size() <<
" 0-sheets:" << std::endl;
286 for(
size_t i = 0; i < data.sheet0List_.size(); i++) {
287 msg <<
"3-sheets for 0-sheet #" << i
288 <<
" [p=" << data.sheet0List_[i].pruned_ <<
"]"
290 for(
size_t j = 0; j < data.sheet0List_[i].sheet3List_.size(); j++) {
291 msg <<
"#" << data.sheet0List_[i].sheet3List_[j] <<
", ";
296 msg << data.sheet1List_.size() <<
" 1-sheets:" << std::endl;
297 for(
size_t i = 0; i < data.sheet1List_.size(); i++) {
298 msg <<
"3-sheets for 1-sheet #" << i
299 <<
" [p=" << data.sheet1List_[i].pruned_ <<
"]"
301 for(
size_t j = 0; j < data.sheet1List_[i].sheet3List_.size(); j++) {
302 msg <<
"#" << data.sheet1List_[i].sheet3List_[j] <<
", ";
307 msg << data.sheet2List_.size() <<
" 2-sheets:" << std::endl;
308 for(
size_t i = 0; i < data.sheet2List_.size(); i++) {
309 msg <<
"3-sheets for 2-sheet #" << i
310 <<
" [p=" << data.sheet2List_[i].pruned_ <<
"]"
312 for(
size_t j = 0; j < data.sheet2List_[i].sheet3List_.size(); j++) {
313 msg <<
"#" << data.sheet2List_[i].sheet3List_[j] <<
", ";
318 msg << data.sheet3List_.size() <<
" 3-sheets:" << std::endl;
319 for(
size_t i = 0; i < data.sheet3List_.size(); i++) {
320 msg <<
"3-sheets for 3-sheet #" << i
321 <<
" [p=" << data.sheet3List_[i].pruned_ <<
"]"
323 for(
size_t j = 0; j < data.sheet3List_[i].sheet3List_.size(); j++) {
324 msg <<
"#" << data.sheet3List_[i].sheet3List_[j] <<
", ";
329 std::string one_line{};
330 while(std::getline(msg, one_line)) {
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)