Changeset d0b375b


Ignore:
Timestamp:
Oct 25, 2011, 12:08:03 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:
212c179
Parents:
f67817f
git-author:
Frederik Heber <heber@…> (10/18/11 13:28:37)
git-committer:
Frederik Heber <heber@…> (10/25/11 12:08:03)
Message:

Removed ShortestPathList.

  • there have been references in the code that ShortestPathList is probably obsolete meanwhile (seemingly it is).
Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/UniqueFragments.cpp

    rf67817f rd0b375b  
    8181
    8282/** Sets FragmenSearch to initial value.
    83  * Sets UniqueFragments::ShortestPathList entries to zero, UniqueFragments::BondsPerSPCount to zero (except zero level to 1) and
    84  * adds initial bond UniqueFragments::Root to UniqueFragments::Root to UniqueFragments::BondsPerSPList
     83 * Sets UniqueFragments::BondsPerSPCount to zero (except zero level to 1) and adds initial bond
     84 * UniqueFragments::Root to UniqueFragments::Root to UniqueFragments::BondsPerSPList
    8585 * \param Order bond order (limits BFS exploration and "number of digits" in power set generation
    8686 * \sa UniqueFragments::FreeSPList()
     
    8888void UniqueFragments::SetSPList(int Order)
    8989{
    90   // prepare Label and SP arrays of the BFS search
    91   ShortestPathList[Root->getNr()] = 0;
    92 
    9390  // prepare root level (SP = 0) and a loop bond denoting Root
    9491  for (int i=Order;i--;)
     
    9996};
    10097
    101 /** Resets UniqueFragments::ShortestPathList and cleans bonds from UniqueFragments::BondsPerSPList.
     98/** Cleans bonds from UniqueFragments::BondsPerSPList.
    10299 * \param Order bond order (limits BFS exploration and "number of digits" in power set generation
    103100 * \sa UniqueFragments::InitialiseSPList()
     
    108105  for(int i=Order;i--;) {
    109106    DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << ": ");
    110     for (UniqueFragments::BondsPerSP::const_iterator iter = BondsPerSPList[i].begin();
    111         iter != BondsPerSPList[i].end();
    112         ++iter) {
    113       // Log() << Verbose(0) << "Removing atom " << Binder->leftatom->getNr() << " and " << Binder->rightatom->getNr() << "." << endl; // make sure numbers are local
    114       ShortestPathList[(*iter)->leftatom->getNr()] = -1;
    115       ShortestPathList[(*iter)->rightatom->getNr()] = -1;
    116     }
    117107    // delete added bonds
    118108    for (UniqueFragments::BondsPerSP::iterator iter = BondsPerSPList[i].begin();
     
    183173          // set the label if not set (and push on root stack as well)
    184174          if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->getNr() > RootKeyNr)) { // only pass through those with label bigger than Root's
    185             ShortestPathList[OtherWalker->getNr()] = SP+1;
    186             DoLog(3) && (Log() << Verbose(3) << "Set Shortest Path to " << ShortestPathList[OtherWalker->getNr()] << "." << endl);
    187175            // add the bond in between to the SP list
    188176            Binder = new bond(Walker, OtherWalker); // create a new bond in such a manner, that bond::rightatom is always the one more distant
     
    239227 * \param AtomCount number of nodes/atoms
    240228 */
    241 void UniqueFragments::Init(atom *_Root, size_t AtomCount)
     229void UniqueFragments::Init(atom *_Root)
    242230{
    243231  // initialise the fragments structure
     
    245233  FragmentSet = new KeySet;
    246234  Root = _Root;
    247   ShortestPathList = new int[AtomCount];
    248   for (int i=AtomCount;i--;) {
    249     ShortestPathList[i] = -1;
    250   }
    251235}
    252236
     
    256240void UniqueFragments::Cleanup()
    257241{
    258   delete[](ShortestPathList);
    259242  delete(FragmentSet);
    260243}
  • src/Fragmentation/UniqueFragments.hpp

    rf67817f rd0b375b  
    4242  void OutputSPList(int Order);
    4343  int CountNumbersInBondsList(int Order);
    44   void Init(atom *_Root, size_t AtomCount);
     44  void Init(atom *_Root);
    4545  void Cleanup();
    4646
     
    6262  int ANOVAOrder;
    6363  int CurrentIndex;
    64   int *ShortestPathList;
    6564  bool **UsedList;
    6665};
  • src/molecule.hpp

    rf67817f rd0b375b  
    225225  void FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack);
    226226  molecule * StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem);
    227   int LookForRemovalCandidate(KeySet *&Leaf, int *&ShortestPathList);
    228227  int GuesstimateFragmentCount(int order);
    229228
  • src/molecule_fragmentation.cpp

    rf67817f rd0b375b  
    516516};
    517517
    518 
    519 
    520 /** Looks through a std::deque<atom *> and returns the likeliest removal candiate.
    521  * \param *out output stream for debugging messages
    522  * \param *&Leaf KeySet to look through
    523  * \param *&ShortestPathList list of the shortest path to decide which atom to suggest as removal candidate in the end
    524  * \param index of the atom suggested for removal
    525  */
    526 int molecule::LookForRemovalCandidate(KeySet *&Leaf, int *&ShortestPathList)
    527 {
    528   atom *Runner = NULL;
    529   int SP, Removal;
    530 
    531   DoLog(2) && (Log() << Verbose(2) << "Looking for removal candidate." << endl);
    532   SP = -1; //0;  // not -1, so that Root is never removed
    533   Removal = -1;
    534   for (KeySet::iterator runner = Leaf->begin(); runner != Leaf->end(); runner++) {
    535     Runner = FindAtom((*runner));
    536     if (Runner->getType()->getAtomicNumber() != 1) { // skip all those added hydrogens when re-filling snake stack
    537       if (ShortestPathList[(*runner)] > SP) {  // remove the oldest one with longest shortest path
    538         SP = ShortestPathList[(*runner)];
    539         Removal = (*runner);
    540       }
    541     }
    542   }
    543   return Removal;
    544 };
    545518
    546519/** Initializes some value for putting fragment of \a *mol into \a *Leaf.
     
    702675  }
    703676
    704   FragmentSearch.Init(FindAtom(RootKeyNr), getAtomCount());
     677  FragmentSearch.Init(FindAtom(RootKeyNr));
    705678
    706679  // Construct the complete KeySet which we need for topmost level only (but for all Roots)
Note: See TracChangeset for help on using the changeset viewer.