Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_graph.cpp

    r59fff1 rd103d3  
    5252bool molecule::FillBondStructureFromReference(const molecule * const reference, atom **&ListOfLocalAtoms, bool FreeList)
    5353{
    54   bool status = true;
     54  atom *OtherWalker = NULL;
     55  atom *Father = NULL;
     56  bool status = true;
     57  int AtomNo;
    5558
    5659  LOG(1, "Begin of FillBondStructureFromReference.");
     
    6871
    6972
    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
     73    for(molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     74      Father = (*iter)->GetTrueFather();
     75      AtomNo = Father->getNr(); // global id of the current walker
    7376      const BondList& ListOfBonds = Father->getListOfBonds();
    7477      for (BondList::const_iterator Runner = ListOfBonds.begin();
    7578          Runner != ListOfBonds.end();
    7679          ++Runner) {
    77         atom * const OtherAtom = (*Runner)->GetOtherAtom((*iter)->GetTrueFather());
    78         atom * const OtherWalker = ListOfLocalAtoms[OtherAtom->getNr()]; // local copy of current bond partner of walker
     80        OtherWalker = ListOfLocalAtoms[(*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr()]; // local copy of current bond partner of walker
    7981        if (OtherWalker != NULL) {
    8082          if (OtherWalker->getNr() > (*iter)->getNr())
    8183            AddBond((*iter), OtherWalker, (*Runner)->BondDegree);
    8284        } else {
    83           LOG(1, "OtherWalker = ListOfLocalAtoms[" << OtherAtom->getNr() << "] is NULL!");
     85          LOG(1, "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!");
    8486          status = false;
    8587        }
     
    152154  if (AdjacencyFile.good()) {
    153155    AdjacencyFile << "m\tn" << endl;
    154     for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
     156    for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
    155157    AdjacencyFile.close();
    156158    LOG(1, "\t... done.");
     
    184186  if (BondFile.good()) {
    185187    BondFile << "m\tn" << endl;
    186     for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
     188    for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
    187189    BondFile.close();
    188190    LOG(1, "\t... done.");
Note: See TracChangeset for help on using the changeset viewer.