Changeset 59fff1
- Timestamp:
- Dec 28, 2011, 3:25:49 PM (13 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- afa9d8
- Parents:
- 30c753
- git-author:
- Frederik Heber <heber@…> (12/23/11 10:09:37)
- git-committer:
- Frederik Heber <heber@…> (12/28/11 15:25:49)
- Location:
- src
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/WorldAction/BoundInBoxAction.cpp
r30c753 r59fff1 76 76 MolRunner != AllMolecules.end(); 77 77 ++MolRunner) { 78 for(molecule:: const_iterator AtomRunner = (*MolRunner)->begin();78 for(molecule::iterator AtomRunner = (*MolRunner)->begin(); 79 79 AtomRunner != (*MolRunner)->end(); 80 80 ++AtomRunner) { -
src/Actions/WorldAction/CenterInBoxAction.cpp
r30c753 r59fff1 109 109 MolRunner != AllMolecules.end(); 110 110 ++MolRunner) { 111 for(molecule:: const_iterator AtomRunner = (*MolRunner)->begin();111 for(molecule::iterator AtomRunner = (*MolRunner)->begin(); 112 112 AtomRunner != (*MolRunner)->end(); 113 113 ++AtomRunner) { -
src/Analysis/analysis_correlation.cpp
r30c753 r59fff1 212 212 LOG(1,"INFO: Resulting relative angle for molecule " << _mol->getName() 213 213 << " is " << angle << "."); 214 outmap->insert ( make_pair (angle, *iter ) );214 outmap->insert ( std::make_pair (angle, *iter ) ); 215 215 ++i; 216 216 } … … 322 322 distance = domain.periodicDistance((*iter)->getPosition(),(*runner)->getPosition()); 323 323 //LOG(1, "Inserting " << *(*iter) << " and " << *(*runner)); 324 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) ); 324 outmap->insert ( 325 std::pair<double, std::pair <const atom *, const atom*> > ( 326 distance, 327 std::pair<const atom *, const atom*> ((*iter), (*runner)) 328 ) 329 ); 325 330 } 326 331 } … … 403 408 distance = checkX.distance(checkOtherX); 404 409 //LOG(1, "Inserting " << *(*iter) << " and " << *(*runner)); 405 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) ); 410 outmap->insert ( 411 std::pair<double, std::pair <const atom *, const atom*> > ( 412 distance, 413 std::pair<const atom *, const atom*> ( 414 (*iter), 415 (*runner)) 416 ) 417 ); 406 418 } 407 419 } … … 444 456 distance = domain.periodicDistance((*iter)->getPosition(),*point); 445 457 LOG(4, "Current distance is " << distance << "."); 446 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ((*iter), point) ) ); 458 outmap->insert ( 459 std::pair<double, std::pair<const atom *, const Vector*> >( 460 distance, 461 std::pair<const atom *, const Vector*> ( 462 (*iter), 463 point) 464 ) 465 ); 447 466 } 448 467 } … … 491 510 distance = checkX.distance(*point); 492 511 LOG(4, "Current distance is " << distance << "."); 493 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (*iter, point) ) ); 512 outmap->insert ( 513 std::pair<double, 514 std::pair<const atom *, const Vector*> >( 515 distance, 516 std::pair<const atom *, const Vector*> ( 517 *iter, 518 point) 519 ) 520 ); 494 521 } 495 522 } … … 533 560 distance = Intersections.GetSmallestDistance(); 534 561 triangle = Intersections.GetClosestTriangle(); 535 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> ((*iter), triangle) ) ); 562 outmap->insert ( 563 std::pair<double, 564 std::pair<const atom *, BoundaryTriangleSet*> >( 565 distance, 566 std::pair<const atom *, BoundaryTriangleSet*> ( 567 (*iter), 568 triangle) 569 ) 570 ); 536 571 } 537 572 } … … 597 632 } 598 633 // insert 599 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (*iter, ShortestTriangle) ) ); 634 outmap->insert ( 635 std::pair<double, 636 std::pair<const atom *, BoundaryTriangleSet*> >( 637 ShortestDistance, 638 std::pair<const atom *, BoundaryTriangleSet*> ( 639 *iter, 640 ShortestTriangle) 641 ) 642 ); 600 643 //LOG(1, "INFO: Inserting " << Walker << " with distance " << ShortestDistance << " to " << *ShortestTriangle << "."); 601 644 } -
src/Analysis/analysis_correlation.hpp
r30c753 r59fff1 46 46 /********************************************** definitions *********************************/ 47 47 48 typedef multimap<double, pair< atom *,atom *> > PairCorrelationMap;49 typedef multimap<double, atom * > DipoleAngularCorrelationMap;50 typedef multimap<double, pair< molecule *,molecule *> > DipoleCorrelationMap;51 typedef multimap<double, pair< atom *, const Vector *> > CorrelationToPointMap;52 typedef multimap<double, pair< atom *, BoundaryTriangleSet *> > CorrelationToSurfaceMap;48 typedef multimap<double, pair<const atom *, const atom *> > PairCorrelationMap; 49 typedef multimap<double, const atom * > DipoleAngularCorrelationMap; 50 typedef multimap<double, pair<const molecule *, const molecule *> > DipoleCorrelationMap; 51 typedef multimap<double, pair<const atom *, const Vector *> > CorrelationToPointMap; 52 typedef multimap<double, pair<const atom *, BoundaryTriangleSet *> > CorrelationToSurfaceMap; 53 53 typedef map<double, int> BinPairMap; 54 54 -
src/Fragmentation/Fragmentation.cpp
r30c753 r59fff1 595 595 596 596 // set atom values 597 for(molecule:: const_iterator iter=mol->begin();iter!=mol->end();++iter){597 for(molecule::iterator iter=mol->begin();iter!=mol->end();++iter){ 598 598 (*iter)->AdaptiveOrder = OrderArray[(*iter)->getNr()]; 599 599 (*iter)->MaxOrder = MaxArray[(*iter)->getNr()]; … … 676 676 677 677 // we increment the iter just before skipping the hydrogen 678 for (molecule::const_iterator iter = Leaf->begin(); iter != Leaf->end();) { 678 // as we use AddBond, we cannot have a const_iterator here 679 for (molecule::iterator iter = Leaf->begin(); iter != Leaf->end();) { 679 680 LonelyFlag = true; 680 681 FatherOfRunner = (*iter)->father; -
src/Graph/BuildInducedSubgraph.cpp
r30c753 r59fff1 46 46 // fill parent list with sons 47 47 LOG(3, "Filling Parent List."); 48 for (molecule:: const_iterator iter = Son->begin(); iter != Son->end(); ++iter) {48 for (molecule::iterator iter = Son->begin(); iter != Son->end(); ++iter) { 49 49 ParentList[(*iter)->father] = (*iter); 50 50 // Outputting List for debugging … … 59 59 // check each entry of parent list and if ok (one-to-and-onto matching) create bonds 60 60 LOG(2, "STATUS: Creating bonds."); 61 for (molecule:: const_iterator iter = Father->begin(); iter != Father->end(); ++iter) {61 for (molecule::iterator iter = Father->begin(); iter != Father->end(); ++iter) { 62 62 if (ParentList.count(*iter)) { 63 63 if (ParentList[(*iter)]->father != (*iter)) { -
src/MoleculeLeafClass.cpp
r30c753 r59fff1 110 110 bool MoleculeLeafClass::FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter, const enum HydrogenSaturation saturation) 111 111 { 112 atom *Father = NULL;113 114 112 if (RootStack != NULL) { 115 113 // find first root candidates … … 117 115 RootStack[FragmentCounter].clear(); 118 116 for(molecule::const_iterator iter = Leaf->begin(); iter != Leaf->end(); ++iter) { 119 Father = (*iter)->GetTrueFather();117 const atom * const Father = (*iter)->GetTrueFather(); 120 118 if (AtomMask[Father->getNr()]) // apply mask 121 119 if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen -
src/Parser/FormatParserStorage.cpp
r30c753 r59fff1 267 267 * We store in the order of the atomic ids, not in the order they appear in the molecules. 268 268 * Hence, we first create a vector from all selected molecules' atoms. 269 * 270 * TODO: Change here atom * to const atom * when FormatParserStorage::save() uses vector<const atom *> 271 * 269 272 * \param &output output stream 270 273 * \param suffix … … 278 281 MolIter != molecules.end(); 279 282 ++MolIter) { 280 for(molecule:: const_iterator AtomIter = (*MolIter)->begin();283 for(molecule::iterator AtomIter = (*MolIter)->begin(); 281 284 AtomIter != (*MolIter)->end(); 282 285 ++AtomIter) { -
src/Tesselation/BoundaryMaps.hpp
r30c753 r59fff1 29 29 30 30 // ============= TesselPoint maps ======================== // 31 typedef std::pair < double, classTesselPoint * > TesselPointDistancePair;32 typedef std::multimap < double, class TesselPoint * > TesselPointDistanceMap;33 typedef std::pair < TesselPointDistanceMap::iterator, bool > TesselPointDistanceTestPair;31 typedef std::pair < double, TesselPoint * > TesselPointDistancePair; 32 //typedef std::multimap < double, class TesselPoint * > TesselPointDistanceMap; 33 //typedef std::pair < TesselPointDistanceMap::iterator, bool > TesselPointDistanceTestPair; 34 34 35 35 typedef std::list <TesselPoint *> TesselPointList; -
src/Tesselation/boundary.cpp
r30c753 r59fff1 189 189 190 190 // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours 191 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 191 // Boundaries stores non-const TesselPoint ref, hence we need iterator here 192 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) { 192 193 ProjectedVector = (*iter)->getPosition() - (*MolCenter); 193 194 ProjectedVector.ProjectOntoPlane(AxisVector); … … 874 875 phi[i] = (random()/(rng_max-rng_min))*(2.*M_PI); 875 876 876 for(molecule::const_iterator iter = filler->begin(); iter !=filler->end();++iter){ 877 // atom::clone is not const member function, hence we need iterator here 878 for(molecule::iterator iter = filler->begin(); iter !=filler->end();++iter){ 877 879 878 880 // create atomic random translation vector ... -
src/atom.cpp
r30c753 r59fff1 79 79 80 80 atom *atom::GetTrueFather() 81 { 82 const atom *father = const_cast<const atom *>(this)->GetTrueFather(); 83 return const_cast<atom *>(father); 84 } 85 86 const atom *atom::GetTrueFather() const 81 87 { 82 88 if(father == this){ // top most father is the one that points on itself -
src/atom.hpp
r30c753 r59fff1 153 153 */ 154 154 atom *GetTrueFather(); 155 156 /** Const version of \sa GetTrueFather(). 157 * \return true father, i.e. whose father points to itself, NULL if it could not be found or has none (added hydrogen) 158 */ 159 const atom *GetTrueFather() const; 155 160 156 161 /** Compares the indices of \a this atom with a given \a ptr. -
src/molecule.cpp
r30c753 r59fff1 173 173 { 174 174 size_t counter = 0; 175 for ( molecule::const_iterator iter = begin(); iter != end (); ++iter)175 for (const_iterator iter = begin(); iter != end (); ++iter) 176 176 counter++; 177 177 return counter; … … 181 181 { 182 182 OBSERVE; 183 molecule::const_iterator iter = loc;183 const_iterator iter = loc; 184 184 ++iter; 185 atom * atom = *loc;186 atomIds.erase( atom->getId() );187 formula-= atom->getType();188 atom->removeFromMolecule();185 atom * const _atom = const_cast<atom *>(*loc); 186 atomIds.erase( _atom->getId() ); 187 formula-=_atom->getType(); 188 _atom->removeFromMolecule(); 189 189 return iter; 190 190 } … … 193 193 { 194 194 OBSERVE; 195 molecule::const_iterator iter = find(key);195 const_iterator iter = find(key); 196 196 if (iter != end()){ 197 197 ++iter; … … 233 233 // iter != MyIter(atomIds.end(), FromIdToAtom()); 234 234 // ++iter) 235 for (molecule:: const_iterator iter = begin(); iter != end(); ++iter)235 for (molecule::iterator iter = begin(); iter != end(); ++iter) 236 236 vector_of_atoms.push_back(*iter); 237 237 return vector_of_atoms; … … 634 634 // copy all atoms 635 635 std::map< const atom *, atom *> FatherFinder; 636 for ( const_iterator iter = begin(); iter != end(); ++iter) {637 atom * const copy_atom = copy->AddCopyAtom(*iter);636 for (iterator iter = begin(); iter != end(); ++iter) { 637 atom * const copy_atom = copy->AddCopyAtom(*iter); 638 638 FatherFinder.insert( std::make_pair( *iter, copy_atom ) ); 639 639 } … … 649 649 // get the pendant atoms of current bond in the copy molecule 650 650 ASSERT(FatherFinder.count(Binder->leftatom), 651 "molecule::CopyMolecule() - No copy of original left atom for bond copy found"); 651 "molecule::CopyMolecule() - No copy of original left atom " 652 +toString(Binder->leftatom)+" for bond copy found"); 652 653 ASSERT(FatherFinder.count(Binder->rightatom), 653 "molecule::CopyMolecule() - No copy of original right atom for bond copy found"); 654 "molecule::CopyMolecule() - No copy of original right atom " 655 +toString(Binder->rightatom)+" for bond copy found"); 654 656 atom * const LeftAtom = FatherFinder[Binder->leftatom]; 655 657 atom * const RightAtom = FatherFinder[Binder->rightatom]; … … 674 676 { 675 677 // remove each atom from world 676 for( const_iterator AtomRunner = begin(); !empty(); AtomRunner = begin())678 for(iterator AtomRunner = begin(); !empty(); AtomRunner = begin()) 677 679 World::getInstance().destroyAtom(*AtomRunner); 678 680 }; … … 690 692 // copy all atoms 691 693 std::map< const atom *, atom *> FatherFinder; 692 for ( const_iterator iter = begin(); iter != end(); ++iter) {694 for (iterator iter = begin(); iter != end(); ++iter) { 693 695 if((*iter)->IsInShape(region)){ 694 atom * const copy_atom = copy->AddCopyAtom(*iter);696 atom * const copy_atom = copy->AddCopyAtom(*iter); 695 697 FatherFinder.insert( std::make_pair( *iter, copy_atom ) ); 696 698 } … … 739 741 740 742 // some checks to make sure we are able to create the bond 741 ASSERT(atom1, "First atom in bond-creation was an invalid pointer"); 742 ASSERT(atom2, "Second atom in bond-creation was an invalid pointer"); 743 ASSERT(FindAtom(atom1->getNr()),"First atom in bond-creation was not part of molecule"); 744 ASSERT(FindAtom(atom2->getNr()),"Second atom in bond-creation was not part of molecule"); 743 ASSERT(atom1, 744 "molecule::AddBond() - First atom "+toString(atom1) 745 +" is not a invalid pointer"); 746 ASSERT(atom2, 747 "molecule::AddBond() - Second atom "+toString(atom2) 748 +" is not a invalid pointer"); 749 ASSERT(isInMolecule(atom1), 750 "molecule::AddBond() - First atom "+toString(atom1) 751 +" is not part of molecule"); 752 ASSERT(isInMolecule(atom2), 753 "molecule::AddBond() - Second atom "+toString(atom2) 754 +" is not part of molecule"); 745 755 746 756 Binder = new bond(atom1, atom2, degree); 747 757 atom1->RegisterBond(WorldTime::getTime(), Binder); 748 758 atom2->RegisterBond(WorldTime::getTime(), Binder); 749 if ((atom1->getType() != NULL) && (atom1->getType()->getAtomicNumber() != 1) && (atom2->getType() != NULL) && (atom2->getType()->getAtomicNumber() != 1)) 759 if ((atom1->getType() != NULL) 760 && (atom1->getType()->getAtomicNumber() != 1) 761 && (atom2->getType() != NULL) 762 && (atom2->getType()->getAtomicNumber() != 1)) 750 763 NoNonBonds++; 751 764 … … 850 863 atom * molecule::FindAtom(int Nr) const 851 864 { 852 molecule:: const_iterator iter = begin();865 molecule::iterator iter = begin(); 853 866 for (; iter != end(); ++iter) 854 855 867 if ((*iter)->getNr() == Nr) 868 break; 856 869 if (iter != end()) { 857 870 //LOG(0, "Found Atom Nr. " << walker->getNr()); 858 871 return (*iter); 859 872 } else { 860 LOG(0, "Atom not found inlist.");873 ELOG(1, "Atom not found in molecule " << getName() << "'s list."); 861 874 return NULL; 862 875 } 863 }; 876 } 877 878 /** Checks whether the given atom is a member of this molecule. 879 * 880 * We make use here of molecule::atomIds to get a result on 881 * 882 * @param _atom atom to check 883 * @return true - is member, false - is not 884 */ 885 bool molecule::isInMolecule(const atom * const _atom) 886 { 887 ASSERT(_atom->getMolecule() == this, 888 "molecule::isInMolecule() - atom is not designated to be in molecule '" 889 +toString(this->getName())+"'."); 890 molecule::atomIdSet::const_iterator iter = atomIds.find(_atom->getId()); 891 return (iter != atomIds.end()); 892 } 864 893 865 894 /** Asks for atom number, and checks whether in list. … … 1002 1031 int i = 0; 1003 1032 NoNonHydrogen = 0; 1004 for (molecule:: const_iterator iter = begin(); iter != end(); ++iter) {1033 for (molecule::iterator iter = begin(); iter != end(); ++iter) { 1005 1034 (*iter)->setNr(i); // update number in molecule (for easier referencing in FragmentMolecule lateron) 1006 1035 if ((*iter)->getType()->getAtomicNumber() != 1) // count non-hydrogen atoms whilst at it -
src/molecule.hpp
r30c753 r59fff1 81 81 typedef std::set<atomId_t> atomIdSet; 82 82 typedef boost::transform_iterator<FromIdToAtom, atomIdSet::iterator, atom *, atomId_t> iterator; 83 typedef iteratorconst_iterator;83 typedef boost::transform_iterator<FromIdToAtom, atomIdSet::const_iterator, const atom *, atomId_t const &> const_iterator; 84 84 85 85 const periodentafel * const elemente; //!< periodic table with each element … … 185 185 atom * FindAtom(int Nr) const; 186 186 atom * AskAtom(string text); 187 bool isInMolecule(const atom * const _atom); 187 188 188 189 /// Count and change present atoms' coordination. -
src/molecule_geometry.cpp
r30c753 r59fff1 306 306 void molecule::Scale(const double ** const factor) 307 307 { 308 for ( const_iterator iter = begin(); iter != end(); ++iter) {308 for (iterator iter = begin(); iter != end(); ++iter) { 309 309 for (size_t j=0;j<(*iter)->getTrajectorySize();j++) { 310 310 Vector temp = (*iter)->getPositionAtStep(j); … … 320 320 void molecule::Translate(const Vector *trans) 321 321 { 322 for ( const_iterator iter = begin(); iter != end(); ++iter) {322 for (iterator iter = begin(); iter != end(); ++iter) { 323 323 for (size_t j=0;j<(*iter)->getTrajectorySize();j++) { 324 324 (*iter)->setPositionAtStep(j, (*iter)->getPositionAtStep(j) + (*trans)); … … 435 435 alpha = atan(-n->at(0)/n->at(2)); 436 436 LOG(1, "INFO: Z-X-angle: " << alpha << " ... "); 437 for ( const_iterator iter = begin(); iter != end(); ++iter) {437 for (iterator iter = begin(); iter != end(); ++iter) { 438 438 tmp = (*iter)->at(0); 439 439 (*iter)->set(0, cos(alpha) * tmp + sin(alpha) * (*iter)->at(2)); … … 455 455 alpha = atan(-n->at(1)/n->at(2)); 456 456 LOG(1, "INFO: Z-Y-angle: " << alpha << " ... "); 457 for ( const_iterator iter = begin(); iter != end(); ++iter) {457 for (iterator iter = begin(); iter != end(); ++iter) { 458 458 tmp = (*iter)->at(1); 459 459 (*iter)->set(1, cos(alpha) * tmp + sin(alpha) * (*iter)->at(2)); -
src/molecule_graph.cpp
r30c753 r59fff1 52 52 bool molecule::FillBondStructureFromReference(const molecule * const reference, atom **&ListOfLocalAtoms, bool FreeList) 53 53 { 54 atom *OtherWalker = NULL; 55 atom *Father = NULL; 56 bool status = true; 57 int AtomNo; 54 bool status = true; 58 55 59 56 LOG(1, "Begin of FillBondStructureFromReference."); … … 71 68 72 69 73 for(molecule:: const_iterator iter = begin(); iter != end(); ++iter) {74 Father = (*iter)->GetTrueFather();75 AtomNo = Father->getNr(); // global id of the current walker70 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 76 73 const BondList& ListOfBonds = Father->getListOfBonds(); 77 74 for (BondList::const_iterator Runner = ListOfBonds.begin(); 78 75 Runner != ListOfBonds.end(); 79 76 ++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 81 79 if (OtherWalker != NULL) { 82 80 if (OtherWalker->getNr() > (*iter)->getNr()) 83 81 AddBond((*iter), OtherWalker, (*Runner)->BondDegree); 84 82 } else { 85 LOG(1, "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!");83 LOG(1, "OtherWalker = ListOfLocalAtoms[" << OtherAtom->getNr() << "] is NULL!"); 86 84 status = false; 87 85 } -
src/moleculelist.cpp
r30c753 r59fff1 571 571 // output file 572 572 std::vector<atom *> atoms; 573 for (molecule::const_iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) { 573 // TODO: Convert iterator to const_iterator when FormatParserStorage::save() has vector<const atom *> 574 // We need iterator here because FormatParserStorage::save() need vector<atom *> not const refs. 575 for (molecule::iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) { 574 576 atoms.push_back(*iter); 575 577 }
Note:
See TracChangeset
for help on using the changeset viewer.