Changeset 70aeed for src/Fragmentation
- Timestamp:
- May 18, 2016, 10:02:07 PM (9 years ago)
- 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, 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_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:
- d9dbef
- Parents:
- d410e25
- git-author:
- Frederik Heber <heber@…> (03/07/16 18:58:56)
- git-committer:
- Frederik Heber <heber@…> (05/18/16 22:02:07)
- Location:
- src/Fragmentation/Homology
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Homology/AtomFragmentsMap.cpp
rd410e25 r70aeed 69 69 } 70 70 } 71 // add empty entry to fullkeysets, too (if already present, we ignore that) 72 fullkeysets.insert( std::make_pair(keyset, indices_t()) ); 71 73 } 72 74 LOG(2, "DEBUG: There are now " << atommap.size() << " entries in lookup."); … … 109 111 } 110 112 113 bool AtomFragmentsMap::addFullKeyset(const KeySet &_keyset, const indices_t &_fullkeyset) 114 { 115 FragmentFullKeysetMap_t::iterator iter = fullkeysets.find(_keyset); 116 if ((iter == fullkeysets.end()) || (!iter->second.empty())) 117 return false; 118 else { 119 iter->second = _fullkeyset; 120 } 121 return true; 122 } 123 124 const AtomFragmentsMap::indices_t & 125 AtomFragmentsMap::getFullKeyset(const KeySet &_keyset) const 126 { 127 static indices_t emptyset; 128 FragmentFullKeysetMap_t::const_iterator iter = fullkeysets.find(_keyset); 129 if (iter == fullkeysets.end()) 130 return emptyset; 131 else 132 return iter->second; 133 } 134 135 bool AtomFragmentsMap::checkCompleteness() const 136 { 137 bool status = true; 138 for (FragmentFullKeysetMap_t::const_iterator iter = fullkeysets.begin(); 139 iter != fullkeysets.end(); ++iter) 140 status &= (iter->second.size() != 0); 141 142 return status; 143 } 144 111 145 CONSTRUCT_SINGLETON(AtomFragmentsMap) 112 146 -
src/Fragmentation/Homology/AtomFragmentsMap.hpp
rd410e25 r70aeed 19 19 #include <list> 20 20 #include <map> 21 #include <vector> 21 22 22 23 #include <boost/serialization/export.hpp> 23 #include <boost/serialization/set.hpp>24 24 #include <boost/serialization/list.hpp> 25 25 #include <boost/serialization/map.hpp> 26 #include <boost/serialization/set.hpp> 27 #include <boost/serialization/vector.hpp> 26 28 #include <boost/serialization/version.hpp> 27 29 … … 52 54 { atommap.clear(); } 53 55 56 typedef std::vector<atomId_t> indices_t; 54 57 typedef std::list<KeySet> keysets_t; 55 58 //!> typedef for the internal map 56 59 typedef std::map<atomId_t, keysets_t> AtomFragmentsMap_t; 60 typedef std::map<KeySet, indices_t > FragmentFullKeysetMap_t; 57 61 58 62 /** Getter for full stored map. … … 62 66 const AtomFragmentsMap_t& getMap() const 63 67 { return atommap; } 68 69 /** Allows to add the full keyset, with excluded hydrogens, to add 70 * to a given \a _keyset 71 * 72 * \param _keyset keyset to a fragment without hydrogens 73 * \param _fullkeyset full keyset with excluded hydrogens to associate with \a _keyset 74 * \return true - insertion ok, else - index set already present 75 */ 76 bool addFullKeyset(const KeySet &_keyset, const indices_t &_fullkeyset); 77 78 /** Getter for the full key set, i.e. including excluded hydrogens, for a 79 * given \a _keyset without them. 80 * 81 * \param _keyset keyset to a fragment without hydrogens 82 * \return full index set containing all keys from \a _keyset and all excluded 83 * hydrogens 84 */ 85 const indices_t &getFullKeyset(const KeySet &_keyset) const; 64 86 65 87 /** Getter to map cut down to given selection of atoms. … … 72 94 const std::vector<atomId_t> &_candidates, 73 95 size_t _MaxOrder) const; 96 97 /** Checks whether we have a full keyset for every keyset contained. 98 * 99 * \return true - is complete, false - else 100 */ 101 bool checkCompleteness() const; 102 74 103 private: 75 104 //!> grant singleton pattern access to private cstor/dstor … … 87 116 88 117 private: 89 //!> internal map filled on instantiation118 //!> internal map associating atoms and fragments 90 119 AtomFragmentsMap_t atommap; 120 121 //!> internal map to get from keyset (without hydrogens) to full keyset, i.e. forcekeyset 122 FragmentFullKeysetMap_t fullkeysets; 91 123 92 124 private: … … 97 129 { 98 130 ar & atommap; 131 ar & fullkeysets; 99 132 } 100 133 };
Note:
See TracChangeset
for help on using the changeset viewer.