Changeset 88c8ec for src


Ignore:
Timestamp:
Jan 17, 2013, 10:59:15 PM (12 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:
c8302f3
Parents:
d6b6ce
git-author:
Frederik Heber <heber@…> (10/29/12 00:28:46)
git-committer:
Frederik Heber <heber@…> (01/17/13 22:59:15)
Message:

REFACTOR: Replaced all "bond *" appearances by bond::ptr.

  • this is preparatory for making bond::ptr a boost::shared_ptr of bond.
  • NOTE: We had to remove a const prefix at four or five places and forward declarations had to be replaced by the true inclusion of bond.hpp at tne or so files. Apart from that, the replacement has been very smooth.
Location:
src
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/GraphAction/DepthFirstSearchAction.cpp

    rd6b6ce r88c8ec  
    5858  LOG(1, "Depth-First-Search Analysis.");
    5959  ListOfLocalAtoms_t ListOfAtoms;
    60   std::deque<bond *> *LocalBackEdgeStack = NULL;
     60  std::deque<bond::ptr > *LocalBackEdgeStack = NULL;
    6161  DepthFirstSearchAnalysis DFS;
    6262  DFS();
     
    6969      ListOfAtoms.clear();
    7070      Subgraphs->Leaf->FillListOfLocalAtoms(ListOfAtoms, Subgraphs->Leaf->getAtomCount());
    71       LocalBackEdgeStack = new std::deque<bond *>; // no need to have it Subgraphs->Leaf->BondCount size
     71      LocalBackEdgeStack = new std::deque<bond::ptr >; // no need to have it Subgraphs->Leaf->BondCount size
    7272      DFS.PickLocalBackEdges(ListOfAtoms, LocalBackEdgeStack);
    7373      CyclicStructureAnalysis CycleAnalysis(params.DoSaturation.get() ? DoSaturate : DontSaturate);
  • src/Atom/CopyAtoms/CopyAtoms_withBonds.cpp

    rd6b6ce r88c8ec  
    6363    for(BondList::const_iterator iter = ListOfBonds.begin(); iter != ListOfBonds.end(); ++iter) {
    6464      // check both bond partners have been copied
    65       const bond * const Binder = *iter;
     65      const bond::ptr Binder = *iter;
    6666      if (*original_iter == Binder->leftatom) {
    6767        LookupMap_t::const_iterator leftiter = LookupMap.find(Binder->leftatom);
     
    7171          atom * const LeftAtom = leftiter->second;
    7272          atom * const RightAtom = rightiter->second;
    73           bond * const NewBond = LeftAtom->addBond(WorldTime::getTime(), RightAtom);
     73          bond::ptr const NewBond = LeftAtom->addBond(WorldTime::getTime(), RightAtom);
    7474          LOG(3, "DEBUG: Creating copy bond between original " << Binder->leftatom->getId()
    7575              << " and " << Binder->rightatom->getId() << ": " << *NewBond << ".");
  • src/Atom/atom_bondedparticle.cpp

    rd6b6ce r88c8ec  
    104104 * @return const pointer to created bond or to already present bonds
    105105 */
    106 bond * const BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner)
     106bond::ptr const BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner)
    107107{
    108108  const BondList &bondlist = getListOfBondsAtStep(_step);
     
    145145 * @param Binder bond to remove
    146146 */
    147 void BondedParticle::removeBond(bond * binder)
     147void BondedParticle::removeBond(bond::ptr binder)
    148148{
    149149  UnregisterBond(binder);
     
    177177 * \param *Binder bond to insert
    178178 */
    179 bool BondedParticle::RegisterBond(const unsigned int _step, bond * const Binder)
     179bool BondedParticle::RegisterBond(const unsigned int _step, bond::ptr const Binder)
    180180{
    181181  OBSERVE;
     
    203203 * \param *Binder bond to remove
    204204 */
    205 bool BondedParticle::UnregisterBond(bond * const Binder)
     205bool BondedParticle::UnregisterBond(bond::ptr const Binder)
    206206{
    207207  OBSERVE;
     
    253253 * @return >=0 - first time step where bond appears, -1 - bond not present in lists
    254254 */
    255 int BondedParticle::ContainsBondAtStep(bond *Binder) const
     255int BondedParticle::ContainsBondAtStep(bond::ptr Binder) const
    256256{
    257257  int step = -1;
     
    286286  int FalseBondDegree = 0;
    287287  atom *OtherWalker = NULL;
    288   bond *CandidateBond = NULL;
     288  bond::ptr CandidateBond = NULL;
    289289
    290290  NoBonds = CountBonds();
  • src/Atom/atom_bondedparticle.hpp

    rd6b6ce r88c8ec  
    3737  virtual ~BondedParticle();
    3838
    39   bond * const addBond(const unsigned int _step, BondedParticle* Partner);
     39  bond::ptr const addBond(const unsigned int _step, BondedParticle* Partner);
    4040  void removeBond(const unsigned int _step, BondedParticle* Partner);
    41   void removeBond(bond *binder);
     41  void removeBond(bond::ptr binder);
    4242  void removeAllBonds();
    4343  void removeAllBonds(const unsigned int _step);
     
    5454
    5555protected:
    56   bool RegisterBond(const unsigned int _step, bond * const Binder);
    57   bool UnregisterBond(bond * const Binder);
     56  bool RegisterBond(const unsigned int _step, bond::ptr const Binder);
     57  bool UnregisterBond(bond::ptr const Binder);
    5858  void UnregisterAllBond(const unsigned int _step);
    5959
    60   int ContainsBondAtStep(bond *Binder) const;
     60  int ContainsBondAtStep(bond::ptr Binder) const;
    6161
    6262};
  • src/Atom/atom_bondedparticleinfo.hpp

    rd6b6ce r88c8ec  
    2020
    2121#include "atom_observable.hpp"
     22#include "Bond/bond.hpp"
    2223
    2324#include <list>
     
    2526/****************************************** forward declarations *****************************/
    2627
    27 class bond;
    2828class BondedParticle;
    2929
    30 #define BondList std::list<bond *>
     30#define BondList list<bond::ptr >
    3131
    3232/********************************************** declarations *******************************/
  • src/Atom/unittests/CopyAtomsInterfaceUnitTest.cpp

    rd6b6ce r88c8ec  
    129129    const BondList & ListOfBonds = atoms[0]->getListOfBonds();
    130130    CPPUNIT_ASSERT( !ListOfBonds.empty() );
    131     const bond * const _bond = *ListOfBonds.begin();
     131    bond::ptr const _bond = *ListOfBonds.begin();
    132132    CPPUNIT_ASSERT( _bond->GetOtherAtom(atoms[0]) == atoms[1] );
    133133  }
     
    144144    const BondList & ListOfBonds = copyMethod.CopiedAtoms[0]->getListOfBonds();
    145145    CPPUNIT_ASSERT( !ListOfBonds.empty() );
    146     const bond * const _bond = *ListOfBonds.begin();
     146    bond::ptr const _bond = *ListOfBonds.begin();
    147147    CPPUNIT_ASSERT( _bond->GetOtherAtom(copyMethod.CopiedAtoms[0]) == copyMethod.CopiedAtoms[1] );
    148148  }
  • src/Bond/BondInfo.cpp

    rd6b6ce r88c8ec  
    4949#include "WorldTime.hpp"
    5050
    51 BondInfo::BondInfo(const bond * _bond) :
     51BondInfo::BondInfo(const bond::ptr _bond) :
    5252  leftid(_bond->leftatom->getId()),
    5353  rightid(_bond->rightatom->getId()),
     
    6565  }
    6666  const BondList &leftbonds = leftatom->getListOfBonds();
    67   boost::function< bool (const bond *)> predicate =
     67  boost::function< bool (const bond::ptr )> predicate =
    6868      boost::bind(static_cast<bool (bond::*)(const int) const>(&bond::Contains), _1, rightid);
    6969  if (std::find_if(leftbonds.begin(), leftbonds.end(), predicate) != leftbonds.end())
     
    7676  // create bond
    7777  LOG(3, "DEBUG: Re-creating bond " << leftid << "<->" << rightid << ".");
    78   bond * const _bond = leftatom->addBond(WorldTime::getTime(), rightatom);
     78  bond::ptr const _bond = leftatom->addBond(WorldTime::getTime(), rightatom);
    7979  _bond->BondDegree = degree;
    8080  return true;
  • src/Bond/BondInfo.hpp

    rd6b6ce r88c8ec  
    1616
    1717#include "types.hpp"
     18#include "Bond/bond.hpp"
    1819
    19 class bond;
    2020
    2121/** Structure for containing bond state information.
     
    2929   * @param _bond bond whose state to store
    3030   */
    31   BondInfo(const bond * _bond);
     31  BondInfo(const bond::ptr _bond);
    3232
    3333  /** Recreates the bond whose state is contained in this BondInfo.
  • src/Bond/bond.cpp

    rd6b6ce r88c8ec  
    4141
    4242
    43 /***************************************** Functions for class bond ********************************/
     43/***************************************** Functions for class bond::ptr *******************************/
    4444
    4545/** Empty Constructor for class bond.
  • src/Bond/bond.hpp

    rd6b6ce r88c8ec  
    3737class bond : public GraphEdge, public BondObservable
    3838{
    39   public:
     39public:
     40  //!> typedef for a bond ptr
     41  typedef bond* ptr;
     42
    4043  atom *leftatom;    //!< first bond partner
    4144  atom *rightatom;  //!< second bond partner
  • src/Fragmentation/BondsPerShortestPath.cpp

    rd6b6ce r88c8ec  
    9090    BondsPerSPCount[i] = 0;
    9191  BondsPerSPCount[0] = 1;
    92   bond *Binder = new bond(_Root, _Root);
     92  bond::ptr Binder = new bond(_Root, _Root);
    9393  BondsPerSPList[0].push_back(Binder);
    9494};
     
    138138  atom *OtherWalker = NULL;
    139139  atom *Predecessor = NULL;
    140   bond *Binder = NULL;
     140  bond::ptr Binder = NULL;
    141141  int RootKeyNr = _RootKeyNr;
    142142  int RemainingWalkers = -1;
  • src/Fragmentation/PowerSetGenerator.cpp

    rd6b6ce r88c8ec  
    8888 * \return number of set bits
    8989 */
    90 int PowerSetGenerator::AddPowersetToSnakeStack(int verbosity, int CurrentCombination, int SetDimension, KeySet *FragmentSet, std::vector<bond *> &BondsSet, int *&TouchedList, int &TouchedIndex)
     90int PowerSetGenerator::AddPowersetToSnakeStack(int verbosity, int CurrentCombination, int SetDimension, KeySet *FragmentSet, std::vector<bond::ptr > &BondsSet, int *&TouchedList, int &TouchedIndex)
    9191{
    9292  atom *OtherWalker = NULL;
     
    122122 * \return number of elements
    123123 */
    124 int PowerSetGenerator::CountSetMembers(std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex)
     124int PowerSetGenerator::CountSetMembers(std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex)
    125125{
    126126  int SetDimension = 0;
    127   for( std::list<bond *>::const_iterator Binder = SetFirst;
     127  for( std::list<bond::ptr >::const_iterator Binder = SetFirst;
    128128      Binder != SetLast;
    129129      ++Binder) {
     
    144144 * \return number of elements
    145145 */
    146 int PowerSetGenerator::FillBondsList(std::vector<bond *> &BondsList, std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex)
     146int PowerSetGenerator::FillBondsList(std::vector<bond::ptr > &BondsList, std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex)
    147147{
    148148  int SetDimension = 0;
    149   for( std::list<bond *>::const_iterator Binder = SetFirst;
     149  for( std::list<bond::ptr >::const_iterator Binder = SetFirst;
    150150      Binder != SetLast;
    151151      ++Binder) {
     
    257257 * \param SubOrder remaining number of allowed vertices to add
    258258 */
    259 void PowerSetGenerator::SPFragmentGenerator(int RootDistance, std::vector<bond *> &BondsSet, int SetDimension, int SubOrder)
     259void PowerSetGenerator::SPFragmentGenerator(int RootDistance, std::vector<bond::ptr > &BondsSet, int SetDimension, int SubOrder)
    260260{
    261261  Info info(__func__);
     
    302302
    303303          // then allocate and fill the list
    304           std::vector<bond *> BondsList;
     304          std::vector<bond::ptr > BondsList;
    305305          BondsList.resize(SubSetDimension);
    306306          SubSetDimension = FillBondsList(BondsList, BondsPerSPList.BondsPerSPList[SP].begin(), BondsPerSPList.BondsPerSPList[SP].end(), TouchedList, TouchedIndex);
  • src/Fragmentation/PowerSetGenerator.hpp

    rd6b6ce r88c8ec  
    1717#include <vector>
    1818
     19#include "Bond/bond.hpp"
    1920#include "Fragmentation/BondsPerShortestPath.hpp"
    2021#include "Fragmentation/HydrogenSaturation_enum.hpp"
    2122
    22 class bond;
    2323class UniqueFragments;
    2424
     
    2929  ~PowerSetGenerator();
    3030
    31   void SPFragmentGenerator(int RootDistance, std::vector<bond *> &BondsSet, int SetDimension, int SubOrder);
     31  void SPFragmentGenerator(int RootDistance, std::vector<bond::ptr > &BondsSet, int SetDimension, int SubOrder);
    3232  int operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation);
    3333  void RemoveAllTouchedFromSnakeStack(int verbosity, KeySet *FragmentSet, int *&TouchedList, int &TouchedIndex);
    34   int FillBondsList(std::vector<bond *> &BondsList, std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex);
    35   int CountSetMembers(std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex);
    36   int AddPowersetToSnakeStack(int verbosity, int CurrentCombination, int SetDimension, KeySet *FragmentSet, std::vector<bond *> &BondsSet, int *&TouchedList, int &TouchedIndex);
     34  int FillBondsList(std::vector<bond::ptr > &BondsList, std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex);
     35  int CountSetMembers(std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex);
     36  int AddPowersetToSnakeStack(int verbosity, int CurrentCombination, int SetDimension, KeySet *FragmentSet, std::vector<bond::ptr > &BondsSet, int *&TouchedList, int &TouchedIndex);
    3737  void ClearingTouched(int verbosity, int *&TouchedList, int SubOrder, int &TouchedIndex);
    3838
  • src/Graph/BondGraph.hpp

    rd6b6ce r88c8ec  
    235235                LOG(1, "ACCEPT: Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << ".");
    236236                // directly use iter to avoid const_cast'ing Walker, too
    237                 //const bond * Binder =
     237                //const bond::ptr Binder =
    238238                const_cast<atom *>(Walker)->addBond(CurrentTime, const_cast<atom *>(OtherWalker));
    239239                ++BondCount;
     
    334334
    335335      LOG(3, "INFO: Creating bond between atoms " << atom1 << " and " << atom2 << ".");
    336       //const bond * Binder =
     336      //const bond::ptr Binder =
    337337          Walker->addBond(WorldTime::getTime(), OtherWalker);
    338338      bondcounter++;
  • src/Graph/BreadthFirstSearchAdd.cpp

    rd6b6ce r88c8ec  
    8181
    8282
    83 void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond)
     83void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond::ptr &Binder, bond::ptr &Bond)
    8484{
    8585  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)
     
    132132
    133133
    134 void BreadthFirstSearchAdd::VisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond)
     134void BreadthFirstSearchAdd::VisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond::ptr &Binder, bond::ptr &Bond)
    135135{
    136136  LOG(3, "Not Adding, has already been visited.");
     
    148148
    149149
    150 void BreadthFirstSearchAdd::operator()(molecule *Mol, atom *_Root, bond *Bond, int _BondOrder)
     150void BreadthFirstSearchAdd::operator()(molecule *Mol, atom *_Root, bond::ptr Bond, int _BondOrder)
    151151{
    152152  Info FunctionInfo("BreadthFirstSearchAdd");
    153153  atom *Walker = NULL, *OtherAtom = NULL;
    154   bond *Binder = NULL;
     154  bond::ptr Binder = NULL;
    155155
    156156  // add Root if not done yet
  • src/Graph/BreadthFirstSearchAdd.hpp

    rd6b6ce r88c8ec  
    1717#include <map>
    1818
     19#include "Bond/bond.hpp"
    1920#include "Bond/GraphEdge.hpp"
    2021#include "Fragmentation/HydrogenSaturation_enum.hpp"
     
    2324
    2425class atom;
    25 class bond;
    2626class molecule;
    2727
     
    4848   * \param IsAngstroem lengths are in angstroem or bohrradii
    4949   */
    50   void operator()(molecule *Mol, atom *_Root, bond *Bond, int _BondOrder);
     50  void operator()(molecule *Mol, atom *_Root, bond::ptr Bond, int _BondOrder);
    5151
    5252private:
    53   void UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond);
    54   void VisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond);
     53  void UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond::ptr &Binder, bond::ptr &Bond);
     54  void VisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond::ptr &Binder, bond::ptr &Bond);
    5555
    5656  /** initialise vertex as white with no predecessor, empty queue, color Root lightgray.
     
    7070  int ComponentNr;
    7171  std::map<atomId_t, atom *> AddedAtomList;
    72   std::map<bond *, bond *> AddedBondList; //!< maps from father bond to son
     72  std::map<bond::ptr , bond::ptr > AddedBondList; //!< maps from father bond to son
    7373
    7474  //!> whether to treat hydrogen special or not
  • src/Graph/CyclicStructureAnalysis.cpp

    rd6b6ce r88c8ec  
    102102 * \param &BFS accounting structure
    103103 */
    104 void CyclicStructureAnalysis::CyclicBFSFromRootToRoot(bond *&BackEdge)
     104void CyclicStructureAnalysis::CyclicBFSFromRootToRoot(bond::ptr &BackEdge)
    105105{
    106106  atom *Walker = NULL;
     
    187187 * \param &MinRingSize global minimum distance from one node without encountering oneself, set on return
    188188 */
    189 void CyclicStructureAnalysis::RetrieveCycleMembers(atom *&OtherAtom, bond *&BackEdge, int &MinRingSize)
     189void CyclicStructureAnalysis::RetrieveCycleMembers(atom *&OtherAtom, bond::ptr &BackEdge, int &MinRingSize)
    190190{
    191191  atom *Walker = NULL;
     
    327327 * \todo BFS from the not-same-LP to find back to starting point of tributary cycle over more than one bond
    328328 */
    329 void CyclicStructureAnalysis::operator()(std::deque<bond *> * BackEdgeStack)
     329void CyclicStructureAnalysis::operator()(std::deque<bond::ptr > * BackEdgeStack)
    330330{
    331331  Info FunctionInfo("CyclicStructureAnalysis");
    332332  atom *Walker = NULL;
    333333  atom *OtherAtom = NULL;
    334   bond *BackEdge = NULL;
     334  bond::ptr BackEdge = NULL;
    335335  int NumCycles = 0;
    336336  int MinRingSize = -1;
  • src/Graph/CyclicStructureAnalysis.hpp

    rd6b6ce r88c8ec  
    1717#include <map>
    1818
     19#include "Bond/bond.hpp"
    1920#include "Bond/GraphEdge.hpp"
    2021#include "Fragmentation/HydrogenSaturation_enum.hpp"
     
    2324
    2425class atom;
    25 class bond;
    2626class molecule;
    2727
     
    3333
    3434  void Reset();
    35   void operator()(std::deque<bond *> * BackEdgeStack);
     35  void operator()(std::deque<bond::ptr > * BackEdgeStack);
    3636
    3737  const std::map<atomId_t, int >& getMinimumRingSize() const;
     
    4343  void InitializeToRoot(atom *&Walker);
    4444  // performing tasks
    45   void CyclicBFSFromRootToRoot(bond *&BackEdge);
    46   void RetrieveCycleMembers(atom *&OtherAtom, bond *&BackEdge, int &MinRingSize);
     45  void CyclicBFSFromRootToRoot(bond::ptr &BackEdge);
     46  void RetrieveCycleMembers(atom *&OtherAtom, bond::ptr &BackEdge, int &MinRingSize);
    4747  void BFSToNextCycle(atom *&Root, atom *&Walker);
    4848  void AssignRingSizetoNonCycleMembers(int &MinRingSize, int &NumCycles);
  • src/Graph/DepthFirstSearchAnalysis.cpp

    rd6b6ce r88c8ec  
    7777
    7878
    79 bond * DepthFirstSearchAnalysis::FindNextUnused(atom *vertex) const
     79bond::ptr DepthFirstSearchAnalysis::FindNextUnused(atom *vertex) const
    8080{
    8181  const BondList& ListOfBonds = vertex->getListOfBonds();
     
    122122
    123123
    124 bool DepthFirstSearchAnalysis::PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const
     124bool DepthFirstSearchAnalysis::PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond::ptr > *&LocalStack) const
    125125{
    126126  bool status = true;
     
    129129    return false;
    130130  }
    131   bond *Binder = BackEdgeStack.front();
    132   bond *FirstBond = Binder; // mark the first bond, so that we don't loop through the stack indefinitely
     131  bond::ptr Binder = BackEdgeStack.front();
     132  bond::ptr FirstBond = Binder; // mark the first bond, so that we don't loop through the stack indefinitely
    133133  atom *Walker = NULL, *OtherAtom = NULL;
    134134
     
    183183        ++BondRunner)
    184184      if ((*BondRunner)->leftatom == *AtomRunner) {
    185         const bond *Binder = *BondRunner;
     185        const bond::ptr Binder = *BondRunner;
    186186        if (DoLog(2)) {
    187187          std::stringstream output;
     
    235235
    236236
    237 void DepthFirstSearchAnalysis::ProbeAlongUnusedBond(atom *&Walker, bond *&Binder)
     237void DepthFirstSearchAnalysis::ProbeAlongUnusedBond(atom *&Walker, bond::ptr &Binder)
    238238{
    239239  atom *OtherAtom = NULL;
     
    308308
    309309
    310 void DepthFirstSearchAnalysis::CleanRootStackDownTillWalker(atom *&Walker, bond *&Binder, ConnectedSubgraph &Subgraph)
     310void DepthFirstSearchAnalysis::CleanRootStackDownTillWalker(atom *&Walker, bond::ptr &Binder, ConnectedSubgraph &Subgraph)
    311311{
    312312  atom *OtherAtom = NULL;
     
    343343
    344344
    345 const std::deque<bond *>& DepthFirstSearchAnalysis::getBackEdgeStack() const
     345const std::deque<bond::ptr >& DepthFirstSearchAnalysis::getBackEdgeStack() const
    346346{
    347347  return BackEdgeStack;
     
    355355  int OldGraphNr = 0;
    356356  atom *Walker = NULL;
    357   bond *Binder = NULL;
     357  bond::ptr Binder = NULL;
    358358
    359359  if (World::getInstance().numAtoms() == 0)
  • src/Graph/DepthFirstSearchAnalysis.hpp

    rd6b6ce r88c8ec  
    1616#include <deque>
    1717
     18#include "Bond/bond.hpp"
    1819#include "ConnectedSubgraph.hpp"
    1920
    2021class atom;
    21 class bond;
    2222class ListOfLocalAtoms_t;
    2323class MoleculeLeafClass;
     
    3939   * articulations points, ...
    4040   * We use the algorithm from [Even, Graph Algorithms, p.62].
    41    * \param *&BackEdgeStack NULL pointer to std::deque<bond *> with all the found back edges, allocated and filled on return
     41   * \param *&BackEdgeStack NULL pointer to std::deque<bond::ptr > with all the found back edges, allocated and filled on return
    4242   * \return list of each disconnected subgraph as an individual molecule class structure
    4343   */
     
    7171   * \return true - everything ok, false - ReferenceStack was empty
    7272   */
    73   bool PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const;
     73  bool PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond::ptr > *&LocalStack) const;
    7474
    7575  /** Getter for BackEdgeStack.
     
    7777   * @return const reference to BackEdgeStack
    7878   */
    79   const std::deque<bond *>& getBackEdgeStack() const;
     79  const std::deque<bond::ptr >& getBackEdgeStack() const;
    8080
    8181private:
     
    8989   * \return bond class or NULL
    9090   */
    91   bond * FindNextUnused(atom *vertex) const;
     91  bond::ptr FindNextUnused(atom *vertex) const;
    9292
    9393  /** Resets bond::Used flag of all bonds in this molecule.
     
    116116   * \param *&Binder current edge
    117117   */
    118   void ProbeAlongUnusedBond(atom *&Walker, bond *&Binder);
     118  void ProbeAlongUnusedBond(atom *&Walker, bond::ptr &Binder);
    119119
    120120  /** Checks whether we have a new component.
     
    134134   * \param &LeafWalker contains reference to destination subgraph
    135135   */
    136   void CleanRootStackDownTillWalker(atom *&Walker, bond *&Binder, ConnectedSubgraph &LeafWalker);
     136  void CleanRootStackDownTillWalker(atom *&Walker, bond::ptr &Binder, ConnectedSubgraph &LeafWalker);
    137137
    138138  /** Output graph information per atom.
     
    145145
    146146  std::deque<atom *> AtomStack;
    147   std::deque<bond *> BackEdgeStack;
     147  std::deque<bond::ptr > BackEdgeStack;
    148148  int CurrentGraphNr;
    149149  int ComponentNumber;
  • src/Parser/Psi3Parser.cpp

    rd6b6ce r88c8ec  
    268268  unsigned int degrees = 0;
    269269  BOOST_FOREACH(atom *_atom, atoms) {
    270     BOOST_FOREACH(bond *_bond, _atom->getListOfBonds()) {
     270    BOOST_FOREACH(bond::ptr _bond, _atom->getListOfBonds()) {
    271271      degrees += 2*_bond->BondDegree;
    272272    }
  • src/Tesselation/boundary.cpp

    rd6b6ce r88c8ec  
    787787  Vector Inserter;
    788788  double FillIt = false;
    789   bond *Binder = NULL;
     789  bond::ptr Binder = NULL;
    790790  double phi[NDIM];
    791791  map<molecule *, Tesselation *> TesselStruct;
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp

    rd6b6ce r88c8ec  
    178178          ASSERT(!_atom->getListOfBonds().empty(),
    179179              "GLMoleculeObject_atom::recieveNotification() - received BondsAdded but ListOfBonds is empty.");
    180           const bond * _bond = *(_atom->getListOfBonds().rbegin());
     180          const bond::ptr _bond = *(_atom->getListOfBonds().rbegin());
    181181          const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == _atom) ?
    182182              GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp

    rd6b6ce r88c8ec  
    1818#include "CodePatterns/Observer/Observer.hpp"
    1919
     20#include "Bond/bond.hpp"
    2021#include "GLMoleculeObject_bond.hpp"
    2122
    2223class atom;
    23 class bond;
    2424
    2525class GLMoleculeObject_atom : public GLMoleculeObject, public Observer
     
    4040signals:
    4141  void clicked(atomId_t);
    42   void BondsInserted(const bond *_bond, const GLMoleculeObject_bond::SideOfBond side);
     42  void BondsInserted(const bond::ptr _bond, const GLMoleculeObject_bond::SideOfBond side);
    4343  void indexChanged(GLMoleculeObject_atom *ob, int oldId, int newId);
    4444
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp

    rd6b6ce r88c8ec  
    5454#include "LinearAlgebra/Vector.hpp"
    5555
    56 GLMoleculeObject_bond::GLMoleculeObject_bond(QGLSceneNode *mesh[], QObject *parent, const bond *bondref, const enum SideOfBond side) :
     56GLMoleculeObject_bond::GLMoleculeObject_bond(QGLSceneNode *mesh[], QObject *parent, const bond::ptr bondref, const enum SideOfBond side) :
    5757  GLMoleculeObject(mesh, parent),
    5858  Observer(std::string("GLMoleculeObject_bond")
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp

    rd6b6ce r88c8ec  
    1818#include "CodePatterns/Observer/Observer.hpp"
    1919
     20#include "Bond/bond.hpp"
    2021#include "types.hpp"
    2122
    22 class bond;
    2323
    2424class GLMoleculeObject_bond : public GLMoleculeObject, public Observer
     
    2828  enum SideOfBond { left, right };
    2929
    30   GLMoleculeObject_bond(QGLSceneNode *mesh[], QObject *parent, const bond *bondref, const enum SideOfBond side);
     30  GLMoleculeObject_bond(QGLSceneNode *mesh[], QObject *parent, const bond::ptr bondref, const enum SideOfBond side);
    3131  virtual ~GLMoleculeObject_bond();
    3232
     
    4141private:
    4242  void resetPosition();
    43   const bond *_bond;
     43  bond::ptr _bond;
    4444  const enum SideOfBond BondSide;
    4545};
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp

    rd6b6ce r88c8ec  
    127127            bonditer != bondlist.end();
    128128            ++bonditer) {
    129           const bond *_bond = *bonditer;
     129          const bond::ptr _bond = *bonditer;
    130130          const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ?
    131131              GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
     
    154154  connect (atomObject, SIGNAL(hoverChanged(GLMoleculeObject *)), this, SLOT(hoverChangedSignalled(GLMoleculeObject *)));
    155155  connect (atomObject, SIGNAL(selectionChanged()), this, SIGNAL(changed()));
    156   connect (atomObject, SIGNAL(BondsInserted(const bond *, const GLMoleculeObject_bond::SideOfBond)), this, SLOT(bondInserted(const bond *, const GLMoleculeObject_bond::SideOfBond)));
     156  connect (atomObject, SIGNAL(BondsInserted(const bond::ptr , const GLMoleculeObject_bond::SideOfBond)), this, SLOT(bondInserted(const bond::ptr , const GLMoleculeObject_bond::SideOfBond)));
    157157  connect (atomObject, SIGNAL(indexChanged(GLMoleculeObject_atom*, int, int)), this, SLOT(changeAtomId(GLMoleculeObject_atom*, int, int)));
    158158  //bondsChanged(_atom);
     
    244244 * @param side which side of the bond (left or right)
    245245 */
    246 void GLWorldScene::bondInserted(const bond *_bond, const enum GLMoleculeObject_bond::SideOfBond side)
     246void GLWorldScene::bondInserted(const bond::ptr _bond, const enum GLMoleculeObject_bond::SideOfBond side)
    247247{
    248248  LOG(3, "INFO: GLWorldScene::bondInserted() - Adding bond "+toString(*_bond)+".");
     
    263263      "GLWorldScene::bondAdded() - same left-sided bond "+toString(*_bond)+" added again.");
    264264#endif
    265   GLMoleculeObject_bond *bondObject =
     265  GLMoleculeObject_bond * bondObject =
    266266      new GLMoleculeObject_bond(meshCylinder, this, _bond, side);
    267267  connect (
     
    288288        "GLWorldScene::bondRemoved() - bond "+toString(leftnr)+"-"
    289289        +toString(rightnr)+" not on display.");
    290     //GLMoleculeObject_bond *bondObject = leftiter->second;
     290    //GLMoleculeObject_bond::ptr bondObject = leftiter->second;
    291291    BondsinSceneMap.erase(leftiter);
    292292    //delete bondObject; // is done by signal from bond itself
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp

    rd6b6ce r88c8ec  
    2020#include <iosfwd>
    2121
     22#include "Bond/bond.hpp"
    2223#include "GLMoleculeObject_bond.hpp"
    2324#include "GLMoleculeObject_molecule.hpp"
     
    8182  void moleculeRemoved(const molecule *_molecule);
    8283  void worldSelectionChanged();
    83   void bondInserted(const bond *_bond, const GLMoleculeObject_bond::SideOfBond side);
     84  void bondInserted(const bond::ptr _bond, const GLMoleculeObject_bond::SideOfBond side);
    8485  void bondRemoved(const atomId_t leftnr, const atomId_t rightnr);
    8586  void setSelectionModeAtom();
  • src/molecule.cpp

    rd6b6ce r88c8ec  
    326326 * \todo double and triple bonds splitting (always use the tetraeder angle!)
    327327 */
    328 bool molecule::AddHydrogenReplacementAtom(bond *TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem)
     328bool molecule::AddHydrogenReplacementAtom(bond::ptr TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem)
    329329{
    330330//  Info info(__func__);
     
    333333  double bondangle;  // bond angle of the bond to be replaced/cut
    334334  double BondRescale;   // rescale value for the hydrogen bond length
    335   bond *FirstBond = NULL, *SecondBond = NULL; // Other bonds in double bond case to determine "other" plane
     335  bond::ptr FirstBond = NULL;
     336  bond::ptr SecondBond = NULL; // Other bonds in double bond case to determine "other" plane
    336337  atom *FirstOtherAtom = NULL, *SecondOtherAtom = NULL, *ThirdOtherAtom = NULL; // pointer to hydrogen atoms to be added
    337338  double b,l,d,f,g, alpha, factors[NDIM];    // hold temporary values in triple bond case for coordination determination
     
    339340  Vector InBondvector;    // vector in direction of *Bond
    340341  const RealSpaceMatrix &matrix =  World::getInstance().getDomain().getM();
    341   bond *Binder = NULL;
     342  bond::ptr Binder = NULL;
    342343
    343344  // create vector in direction of bond
     
    596597        ++BondRunner)
    597598      if ((*BondRunner)->leftatom == *AtomRunner) {
    598         bond *Binder = (*BondRunner);
     599        bond::ptr Binder = (*BondRunner);
    599600        // get the pendant atoms of current bond in the copy molecule
    600601        ASSERT(FatherFinder.count(Binder->leftatom),
     
    607608        atom * const RightAtom = FatherFinder[Binder->rightatom];
    608609
    609         bond * const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
     610        bond::ptr const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
    610611        NewBond->Cyclic = Binder->Cyclic;
    611612        if (Binder->Cyclic)
     
    656657        ++BondRunner)
    657658      if ((*BondRunner)->leftatom == *AtomRunner) {
    658         bond *Binder = (*BondRunner);
     659        bond::ptr Binder = (*BondRunner);
    659660        if ((FatherFinder.count(Binder->leftatom))
    660661            && (FatherFinder.count(Binder->rightatom))) {
     
    663664          atom * const RightAtom = FatherFinder[Binder->rightatom];
    664665
    665           bond * const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
     666          bond::ptr const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
    666667          NewBond->Cyclic = Binder->Cyclic;
    667668          if (Binder->Cyclic)
     
    685686 * \return pointer to bond or NULL on failure
    686687 */
    687 bond * molecule::AddBond(atom *atom1, atom *atom2, int degree)
    688 {
    689   bond *Binder = NULL;
     688bond::ptr molecule::AddBond(atom *atom1, atom *atom2, int degree)
     689{
     690  bond::ptr Binder = NULL;
    690691
    691692  // some checks to make sure we are able to create the bond
     
    720721 * \return true - bound found and removed, false - bond not found/removed
    721722 */
    722 bool molecule::RemoveBond(bond *pointer)
     723bool molecule::RemoveBond(bond::ptr pointer)
    723724{
    724725  //ELOG(1, "molecule::RemoveBond: Function not implemented yet.");
  • src/molecule.hpp

    rd6b6ce r88c8ec  
    247247  /// Add/remove atoms to/from molecule.
    248248  atom * AddCopyAtom(atom *pointer);
    249   bool AddHydrogenReplacementAtom(bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem);
    250   bond * AddBond(atom *first, atom *second, int degree = 1);
    251   bool RemoveBond(bond *pointer);
     249  bool AddHydrogenReplacementAtom(bond::ptr Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem);
     250  bond::ptr AddBond(atom *first, atom *second, int degree = 1);
     251  bool RemoveBond(bond::ptr pointer);
    252252  bool RemoveBonds(atom *BondPartner);
    253253  bool hasBondStructure() const;
     
    287287  void OutputBondsList() const;
    288288
    289   bond * CopyBond(atom *left, atom *right, bond *CopyBond);
     289  bond::ptr CopyBond(atom *left, atom *right, bond::ptr CopyBond);
    290290
    291291  molecule *CopyMolecule(const Vector &offset = zeroVec) const;
  • src/molecule_graph.cpp

    rd6b6ce r88c8ec  
    190190 * \return pointer to new bond
    191191 */
    192 bond * molecule::CopyBond(atom *left, atom *right, bond *CopyBond)
    193 {
    194   bond *Binder = AddBond(left, right, CopyBond->BondDegree);
     192bond::ptr molecule::CopyBond(atom *left, atom *right, bond::ptr CopyBond)
     193{
     194  bond::ptr Binder = AddBond(left, right, CopyBond->BondDegree);
    195195  Binder->Cyclic = CopyBond->Cyclic;
    196196  Binder->Type = CopyBond->Type;
     
    273273bool molecule::ScanForPeriodicCorrection()
    274274{
    275   bond *Binder = NULL;
    276   //bond *OtherBinder = NULL;
     275  bond::ptr Binder = NULL;
     276  //bond::ptr OtherBinder = NULL;
    277277  atom *Walker = NULL;
    278278  atom *OtherWalker = NULL;
  • src/moleculelist.cpp

    rd6b6ce r88c8ec  
    299299bool MoleculeListClass::AddHydrogenCorrection(std::string &path)
    300300{
    301   const bond *Binder = NULL;
     301  bond::ptr Binder = NULL;
    302302  double ***FitConstant = NULL, **correction = NULL;
    303303  int a, b;
  • src/unittests/ListOfBondsUnitTest.cpp

    rd6b6ce r88c8ec  
    126126void ListOfBondsTest::AddingBondTest()
    127127{
    128   bond *Binder = NULL;
     128  bond::ptr Binder = NULL;
    129129  molecule::iterator iter = TestMolecule->begin();
    130130  atom *atom1 = *iter;
     
    147147  BondList::const_iterator bonditer;
    148148  bonditer = bondlist1.begin();
    149   bond *TestBond1 = *bonditer;
     149  bond::ptr TestBond1 = *bonditer;
    150150  CPPUNIT_ASSERT_EQUAL( TestBond1, Binder );
    151151  const BondList &bondlist2 = atom2->getListOfBonds();
    152152  bonditer = bondlist2.begin();
    153   bond *TestBond2 = *bonditer;
     153  bond::ptr TestBond2 = *bonditer;
    154154  CPPUNIT_ASSERT_EQUAL( TestBond2, Binder );
    155155};
     
    160160void ListOfBondsTest::RemovingBondTest()
    161161{
    162   bond *Binder = NULL;
     162  bond::ptr Binder = NULL;
    163163  molecule::iterator iter = TestMolecule->begin();
    164164  atom *atom1 = *iter;
     
    194194void ListOfBondsTest::RemovingBondsTest()
    195195{
    196   bond *Binder = NULL;
     196  bond::ptr Binder = NULL;
    197197  molecule::iterator iter = TestMolecule->begin();
    198198  atom *atom1 = *iter;
     
    249249};
    250250
    251 /** Unit Test of delete(bond *)
     251/** Unit Test of delete(bond::ptr )
    252252 *
    253253 */
    254254void ListOfBondsTest::DeleteBondTest()
    255255{
    256   bond *Binder = NULL;
     256  bond::ptr Binder = NULL;
    257257  molecule::iterator iter = TestMolecule->begin();
    258258  atom *atom1 = *iter;
     
    288288void ListOfBondsTest::RemoveAtomTest()
    289289{
    290   bond *Binder = NULL;
     290  bond::ptr Binder = NULL;
    291291  molecule::iterator iter = TestMolecule->begin();
    292292  atom *atom1 = *iter;
     
    320320  atom *atom1 = NULL;
    321321  atom *atom2 = NULL;
    322   bond *Binder = NULL;
     322  bond::ptr Binder = NULL;
    323323  {
    324324    molecule::iterator iter = TestMolecule->begin();
     
    366366  atom *atom1 = NULL;
    367367  atom *atom2 = NULL;
    368   bond *Binder = NULL;
     368  bond::ptr Binder = NULL;
    369369  {
    370370    molecule::iterator iter = TestMolecule->begin();
Note: See TracChangeset for help on using the changeset viewer.