Changeset d0b375b for src/Fragmentation
- Timestamp:
- Oct 25, 2011, 12:08:03 PM (13 years ago)
- 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)
- Location:
- src/Fragmentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/UniqueFragments.cpp
rf67817f rd0b375b 81 81 82 82 /** Sets FragmenSearch to initial value. 83 * Sets UniqueFragments:: ShortestPathList entries to zero, UniqueFragments::BondsPerSPCount to zero (except zero level to 1) and84 * adds initial bondUniqueFragments::Root to UniqueFragments::Root to UniqueFragments::BondsPerSPList83 * Sets UniqueFragments::BondsPerSPCount to zero (except zero level to 1) and adds initial bond 84 * UniqueFragments::Root to UniqueFragments::Root to UniqueFragments::BondsPerSPList 85 85 * \param Order bond order (limits BFS exploration and "number of digits" in power set generation 86 86 * \sa UniqueFragments::FreeSPList() … … 88 88 void UniqueFragments::SetSPList(int Order) 89 89 { 90 // prepare Label and SP arrays of the BFS search91 ShortestPathList[Root->getNr()] = 0;92 93 90 // prepare root level (SP = 0) and a loop bond denoting Root 94 91 for (int i=Order;i--;) … … 99 96 }; 100 97 101 /** Resets UniqueFragments::ShortestPathList and cleans bonds from UniqueFragments::BondsPerSPList.98 /** Cleans bonds from UniqueFragments::BondsPerSPList. 102 99 * \param Order bond order (limits BFS exploration and "number of digits" in power set generation 103 100 * \sa UniqueFragments::InitialiseSPList() … … 108 105 for(int i=Order;i--;) { 109 106 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 local114 ShortestPathList[(*iter)->leftatom->getNr()] = -1;115 ShortestPathList[(*iter)->rightatom->getNr()] = -1;116 }117 107 // delete added bonds 118 108 for (UniqueFragments::BondsPerSP::iterator iter = BondsPerSPList[i].begin(); … … 183 173 // set the label if not set (and push on root stack as well) 184 174 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);187 175 // add the bond in between to the SP list 188 176 Binder = new bond(Walker, OtherWalker); // create a new bond in such a manner, that bond::rightatom is always the one more distant … … 239 227 * \param AtomCount number of nodes/atoms 240 228 */ 241 void UniqueFragments::Init(atom *_Root , size_t AtomCount)229 void UniqueFragments::Init(atom *_Root) 242 230 { 243 231 // initialise the fragments structure … … 245 233 FragmentSet = new KeySet; 246 234 Root = _Root; 247 ShortestPathList = new int[AtomCount];248 for (int i=AtomCount;i--;) {249 ShortestPathList[i] = -1;250 }251 235 } 252 236 … … 256 240 void UniqueFragments::Cleanup() 257 241 { 258 delete[](ShortestPathList);259 242 delete(FragmentSet); 260 243 } -
src/Fragmentation/UniqueFragments.hpp
rf67817f rd0b375b 42 42 void OutputSPList(int Order); 43 43 int CountNumbersInBondsList(int Order); 44 void Init(atom *_Root , size_t AtomCount);44 void Init(atom *_Root); 45 45 void Cleanup(); 46 46 … … 62 62 int ANOVAOrder; 63 63 int CurrentIndex; 64 int *ShortestPathList;65 64 bool **UsedList; 66 65 };
Note:
See TracChangeset
for help on using the changeset viewer.