Changeset 70aeed for src/Fragmentation


Ignore:
Timestamp:
May 18, 2016, 10:02:07 PM (9 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, 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)
Message:

Added additional "force" keysets to AtomFragmentsMap.

Location:
src/Fragmentation/Homology
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Homology/AtomFragmentsMap.cpp

    rd410e25 r70aeed  
    6969      }
    7070    }
     71    // add empty entry to fullkeysets, too (if already present, we ignore that)
     72    fullkeysets.insert( std::make_pair(keyset, indices_t()) );
    7173  }
    7274  LOG(2, "DEBUG: There are now " << atommap.size() << " entries in lookup.");
     
    109111}
    110112
     113bool 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
     124const AtomFragmentsMap::indices_t &
     125AtomFragmentsMap::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
     135bool 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
    111145CONSTRUCT_SINGLETON(AtomFragmentsMap)
    112146
  • src/Fragmentation/Homology/AtomFragmentsMap.hpp

    rd410e25 r70aeed  
    1919#include <list>
    2020#include <map>
     21#include <vector>
    2122
    2223#include <boost/serialization/export.hpp>
    23 #include <boost/serialization/set.hpp>
    2424#include <boost/serialization/list.hpp>
    2525#include <boost/serialization/map.hpp>
     26#include <boost/serialization/set.hpp>
     27#include <boost/serialization/vector.hpp>
    2628#include <boost/serialization/version.hpp>
    2729
     
    5254  { atommap.clear(); }
    5355
     56  typedef std::vector<atomId_t> indices_t;
    5457  typedef std::list<KeySet> keysets_t;
    5558  //!> typedef for the internal map
    5659  typedef std::map<atomId_t, keysets_t> AtomFragmentsMap_t;
     60  typedef std::map<KeySet, indices_t > FragmentFullKeysetMap_t;
    5761
    5862  /** Getter for full stored map.
     
    6266  const AtomFragmentsMap_t& getMap() const
    6367  { 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;
    6486
    6587  /** Getter to map cut down to given selection of atoms.
     
    7294      const std::vector<atomId_t> &_candidates,
    7395      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
    74103private:
    75104  //!> grant singleton pattern access to private cstor/dstor
     
    87116
    88117private:
    89   //!> internal map filled on instantiation
     118  //!> internal map associating atoms and fragments
    90119  AtomFragmentsMap_t atommap;
     120
     121  //!> internal map to get from keyset (without hydrogens) to full keyset, i.e. forcekeyset
     122  FragmentFullKeysetMap_t fullkeysets;
    91123
    92124private:
     
    97129  {
    98130    ar & atommap;
     131    ar & fullkeysets;
    99132  }
    100133};
Note: See TracChangeset for help on using the changeset viewer.