Changes in src/molecule_graph.cpp [a67d19:e5ad5c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_graph.cpp
ra67d19 re5ad5c 17 17 #include "memoryallocator.hpp" 18 18 #include "molecule.hpp" 19 #include "World.hpp"20 19 21 20 struct BFSAccounting … … 59 58 60 59 if (!input) { 61 DoLog(1) && (Log() << Verbose(1) << "Opening silica failed \n");60 Log() << Verbose(1) << "Opening silica failed \n"; 62 61 }; 63 62 64 63 *input >> ws >> atom1; 65 64 *input >> ws >> atom2; 66 DoLog(1) && (Log() << Verbose(1) << "Scanning file\n");65 Log() << Verbose(1) << "Scanning file\n"; 67 66 while (!input->eof()) // Check whether we read everything already 68 67 { … … 107 106 LinkedCell *LC = NULL; 108 107 bool free_BG = false; 109 double * const cell_size = World::get()->cell_size;110 108 111 109 if (BG == NULL) { … … 115 113 116 114 BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem); 117 DoLog(0) && (Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl);115 Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl; 118 116 // remove every bond from the list 119 117 bond *Binder = NULL; … … 128 126 // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering) 129 127 CountAtoms(); 130 DoLog(1) && (Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl);128 Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl; 131 129 132 130 if ((AtomCount > 1) && (bonddistance > 1.)) { 133 DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl);131 Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl; 134 132 LC = new LinkedCell(this, bonddistance); 135 133 136 134 // create a list to map Tesselpoint::nr to atom * 137 DoLog(2) && (Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl);135 Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl; 138 136 AtomMap = Calloc<atom *> (AtomCount, "molecule::CreateAdjacencyList - **AtomCount"); 139 137 Walker = start; … … 144 142 145 143 // 3a. go through every cell 146 DoLog(2) && (Log() << Verbose(2) << "Celling ... " << endl);144 Log() << Verbose(2) << "Celling ... " << endl; 147 145 for (LC->n[0] = 0; LC->n[0] < LC->N[0]; LC->n[0]++) 148 146 for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++) 149 147 for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) { 150 const Linked Cell::LinkedNodes *List = LC->GetCurrentCell();151 //Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;148 const LinkedNodes *List = LC->GetCurrentCell(); 149 // Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl; 152 150 if (List != NULL) { 153 for (Linked Cell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {151 for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 154 152 Walker = AtomMap[(*Runner)->nr]; 155 //Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl;153 // Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl; 156 154 // 3c. check for possible bond between each atom in this and every one in the 27 cells 157 155 for (n[0] = -1; n[0] <= 1; n[0]++) 158 156 for (n[1] = -1; n[1] <= 1; n[1]++) 159 157 for (n[2] = -1; n[2] <= 1; n[2]++) { 160 const Linked Cell::LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);161 //Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;158 const LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n); 159 // Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl; 162 160 if (OtherList != NULL) { 163 for (Linked Cell::LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {161 for (LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) { 164 162 if ((*OtherRunner)->nr > Walker->nr) { 165 163 OtherWalker = AtomMap[(*OtherRunner)->nr]; 166 //Log() << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl; 164 // Log() << Verbose(0) << "Current other Atom is " << *OtherWalker << "." << endl; 165 const double distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size); 166 // Log() << Verbose(1) << "Checking distance " << distance << " against typical bond length of " << bonddistance*bonddistance << "." << endl; 167 167 (BG->*minmaxdistance)(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 168 const double distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size);169 168 const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance); 170 if ((OtherWalker->father->nr > Walker->father->nr) && (status)) { // create bond if distance is smaller 171 //Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl; 172 AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount 169 // Log() << Verbose(1) << "MinDistance is " << MinDistance << " and MaxDistance is " << MaxDistance << "." << endl; 170 if (OtherWalker->father->nr > Walker->father->nr) { 171 if (status) { // create bond if distance is smaller 172 // Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl; 173 AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount 174 } else { 175 // Log() << Verbose(1) << "Not Adding: distance too great." << endl; 176 } 173 177 } else { 174 //Log() << Verbose(1) << "Not Adding: Wrong label order or distance too great." << endl;178 // Log() << Verbose(1) << "Not Adding: Wrong order of labels." << endl; 175 179 } 176 180 } … … 183 187 Free(&AtomMap); 184 188 delete (LC); 185 DoLog(1) && (Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl);189 Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl; 186 190 187 191 // correct bond degree by comparing valence and bond degree 188 DoLog(2) && (Log() << Verbose(2) << "Correcting bond degree ... " << endl);192 Log() << Verbose(2) << "Correcting bond degree ... " << endl; 189 193 CorrectBondDegree(); 190 194 … … 192 196 ActOnAllAtoms( &atom::OutputBondOfAtom ); 193 197 } else 194 DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl);195 DoLog(0) && (Log() << Verbose(0) << "End of CreateAdjacencyList." << endl);198 Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl; 199 Log() << Verbose(0) << "End of CreateAdjacencyList." << endl; 196 200 if (free_BG) 197 201 delete(BG); … … 204 208 void molecule::OutputBondsList() const 205 209 { 206 DoLog(1) && (Log() << Verbose(1) << endl << "From contents of bond chain list:");210 Log() << Verbose(1) << endl << "From contents of bond chain list:"; 207 211 bond *Binder = first; 208 212 while (Binder->next != last) { 209 213 Binder = Binder->next; 210 DoLog(0) && (Log() << Verbose(0) << *Binder << "\t" << endl);211 } 212 DoLog(0) && (Log() << Verbose(0) << endl);214 Log() << Verbose(0) << *Binder << "\t" << endl; 215 } 216 Log() << Verbose(0) << endl; 213 217 } 214 218 ; … … 227 231 228 232 if (BondCount != 0) { 229 DoLog(1) && (Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl);233 Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl; 230 234 do { 231 235 OldNo = No; 232 236 No = SumPerAtom( &atom::CorrectBondDegree ); 233 237 } while (OldNo != No); 234 DoLog(0) && (Log() << Verbose(0) << " done." << endl);238 Log() << Verbose(0) << " done." << endl; 235 239 } else { 236 DoLog(1) && (Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl);237 } 238 DoLog(0) && (Log() << Verbose(0) << No << " bonds could not be corrected." << endl);240 Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl; 241 } 242 Log() << Verbose(0) << No << " bonds could not be corrected." << endl; 239 243 240 244 return (No); … … 255 259 bond *Binder = first; 256 260 if ((Binder->next != last) && (Binder->next->Type == Undetermined)) { 257 DoLog(0) && (Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl);261 Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl; 258 262 Subgraphs = DepthFirstSearchAnalysis(BackEdgeStack); 259 263 while (Subgraphs->next != NULL) { … … 310 314 Walker->GraphNr = DFS.CurrentGraphNr; 311 315 Walker->LowpointNr = DFS.CurrentGraphNr; 312 DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);316 Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl; 313 317 DFS.AtomStack->Push(Walker); 314 318 DFS.CurrentGraphNr++; … … 337 341 if (Binder == NULL) 338 342 break; 339 DoLog(2) && (Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl);343 Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl; 340 344 // (4) Mark Binder used, ... 341 345 Binder->MarkUsed(black); 342 346 OtherAtom = Binder->GetOtherAtom(Walker); 343 DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl);347 Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl; 344 348 if (OtherAtom->GraphNr != -1) { 345 349 // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3) … … 347 351 DFS.BackEdgeStack->Push(Binder); 348 352 Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr; 349 DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl);353 Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl; 350 354 } else { 351 355 // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2) … … 353 357 OtherAtom->Ancestor = Walker; 354 358 Walker = OtherAtom; 355 DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl);359 Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl; 356 360 break; 357 361 } … … 375 379 376 380 // (5) if Ancestor of Walker is ... 377 DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl);381 Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl; 378 382 379 383 if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) { … … 382 386 // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8) 383 387 Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr; 384 DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);388 Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl; 385 389 } else { 386 390 // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component 387 391 Walker->Ancestor->SeparationVertex = true; 388 DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl);392 Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl; 389 393 mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber); 390 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);394 Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl; 391 395 mol->SetNextComponentNumber(Walker, DFS.ComponentNumber); 392 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);396 Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl; 393 397 do { 394 398 OtherAtom = DFS.AtomStack->PopLast(); 395 399 LeafWalker->Leaf->AddCopyAtom(OtherAtom); 396 400 mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber); 397 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);401 Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl; 398 402 } while (OtherAtom != Walker); 399 403 DFS.ComponentNumber++; 400 404 } 401 405 // (8) Walker becomes its Ancestor, go to (3) 402 DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl);406 Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl; 403 407 Walker = Walker->Ancestor; 404 408 DFS.BackStepping = true; … … 424 428 //DFS.AtomStack->Output(out); 425 429 mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber); 426 DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);430 Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl; 427 431 mol->SetNextComponentNumber(Walker, DFS.ComponentNumber); 428 DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);432 Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl; 429 433 do { 430 434 OtherAtom = DFS.AtomStack->PopLast(); 431 435 LeafWalker->Leaf->AddCopyAtom(OtherAtom); 432 436 mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber); 433 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);437 Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl; 434 438 } while (OtherAtom != Walker); 435 439 DFS.ComponentNumber++; … … 438 442 Walker = DFS.Root; 439 443 Binder = mol->FindNextUnused(Walker); 440 DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl);444 Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl; 441 445 if (Binder != NULL) { // Root is separation vertex 442 DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl);446 Log() << Verbose(1) << "(11) Root is a separation vertex." << endl; 443 447 Walker->SeparationVertex = true; 444 448 } … … 495 499 bond *Binder = NULL; 496 500 497 if (AtomCount == 0) 498 return SubGraphs; 499 DoLog(0) && (Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl); 501 Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl; 500 502 DepthFirstSearchAnalysis_Init(DFS, this); 501 503 … … 519 521 520 522 if (Binder == NULL) { 521 DoLog(2) && (Log() << Verbose(2) << "No more Unused Bonds." << endl);523 Log() << Verbose(2) << "No more Unused Bonds." << endl; 522 524 break; 523 525 } else … … 536 538 537 539 // From OldGraphNr to CurrentGraphNr ranges an disconnected subgraph 538 DoLog(0) && (Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl);540 Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl; 539 541 LeafWalker->Leaf->Output((ofstream *)&cout); 540 DoLog(0) && (Log() << Verbose(0) << endl);542 Log() << Verbose(0) << endl; 541 543 542 544 // step on to next root … … 556 558 // free all and exit 557 559 DepthFirstSearchAnalysis_Finalize(DFS); 558 DoLog(0) && (Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl);560 Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl; 559 561 return SubGraphs; 560 562 } … … 582 584 void molecule::OutputGraphInfoPerAtom() const 583 585 { 584 DoLog(1) && (Log() << Verbose(1) << "Final graph info for each atom is:" << endl);586 Log() << Verbose(1) << "Final graph info for each atom is:" << endl; 585 587 ActOnAllAtoms( &atom::OutputGraphInfo ); 586 588 } … … 592 594 void molecule::OutputGraphInfoPerBond() const 593 595 { 594 DoLog(1) && (Log() << Verbose(1) << "Final graph info for each bond is:" << endl);596 Log() << Verbose(1) << "Final graph info for each bond is:" << endl; 595 597 bond *Binder = first; 596 598 while (Binder->next != last) { 597 599 Binder = Binder->next; 598 DoLog(2) && (Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <");599 DoLog(0) && (Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.");600 Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <"; 601 Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp."; 600 602 Binder->leftatom->OutputComponentNumber(); 601 DoLog(0) && (Log() << Verbose(0) << " === ");602 DoLog(0) && (Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp.");603 Log() << Verbose(0) << " === "; 604 Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp."; 603 605 Binder->rightatom->OutputComponentNumber(); 604 DoLog(0) && (Log() << Verbose(0) << ">." << endl);606 Log() << Verbose(0) << ">." << endl; 605 607 if (Binder->Cyclic) // cyclic ?? 606 DoLog(3) && (Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl);608 Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl; 607 609 } 608 610 } … … 678 680 do { // look for Root 679 681 Walker = BFS.BFSStack->PopFirst(); 680 DoLog(2) && (Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl);682 Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl; 681 683 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 682 684 if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder) … … 685 687 if (OtherAtom->type->Z != 1) { 686 688 #endif 687 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);689 Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl; 688 690 if (BFS.ColorList[OtherAtom->nr] == white) { 689 691 BFS.TouchedStack->Push(OtherAtom); … … 691 693 BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor 692 694 BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1; 693 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);695 Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl; 694 696 //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance 695 DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl);697 Log() << Verbose(3) << "Putting OtherAtom into queue." << endl; 696 698 BFS.BFSStack->Push(OtherAtom); 697 699 //} 698 700 } else { 699 DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl);701 Log() << Verbose(3) << "Not Adding, has already been visited." << endl; 700 702 } 701 703 if (OtherAtom == BFS.Root) … … 703 705 #ifdef ADDHYDROGEN 704 706 } else { 705 DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl);707 Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl; 706 708 BFS.ColorList[OtherAtom->nr] = black; 707 709 } 708 710 #endif 709 711 } else { 710 DoLog(2) && (Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl);712 Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl; 711 713 } 712 714 } 713 715 BFS.ColorList[Walker->nr] = black; 714 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);716 Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl; 715 717 if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand 716 718 // step through predecessor list … … 722 724 } 723 725 if (OtherAtom == BackEdge->rightatom) { // if each atom in found cycle is cyclic, loop's been found before already 724 DoLog(3) && (Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl);726 Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl; 725 727 do { 726 728 OtherAtom = BFS.TouchedStack->PopLast(); 727 729 if (BFS.PredecessorList[OtherAtom->nr] == Walker) { 728 DoLog(4) && (Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl);730 Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl; 729 731 BFS.PredecessorList[OtherAtom->nr] = NULL; 730 732 BFS.ShortestPathList[OtherAtom->nr] = -1; … … 760 762 RingSize = 1; 761 763 BFS.Root->GetTrueFather()->IsCyclic = true; 762 DoLog(1) && (Log() << Verbose(1) << "Found ring contains: ");764 Log() << Verbose(1) << "Found ring contains: "; 763 765 Walker = BFS.Root; 764 766 while (Walker != BackEdge->rightatom) { 765 DoLog(0) && (Log() << Verbose(0) << Walker->Name << " <-> ");767 Log() << Verbose(0) << Walker->Name << " <-> "; 766 768 Walker = BFS.PredecessorList[Walker->nr]; 767 769 Walker->GetTrueFather()->IsCyclic = true; 768 770 RingSize++; 769 771 } 770 DoLog(0) && (Log() << Verbose(0) << Walker->Name << " with a length of " << RingSize << "." << endl << endl);772 Log() << Verbose(0) << Walker->Name << " with a length of " << RingSize << "." << endl << endl; 771 773 // walk through all and set MinimumRingSize 772 774 Walker = BFS.Root; … … 780 782 MinRingSize = RingSize; 781 783 } else { 782 DoLog(1) && (Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl);784 Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl; 783 785 } 784 786 }; … … 858 860 859 861 } 860 DoLog(1) && (Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl);861 } 862 DoLog(1) && (Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl);862 Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl; 863 } 864 Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl; 863 865 } else 864 DoLog(1) && (Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl);866 Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl; 865 867 } 866 868 ; … … 890 892 //BackEdgeStack->Output(out); 891 893 892 DoLog(1) && (Log() << Verbose(1) << "Analysing cycles ... " << endl);894 Log() << Verbose(1) << "Analysing cycles ... " << endl; 893 895 NumCycles = 0; 894 896 while (!BackEdgeStack->IsEmpty()) { … … 901 903 ResetBFSAccounting(Walker, BFS); 902 904 903 DoLog(1) && (Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl);905 Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl; 904 906 OtherAtom = NULL; 905 907 CyclicStructureAnalysis_CyclicBFSFromRootToRoot(BackEdge, BFS); … … 930 932 break; // breaking here will not cause error! 931 933 } 932 if (i == vertex->ListOfBonds.size()) { 933 DoeLog(0) && (eLog()<< Verbose(0) << "Error: All Component entries are already occupied!" << endl); 934 performCriticalExit(); 935 } 936 } else { 937 DoeLog(0) && (eLog()<< Verbose(0) << "Error: Given vertex is NULL!" << endl); 938 performCriticalExit(); 939 } 934 if (i == vertex->ListOfBonds.size()) 935 eLog() << Verbose(0) << "Error: All Component entries are already occupied!" << endl; 936 } else 937 eLog() << Verbose(0) << "Error: Given vertex is NULL!" << endl; 940 938 } 941 939 ; … … 973 971 void OutputAlreadyVisited(int *list) 974 972 { 975 DoLog(4) && (Log() << Verbose(4) << "Already Visited Bonds:\t");973 Log() << Verbose(4) << "Already Visited Bonds:\t"; 976 974 for (int i = 1; i <= list[0]; i++) 977 DoLog(0) && (Log() << Verbose(0) << list[i] << " ");978 DoLog(0) && (Log() << Verbose(0) << endl);975 Log() << Verbose(0) << list[i] << " "; 976 Log() << Verbose(0) << endl; 979 977 } 980 978 ; … … 982 980 /** Storing the bond structure of a molecule to file. 983 981 * Simply stores Atom::nr and then the Atom::nr of all bond partners per line. 982 * \param *out output stream for debugging 984 983 * \param *path path to file 985 * \param *filename name of file986 984 * \return true - file written successfully, false - writing failed 987 985 */ 988 bool molecule::StoreAdjacencyToFile(char *path , char *filename)986 bool molecule::StoreAdjacencyToFile(char *path) 989 987 { 990 988 ofstream AdjacencyFile; … … 992 990 bool status = true; 993 991 994 if (path != NULL) 995 line << path << "/" << filename; 996 else 997 line << filename; 992 line << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE; 998 993 AdjacencyFile.open(line.str().c_str(), ios::out); 999 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... ");994 Log() << Verbose(1) << "Saving adjacency list ... "; 1000 995 if (AdjacencyFile != NULL) { 1001 AdjacencyFile << "m\tn" << endl;1002 996 ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile); 1003 997 AdjacencyFile.close(); 1004 DoLog(1) && (Log() << Verbose(1) << "done." << endl);998 Log() << Verbose(1) << "done." << endl; 1005 999 } else { 1006 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 1007 status = false; 1008 } 1009 1010 return status; 1011 } 1012 ; 1013 1014 /** Storing the bond structure of a molecule to file. 1015 * Simply stores Atom::nr and then the Atom::nr of all bond partners, one per line. 1016 * \param *path path to file 1017 * \param *filename name of file 1018 * \return true - file written successfully, false - writing failed 1019 */ 1020 bool molecule::StoreBondsToFile(char *path, char *filename) 1021 { 1022 ofstream BondFile; 1023 stringstream line; 1024 bool status = true; 1025 1026 if (path != NULL) 1027 line << path << "/" << filename; 1028 else 1029 line << filename; 1030 BondFile.open(line.str().c_str(), ios::out); 1031 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... "); 1032 if (BondFile != NULL) { 1033 BondFile << "m\tn" << endl; 1034 ActOnAllAtoms(&atom::OutputBonds, &BondFile); 1035 BondFile.close(); 1036 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 1037 } else { 1038 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 1000 Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl; 1039 1001 status = false; 1040 1002 } … … 1049 1011 filename << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE; 1050 1012 File.open(filename.str().c_str(), ios::out); 1051 DoLog(1) && (Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... ");1013 Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... "; 1052 1014 if (File == NULL) 1053 1015 return false; … … 1090 1052 //Log() << Verbose(0) << endl; 1091 1053 } else { 1092 DoLog(0) && (Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl);1054 Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl; 1093 1055 status = false; 1094 1056 } … … 1113 1075 1114 1076 if (!CheckAdjacencyFileAgainstMolecule_Init(path, File, CurrentBonds)) { 1115 DoLog(1) && (Log() << Verbose(1) << "Adjacency file not found." << endl);1077 Log() << Verbose(1) << "Adjacency file not found." << endl; 1116 1078 return true; 1117 1079 } … … 1139 1101 1140 1102 if (status) { // if equal we parse the KeySetFile 1141 DoLog(1) && (Log() << Verbose(1) << "done: Equal." << endl);1103 Log() << Verbose(1) << "done: Equal." << endl; 1142 1104 } else 1143 DoLog(1) && (Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl);1105 Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl; 1144 1106 return status; 1145 1107 } … … 1157 1119 bool status = true; 1158 1120 if (ReferenceStack->IsEmpty()) { 1159 DoLog(1) && (Log() << Verbose(1) << "ReferenceStack is empty!" << endl);1121 eLog() << Verbose(0) << "ReferenceStack is empty!" << endl; 1160 1122 return false; 1161 1123 } … … 1172 1134 if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->nr]) { // found the bond 1173 1135 LocalStack->Push((*Runner)); 1174 DoLog(3) && (Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl);1136 Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl; 1175 1137 break; 1176 1138 } 1177 1139 } 1178 1140 Binder = ReferenceStack->PopFirst(); // loop the stack for next item 1179 DoLog(3) && (Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl);1141 Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl; 1180 1142 ReferenceStack->Push(Binder); 1181 1143 } while (FirstBond != Binder); … … 1226 1188 BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor 1227 1189 BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1; 1228 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);1190 Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl; 1229 1191 if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance 1230 DoLog(3) && (Log() << Verbose(3));1192 Log() << Verbose(3); 1231 1193 if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far 1232 1194 AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom); 1233 DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name);1195 Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name; 1234 1196 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder); 1235 DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");1197 Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", "; 1236 1198 } else { // this code should actually never come into play (all white atoms are not yet present in BondMolecule, that's why they are white in the first place) 1237 DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name);1199 Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name; 1238 1200 if (AddedBondList[Binder->nr] == NULL) { 1239 1201 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder); 1240 DoLog(0) && (Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]));1202 Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]); 1241 1203 } else 1242 DoLog(0) && (Log() << Verbose(0) << ", not added Bond ");1243 } 1244 DoLog(0) && (Log() << Verbose(0) << ", putting OtherAtom into queue." << endl);1204 Log() << Verbose(0) << ", not added Bond "; 1205 } 1206 Log() << Verbose(0) << ", putting OtherAtom into queue." << endl; 1245 1207 BFS.BFSStack->Push(OtherAtom); 1246 1208 } else { // out of bond order, then replace … … 1248 1210 BFS.ColorList[OtherAtom->nr] = white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic) 1249 1211 if (Binder == Bond) 1250 DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond");1212 Log() << Verbose(3) << "Not Queueing, is the Root bond"; 1251 1213 else if (BFS.ShortestPathList[OtherAtom->nr] >= BFS.BondOrder) 1252 DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder);1214 Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder; 1253 1215 if (!Binder->Cyclic) 1254 DoLog(0) && (Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl);1216 Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl; 1255 1217 if (AddedBondList[Binder->nr] == NULL) { 1256 1218 if ((AddedAtomList[OtherAtom->nr] != NULL)) { // .. whether we add or saturate … … 1269 1231 void BreadthFirstSearchAdd_VisitedNode(molecule *Mol, struct BFSAccounting &BFS, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond, atom **&AddedAtomList, bond **&AddedBondList, bool IsAngstroem) 1270 1232 { 1271 DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl);1233 Log() << Verbose(3) << "Not Adding, has already been visited." << endl; 1272 1234 // This has to be a cyclic bond, check whether it's present ... 1273 1235 if (AddedBondList[Binder->nr] == NULL) { … … 1315 1277 // followed by n+1 till top of stack. 1316 1278 Walker = BFS.BFSStack->PopFirst(); // pop oldest added 1317 DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);1279 Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl; 1318 1280 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1319 1281 if ((*Runner) != NULL) { // don't look at bond equal NULL 1320 1282 Binder = (*Runner); 1321 1283 OtherAtom = (*Runner)->GetOtherAtom(Walker); 1322 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);1284 Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl; 1323 1285 if (BFS.ColorList[OtherAtom->nr] == white) { 1324 1286 BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem); … … 1329 1291 } 1330 1292 BFS.ColorList[Walker->nr] = black; 1331 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);1293 Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl; 1332 1294 } 1333 1295 BreadthFirstSearchAdd_Free(BFS); … … 1354 1316 // reset parent list 1355 1317 ParentList = Calloc<atom*> (AtomCount, "molecule::BuildInducedSubgraph_Init: **ParentList"); 1356 DoLog(3) && (Log() << Verbose(3) << "Resetting ParentList." << endl);1318 Log() << Verbose(3) << "Resetting ParentList." << endl; 1357 1319 } 1358 1320 ; … … 1361 1323 { 1362 1324 // fill parent list with sons 1363 DoLog(3) && (Log() << Verbose(3) << "Filling Parent List." << endl);1325 Log() << Verbose(3) << "Filling Parent List." << endl; 1364 1326 atom *Walker = mol->start; 1365 1327 while (Walker->next != mol->end) { … … 1367 1329 ParentList[Walker->father->nr] = Walker; 1368 1330 // Outputting List for debugging 1369 DoLog(4) && (Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl);1331 Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl; 1370 1332 } 1371 1333 … … 1385 1347 atom *OtherAtom = NULL; 1386 1348 // check each entry of parent list and if ok (one-to-and-onto matching) create bonds 1387 DoLog(3) && (Log() << Verbose(3) << "Creating bonds." << endl);1349 Log() << Verbose(3) << "Creating bonds." << endl; 1388 1350 Walker = Father->start; 1389 1351 while (Walker->next != Father->end) { … … 1396 1358 OtherAtom = (*Runner)->GetOtherAtom(Walker); 1397 1359 if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond 1398 DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl);1360 Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl; 1399 1361 mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree); 1400 1362 } … … 1421 1383 atom **ParentList = NULL; 1422 1384 1423 DoLog(2) && (Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl);1385 Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl; 1424 1386 BuildInducedSubgraph_Init(ParentList, Father->AtomCount); 1425 1387 BuildInducedSubgraph_FillParentList(this, Father, ParentList); 1426 1388 status = BuildInducedSubgraph_CreateBondsFromParent(this, Father, ParentList); 1427 1389 BuildInducedSubgraph_Finalize(ParentList); 1428 DoLog(2) && (Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl);1390 Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl; 1429 1391 return status; 1430 1392 } … … 1443 1405 int size; 1444 1406 1445 DoLog(1) && (Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl);1446 DoLog(2) && (Log() << Verbose(2) << "Disconnected atom: ");1407 Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl; 1408 Log() << Verbose(2) << "Disconnected atom: "; 1447 1409 1448 1410 // count number of atoms in graph … … 1466 1428 } 1467 1429 if (!BondStatus) { 1468 DoLog(0) && (Log() << Verbose(0) << (*Walker) << endl);1430 Log() << Verbose(0) << (*Walker) << endl; 1469 1431 return false; 1470 1432 } 1471 1433 } 1472 1434 else { 1473 DoLog(0) && (Log() << Verbose(0) << "none." << endl);1435 Log() << Verbose(0) << "none." << endl; 1474 1436 return true; 1475 1437 } 1476 DoLog(0) && (Log() << Verbose(0) << "none." << endl);1477 1478 DoLog(1) && (Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl);1438 Log() << Verbose(0) << "none." << endl; 1439 1440 Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl; 1479 1441 1480 1442 return true;
Note:
See TracChangeset
for help on using the changeset viewer.