- 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
- Files:
-
- 2 added
- 26 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/CreateAdjacencyAction.cpp
r766ba5 r129204 24 24 25 25 #include "atom.hpp" 26 #include "bond.hpp" 27 #include "Graph/BondGraph.hpp" 26 #include "Bond/bond.hpp" 28 27 #include "CodePatterns/Log.hpp" 29 28 #include "CodePatterns/Range.hpp" 30 29 #include "CodePatterns/Verbose.hpp" 31 30 #include "config.hpp" 31 #include "Graph/BondGraph.hpp" 32 32 #include "linkedcell.hpp" 33 33 #include "molecule.hpp" -
src/Actions/FragmentationAction/SubgraphDissectionAction.cpp
r766ba5 r129204 24 24 25 25 #include "atom.hpp" 26 #include "bond.hpp" 27 #include "Graph/BondGraph.hpp" 26 #include "Bond/bond.hpp" 28 27 #include "config.hpp" 29 28 #include "CodePatterns/Log.hpp" 30 29 #include "CodePatterns/Verbose.hpp" 30 #include "Graph/BondGraph.hpp" 31 31 #include "molecule.hpp" 32 32 #include "World.hpp" -
src/Actions/MoleculeAction/CopyAction.cpp
r766ba5 r129204 24 24 #include "LinearAlgebra/Vector.hpp" 25 25 #include "atom.hpp" 26 #include " bond.hpp"26 #include "Bond/bond.hpp" 27 27 #include "molecule.hpp" 28 28 #include "World.hpp" -
src/Bond/bond.cpp
r766ba5 r129204 6 6 */ 7 7 8 /** \file bond.cpp8 /** \file Bond.cpp 9 9 * 10 10 * Function implementations for the classes BondLeaf, BondTree and bond. … … 22 22 #include "CodePatterns/Verbose.hpp" 23 23 #include "atom.hpp" 24 #include " bond.hpp"24 #include "Bond/bond.hpp" 25 25 #include "element.hpp" 26 26 … … 35 35 HydrogenBond(0), 36 36 BondDegree(0), 37 nr(-1), 38 Cyclic(false), 39 Type(Undetermined), 40 Used(white) 37 nr(-1) 41 38 {}; 42 39 … … 52 49 HydrogenBond(0), 53 50 BondDegree(degree), 54 nr(number), 55 Cyclic(false), 56 Type(Undetermined), 57 Used(white) 51 nr(number) 58 52 { 59 53 if ((left != NULL) && (right != NULL)) { … … 97 91 98 92 99 /** Returns whether vertex was used in DFS.100 * \return bond::Used101 */102 enum bond::Shading bond::IsUsed()103 {104 return Used;105 };106 107 93 /** Checks if an atom exists in a bond. 108 94 * \param *ptr pointer to atom … … 123 109 }; 124 110 125 /** Masks vertex as used in DFS.126 * \return bond::Used, false if bond was already marked used127 */128 bool bond::MarkUsed(const enum Shading color) {129 if (Used == black) {130 DoeLog(1) && (eLog()<< Verbose(1) << "Bond " << this << " was already marked black!." << endl);131 return false;132 } else {133 Used = color;134 return true;135 }136 };137 138 /** Resets used flag in DFS.139 * \return bond::Used140 */141 void bond::ResetUsed() {142 Used = white;143 };144 145 111 /** Calculates the bond length. 146 112 * \return |a - b| with a = bond::leftatom and b = bond::rightatom. … … 158 124 return (leftatom->DistanceSquared(*rightatom)); 159 125 }; 160 161 /** Returns Shading as a char string.162 * \param color the Shading163 * \return string of the flag164 */165 string bond::getColorName(enum Shading color)166 {167 switch (color) {168 case white:169 return "white";170 break;171 case lightgray:172 return "lightgray";173 break;174 case darkgray:175 return "darkgray";176 break;177 case black:178 return "black";179 break;180 default:181 return "uncolored";182 break;183 };184 } -
src/Bond/bond.hpp
r766ba5 r129204 1 1 /* 2 * bond.hpp2 * Bond.hpp 3 3 * 4 4 * Created on: Aug 3, 2009 … … 18 18 #endif 19 19 20 #include "Bond/GraphEdge.hpp" 21 20 22 /****************************************** forward declarations *****************************/ 21 23 … … 28 30 * Class incorporates bonds between atoms in a molecule. 29 31 * Note that we regard bond always as something in a molecule, 30 * as it is the glue making up the connected subgrap gh and32 * as it is the glue making up the connected subgraph and 31 33 * hence the molecule. Thus, bonds belong globally to the molecule 32 * (and are free'd there) and only locally to the atom class s.34 * (and are free'd there) and only locally to the atom class. 33 35 */ 34 class bond { 36 class bond : public GraphEdge 37 { 35 38 public: 36 enum EdgeType { Undetermined, TreeEdge, BackEdge }; //!< edge type in a graph after Depth-First-Search analysis.37 38 enum Shading { white, lightgray, darkgray, black }; //!< color in Breadth-First-Search analysis39 40 39 atom *leftatom; //!< first bond partner 41 40 atom *rightatom; //!< second bond partner … … 43 42 int BondDegree; //!< single, double, triple, ... bond 44 43 int nr; //!< unique number in a molecule, updated by BondGraph::CreateAdjacencyForList() 45 bool Cyclic; //!< flag whether bond is part of a cycle or not, given in DepthFirstSearchAnalysis()46 enum EdgeType Type;//!< whether this is a tree or back edge47 44 48 45 atom * GetOtherAtom(const ParticleInfo * const Atom) const; 49 46 50 bool MarkUsed(const enum Shading color);51 enum Shading IsUsed();52 void ResetUsed();53 47 bool Contains(const ParticleInfo * const ptr); 54 48 bool Contains(const int nr); … … 60 54 ~bond(); 61 55 62 static std::string getColorName(enum Shading color);63 64 private:65 enum Shading Used; //!< marker in depth-first search, DepthFirstSearchAnalysis()66 56 }; 67 57 -
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; -
src/Makefile.am
r766ba5 r129204 70 70 Actions/Process.hpp 71 71 72 BONDSOURCE = \ 73 Bond/bond.cpp \ 74 Bond/GraphEdge.cpp 75 76 BONDHEADER = \ 77 Bond/bond.hpp \ 78 Bond/GraphEdge.hpp 72 79 73 80 DESCRIPTORSOURCE = \ … … 179 186 ${ACTIONSSOURCE} \ 180 187 ${ATOMSOURCE} \ 188 ${BONDSOURCE} \ 181 189 ${DESCRIPTORSOURCE} \ 182 190 ${DYNAMICSSOURCE} \ … … 187 195 Helpers/defs.cpp \ 188 196 Helpers/helpers.cpp \ 189 bond.cpp \190 197 boundary.cpp \ 191 198 Box.cpp \ … … 215 222 ${ACTIONSHEADER} \ 216 223 ${ATOMHEADER} \ 224 ${BONDHEADER} \ 217 225 ${DESCRIPTORHEADER} \ 218 226 ${DESCRIPTORIMPLHEADER} \ … … 225 233 Helpers/fast_functions.hpp \ 226 234 Helpers/helpers.hpp \ 227 bond.hpp \228 235 boundary.hpp \ 229 236 Box.hpp \ -
src/Parser/PdbParser.cpp
r766ba5 r129204 27 27 #include "World.hpp" 28 28 #include "atom.hpp" 29 #include " bond.hpp"29 #include "Bond/bond.hpp" 30 30 #include "element.hpp" 31 31 #include "molecule.hpp" -
src/Parser/TremoloParser.cpp
r766ba5 r129204 28 28 #include "WorldTime.hpp" 29 29 #include "atom.hpp" 30 #include " bond.hpp"30 #include "Bond/bond.hpp" 31 31 #include "element.hpp" 32 32 #include "molecule.hpp" -
src/analysis_bonds.cpp
r766ba5 r129204 22 22 #include "analysis_bonds.hpp" 23 23 #include "atom.hpp" 24 #include " bond.hpp"24 #include "Bond/bond.hpp" 25 25 #include "element.hpp" 26 26 #include "CodePatterns/Info.hpp" -
src/analysis_correlation.cpp
r766ba5 r129204 24 24 25 25 #include "atom.hpp" 26 #include " bond.hpp"26 #include "Bond/bond.hpp" 27 27 #include "BoundaryTriangleSet.hpp" 28 28 #include "Box.hpp" -
src/atom.cpp
r766ba5 r129204 20 20 21 21 #include "atom.hpp" 22 #include " bond.hpp"22 #include "Bond/bond.hpp" 23 23 #include "CodePatterns/Log.hpp" 24 24 #include "config.hpp" -
src/atom_bondedparticle.cpp
r766ba5 r129204 22 22 #include "atom.hpp" 23 23 #include "atom_bondedparticle.hpp" 24 #include " bond.hpp"24 #include "Bond/bond.hpp" 25 25 #include "CodePatterns/Assert.hpp" 26 26 #include "CodePatterns/Log.hpp" -
src/boundary.cpp
r766ba5 r129204 19 19 20 20 #include "atom.hpp" 21 #include " bond.hpp"21 #include "Bond/bond.hpp" 22 22 #include "boundary.hpp" 23 23 #include "BoundaryLineSet.hpp" -
src/config.cpp
r766ba5 r129204 25 25 #include <string> 26 26 27 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"28 27 #include "atom.hpp" 29 #include "bond.hpp" 30 #include "Graph/BondGraph.hpp" 28 #include "Bond/bond.hpp" 29 #include "Box.hpp" 30 #include "CodePatterns/Info.hpp" 31 #include "CodePatterns/Log.hpp" 32 #include "CodePatterns/toString.hpp" 33 #include "CodePatterns/Verbose.hpp" 31 34 #include "config.hpp" 32 35 #include "ConfigFileBuffer.hpp" 33 36 #include "element.hpp" 34 37 #include "Helpers/helpers.hpp" 35 #include "CodePatterns/Info.hpp" 36 #include "CodePatterns/Log.hpp" 37 #include "CodePatterns/toString.hpp" 38 #include "CodePatterns/Verbose.hpp" 38 #include "Graph/BondGraph.hpp" 39 #include "LinearAlgebra/RealSpaceMatrix.hpp" 39 40 #include "molecule.hpp" 40 41 #include "molecule.hpp" … … 42 43 #include "ThermoStatContainer.hpp" 43 44 #include "World.hpp" 44 #include "LinearAlgebra/RealSpaceMatrix.hpp"45 #include "Box.hpp"46 45 47 46 /************************************* Functions for class config ***************************/ -
src/graph.cpp
r766ba5 r129204 22 22 23 23 #include "atom.hpp" 24 #include " bond.hpp"24 #include "Bond/bond.hpp" 25 25 #include "config.hpp" 26 26 #include "graph.hpp" -
src/molecule.cpp
r766ba5 r129204 27 27 28 28 #include "atom.hpp" 29 #include "bond.hpp" 30 #include "Graph/BondGraph.hpp" 29 #include "Bond/bond.hpp" 31 30 #include "Box.hpp" 32 31 #include "CodePatterns/enumeration.hpp" … … 36 35 #include "Exceptions/LinearDependenceException.hpp" 37 36 #include "graph.hpp" 37 #include "Graph/BondGraph.hpp" 38 38 #include "Helpers/helpers.hpp" 39 39 #include "LinearAlgebra/leastsquaremin.hpp" … … 400 400 Binder = AddBond(BottomOrigin, FirstOtherAtom, 1); 401 401 Binder->Cyclic = false; 402 Binder->Type = bond::TreeEdge;402 Binder->Type = GraphEdge::TreeEdge; 403 403 break; 404 404 case 2: … … 496 496 Binder = AddBond(BottomOrigin, FirstOtherAtom, 1); 497 497 Binder->Cyclic = false; 498 Binder->Type = bond::TreeEdge;498 Binder->Type = GraphEdge::TreeEdge; 499 499 Binder = AddBond(BottomOrigin, SecondOtherAtom, 1); 500 500 Binder->Cyclic = false; 501 Binder->Type = bond::TreeEdge;501 Binder->Type = GraphEdge::TreeEdge; 502 502 break; 503 503 case 3: … … 579 579 Binder = AddBond(BottomOrigin, FirstOtherAtom, 1); 580 580 Binder->Cyclic = false; 581 Binder->Type = bond::TreeEdge;581 Binder->Type = GraphEdge::TreeEdge; 582 582 Binder = AddBond(BottomOrigin, SecondOtherAtom, 1); 583 583 Binder->Cyclic = false; 584 Binder->Type = bond::TreeEdge;584 Binder->Type = GraphEdge::TreeEdge; 585 585 Binder = AddBond(BottomOrigin, ThirdOtherAtom, 1); 586 586 Binder->Cyclic = false; 587 Binder->Type = bond::TreeEdge;587 Binder->Type = GraphEdge::TreeEdge; 588 588 break; 589 589 default: -
src/molecule_fragmentation.cpp
r766ba5 r129204 22 22 #include <cstring> 23 23 24 #include "World.hpp"25 24 #include "atom.hpp" 26 #include "bond.hpp" 27 #include "Graph/BondGraph.hpp" 25 #include "Bond/bond.hpp" 26 #include "Box.hpp" 27 #include "CodePatterns/Verbose.hpp" 28 #include "CodePatterns/Log.hpp" 28 29 #include "config.hpp" 29 30 #include "element.hpp" 30 31 #include "Helpers/helpers.hpp" 31 #include " CodePatterns/Verbose.hpp"32 #include " CodePatterns/Log.hpp"32 #include "Graph/BondGraph.hpp" 33 #include "LinearAlgebra/RealSpaceMatrix.hpp" 33 34 #include "molecule.hpp" 34 35 #include "periodentafel.hpp" 35 36 #include "World.hpp" 36 #include "LinearAlgebra/RealSpaceMatrix.hpp"37 #include "Box.hpp"38 37 39 38 /************************************* Functions for class molecule *********************************/ … … 1783 1782 atom *OtherWalker = NULL; 1784 1783 RealSpaceMatrix matrix = World::getInstance().getDomain().getM(); 1785 enum bond::Shading *ColorList = NULL;1784 enum GraphEdge::Shading *ColorList = NULL; 1786 1785 double tmp; 1787 1786 //bool LastBond = true; // only needed to due list construct … … 1794 1793 DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl); 1795 1794 1796 ColorList = new enum bond::Shading[getAtomCount()];1795 ColorList = new enum GraphEdge::Shading[getAtomCount()]; 1797 1796 for (int i=0;i<getAtomCount();i++) 1798 ColorList[i] = (enum bond::Shading)0;1797 ColorList[i] = (enum GraphEdge::Shading)0; 1799 1798 if (flag) { 1800 1799 // remove bonds that are beyond bonddistance … … 1836 1835 // apply to all atoms of first component via BFS 1837 1836 for (int i=getAtomCount();i--;) 1838 ColorList[i] = bond::white;1837 ColorList[i] = GraphEdge::white; 1839 1838 AtomStack->push_front(Binder->leftatom); 1840 1839 while (!AtomStack->empty()) { … … 1842 1841 AtomStack->pop_front(); 1843 1842 //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl; 1844 ColorList[Walker->getNr()] = bond::black; // mark as explored1843 ColorList[Walker->getNr()] = GraphEdge::black; // mark as explored 1845 1844 *Walker += Translationvector; // translate 1846 1845 const BondList& ListOfBonds = Walker->getListOfBonds(); … … 1850 1849 if ((*Runner) != Binder) { 1851 1850 OtherWalker = (*Runner)->GetOtherAtom(Walker); 1852 if (ColorList[OtherWalker->getNr()] == bond::white) {1851 if (ColorList[OtherWalker->getNr()] == GraphEdge::white) { 1853 1852 AtomStack->push_front(OtherWalker); // push if yet unexplored 1854 1853 } -
src/molecule_geometry.cpp
r766ba5 r129204 20 20 #include "CodePatterns/MemDebug.hpp" 21 21 22 #include "Helpers/helpers.hpp" 22 #include "atom.hpp" 23 #include "Bond/bond.hpp" 24 #include "Box.hpp" 23 25 #include "CodePatterns/Log.hpp" 24 26 #include "CodePatterns/Verbose.hpp" 27 #include "config.hpp" 28 #include "element.hpp" 29 #include "Graph/BondGraph.hpp" 30 #include "Helpers/helpers.hpp" 31 #include "LinearAlgebra/leastsquaremin.hpp" 25 32 #include "LinearAlgebra/Line.hpp" 26 33 #include "LinearAlgebra/RealSpaceMatrix.hpp" 27 34 #include "LinearAlgebra/Plane.hpp" 28 29 #include "atom.hpp"30 #include "bond.hpp"31 #include "Graph/BondGraph.hpp"32 #include "config.hpp"33 #include "element.hpp"34 #include "LinearAlgebra/leastsquaremin.hpp"35 35 #include "molecule.hpp" 36 36 #include "World.hpp" 37 38 #include "Box.hpp"39 37 40 38 #include <boost/foreach.hpp> -
src/molecule_graph.cpp
r766ba5 r129204 23 23 24 24 #include "atom.hpp" 25 #include "bond.hpp" 26 #include "Graph/BondGraph.hpp" 25 #include "Bond/bond.hpp" 27 26 #include "Box.hpp" 28 27 #include "CodePatterns/Assert.hpp" … … 32 31 #include "config.hpp" 33 32 #include "element.hpp" 33 #include "Graph/BondGraph.hpp" 34 34 #include "Helpers/defs.hpp" 35 35 #include "Helpers/fast_functions.hpp" … … 48 48 atom **PredecessorList; 49 49 int *ShortestPathList; 50 enum bond::Shading *ColorList;50 enum GraphEdge::Shading *ColorList; 51 51 std::deque<atom *> *BFSStack; 52 52 std::deque<atom *> *TouchedStack; … … 173 173 for(molecule::iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) { 174 174 const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds(); 175 if ((!ListOfBonds.empty()) && ((*ListOfBonds.begin())->Type == bond::Undetermined)) {175 if ((!ListOfBonds.empty()) && ((*ListOfBonds.begin())->Type == GraphEdge::Undetermined)) { 176 176 DoLog(0) && (Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl); 177 177 Subgraphs = DepthFirstSearchAnalysis(BackEdgeStack); … … 237 237 DoLog(2) && (Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl); 238 238 // (4) Mark Binder used, ... 239 Binder->MarkUsed( bond::black);239 Binder->MarkUsed(GraphEdge::black); 240 240 OtherAtom = Binder->GetOtherAtom(Walker); 241 241 DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->getName() << "." << endl); 242 242 if (OtherAtom->GraphNr != -1) { 243 243 // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3) 244 Binder->Type = bond::BackEdge;244 Binder->Type = GraphEdge::BackEdge; 245 245 DFS.BackEdgeStack->push_front(Binder); 246 246 Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr; … … 248 248 } else { 249 249 // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2) 250 Binder->Type = bond::TreeEdge;250 Binder->Type = GraphEdge::TreeEdge; 251 251 OtherAtom->Ancestor = Walker; 252 252 Walker = OtherAtom; … … 504 504 if (DoLog(2)) { 505 505 ostream &out = (Log() << Verbose(2)); 506 out << ((Binder->Type == bond::TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <";506 out << ((Binder->Type == GraphEdge::TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <"; 507 507 out << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp."; 508 508 Binder->leftatom->OutputComponentNumber(&out); … … 528 528 BFS.PredecessorList = new atom*[AtomCount]; 529 529 BFS.ShortestPathList = new int[AtomCount]; 530 BFS.ColorList = new enum bond::Shading[AtomCount];530 BFS.ColorList = new enum GraphEdge::Shading[AtomCount]; 531 531 BFS.BFSStack = new std::deque<atom *> (AtomCount); 532 532 BFS.TouchedStack = new std::deque<atom *> (AtomCount); … … 535 535 BFS.ShortestPathList[i] = -1; 536 536 BFS.PredecessorList[i] = 0; 537 BFS.ColorList[i] = bond::white;537 BFS.ColorList[i] = GraphEdge::white; 538 538 } 539 539 }; … … 563 563 BFS.PredecessorList[Walker->getNr()] = NULL; 564 564 BFS.ShortestPathList[Walker->getNr()] = -1; 565 BFS.ColorList[Walker->getNr()] = bond::white;565 BFS.ColorList[Walker->getNr()] = GraphEdge::white; 566 566 } 567 567 }; … … 602 602 #endif 603 603 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 604 if (BFS.ColorList[OtherAtom->getNr()] == bond::white) {604 if (BFS.ColorList[OtherAtom->getNr()] == GraphEdge::white) { 605 605 BFS.TouchedStack->push_front(OtherAtom); 606 BFS.ColorList[OtherAtom->getNr()] = bond::lightgray;606 BFS.ColorList[OtherAtom->getNr()] = GraphEdge::lightgray; 607 607 BFS.PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor 608 608 BFS.ShortestPathList[OtherAtom->getNr()] = BFS.ShortestPathList[Walker->getNr()] + 1; … … 620 620 } else { 621 621 DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl); 622 BFS.ColorList[OtherAtom->getNr()] = bond::black;622 BFS.ColorList[OtherAtom->getNr()] = GraphEdge::black; 623 623 } 624 624 #endif … … 627 627 } 628 628 } 629 BFS.ColorList[Walker->getNr()] = bond::black;629 BFS.ColorList[Walker->getNr()] = GraphEdge::black; 630 630 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl); 631 631 if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand … … 647 647 BFS.PredecessorList[OtherAtom->getNr()] = NULL; 648 648 BFS.ShortestPathList[OtherAtom->getNr()] = -1; 649 BFS.ColorList[OtherAtom->getNr()] = bond::white;649 BFS.ColorList[OtherAtom->getNr()] = GraphEdge::white; 650 650 // rats ... deque has no find() 651 651 std::deque<atom *>::iterator iter = find( … … 734 734 OtherAtom = (*Runner)->GetOtherAtom(Walker); 735 735 //Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *Binder << "." << endl; 736 if (BFS.ColorList[OtherAtom->getNr()] == bond::white) {736 if (BFS.ColorList[OtherAtom->getNr()] == GraphEdge::white) { 737 737 BFS.TouchedStack->push_front(OtherAtom); 738 BFS.ColorList[OtherAtom->getNr()] = bond::lightgray;738 BFS.ColorList[OtherAtom->getNr()] = GraphEdge::lightgray; 739 739 BFS.PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor 740 740 BFS.ShortestPathList[OtherAtom->getNr()] = BFS.ShortestPathList[Walker->getNr()] + 1; … … 753 753 } 754 754 } 755 BFS.ColorList[Walker->getNr()] = bond::black;755 BFS.ColorList[Walker->getNr()] = GraphEdge::black; 756 756 //Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl; 757 757 } … … 881 881 Runner != ListOfBonds.end(); 882 882 ++Runner) 883 if ((*Runner)->IsUsed() == bond::white)883 if ((*Runner)->IsUsed() == GraphEdge::white) 884 884 return ((*Runner)); 885 885 return NULL; -
src/moleculelist.cpp
r766ba5 r129204 25 25 26 26 #include "atom.hpp" 27 #include "bond.hpp" 28 #include "Graph/BondGraph.hpp" 27 #include "Bond/bond.hpp" 29 28 #include "boundary.hpp" 30 29 #include "Box.hpp" … … 34 33 #include "config.hpp" 35 34 #include "element.hpp" 35 #include "Graph/BondGraph.hpp" 36 36 #include "Helpers/fast_functions.hpp" 37 37 #include "Helpers/helpers.hpp" -
src/unittests/AnalysisBondsUnitTest.cpp
r766ba5 r129204 30 30 #include "analysis_bonds.hpp" 31 31 #include "atom.hpp" 32 #include "bond.hpp" 32 #include "Bond/bond.hpp" 33 #include "element.hpp" 33 34 #include "Graph/BondGraph.hpp" 34 #include "element.hpp"35 35 #include "molecule.hpp" 36 36 #include "periodentafel.hpp" -
src/unittests/BondGraphUnitTest.cpp
r766ba5 r129204 31 31 32 32 #include "atom.hpp" 33 #include "bond.hpp" 33 #include "Bond/bond.hpp" 34 #include "CodePatterns/Log.hpp" 35 #include "element.hpp" 34 36 #include "Graph/BondGraph.hpp" 35 #include "element.hpp"36 #include "CodePatterns/Log.hpp"37 37 #include "molecule.hpp" 38 38 #include "periodentafel.hpp" -
src/unittests/CountBondsUnitTest.cpp
r766ba5 r129204 32 32 #include "analysis_bonds.hpp" 33 33 #include "atom.hpp" 34 #include "bond.hpp" 34 #include "Bond/bond.hpp" 35 #include "element.hpp" 35 36 #include "Graph/BondGraph.hpp" 36 #include "element.hpp"37 37 #include "molecule.hpp" 38 38 #include "periodentafel.hpp" -
src/unittests/ListOfBondsUnitTest.cpp
r766ba5 r129204 29 29 #include "World.hpp" 30 30 #include "atom.hpp" 31 #include " bond.hpp"31 #include "Bond/bond.hpp" 32 32 #include "element.hpp" 33 33 #include "molecule.hpp"
Note:
See TracChangeset
for help on using the changeset viewer.