Changeset d0b375b
- 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
- Files:
-
- 4 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 }; -
src/molecule.hpp
rf67817f rd0b375b 225 225 void FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack); 226 226 molecule * StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem); 227 int LookForRemovalCandidate(KeySet *&Leaf, int *&ShortestPathList);228 227 int GuesstimateFragmentCount(int order); 229 228 -
src/molecule_fragmentation.cpp
rf67817f rd0b375b 516 516 }; 517 517 518 519 520 /** Looks through a std::deque<atom *> and returns the likeliest removal candiate.521 * \param *out output stream for debugging messages522 * \param *&Leaf KeySet to look through523 * \param *&ShortestPathList list of the shortest path to decide which atom to suggest as removal candidate in the end524 * \param index of the atom suggested for removal525 */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 removed533 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 stack537 if (ShortestPathList[(*runner)] > SP) { // remove the oldest one with longest shortest path538 SP = ShortestPathList[(*runner)];539 Removal = (*runner);540 }541 }542 }543 return Removal;544 };545 518 546 519 /** Initializes some value for putting fragment of \a *mol into \a *Leaf. … … 702 675 } 703 676 704 FragmentSearch.Init(FindAtom(RootKeyNr) , getAtomCount());677 FragmentSearch.Init(FindAtom(RootKeyNr)); 705 678 706 679 // 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.