Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/molecule_graph.cpp

    rd103d3 r59fff1  
    5252bool molecule::FillBondStructureFromReference(const molecule * const reference, atom **&ListOfLocalAtoms, bool FreeList)
    5353{
    54   atom *OtherWalker = NULL;
    55   atom *Father = NULL;
    56   bool status = true;
    57   int AtomNo;
     54  bool status = true;
    5855
    5956  LOG(1, "Begin of FillBondStructureFromReference.");
     
    7168
    7269
    73     for(molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    74       Father = (*iter)->GetTrueFather();
    75       AtomNo = Father->getNr(); // global id of the current walker
     70    for(molecule::iterator iter = begin(); iter != end(); ++iter) {
     71      const atom * const Father = (*iter)->GetTrueFather();
     72      const int AtomNo = Father->getNr(); // global id of the current walker
    7673      const BondList& ListOfBonds = Father->getListOfBonds();
    7774      for (BondList::const_iterator Runner = ListOfBonds.begin();
    7875          Runner != ListOfBonds.end();
    7976          ++Runner) {
    80         OtherWalker = ListOfLocalAtoms[(*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr()]; // local copy of current bond partner of walker
     77        atom * const OtherAtom = (*Runner)->GetOtherAtom((*iter)->GetTrueFather());
     78        atom * const OtherWalker = ListOfLocalAtoms[OtherAtom->getNr()]; // local copy of current bond partner of walker
    8179        if (OtherWalker != NULL) {
    8280          if (OtherWalker->getNr() > (*iter)->getNr())
    8381            AddBond((*iter), OtherWalker, (*Runner)->BondDegree);
    8482        } else {
    85           LOG(1, "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!");
     83          LOG(1, "OtherWalker = ListOfLocalAtoms[" << OtherAtom->getNr() << "] is NULL!");
    8684          status = false;
    8785        }
     
    154152  if (AdjacencyFile.good()) {
    155153    AdjacencyFile << "m\tn" << endl;
    156     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
     154    for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
    157155    AdjacencyFile.close();
    158156    LOG(1, "\t... done.");
     
    186184  if (BondFile.good()) {
    187185    BondFile << "m\tn" << endl;
    188     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
     186    for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
    189187    BondFile.close();
    190188    LOG(1, "\t... done.");
Note: See TracChangeset for help on using the changeset viewer.