Changeset 129204 for src


Ignore:
Timestamp:
Mar 2, 2011, 9:53:08 PM (14 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

Moved bond.* to Bond/, new class GraphEdge which contains graph parts of bond.

  • enums Shading and EdgeType are now part of GraphEdge, hence bigger change in the code where these are used.
Location:
src
Files:
2 added
26 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/CreateAdjacencyAction.cpp

    r766ba5 r129204  
    2424
    2525#include "atom.hpp"
    26 #include "bond.hpp"
    27 #include "Graph/BondGraph.hpp"
     26#include "Bond/bond.hpp"
    2827#include "CodePatterns/Log.hpp"
    2928#include "CodePatterns/Range.hpp"
    3029#include "CodePatterns/Verbose.hpp"
    3130#include "config.hpp"
     31#include "Graph/BondGraph.hpp"
    3232#include "linkedcell.hpp"
    3333#include "molecule.hpp"
  • src/Actions/FragmentationAction/SubgraphDissectionAction.cpp

    r766ba5 r129204  
    2424
    2525#include "atom.hpp"
    26 #include "bond.hpp"
    27 #include "Graph/BondGraph.hpp"
     26#include "Bond/bond.hpp"
    2827#include "config.hpp"
    2928#include "CodePatterns/Log.hpp"
    3029#include "CodePatterns/Verbose.hpp"
     30#include "Graph/BondGraph.hpp"
    3131#include "molecule.hpp"
    3232#include "World.hpp"
  • src/Actions/MoleculeAction/CopyAction.cpp

    r766ba5 r129204  
    2424#include "LinearAlgebra/Vector.hpp"
    2525#include "atom.hpp"
    26 #include "bond.hpp"
     26#include "Bond/bond.hpp"
    2727#include "molecule.hpp"
    2828#include "World.hpp"
  • src/Bond/bond.cpp

    r766ba5 r129204  
    66 */
    77
    8 /** \file bond.cpp
     8/** \file Bond.cpp
    99 *
    1010 * Function implementations for the classes BondLeaf, BondTree and bond.
     
    2222#include "CodePatterns/Verbose.hpp"
    2323#include "atom.hpp"
    24 #include "bond.hpp"
     24#include "Bond/bond.hpp"
    2525#include "element.hpp"
    2626
     
    3535  HydrogenBond(0),
    3636  BondDegree(0),
    37   nr(-1),
    38   Cyclic(false),
    39   Type(Undetermined),
    40   Used(white)
     37  nr(-1)
    4138{};
    4239
     
    5249  HydrogenBond(0),
    5350  BondDegree(degree),
    54   nr(number),
    55   Cyclic(false),
    56   Type(Undetermined),
    57   Used(white)
     51  nr(number)
    5852{
    5953  if ((left != NULL) && (right != NULL)) {
     
    9791
    9892
    99 /** Returns whether vertex was used in DFS.
    100  * \return bond::Used
    101  */
    102 enum bond::Shading bond::IsUsed()
    103 {
    104   return Used;
    105 };
    106 
    10793/** Checks if an atom exists in a bond.
    10894 * \param *ptr pointer to atom
     
    123109};
    124110
    125 /** Masks vertex as used in DFS.
    126  * \return bond::Used, false if bond was already marked used
    127  */
    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::Used
    140  */
    141 void bond::ResetUsed() {
    142   Used = white;
    143 };
    144 
    145111/** Calculates the bond length.
    146112 * \return |a - b| with a = bond::leftatom and b = bond::rightatom.
     
    158124  return (leftatom->DistanceSquared(*rightatom));
    159125};
    160 
    161 /** Returns Shading as a char string.
    162  * \param color the Shading
    163  * \return string of the flag
    164  */
    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  
    11/*
    2  * bond.hpp
     2 * Bond.hpp
    33 *
    44 *  Created on: Aug 3, 2009
     
    1818#endif
    1919
     20#include "Bond/GraphEdge.hpp"
     21
    2022/****************************************** forward declarations *****************************/
    2123
     
    2830 * Class incorporates bonds between atoms in a molecule.
    2931 * Note that we regard bond always as something in a molecule,
    30  * as it is the glue making up the connected subgrapgh and
     32 * as it is the glue making up the connected subgraph and
    3133 * hence the molecule. Thus, bonds belong globally to the molecule
    32  * (and are free'd there) and only locally to the atom classs.
     34 * (and are free'd there) and only locally to the atom class.
    3335 */
    34 class bond {
     36class bond : public GraphEdge
     37{
    3538  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 analysis
    39 
    4039  atom *leftatom;    //!< first bond partner
    4140  atom *rightatom;  //!< second bond partner
     
    4342  int BondDegree;    //!< single, double, triple, ... bond
    4443  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 edge
    4744
    4845  atom * GetOtherAtom(const ParticleInfo * const Atom) const;
    4946
    50   bool MarkUsed(const enum Shading color);
    51   enum Shading IsUsed();
    52   void ResetUsed();
    5347  bool Contains(const ParticleInfo * const ptr);
    5448  bool Contains(const int nr);
     
    6054  ~bond();
    6155
    62   static std::string getColorName(enum Shading color);
    63 
    64   private:
    65     enum Shading Used;        //!< marker in depth-first search, DepthFirstSearchAnalysis()
    6656};
    6757
  • src/Graph/BondGraph.cpp

    r766ba5 r129204  
    2323
    2424#include "atom.hpp"
    25 #include "bond.hpp"
     25#include "Bond/bond.hpp"
    2626#include "Graph/BondGraph.hpp"
    2727#include "Box.hpp"
  • src/Graph/BondGraph.hpp

    r766ba5 r129204  
    2121
    2222#include "AtomSet.hpp"
    23 #include "bond.hpp"
     23#include "Bond/bond.hpp"
    2424#include "CodePatterns/Assert.hpp"
    2525#include "CodePatterns/Log.hpp"
  • src/Graph/BreadthFirstSearchAdd.cpp

    r766ba5 r129204  
    2323
    2424#include "atom.hpp"
    25 #include "bond.hpp"
     25#include "Bond/bond.hpp"
    2626#include "CodePatterns/Assert.hpp"
    2727#include "CodePatterns/Info.hpp"
     
    5757  ShortestPathList[atom_id] = -1;
    5858  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;
    6060  else
    61     ColorList[atom_id] = bond::white;
     61    ColorList[atom_id] = GraphEdge::white;
    6262}
    6363
     
    6565void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond)
    6666{
    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;
    6969  PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor
    7070  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);
    7272  if ((((ShortestPathList[OtherAtom->getNr()] < BondOrder) && (Binder != Bond)))) { // Check for maximum distance
    7373    DoLog(3) && (Log() << Verbose(3));
     
    7777      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->getNr()], AddedAtomList[OtherAtom->getNr()], Binder);
    7878      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)
    8080      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName());
    8181      if (AddedBondList[Binder->nr] == NULL) {
     
    8989  } else { // out of bond order, then replace
    9090    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)
    9292    if (Binder == Bond)
    9393      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond");
     
    139139  Init(_Root, _BondOrder);
    140140
    141   // and go on ... Queue always contains all bond::lightgray vertices
     141  // and go on ... Queue always contains all GraphEdge::lightgray vertices
    142142  while (!BFSStack.empty()) {
    143143    // we have to pop the oldest atom from stack. This keeps the atoms on the stack always of the same ShortestPath distance.
     
    156156        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    157157        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) {
    159159          UnvisitedNode(Mol, Walker, OtherAtom, Binder, Bond);
    160160        } else {
     
    163163      }
    164164    }
    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);
    167167  }
    168168}
  • src/Graph/BreadthFirstSearchAdd.hpp

    r766ba5 r129204  
    2020#include "types.hpp"
    2121
    22 #include "bond.hpp"
     22#include "Bond/bond.hpp"
    2323
    2424class atom;
     
    6060  std::map<atomId_t, atom *> PredecessorList;
    6161  std::map<atomId_t, int > ShortestPathList;
    62   std::map<atomId_t, enum bond::Shading> ColorList;
     62  std::map<atomId_t, enum GraphEdge::Shading> ColorList;
    6363  std::deque<atom *> BFSStack;
    6464  int BondOrder;
  • src/Makefile.am

    r766ba5 r129204  
    7070  Actions/Process.hpp
    7171
     72BONDSOURCE = \
     73        Bond/bond.cpp \
     74        Bond/GraphEdge.cpp
     75
     76BONDHEADER = \
     77        Bond/bond.hpp \
     78        Bond/GraphEdge.hpp
    7279
    7380DESCRIPTORSOURCE = \
     
    179186  ${ACTIONSSOURCE} \
    180187  ${ATOMSOURCE} \
     188  ${BONDSOURCE} \
    181189  ${DESCRIPTORSOURCE} \
    182190  ${DYNAMICSSOURCE} \
     
    187195  Helpers/defs.cpp \
    188196  Helpers/helpers.cpp \
    189   bond.cpp \
    190197  boundary.cpp \
    191198  Box.cpp \
     
    215222  ${ACTIONSHEADER} \
    216223  ${ATOMHEADER} \
     224  ${BONDHEADER} \
    217225  ${DESCRIPTORHEADER} \
    218226  ${DESCRIPTORIMPLHEADER} \
     
    225233  Helpers/fast_functions.hpp \
    226234  Helpers/helpers.hpp \
    227   bond.hpp \
    228235  boundary.hpp \
    229236  Box.hpp \
  • src/Parser/PdbParser.cpp

    r766ba5 r129204  
    2727#include "World.hpp"
    2828#include "atom.hpp"
    29 #include "bond.hpp"
     29#include "Bond/bond.hpp"
    3030#include "element.hpp"
    3131#include "molecule.hpp"
  • src/Parser/TremoloParser.cpp

    r766ba5 r129204  
    2828#include "WorldTime.hpp"
    2929#include "atom.hpp"
    30 #include "bond.hpp"
     30#include "Bond/bond.hpp"
    3131#include "element.hpp"
    3232#include "molecule.hpp"
  • src/analysis_bonds.cpp

    r766ba5 r129204  
    2222#include "analysis_bonds.hpp"
    2323#include "atom.hpp"
    24 #include "bond.hpp"
     24#include "Bond/bond.hpp"
    2525#include "element.hpp"
    2626#include "CodePatterns/Info.hpp"
  • src/analysis_correlation.cpp

    r766ba5 r129204  
    2424
    2525#include "atom.hpp"
    26 #include "bond.hpp"
     26#include "Bond/bond.hpp"
    2727#include "BoundaryTriangleSet.hpp"
    2828#include "Box.hpp"
  • src/atom.cpp

    r766ba5 r129204  
    2020
    2121#include "atom.hpp"
    22 #include "bond.hpp"
     22#include "Bond/bond.hpp"
    2323#include "CodePatterns/Log.hpp"
    2424#include "config.hpp"
  • src/atom_bondedparticle.cpp

    r766ba5 r129204  
    2222#include "atom.hpp"
    2323#include "atom_bondedparticle.hpp"
    24 #include "bond.hpp"
     24#include "Bond/bond.hpp"
    2525#include "CodePatterns/Assert.hpp"
    2626#include "CodePatterns/Log.hpp"
  • src/boundary.cpp

    r766ba5 r129204  
    1919
    2020#include "atom.hpp"
    21 #include "bond.hpp"
     21#include "Bond/bond.hpp"
    2222#include "boundary.hpp"
    2323#include "BoundaryLineSet.hpp"
  • src/config.cpp

    r766ba5 r129204  
    2525#include <string>
    2626
    27 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    2827#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"
    3134#include "config.hpp"
    3235#include "ConfigFileBuffer.hpp"
    3336#include "element.hpp"
    3437#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"
    3940#include "molecule.hpp"
    4041#include "molecule.hpp"
     
    4243#include "ThermoStatContainer.hpp"
    4344#include "World.hpp"
    44 #include "LinearAlgebra/RealSpaceMatrix.hpp"
    45 #include "Box.hpp"
    4645
    4746/************************************* Functions for class config ***************************/
  • src/graph.cpp

    r766ba5 r129204  
    2222
    2323#include "atom.hpp"
    24 #include "bond.hpp"
     24#include "Bond/bond.hpp"
    2525#include "config.hpp"
    2626#include "graph.hpp"
  • src/molecule.cpp

    r766ba5 r129204  
    2727
    2828#include "atom.hpp"
    29 #include "bond.hpp"
    30 #include "Graph/BondGraph.hpp"
     29#include "Bond/bond.hpp"
    3130#include "Box.hpp"
    3231#include "CodePatterns/enumeration.hpp"
     
    3635#include "Exceptions/LinearDependenceException.hpp"
    3736#include "graph.hpp"
     37#include "Graph/BondGraph.hpp"
    3838#include "Helpers/helpers.hpp"
    3939#include "LinearAlgebra/leastsquaremin.hpp"
     
    400400      Binder = AddBond(BottomOrigin, FirstOtherAtom, 1);
    401401      Binder->Cyclic = false;
    402       Binder->Type = bond::TreeEdge;
     402      Binder->Type = GraphEdge::TreeEdge;
    403403      break;
    404404    case 2:
     
    496496      Binder = AddBond(BottomOrigin, FirstOtherAtom, 1);
    497497      Binder->Cyclic = false;
    498       Binder->Type = bond::TreeEdge;
     498      Binder->Type = GraphEdge::TreeEdge;
    499499      Binder = AddBond(BottomOrigin, SecondOtherAtom, 1);
    500500      Binder->Cyclic = false;
    501       Binder->Type = bond::TreeEdge;
     501      Binder->Type = GraphEdge::TreeEdge;
    502502      break;
    503503    case 3:
     
    579579      Binder = AddBond(BottomOrigin, FirstOtherAtom, 1);
    580580      Binder->Cyclic = false;
    581       Binder->Type = bond::TreeEdge;
     581      Binder->Type = GraphEdge::TreeEdge;
    582582      Binder = AddBond(BottomOrigin, SecondOtherAtom, 1);
    583583      Binder->Cyclic = false;
    584       Binder->Type = bond::TreeEdge;
     584      Binder->Type = GraphEdge::TreeEdge;
    585585      Binder = AddBond(BottomOrigin, ThirdOtherAtom, 1);
    586586      Binder->Cyclic = false;
    587       Binder->Type = bond::TreeEdge;
     587      Binder->Type = GraphEdge::TreeEdge;
    588588      break;
    589589    default:
  • src/molecule_fragmentation.cpp

    r766ba5 r129204  
    2222#include <cstring>
    2323
    24 #include "World.hpp"
    2524#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"
    2829#include "config.hpp"
    2930#include "element.hpp"
    3031#include "Helpers/helpers.hpp"
    31 #include "CodePatterns/Verbose.hpp"
    32 #include "CodePatterns/Log.hpp"
     32#include "Graph/BondGraph.hpp"
     33#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3334#include "molecule.hpp"
    3435#include "periodentafel.hpp"
    3536#include "World.hpp"
    36 #include "LinearAlgebra/RealSpaceMatrix.hpp"
    37 #include "Box.hpp"
    3837
    3938/************************************* Functions for class molecule *********************************/
     
    17831782  atom *OtherWalker = NULL;
    17841783  RealSpaceMatrix matrix = World::getInstance().getDomain().getM();
    1785   enum bond::Shading *ColorList = NULL;
     1784  enum GraphEdge::Shading *ColorList = NULL;
    17861785  double tmp;
    17871786  //bool LastBond = true; // only needed to due list construct
     
    17941793  DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl);
    17951794
    1796   ColorList = new enum bond::Shading[getAtomCount()];
     1795  ColorList = new enum GraphEdge::Shading[getAtomCount()];
    17971796  for (int i=0;i<getAtomCount();i++)
    1798     ColorList[i] = (enum bond::Shading)0;
     1797    ColorList[i] = (enum GraphEdge::Shading)0;
    17991798  if (flag) {
    18001799    // remove bonds that are beyond bonddistance
     
    18361835      // apply to all atoms of first component via BFS
    18371836      for (int i=getAtomCount();i--;)
    1838         ColorList[i] = bond::white;
     1837        ColorList[i] = GraphEdge::white;
    18391838      AtomStack->push_front(Binder->leftatom);
    18401839      while (!AtomStack->empty()) {
     
    18421841        AtomStack->pop_front();
    18431842        //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl;
    1844         ColorList[Walker->getNr()] = bond::black;    // mark as explored
     1843        ColorList[Walker->getNr()] = GraphEdge::black;    // mark as explored
    18451844        *Walker += Translationvector; // translate
    18461845        const BondList& ListOfBonds = Walker->getListOfBonds();
     
    18501849          if ((*Runner) != Binder) {
    18511850            OtherWalker = (*Runner)->GetOtherAtom(Walker);
    1852             if (ColorList[OtherWalker->getNr()] == bond::white) {
     1851            if (ColorList[OtherWalker->getNr()] == GraphEdge::white) {
    18531852              AtomStack->push_front(OtherWalker); // push if yet unexplored
    18541853            }
  • src/molecule_geometry.cpp

    r766ba5 r129204  
    2020#include "CodePatterns/MemDebug.hpp"
    2121
    22 #include "Helpers/helpers.hpp"
     22#include "atom.hpp"
     23#include "Bond/bond.hpp"
     24#include "Box.hpp"
    2325#include "CodePatterns/Log.hpp"
    2426#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"
    2532#include "LinearAlgebra/Line.hpp"
    2633#include "LinearAlgebra/RealSpaceMatrix.hpp"
    2734#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"
    3535#include "molecule.hpp"
    3636#include "World.hpp"
    37 
    38 #include "Box.hpp"
    3937
    4038#include <boost/foreach.hpp>
  • src/molecule_graph.cpp

    r766ba5 r129204  
    2323
    2424#include "atom.hpp"
    25 #include "bond.hpp"
    26 #include "Graph/BondGraph.hpp"
     25#include "Bond/bond.hpp"
    2726#include "Box.hpp"
    2827#include "CodePatterns/Assert.hpp"
     
    3231#include "config.hpp"
    3332#include "element.hpp"
     33#include "Graph/BondGraph.hpp"
    3434#include "Helpers/defs.hpp"
    3535#include "Helpers/fast_functions.hpp"
     
    4848  atom **PredecessorList;
    4949  int *ShortestPathList;
    50   enum bond::Shading *ColorList;
     50  enum GraphEdge::Shading *ColorList;
    5151  std::deque<atom *> *BFSStack;
    5252  std::deque<atom *> *TouchedStack;
     
    173173  for(molecule::iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) {
    174174    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
    175     if ((!ListOfBonds.empty()) && ((*ListOfBonds.begin())->Type == bond::Undetermined)) {
     175    if ((!ListOfBonds.empty()) && ((*ListOfBonds.begin())->Type == GraphEdge::Undetermined)) {
    176176      DoLog(0) && (Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl);
    177177      Subgraphs = DepthFirstSearchAnalysis(BackEdgeStack);
     
    237237    DoLog(2) && (Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl);
    238238    // (4) Mark Binder used, ...
    239     Binder->MarkUsed(bond::black);
     239    Binder->MarkUsed(GraphEdge::black);
    240240    OtherAtom = Binder->GetOtherAtom(Walker);
    241241    DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->getName() << "." << endl);
    242242    if (OtherAtom->GraphNr != -1) {
    243243      // (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;
    245245      DFS.BackEdgeStack->push_front(Binder);
    246246      Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr;
     
    248248    } else {
    249249      // (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;
    251251      OtherAtom->Ancestor = Walker;
    252252      Walker = OtherAtom;
     
    504504        if (DoLog(2)) {
    505505          ostream &out = (Log() << Verbose(2));
    506           out << ((Binder->Type == bond::TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <";
     506          out << ((Binder->Type == GraphEdge::TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <";
    507507          out << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.";
    508508          Binder->leftatom->OutputComponentNumber(&out);
     
    528528  BFS.PredecessorList = new atom*[AtomCount];
    529529  BFS.ShortestPathList = new int[AtomCount];
    530   BFS.ColorList = new enum bond::Shading[AtomCount];
     530  BFS.ColorList = new enum GraphEdge::Shading[AtomCount];
    531531  BFS.BFSStack = new std::deque<atom *> (AtomCount);
    532532  BFS.TouchedStack = new std::deque<atom *> (AtomCount);
     
    535535    BFS.ShortestPathList[i] = -1;
    536536    BFS.PredecessorList[i] = 0;
    537     BFS.ColorList[i] = bond::white;
     537    BFS.ColorList[i] = GraphEdge::white;
    538538  }
    539539};
     
    563563    BFS.PredecessorList[Walker->getNr()] = NULL;
    564564    BFS.ShortestPathList[Walker->getNr()] = -1;
    565     BFS.ColorList[Walker->getNr()] = bond::white;
     565    BFS.ColorList[Walker->getNr()] = GraphEdge::white;
    566566  }
    567567};
     
    602602#endif
    603603        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) {
    605605          BFS.TouchedStack->push_front(OtherAtom);
    606           BFS.ColorList[OtherAtom->getNr()] = bond::lightgray;
     606          BFS.ColorList[OtherAtom->getNr()] = GraphEdge::lightgray;
    607607          BFS.PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor
    608608          BFS.ShortestPathList[OtherAtom->getNr()] = BFS.ShortestPathList[Walker->getNr()] + 1;
     
    620620      } else {
    621621        DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl);
    622         BFS.ColorList[OtherAtom->getNr()] = bond::black;
     622        BFS.ColorList[OtherAtom->getNr()] = GraphEdge::black;
    623623      }
    624624#endif
     
    627627      }
    628628    }
    629     BFS.ColorList[Walker->getNr()] = bond::black;
     629    BFS.ColorList[Walker->getNr()] = GraphEdge::black;
    630630    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
    631631    if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand
     
    647647            BFS.PredecessorList[OtherAtom->getNr()] = NULL;
    648648            BFS.ShortestPathList[OtherAtom->getNr()] = -1;
    649             BFS.ColorList[OtherAtom->getNr()] = bond::white;
     649            BFS.ColorList[OtherAtom->getNr()] = GraphEdge::white;
    650650            // rats ... deque has no find()
    651651            std::deque<atom *>::iterator iter = find(
     
    734734        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    735735        //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) {
    737737          BFS.TouchedStack->push_front(OtherAtom);
    738           BFS.ColorList[OtherAtom->getNr()] = bond::lightgray;
     738          BFS.ColorList[OtherAtom->getNr()] = GraphEdge::lightgray;
    739739          BFS.PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor
    740740          BFS.ShortestPathList[OtherAtom->getNr()] = BFS.ShortestPathList[Walker->getNr()] + 1;
     
    753753      }
    754754    }
    755     BFS.ColorList[Walker->getNr()] = bond::black;
     755    BFS.ColorList[Walker->getNr()] = GraphEdge::black;
    756756    //Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;
    757757  }
     
    881881      Runner != ListOfBonds.end();
    882882      ++Runner)
    883     if ((*Runner)->IsUsed() == bond::white)
     883    if ((*Runner)->IsUsed() == GraphEdge::white)
    884884      return ((*Runner));
    885885  return NULL;
  • src/moleculelist.cpp

    r766ba5 r129204  
    2525
    2626#include "atom.hpp"
    27 #include "bond.hpp"
    28 #include "Graph/BondGraph.hpp"
     27#include "Bond/bond.hpp"
    2928#include "boundary.hpp"
    3029#include "Box.hpp"
     
    3433#include "config.hpp"
    3534#include "element.hpp"
     35#include "Graph/BondGraph.hpp"
    3636#include "Helpers/fast_functions.hpp"
    3737#include "Helpers/helpers.hpp"
  • src/unittests/AnalysisBondsUnitTest.cpp

    r766ba5 r129204  
    3030#include "analysis_bonds.hpp"
    3131#include "atom.hpp"
    32 #include "bond.hpp"
     32#include "Bond/bond.hpp"
     33#include "element.hpp"
    3334#include "Graph/BondGraph.hpp"
    34 #include "element.hpp"
    3535#include "molecule.hpp"
    3636#include "periodentafel.hpp"
  • src/unittests/BondGraphUnitTest.cpp

    r766ba5 r129204  
    3131
    3232#include "atom.hpp"
    33 #include "bond.hpp"
     33#include "Bond/bond.hpp"
     34#include "CodePatterns/Log.hpp"
     35#include "element.hpp"
    3436#include "Graph/BondGraph.hpp"
    35 #include "element.hpp"
    36 #include "CodePatterns/Log.hpp"
    3737#include "molecule.hpp"
    3838#include "periodentafel.hpp"
  • src/unittests/CountBondsUnitTest.cpp

    r766ba5 r129204  
    3232#include "analysis_bonds.hpp"
    3333#include "atom.hpp"
    34 #include "bond.hpp"
     34#include "Bond/bond.hpp"
     35#include "element.hpp"
    3536#include "Graph/BondGraph.hpp"
    36 #include "element.hpp"
    3737#include "molecule.hpp"
    3838#include "periodentafel.hpp"
  • src/unittests/ListOfBondsUnitTest.cpp

    r766ba5 r129204  
    2929#include "World.hpp"
    3030#include "atom.hpp"
    31 #include "bond.hpp"
     31#include "Bond/bond.hpp"
    3232#include "element.hpp"
    3333#include "molecule.hpp"
Note: See TracChangeset for help on using the changeset viewer.