Changes in src/molecule_graph.cpp [af2c424:e4afb4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_graph.cpp
raf2c424 re4afb4 220 220 221 221 // output bonds for debugging (if bond chain list was correctly installed) 222 ActOnAllAtoms( &atom::OutputBondOfAtom);222 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::OutputBondOfAtom)); 223 223 } else 224 224 DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << getAtomCount() << ", thus no bonds, no connections!." << endl); … … 233 233 * \return true - bonds present, false - no bonds 234 234 */ 235 bool molecule::hasBondStructure() 236 { 237 for(molecule:: iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner)235 bool molecule::hasBondStructure() const 236 { 237 for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) 238 238 if (!(*AtomRunner)->ListOfBonds.empty()) 239 239 return true; … … 285 285 do { 286 286 OldNo = No; 287 No = SumPerAtom( &atom::CorrectBondDegree ); 287 No=0; 288 BOOST_FOREACH(atom *atom,atoms){ 289 No+=atom->CorrectBondDegree(); 290 } 288 291 } while (OldNo != No); 289 292 DoLog(0) && (Log() << Verbose(0) << " done." << endl); … … 515 518 DFS.BackStepping = false; 516 519 mol->ResetAllBondsToUnused(); 517 mol->SetAtomValueToValue(-1, &atom::GraphNr);518 mol->ActOnAllAtoms(&atom::InitComponentNr);519 520 DFS.BackEdgeStack->ClearStack(); 520 521 } … … 531 532 } 532 533 ; 534 535 void molecule::init_DFS(struct DFSAccounting &DFS) const{ 536 DepthFirstSearchAnalysis_Init(DFS, this); 537 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::resetGraphNr)); 538 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::InitComponentNr)); 539 } 533 540 534 541 /** Performs a Depth-First search on this molecule. … … 554 561 return SubGraphs; 555 562 DoLog(0) && (Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl); 556 DepthFirstSearchAnalysis_Init(DFS, this);563 init_DFS(DFS); 557 564 558 565 for (molecule::const_iterator iter = begin(); iter != end();) { … … 638 645 { 639 646 DoLog(1) && (Log() << Verbose(1) << "Final graph info for each atom is:" << endl); 640 ActOnAllAtoms( &atom::OutputGraphInfo);647 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::OutputGraphInfo)); 641 648 } 642 649 ; … … 1049 1056 * \return true - file written successfully, false - writing failed 1050 1057 */ 1051 bool molecule::StoreAdjacencyToFile(std::string &filename, std::string path)1058 bool molecule::StoreAdjacencyToFile(std::string filename, std::string path) 1052 1059 { 1053 1060 ofstream AdjacencyFile; … … 1063 1070 if (AdjacencyFile.good()) { 1064 1071 AdjacencyFile << "m\tn" << endl; 1065 ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile);1072 for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile)); 1066 1073 AdjacencyFile.close(); 1067 1074 DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl); … … 1081 1088 * \return true - file written successfully, false - writing failed 1082 1089 */ 1083 bool molecule::StoreBondsToFile(std::string &filename, std::string path)1090 bool molecule::StoreBondsToFile(std::string filename, std::string path) 1084 1091 { 1085 1092 ofstream BondFile; … … 1095 1102 if (BondFile.good()) { 1096 1103 BondFile << "m\tn" << endl; 1097 ActOnAllAtoms(&atom::OutputBonds, &BondFile);1104 for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile)); 1098 1105 BondFile.close(); 1099 1106 DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);
Note:
See TracChangeset
for help on using the changeset viewer.