Ignore:
Timestamp:
May 18, 2016, 10:02:06 PM (10 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, 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, Candidate_v1.7.0, 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_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, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, 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:
d713ce
Parents:
d45ed9
git-author:
Frederik Heber <heber@…> (03/07/16 13:44:02)
git-committer:
Frederik Heber <heber@…> (05/18/16 22:02:06)
Message:

Prepared AtomFragmentsMap to work in ids, not instances.

  • no more ptrs such that we may convert it into a serializable singleton container.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Interfragmenter.cpp

    rd45ed9 rbd6e5c  
    107107  for (candidates_t::const_iterator candidateiter = _candidates.begin();
    108108      candidateiter != _candidates.end(); ++candidateiter) {
    109     const atom * _atom = *candidateiter;
    110     atomkeyset_t::const_iterator iter = _atomkeyset.find(_atom);
     109    const atomId_t atomid = (*candidateiter)->getId();
     110    atomkeyset_t::const_iterator iter = _atomkeyset.find(atomid);
    111111    ASSERT( iter != _atomkeyset.end(),
    112112        "Interfragmenter::getAtomSpecificKeySetMap() - could not find atom "
    113         +toString(_atom->getId())+" in lookup.");
    114     fragmentmap.insert( std::make_pair( _atom, iter->second) );
     113        +toString(atomid)+" in lookup.");
     114    fragmentmap.insert( std::make_pair( atomid, iter->second) );
    115115  }
    116116  LOG(4, "DEBUG: Copied part of lookup map contains " << fragmentmap.size() << " keys.");
     
    122122    const size_t _MaxOrder,
    123123    const candidates_t &_candidates,
    124     atomkeyset_t &_fragmentmap,
     124    const atomkeyset_t &_fragmentmap,
    125125    const KeySet &_keyset,
    126126    Graph &_InterFragments,
     
    131131    const atom *_atom = *candidateiter;
    132132    LOG(3, "DEBUG: Current candidate is " << *_atom << ".");
    133     atomkeyset_t::iterator finditer = _fragmentmap.find(_atom);
     133    atomkeyset_t::const_iterator finditer = _fragmentmap.find(_atom->getId());
    134134    ASSERT( finditer != _fragmentmap.end(),
    135135        "Interfragmenter::combineFragments() - could not find atom "
    136136        +toString(_atom->getId())+" in fragment specific lookup.");
    137     keysets_t &othersets = finditer->second;
     137    // copy set to allow erase
     138    keysets_t othersets(finditer->second);
    138139    ASSERT( !othersets.empty(),
    139140        "Interfragmenter::combineFragments() - keysets to "+toString(_atom->getId())+
     
    141142    keysets_t::iterator otheriter = othersets.begin();
    142143    while (otheriter != othersets.end()) {
    143       const KeySet &otherset = **otheriter;
     144      const KeySet &otherset = *otheriter;
    144145      LOG(3, "DEBUG: Current keyset is " << otherset << ".");
    145146      // only add them one way round and not the other
Note: See TracChangeset for help on using the changeset viewer.