Changeset 47d041 for src/Fragmentation/BondsPerShortestPath.cpp
- Timestamp:
- Nov 3, 2011, 7:44:01 PM (14 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, Candidate_v1.7.0, 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:
- 41a467
- Parents:
- 50e4e5
- git-author:
- Frederik Heber <heber@…> (10/27/11 11:53:58)
- git-committer:
- Frederik Heber <heber@…> (11/03/11 19:44:01)
- File:
-
- 1 edited
-
src/Fragmentation/BondsPerShortestPath.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/BondsPerShortestPath.cpp
r50e4e5 r47d041 21 21 22 22 #include "BondsPerShortestPath.hpp" 23 24 #include <sstream> 23 25 24 26 #include "CodePatterns/Log.hpp" … … 82 84 void BondsPerShortestPath::ResetSPList() 83 85 { 84 DoLog(0) && (Log() << Verbose(0) << "Free'ing all found lists. and resetting index lists" << endl); 86 LOG(0, "Free'ing all found lists. and resetting index lists"); 87 std::stringstream output; 85 88 for(int i=Order;i--;) { 86 DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << ": ");89 output << "Current SP level is " << i << ": "; 87 90 // delete added bonds 88 91 for (BondsPerSP::iterator iter = BondsPerSPList[i].begin(); … … 93 96 BondsPerSPList[i].clear(); 94 97 // also start and end node 95 DoLog(0) && (Log() << Verbose(0) << "cleaned." << endl); 96 } 98 output << "cleaned."; 99 } 100 LOG(1, output.str()); 97 101 }; 98 102 … … 120 124 int SP = -1; 121 125 122 DoLog(0) && (Log() << Verbose(0) << "Starting BFS analysis ..." << endl);126 LOG(0, "Starting BFS analysis ..."); 123 127 for (SP = 0; SP < (Order-1); SP++) { 124 DoLog(1) && (Log() << Verbose(1) << "New SP level reached: " << SP << ", creating new SP list with " << BondsPerSPCount[SP] << " item(s)"); 125 if (SP > 0) { 126 DoLog(0) && (Log() << Verbose(0) << ", old level closed with " << BondsPerSPCount[SP-1] << " item(s)." << endl); 127 BondsPerSPCount[SP] = 0; 128 } else 129 DoLog(0) && (Log() << Verbose(0) << "." << endl); 128 { 129 std::stringstream output; 130 output << "New SP level reached: " << SP << ", creating new SP list with " << BondsPerSPCount[SP] << " item(s)"; 131 if (SP > 0) { 132 output << ", old level closed with " << BondsPerSPCount[SP-1] << " item(s)."; 133 BondsPerSPCount[SP] = 0; 134 } else 135 output << "."; 136 LOG(1, output.str()); 137 } 130 138 131 139 RemainingWalkers = BondsPerSPCount[SP]; … … 137 145 Predecessor = (*CurrentEdge)->leftatom; // ... and leftatom is predecessor 138 146 AtomKeyNr = Walker->getNr(); 139 DoLog(0) && (Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->getNr() << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl);147 LOG(0, "Current Walker is: " << *Walker << " with nr " << Walker->getNr() << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level."); 140 148 // check for new sp level 141 149 // go through all its bonds 142 DoLog(1) && (Log() << Verbose(1) << "Going through all bonds of Walker." << endl);150 LOG(1, "Going through all bonds of Walker."); 143 151 const BondList& ListOfBonds = Walker->getListOfBonds(); 144 152 for (BondList::const_iterator Runner = ListOfBonds.begin(); … … 149 157 // skip hydrogens if desired and restrict to fragment 150 158 && ((saturation == DontSaturate) || (OtherWalker->getType()->getAtomicNumber() != 1))) { 151 DoLog(2) && (Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << "." << endl);159 LOG(2, "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << "."); 152 160 // set the label if not set (and push on root stack as well) 153 161 if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->getNr() > RootKeyNr)) { // only pass through those with label bigger than Root's … … 156 164 BondsPerSPList[SP+1].push_back(Binder); 157 165 BondsPerSPCount[SP+1]++; 158 DoLog(3) && (Log() << Verbose(3) << "Added its bond to SP list, having now " << BondsPerSPCount[SP+1] << " item(s)." << endl);166 LOG(3, "Added its bond to SP list, having now " << BondsPerSPCount[SP+1] << " item(s)."); 159 167 } else { 160 168 if (OtherWalker != Predecessor) 161 DoLog(3) && (Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->getNr() << " is smaller than that of Root " << RootKeyNr << "." << endl);169 LOG(3, "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->getNr() << " is smaller than that of Root " << RootKeyNr << "."); 162 170 else 163 DoLog(3) && (Log() << Verbose(3) << "This is my predecessor " << *Predecessor << "." << endl);171 LOG(3, "This is my predecessor " << *Predecessor << "."); 164 172 } 165 } else L og() << Verbose(2) << "Is not in the restricted keyset or skipping hydrogen " << *OtherWalker << "." << endl;173 } else LOG(2, "Is not in the restricted keyset or skipping hydrogen " << *OtherWalker << "."); 166 174 } 167 175 } … … 173 181 void BondsPerShortestPath::OutputSPList() 174 182 { 175 DoLog(0) && (Log() << Verbose(0) << "Printing all found lists." << endl);183 LOG(0, "Printing all found lists."); 176 184 for(int i=1;i<Order;i++) { // skip the root edge in the printing 177 DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << "." << endl);185 LOG(1, "Current SP level is " << i << "."); 178 186 for (BondsPerShortestPath::BondsPerSP::const_iterator Binder = BondsPerSPList[i].begin(); 179 187 Binder != BondsPerSPList[i].end(); 180 188 ++Binder) { 181 DoLog(2) && (Log() << Verbose(2) << *Binder << endl);189 LOG(2, *Binder); 182 190 } 183 191 }
Note:
See TracChangeset
for help on using the changeset viewer.
