Changes in src/molecule_graph.cpp [59fff1:d103d3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_graph.cpp
r59fff1 rd103d3 52 52 bool molecule::FillBondStructureFromReference(const molecule * const reference, atom **&ListOfLocalAtoms, bool FreeList) 53 53 { 54 bool status = true; 54 atom *OtherWalker = NULL; 55 atom *Father = NULL; 56 bool status = true; 57 int AtomNo; 55 58 56 59 LOG(1, "Begin of FillBondStructureFromReference."); … … 68 71 69 72 70 for(molecule:: iterator iter = begin(); iter != end(); ++iter) {71 const atom * constFather = (*iter)->GetTrueFather();72 const intAtomNo = Father->getNr(); // global id of the current walker73 for(molecule::const_iterator iter = begin(); iter != end(); ++iter) { 74 Father = (*iter)->GetTrueFather(); 75 AtomNo = Father->getNr(); // global id of the current walker 73 76 const BondList& ListOfBonds = Father->getListOfBonds(); 74 77 for (BondList::const_iterator Runner = ListOfBonds.begin(); 75 78 Runner != ListOfBonds.end(); 76 79 ++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 79 81 if (OtherWalker != NULL) { 80 82 if (OtherWalker->getNr() > (*iter)->getNr()) 81 83 AddBond((*iter), OtherWalker, (*Runner)->BondDegree); 82 84 } else { 83 LOG(1, "OtherWalker = ListOfLocalAtoms[" << OtherAtom->getNr() << "] is NULL!");85 LOG(1, "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!"); 84 86 status = false; 85 87 } … … 152 154 if (AdjacencyFile.good()) { 153 155 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)); 155 157 AdjacencyFile.close(); 156 158 LOG(1, "\t... done."); … … 184 186 if (BondFile.good()) { 185 187 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)); 187 189 BondFile.close(); 188 190 LOG(1, "\t... done.");
Note:
See TracChangeset
for help on using the changeset viewer.