- Timestamp:
- Mar 2, 2011, 9:53:08 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, 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:
- 111387
- Parents:
- 766ba5
- git-author:
- Frederik Heber <heber@…> (02/25/11 19:58:54)
- git-committer:
- Frederik Heber <heber@…> (03/02/11 21:53:08)
- Location:
- src/Graph
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Graph/BondGraph.cpp
r766ba5 r129204 23 23 24 24 #include "atom.hpp" 25 #include " bond.hpp"25 #include "Bond/bond.hpp" 26 26 #include "Graph/BondGraph.hpp" 27 27 #include "Box.hpp" -
src/Graph/BondGraph.hpp
r766ba5 r129204 21 21 22 22 #include "AtomSet.hpp" 23 #include " bond.hpp"23 #include "Bond/bond.hpp" 24 24 #include "CodePatterns/Assert.hpp" 25 25 #include "CodePatterns/Log.hpp" -
src/Graph/BreadthFirstSearchAdd.cpp
r766ba5 r129204 23 23 24 24 #include "atom.hpp" 25 #include " bond.hpp"25 #include "Bond/bond.hpp" 26 26 #include "CodePatterns/Assert.hpp" 27 27 #include "CodePatterns/Info.hpp" … … 57 57 ShortestPathList[atom_id] = -1; 58 58 if (AddedAtomList.find(atom_id) != AddedAtomList.end()) // mark already present atoms (i.e. Root and maybe others) as visited 59 ColorList[atom_id] = bond::lightgray;59 ColorList[atom_id] = GraphEdge::lightgray; 60 60 else 61 ColorList[atom_id] = bond::white;61 ColorList[atom_id] = GraphEdge::white; 62 62 } 63 63 … … 65 65 void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond) 66 66 { 67 if (Binder != Bond) // let other atom bond::white if it's via Root bond. In case it's cyclic it has to be reached again (yet Root is from OtherAtom already bond::black, thus no problem)68 ColorList[OtherAtom->getNr()] = bond::lightgray;67 if (Binder != Bond) // let other atom GraphEdge::white if it's via Root bond. In case it's cyclic it has to be reached again (yet Root is from OtherAtom already GraphEdge::black, thus no problem) 68 ColorList[OtherAtom->getNr()] = GraphEdge::lightgray; 69 69 PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor 70 70 ShortestPathList[OtherAtom->getNr()] = ShortestPathList[Walker->getNr()] + 1; 71 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << Binder->getColorName(ColorList[OtherAtom->getNr()]) << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl);71 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << GraphEdge::getColorName(ColorList[OtherAtom->getNr()]) << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl); 72 72 if ((((ShortestPathList[OtherAtom->getNr()] < BondOrder) && (Binder != Bond)))) { // Check for maximum distance 73 73 DoLog(3) && (Log() << Verbose(3)); … … 77 77 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->getNr()], AddedAtomList[OtherAtom->getNr()], Binder); 78 78 DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", "); 79 } else { // this code should actually never come into play (all bond::white atoms are not yet present in BondMolecule, that's why they are bond::white in the first place)79 } else { // this code should actually never come into play (all GraphEdge::white atoms are not yet present in BondMolecule, that's why they are GraphEdge::white in the first place) 80 80 DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName()); 81 81 if (AddedBondList[Binder->nr] == NULL) { … … 89 89 } else { // out of bond order, then replace 90 90 if ((AddedAtomList[OtherAtom->getNr()] == NULL) && (Binder->Cyclic)) 91 ColorList[OtherAtom->getNr()] = bond::white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)91 ColorList[OtherAtom->getNr()] = GraphEdge::white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic) 92 92 if (Binder == Bond) 93 93 DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond"); … … 139 139 Init(_Root, _BondOrder); 140 140 141 // and go on ... Queue always contains all bond::lightgray vertices141 // and go on ... Queue always contains all GraphEdge::lightgray vertices 142 142 while (!BFSStack.empty()) { 143 143 // we have to pop the oldest atom from stack. This keeps the atoms on the stack always of the same ShortestPath distance. … … 156 156 OtherAtom = (*Runner)->GetOtherAtom(Walker); 157 157 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 158 if (ColorList[OtherAtom->getNr()] == bond::white) {158 if (ColorList[OtherAtom->getNr()] == GraphEdge::white) { 159 159 UnvisitedNode(Mol, Walker, OtherAtom, Binder, Bond); 160 160 } else { … … 163 163 } 164 164 } 165 ColorList[Walker->getNr()] = bond::black;166 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " bond::black." << endl);165 ColorList[Walker->getNr()] = GraphEdge::black; 166 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " GraphEdge::black." << endl); 167 167 } 168 168 } -
src/Graph/BreadthFirstSearchAdd.hpp
r766ba5 r129204 20 20 #include "types.hpp" 21 21 22 #include " bond.hpp"22 #include "Bond/bond.hpp" 23 23 24 24 class atom; … … 60 60 std::map<atomId_t, atom *> PredecessorList; 61 61 std::map<atomId_t, int > ShortestPathList; 62 std::map<atomId_t, enum bond::Shading> ColorList;62 std::map<atomId_t, enum GraphEdge::Shading> ColorList; 63 63 std::deque<atom *> BFSStack; 64 64 int BondOrder;
Note:
See TracChangeset
for help on using the changeset viewer.