Ignore:
Timestamp:
Oct 25, 2011, 12:08:02 PM (13 years ago)
Author:
Frederik Heber <heber@…>
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:
708798
Parents:
5fd0f4
git-author:
Frederik Heber <heber@…> (10/17/11 15:23:42)
git-committer:
Frederik Heber <heber@…> (10/25/11 12:08:02)
Message:

Rewrite of CheckAgainstAdjacencyFile.

  • we now construct two multimaps -- one from file, the other from World's selected atoms -- and compare these two.
  • added unit test on the class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/CheckAgainstAdjacencyFile.hpp

    r5fd0f4 rec87e4  
    1616#include <iosfwd>
    1717#include <map>
     18#include <set>
     19
     20#include "types.hpp"
     21#include "World.hpp"
    1822
    1923class atom;
     
    2125class CheckAgainstAdjacencyFile
    2226{
     27  //!> Unit test is granted access to internal data
     28  friend class CheckAgainstAdjacencyFileTest;
    2329public:
    24   CheckAgainstAdjacencyFile();
     30  CheckAgainstAdjacencyFile(World::AtomSet::const_iterator AtomMapBegin, World::AtomSet::const_iterator AtomMapEnd);
    2531  ~CheckAgainstAdjacencyFile();
    2632
    27   bool operator()(std::ifstream &File, std::map<int, atom*> ListOfAtoms);
     33  bool operator()(std::istream &File);
    2834
    2935private:
    30   enum {MAXBONDS=8};
    31 
    32   int *CurrentBonds;
     36  typedef std::set<atomId_t> KeysSet;
     37  typedef std::set<atomId_t> ValuesSet;
     38  typedef std::pair<atomId_t, atomId_t> AtomBondPair;
     39  typedef std::multimap< atomId_t, atomId_t > AtomBondMap;
     40  typedef std::pair<AtomBondMap::const_iterator, AtomBondMap::const_iterator> AtomBondRange;
     41  AtomBondMap InternalAtomBondMap;
     42  AtomBondMap ExternalAtomBondMap;
    3343  bool status;
    3444  int NonMatchNumber;
    3545
    36   void CompareBonds(const atom *&Walker, size_t &CurrentBondsOfAtom, int AtomNr, std::map<int, atom*> &ListOfAtoms);
     46  void CreateInternalMap(World::AtomSet::const_iterator &AtomMapBegin, World::AtomSet::const_iterator &AtomMapEnd);
     47  bool ParseInExternalMap(std::istream &File);
     48  bool CompareInternalExternalMap();
    3749};
    3850
Note: See TracChangeset for help on using the changeset viewer.