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