Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_graph.cpp

    re4afb4 raf2c424  
    220220
    221221    // 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 );
    223223  } else
    224224    DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << getAtomCount() << ", thus no bonds, no connections!." << endl);
     
    233233 * \return true - bonds present, false - no bonds
    234234 */
    235 bool molecule::hasBondStructure() const
    236 {
    237   for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner)
     235bool molecule::hasBondStructure()
     236{
     237  for(molecule::iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner)
    238238    if (!(*AtomRunner)->ListOfBonds.empty())
    239239      return true;
     
    285285    do {
    286286      OldNo = No;
    287       No=0;
    288       BOOST_FOREACH(atom *atom,atoms){
    289         No+=atom->CorrectBondDegree();
    290       }
     287      No = SumPerAtom( &atom::CorrectBondDegree );
    291288    } while (OldNo != No);
    292289    DoLog(0) && (Log() << Verbose(0) << " done." << endl);
     
    518515  DFS.BackStepping = false;
    519516  mol->ResetAllBondsToUnused();
     517  mol->SetAtomValueToValue(-1, &atom::GraphNr);
     518  mol->ActOnAllAtoms(&atom::InitComponentNr);
    520519  DFS.BackEdgeStack->ClearStack();
    521520}
     
    532531}
    533532;
    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 }
    540533
    541534/** Performs a Depth-First search on this molecule.
     
    561554    return SubGraphs;
    562555  DoLog(0) && (Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl);
    563   init_DFS(DFS);
     556  DepthFirstSearchAnalysis_Init(DFS, this);
    564557
    565558  for (molecule::const_iterator iter = begin(); iter != end();) {
     
    645638{
    646639  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 );
    648641}
    649642;
     
    10561049 * \return true - file written successfully, false - writing failed
    10571050 */
    1058 bool molecule::StoreAdjacencyToFile(std::string filename, std::string path)
     1051bool molecule::StoreAdjacencyToFile(std::string &filename, std::string path)
    10591052{
    10601053  ofstream AdjacencyFile;
     
    10701063  if (AdjacencyFile.good()) {
    10711064    AdjacencyFile << "m\tn" << endl;
    1072     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
     1065    ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile);
    10731066    AdjacencyFile.close();
    10741067    DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);
     
    10881081 * \return true - file written successfully, false - writing failed
    10891082 */
    1090 bool molecule::StoreBondsToFile(std::string filename, std::string path)
     1083bool molecule::StoreBondsToFile(std::string &filename, std::string path)
    10911084{
    10921085  ofstream BondFile;
     
    11021095  if (BondFile.good()) {
    11031096    BondFile << "m\tn" << endl;
    1104     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
     1097    ActOnAllAtoms(&atom::OutputBonds, &BondFile);
    11051098    BondFile.close();
    11061099    DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);
Note: See TracChangeset for help on using the changeset viewer.