- Timestamp:
- Jan 17, 2013, 10:59:15 PM (12 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:
- 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)
- Location:
- src
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/GraphAction/DepthFirstSearchAction.cpp
rd6b6ce r88c8ec 58 58 LOG(1, "Depth-First-Search Analysis."); 59 59 ListOfLocalAtoms_t ListOfAtoms; 60 std::deque<bond *> *LocalBackEdgeStack = NULL;60 std::deque<bond::ptr > *LocalBackEdgeStack = NULL; 61 61 DepthFirstSearchAnalysis DFS; 62 62 DFS(); … … 69 69 ListOfAtoms.clear(); 70 70 Subgraphs->Leaf->FillListOfLocalAtoms(ListOfAtoms, Subgraphs->Leaf->getAtomCount()); 71 LocalBackEdgeStack = new std::deque<bond *>; // no need to have it Subgraphs->Leaf->BondCount size71 LocalBackEdgeStack = new std::deque<bond::ptr >; // no need to have it Subgraphs->Leaf->BondCount size 72 72 DFS.PickLocalBackEdges(ListOfAtoms, LocalBackEdgeStack); 73 73 CyclicStructureAnalysis CycleAnalysis(params.DoSaturation.get() ? DoSaturate : DontSaturate); -
src/Atom/CopyAtoms/CopyAtoms_withBonds.cpp
rd6b6ce r88c8ec 63 63 for(BondList::const_iterator iter = ListOfBonds.begin(); iter != ListOfBonds.end(); ++iter) { 64 64 // check both bond partners have been copied 65 const bond * constBinder = *iter;65 const bond::ptr Binder = *iter; 66 66 if (*original_iter == Binder->leftatom) { 67 67 LookupMap_t::const_iterator leftiter = LookupMap.find(Binder->leftatom); … … 71 71 atom * const LeftAtom = leftiter->second; 72 72 atom * const RightAtom = rightiter->second; 73 bond *const NewBond = LeftAtom->addBond(WorldTime::getTime(), RightAtom);73 bond::ptr const NewBond = LeftAtom->addBond(WorldTime::getTime(), RightAtom); 74 74 LOG(3, "DEBUG: Creating copy bond between original " << Binder->leftatom->getId() 75 75 << " and " << Binder->rightatom->getId() << ": " << *NewBond << "."); -
src/Atom/atom_bondedparticle.cpp
rd6b6ce r88c8ec 104 104 * @return const pointer to created bond or to already present bonds 105 105 */ 106 bond *const BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner)106 bond::ptr const BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner) 107 107 { 108 108 const BondList &bondlist = getListOfBondsAtStep(_step); … … 145 145 * @param Binder bond to remove 146 146 */ 147 void BondedParticle::removeBond(bond *binder)147 void BondedParticle::removeBond(bond::ptr binder) 148 148 { 149 149 UnregisterBond(binder); … … 177 177 * \param *Binder bond to insert 178 178 */ 179 bool BondedParticle::RegisterBond(const unsigned int _step, bond *const Binder)179 bool BondedParticle::RegisterBond(const unsigned int _step, bond::ptr const Binder) 180 180 { 181 181 OBSERVE; … … 203 203 * \param *Binder bond to remove 204 204 */ 205 bool BondedParticle::UnregisterBond(bond *const Binder)205 bool BondedParticle::UnregisterBond(bond::ptr const Binder) 206 206 { 207 207 OBSERVE; … … 253 253 * @return >=0 - first time step where bond appears, -1 - bond not present in lists 254 254 */ 255 int BondedParticle::ContainsBondAtStep(bond *Binder) const255 int BondedParticle::ContainsBondAtStep(bond::ptr Binder) const 256 256 { 257 257 int step = -1; … … 286 286 int FalseBondDegree = 0; 287 287 atom *OtherWalker = NULL; 288 bond *CandidateBond = NULL;288 bond::ptr CandidateBond = NULL; 289 289 290 290 NoBonds = CountBonds(); -
src/Atom/atom_bondedparticle.hpp
rd6b6ce r88c8ec 37 37 virtual ~BondedParticle(); 38 38 39 bond *const addBond(const unsigned int _step, BondedParticle* Partner);39 bond::ptr const addBond(const unsigned int _step, BondedParticle* Partner); 40 40 void removeBond(const unsigned int _step, BondedParticle* Partner); 41 void removeBond(bond *binder);41 void removeBond(bond::ptr binder); 42 42 void removeAllBonds(); 43 43 void removeAllBonds(const unsigned int _step); … … 54 54 55 55 protected: 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); 58 58 void UnregisterAllBond(const unsigned int _step); 59 59 60 int ContainsBondAtStep(bond *Binder) const;60 int ContainsBondAtStep(bond::ptr Binder) const; 61 61 62 62 }; -
src/Atom/atom_bondedparticleinfo.hpp
rd6b6ce r88c8ec 20 20 21 21 #include "atom_observable.hpp" 22 #include "Bond/bond.hpp" 22 23 23 24 #include <list> … … 25 26 /****************************************** forward declarations *****************************/ 26 27 27 class bond;28 28 class BondedParticle; 29 29 30 #define BondList std::list<bond *>30 #define BondList list<bond::ptr > 31 31 32 32 /********************************************** declarations *******************************/ -
src/Atom/unittests/CopyAtomsInterfaceUnitTest.cpp
rd6b6ce r88c8ec 129 129 const BondList & ListOfBonds = atoms[0]->getListOfBonds(); 130 130 CPPUNIT_ASSERT( !ListOfBonds.empty() ); 131 const bond *const _bond = *ListOfBonds.begin();131 bond::ptr const _bond = *ListOfBonds.begin(); 132 132 CPPUNIT_ASSERT( _bond->GetOtherAtom(atoms[0]) == atoms[1] ); 133 133 } … … 144 144 const BondList & ListOfBonds = copyMethod.CopiedAtoms[0]->getListOfBonds(); 145 145 CPPUNIT_ASSERT( !ListOfBonds.empty() ); 146 const bond *const _bond = *ListOfBonds.begin();146 bond::ptr const _bond = *ListOfBonds.begin(); 147 147 CPPUNIT_ASSERT( _bond->GetOtherAtom(copyMethod.CopiedAtoms[0]) == copyMethod.CopiedAtoms[1] ); 148 148 } -
src/Bond/BondInfo.cpp
rd6b6ce r88c8ec 49 49 #include "WorldTime.hpp" 50 50 51 BondInfo::BondInfo(const bond *_bond) :51 BondInfo::BondInfo(const bond::ptr _bond) : 52 52 leftid(_bond->leftatom->getId()), 53 53 rightid(_bond->rightatom->getId()), … … 65 65 } 66 66 const BondList &leftbonds = leftatom->getListOfBonds(); 67 boost::function< bool (const bond *)> predicate =67 boost::function< bool (const bond::ptr )> predicate = 68 68 boost::bind(static_cast<bool (bond::*)(const int) const>(&bond::Contains), _1, rightid); 69 69 if (std::find_if(leftbonds.begin(), leftbonds.end(), predicate) != leftbonds.end()) … … 76 76 // create bond 77 77 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); 79 79 _bond->BondDegree = degree; 80 80 return true; -
src/Bond/BondInfo.hpp
rd6b6ce r88c8ec 16 16 17 17 #include "types.hpp" 18 #include "Bond/bond.hpp" 18 19 19 class bond;20 20 21 21 /** Structure for containing bond state information. … … 29 29 * @param _bond bond whose state to store 30 30 */ 31 BondInfo(const bond *_bond);31 BondInfo(const bond::ptr _bond); 32 32 33 33 /** Recreates the bond whose state is contained in this BondInfo. -
src/Bond/bond.cpp
rd6b6ce r88c8ec 41 41 42 42 43 /***************************************** Functions for class bond ********************************/43 /***************************************** Functions for class bond::ptr *******************************/ 44 44 45 45 /** Empty Constructor for class bond. -
src/Bond/bond.hpp
rd6b6ce r88c8ec 37 37 class bond : public GraphEdge, public BondObservable 38 38 { 39 public: 39 public: 40 //!> typedef for a bond ptr 41 typedef bond* ptr; 42 40 43 atom *leftatom; //!< first bond partner 41 44 atom *rightatom; //!< second bond partner -
src/Fragmentation/BondsPerShortestPath.cpp
rd6b6ce r88c8ec 90 90 BondsPerSPCount[i] = 0; 91 91 BondsPerSPCount[0] = 1; 92 bond *Binder = new bond(_Root, _Root);92 bond::ptr Binder = new bond(_Root, _Root); 93 93 BondsPerSPList[0].push_back(Binder); 94 94 }; … … 138 138 atom *OtherWalker = NULL; 139 139 atom *Predecessor = NULL; 140 bond *Binder = NULL;140 bond::ptr Binder = NULL; 141 141 int RootKeyNr = _RootKeyNr; 142 142 int RemainingWalkers = -1; -
src/Fragmentation/PowerSetGenerator.cpp
rd6b6ce r88c8ec 88 88 * \return number of set bits 89 89 */ 90 int PowerSetGenerator::AddPowersetToSnakeStack(int verbosity, int CurrentCombination, int SetDimension, KeySet *FragmentSet, std::vector<bond *> &BondsSet, int *&TouchedList, int &TouchedIndex)90 int PowerSetGenerator::AddPowersetToSnakeStack(int verbosity, int CurrentCombination, int SetDimension, KeySet *FragmentSet, std::vector<bond::ptr > &BondsSet, int *&TouchedList, int &TouchedIndex) 91 91 { 92 92 atom *OtherWalker = NULL; … … 122 122 * \return number of elements 123 123 */ 124 int PowerSetGenerator::CountSetMembers(std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex)124 int PowerSetGenerator::CountSetMembers(std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex) 125 125 { 126 126 int SetDimension = 0; 127 for( std::list<bond *>::const_iterator Binder = SetFirst;127 for( std::list<bond::ptr >::const_iterator Binder = SetFirst; 128 128 Binder != SetLast; 129 129 ++Binder) { … … 144 144 * \return number of elements 145 145 */ 146 int PowerSetGenerator::FillBondsList(std::vector<bond *> &BondsList, std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex)146 int 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) 147 147 { 148 148 int SetDimension = 0; 149 for( std::list<bond *>::const_iterator Binder = SetFirst;149 for( std::list<bond::ptr >::const_iterator Binder = SetFirst; 150 150 Binder != SetLast; 151 151 ++Binder) { … … 257 257 * \param SubOrder remaining number of allowed vertices to add 258 258 */ 259 void PowerSetGenerator::SPFragmentGenerator(int RootDistance, std::vector<bond *> &BondsSet, int SetDimension, int SubOrder)259 void PowerSetGenerator::SPFragmentGenerator(int RootDistance, std::vector<bond::ptr > &BondsSet, int SetDimension, int SubOrder) 260 260 { 261 261 Info info(__func__); … … 302 302 303 303 // then allocate and fill the list 304 std::vector<bond *> BondsList;304 std::vector<bond::ptr > BondsList; 305 305 BondsList.resize(SubSetDimension); 306 306 SubSetDimension = FillBondsList(BondsList, BondsPerSPList.BondsPerSPList[SP].begin(), BondsPerSPList.BondsPerSPList[SP].end(), TouchedList, TouchedIndex); -
src/Fragmentation/PowerSetGenerator.hpp
rd6b6ce r88c8ec 17 17 #include <vector> 18 18 19 #include "Bond/bond.hpp" 19 20 #include "Fragmentation/BondsPerShortestPath.hpp" 20 21 #include "Fragmentation/HydrogenSaturation_enum.hpp" 21 22 22 class bond;23 23 class UniqueFragments; 24 24 … … 29 29 ~PowerSetGenerator(); 30 30 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); 32 32 int operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation); 33 33 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); 37 37 void ClearingTouched(int verbosity, int *&TouchedList, int SubOrder, int &TouchedIndex); 38 38 -
src/Graph/BondGraph.hpp
rd6b6ce r88c8ec 235 235 LOG(1, "ACCEPT: Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "."); 236 236 // directly use iter to avoid const_cast'ing Walker, too 237 //const bond *Binder =237 //const bond::ptr Binder = 238 238 const_cast<atom *>(Walker)->addBond(CurrentTime, const_cast<atom *>(OtherWalker)); 239 239 ++BondCount; … … 334 334 335 335 LOG(3, "INFO: Creating bond between atoms " << atom1 << " and " << atom2 << "."); 336 //const bond *Binder =336 //const bond::ptr Binder = 337 337 Walker->addBond(WorldTime::getTime(), OtherWalker); 338 338 bondcounter++; -
src/Graph/BreadthFirstSearchAdd.cpp
rd6b6ce r88c8ec 81 81 82 82 83 void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond)83 void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond::ptr &Binder, bond::ptr &Bond) 84 84 { 85 85 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) … … 132 132 133 133 134 void BreadthFirstSearchAdd::VisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond)134 void BreadthFirstSearchAdd::VisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond::ptr &Binder, bond::ptr &Bond) 135 135 { 136 136 LOG(3, "Not Adding, has already been visited."); … … 148 148 149 149 150 void BreadthFirstSearchAdd::operator()(molecule *Mol, atom *_Root, bond *Bond, int _BondOrder)150 void BreadthFirstSearchAdd::operator()(molecule *Mol, atom *_Root, bond::ptr Bond, int _BondOrder) 151 151 { 152 152 Info FunctionInfo("BreadthFirstSearchAdd"); 153 153 atom *Walker = NULL, *OtherAtom = NULL; 154 bond *Binder = NULL;154 bond::ptr Binder = NULL; 155 155 156 156 // add Root if not done yet -
src/Graph/BreadthFirstSearchAdd.hpp
rd6b6ce r88c8ec 17 17 #include <map> 18 18 19 #include "Bond/bond.hpp" 19 20 #include "Bond/GraphEdge.hpp" 20 21 #include "Fragmentation/HydrogenSaturation_enum.hpp" … … 23 24 24 25 class atom; 25 class bond;26 26 class molecule; 27 27 … … 48 48 * \param IsAngstroem lengths are in angstroem or bohrradii 49 49 */ 50 void operator()(molecule *Mol, atom *_Root, bond *Bond, int _BondOrder);50 void operator()(molecule *Mol, atom *_Root, bond::ptr Bond, int _BondOrder); 51 51 52 52 private: 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); 55 55 56 56 /** initialise vertex as white with no predecessor, empty queue, color Root lightgray. … … 70 70 int ComponentNr; 71 71 std::map<atomId_t, atom *> AddedAtomList; 72 std::map<bond *, bond *> AddedBondList; //!< maps from father bond to son72 std::map<bond::ptr , bond::ptr > AddedBondList; //!< maps from father bond to son 73 73 74 74 //!> whether to treat hydrogen special or not -
src/Graph/CyclicStructureAnalysis.cpp
rd6b6ce r88c8ec 102 102 * \param &BFS accounting structure 103 103 */ 104 void CyclicStructureAnalysis::CyclicBFSFromRootToRoot(bond *&BackEdge)104 void CyclicStructureAnalysis::CyclicBFSFromRootToRoot(bond::ptr &BackEdge) 105 105 { 106 106 atom *Walker = NULL; … … 187 187 * \param &MinRingSize global minimum distance from one node without encountering oneself, set on return 188 188 */ 189 void CyclicStructureAnalysis::RetrieveCycleMembers(atom *&OtherAtom, bond *&BackEdge, int &MinRingSize)189 void CyclicStructureAnalysis::RetrieveCycleMembers(atom *&OtherAtom, bond::ptr &BackEdge, int &MinRingSize) 190 190 { 191 191 atom *Walker = NULL; … … 327 327 * \todo BFS from the not-same-LP to find back to starting point of tributary cycle over more than one bond 328 328 */ 329 void CyclicStructureAnalysis::operator()(std::deque<bond *> * BackEdgeStack)329 void CyclicStructureAnalysis::operator()(std::deque<bond::ptr > * BackEdgeStack) 330 330 { 331 331 Info FunctionInfo("CyclicStructureAnalysis"); 332 332 atom *Walker = NULL; 333 333 atom *OtherAtom = NULL; 334 bond *BackEdge = NULL;334 bond::ptr BackEdge = NULL; 335 335 int NumCycles = 0; 336 336 int MinRingSize = -1; -
src/Graph/CyclicStructureAnalysis.hpp
rd6b6ce r88c8ec 17 17 #include <map> 18 18 19 #include "Bond/bond.hpp" 19 20 #include "Bond/GraphEdge.hpp" 20 21 #include "Fragmentation/HydrogenSaturation_enum.hpp" … … 23 24 24 25 class atom; 25 class bond;26 26 class molecule; 27 27 … … 33 33 34 34 void Reset(); 35 void operator()(std::deque<bond *> * BackEdgeStack);35 void operator()(std::deque<bond::ptr > * BackEdgeStack); 36 36 37 37 const std::map<atomId_t, int >& getMinimumRingSize() const; … … 43 43 void InitializeToRoot(atom *&Walker); 44 44 // 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); 47 47 void BFSToNextCycle(atom *&Root, atom *&Walker); 48 48 void AssignRingSizetoNonCycleMembers(int &MinRingSize, int &NumCycles); -
src/Graph/DepthFirstSearchAnalysis.cpp
rd6b6ce r88c8ec 77 77 78 78 79 bond *DepthFirstSearchAnalysis::FindNextUnused(atom *vertex) const79 bond::ptr DepthFirstSearchAnalysis::FindNextUnused(atom *vertex) const 80 80 { 81 81 const BondList& ListOfBonds = vertex->getListOfBonds(); … … 122 122 123 123 124 bool DepthFirstSearchAnalysis::PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const124 bool DepthFirstSearchAnalysis::PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond::ptr > *&LocalStack) const 125 125 { 126 126 bool status = true; … … 129 129 return false; 130 130 } 131 bond *Binder = BackEdgeStack.front();132 bond *FirstBond = Binder; // mark the first bond, so that we don't loop through the stack indefinitely131 bond::ptr Binder = BackEdgeStack.front(); 132 bond::ptr FirstBond = Binder; // mark the first bond, so that we don't loop through the stack indefinitely 133 133 atom *Walker = NULL, *OtherAtom = NULL; 134 134 … … 183 183 ++BondRunner) 184 184 if ((*BondRunner)->leftatom == *AtomRunner) { 185 const bond *Binder = *BondRunner;185 const bond::ptr Binder = *BondRunner; 186 186 if (DoLog(2)) { 187 187 std::stringstream output; … … 235 235 236 236 237 void DepthFirstSearchAnalysis::ProbeAlongUnusedBond(atom *&Walker, bond *&Binder)237 void DepthFirstSearchAnalysis::ProbeAlongUnusedBond(atom *&Walker, bond::ptr &Binder) 238 238 { 239 239 atom *OtherAtom = NULL; … … 308 308 309 309 310 void DepthFirstSearchAnalysis::CleanRootStackDownTillWalker(atom *&Walker, bond *&Binder, ConnectedSubgraph &Subgraph)310 void DepthFirstSearchAnalysis::CleanRootStackDownTillWalker(atom *&Walker, bond::ptr &Binder, ConnectedSubgraph &Subgraph) 311 311 { 312 312 atom *OtherAtom = NULL; … … 343 343 344 344 345 const std::deque<bond *>& DepthFirstSearchAnalysis::getBackEdgeStack() const345 const std::deque<bond::ptr >& DepthFirstSearchAnalysis::getBackEdgeStack() const 346 346 { 347 347 return BackEdgeStack; … … 355 355 int OldGraphNr = 0; 356 356 atom *Walker = NULL; 357 bond *Binder = NULL;357 bond::ptr Binder = NULL; 358 358 359 359 if (World::getInstance().numAtoms() == 0) -
src/Graph/DepthFirstSearchAnalysis.hpp
rd6b6ce r88c8ec 16 16 #include <deque> 17 17 18 #include "Bond/bond.hpp" 18 19 #include "ConnectedSubgraph.hpp" 19 20 20 21 class atom; 21 class bond;22 22 class ListOfLocalAtoms_t; 23 23 class MoleculeLeafClass; … … 39 39 * articulations points, ... 40 40 * 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 return41 * \param *&BackEdgeStack NULL pointer to std::deque<bond::ptr > with all the found back edges, allocated and filled on return 42 42 * \return list of each disconnected subgraph as an individual molecule class structure 43 43 */ … … 71 71 * \return true - everything ok, false - ReferenceStack was empty 72 72 */ 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; 74 74 75 75 /** Getter for BackEdgeStack. … … 77 77 * @return const reference to BackEdgeStack 78 78 */ 79 const std::deque<bond *>& getBackEdgeStack() const;79 const std::deque<bond::ptr >& getBackEdgeStack() const; 80 80 81 81 private: … … 89 89 * \return bond class or NULL 90 90 */ 91 bond *FindNextUnused(atom *vertex) const;91 bond::ptr FindNextUnused(atom *vertex) const; 92 92 93 93 /** Resets bond::Used flag of all bonds in this molecule. … … 116 116 * \param *&Binder current edge 117 117 */ 118 void ProbeAlongUnusedBond(atom *&Walker, bond *&Binder);118 void ProbeAlongUnusedBond(atom *&Walker, bond::ptr &Binder); 119 119 120 120 /** Checks whether we have a new component. … … 134 134 * \param &LeafWalker contains reference to destination subgraph 135 135 */ 136 void CleanRootStackDownTillWalker(atom *&Walker, bond *&Binder, ConnectedSubgraph &LeafWalker);136 void CleanRootStackDownTillWalker(atom *&Walker, bond::ptr &Binder, ConnectedSubgraph &LeafWalker); 137 137 138 138 /** Output graph information per atom. … … 145 145 146 146 std::deque<atom *> AtomStack; 147 std::deque<bond *> BackEdgeStack;147 std::deque<bond::ptr > BackEdgeStack; 148 148 int CurrentGraphNr; 149 149 int ComponentNumber; -
src/Parser/Psi3Parser.cpp
rd6b6ce r88c8ec 268 268 unsigned int degrees = 0; 269 269 BOOST_FOREACH(atom *_atom, atoms) { 270 BOOST_FOREACH(bond *_bond, _atom->getListOfBonds()) {270 BOOST_FOREACH(bond::ptr _bond, _atom->getListOfBonds()) { 271 271 degrees += 2*_bond->BondDegree; 272 272 } -
src/Tesselation/boundary.cpp
rd6b6ce r88c8ec 787 787 Vector Inserter; 788 788 double FillIt = false; 789 bond *Binder = NULL;789 bond::ptr Binder = NULL; 790 790 double phi[NDIM]; 791 791 map<molecule *, Tesselation *> TesselStruct; -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
rd6b6ce r88c8ec 178 178 ASSERT(!_atom->getListOfBonds().empty(), 179 179 "GLMoleculeObject_atom::recieveNotification() - received BondsAdded but ListOfBonds is empty."); 180 const bond *_bond = *(_atom->getListOfBonds().rbegin());180 const bond::ptr _bond = *(_atom->getListOfBonds().rbegin()); 181 181 const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == _atom) ? 182 182 GLMoleculeObject_bond::left : GLMoleculeObject_bond::right; -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp
rd6b6ce r88c8ec 18 18 #include "CodePatterns/Observer/Observer.hpp" 19 19 20 #include "Bond/bond.hpp" 20 21 #include "GLMoleculeObject_bond.hpp" 21 22 22 23 class atom; 23 class bond;24 24 25 25 class GLMoleculeObject_atom : public GLMoleculeObject, public Observer … … 40 40 signals: 41 41 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); 43 43 void indexChanged(GLMoleculeObject_atom *ob, int oldId, int newId); 44 44 -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp
rd6b6ce r88c8ec 54 54 #include "LinearAlgebra/Vector.hpp" 55 55 56 GLMoleculeObject_bond::GLMoleculeObject_bond(QGLSceneNode *mesh[], QObject *parent, const bond *bondref, const enum SideOfBond side) :56 GLMoleculeObject_bond::GLMoleculeObject_bond(QGLSceneNode *mesh[], QObject *parent, const bond::ptr bondref, const enum SideOfBond side) : 57 57 GLMoleculeObject(mesh, parent), 58 58 Observer(std::string("GLMoleculeObject_bond") -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp
rd6b6ce r88c8ec 18 18 #include "CodePatterns/Observer/Observer.hpp" 19 19 20 #include "Bond/bond.hpp" 20 21 #include "types.hpp" 21 22 22 class bond;23 23 24 24 class GLMoleculeObject_bond : public GLMoleculeObject, public Observer … … 28 28 enum SideOfBond { left, right }; 29 29 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); 31 31 virtual ~GLMoleculeObject_bond(); 32 32 … … 41 41 private: 42 42 void resetPosition(); 43 const bond *_bond;43 bond::ptr _bond; 44 44 const enum SideOfBond BondSide; 45 45 }; -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
rd6b6ce r88c8ec 127 127 bonditer != bondlist.end(); 128 128 ++bonditer) { 129 const bond *_bond = *bonditer;129 const bond::ptr _bond = *bonditer; 130 130 const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ? 131 131 GLMoleculeObject_bond::left : GLMoleculeObject_bond::right; … … 154 154 connect (atomObject, SIGNAL(hoverChanged(GLMoleculeObject *)), this, SLOT(hoverChangedSignalled(GLMoleculeObject *))); 155 155 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))); 157 157 connect (atomObject, SIGNAL(indexChanged(GLMoleculeObject_atom*, int, int)), this, SLOT(changeAtomId(GLMoleculeObject_atom*, int, int))); 158 158 //bondsChanged(_atom); … … 244 244 * @param side which side of the bond (left or right) 245 245 */ 246 void GLWorldScene::bondInserted(const bond *_bond, const enum GLMoleculeObject_bond::SideOfBond side)246 void GLWorldScene::bondInserted(const bond::ptr _bond, const enum GLMoleculeObject_bond::SideOfBond side) 247 247 { 248 248 LOG(3, "INFO: GLWorldScene::bondInserted() - Adding bond "+toString(*_bond)+"."); … … 263 263 "GLWorldScene::bondAdded() - same left-sided bond "+toString(*_bond)+" added again."); 264 264 #endif 265 GLMoleculeObject_bond * bondObject =265 GLMoleculeObject_bond * bondObject = 266 266 new GLMoleculeObject_bond(meshCylinder, this, _bond, side); 267 267 connect ( … … 288 288 "GLWorldScene::bondRemoved() - bond "+toString(leftnr)+"-" 289 289 +toString(rightnr)+" not on display."); 290 //GLMoleculeObject_bond *bondObject = leftiter->second;290 //GLMoleculeObject_bond::ptr bondObject = leftiter->second; 291 291 BondsinSceneMap.erase(leftiter); 292 292 //delete bondObject; // is done by signal from bond itself -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
rd6b6ce r88c8ec 20 20 #include <iosfwd> 21 21 22 #include "Bond/bond.hpp" 22 23 #include "GLMoleculeObject_bond.hpp" 23 24 #include "GLMoleculeObject_molecule.hpp" … … 81 82 void moleculeRemoved(const molecule *_molecule); 82 83 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); 84 85 void bondRemoved(const atomId_t leftnr, const atomId_t rightnr); 85 86 void setSelectionModeAtom(); -
src/molecule.cpp
rd6b6ce r88c8ec 326 326 * \todo double and triple bonds splitting (always use the tetraeder angle!) 327 327 */ 328 bool molecule::AddHydrogenReplacementAtom(bond *TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem)328 bool molecule::AddHydrogenReplacementAtom(bond::ptr TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem) 329 329 { 330 330 // Info info(__func__); … … 333 333 double bondangle; // bond angle of the bond to be replaced/cut 334 334 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 336 337 atom *FirstOtherAtom = NULL, *SecondOtherAtom = NULL, *ThirdOtherAtom = NULL; // pointer to hydrogen atoms to be added 337 338 double b,l,d,f,g, alpha, factors[NDIM]; // hold temporary values in triple bond case for coordination determination … … 339 340 Vector InBondvector; // vector in direction of *Bond 340 341 const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM(); 341 bond *Binder = NULL;342 bond::ptr Binder = NULL; 342 343 343 344 // create vector in direction of bond … … 596 597 ++BondRunner) 597 598 if ((*BondRunner)->leftatom == *AtomRunner) { 598 bond *Binder = (*BondRunner);599 bond::ptr Binder = (*BondRunner); 599 600 // get the pendant atoms of current bond in the copy molecule 600 601 ASSERT(FatherFinder.count(Binder->leftatom), … … 607 608 atom * const RightAtom = FatherFinder[Binder->rightatom]; 608 609 609 bond *const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);610 bond::ptr const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree); 610 611 NewBond->Cyclic = Binder->Cyclic; 611 612 if (Binder->Cyclic) … … 656 657 ++BondRunner) 657 658 if ((*BondRunner)->leftatom == *AtomRunner) { 658 bond *Binder = (*BondRunner);659 bond::ptr Binder = (*BondRunner); 659 660 if ((FatherFinder.count(Binder->leftatom)) 660 661 && (FatherFinder.count(Binder->rightatom))) { … … 663 664 atom * const RightAtom = FatherFinder[Binder->rightatom]; 664 665 665 bond *const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);666 bond::ptr const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree); 666 667 NewBond->Cyclic = Binder->Cyclic; 667 668 if (Binder->Cyclic) … … 685 686 * \return pointer to bond or NULL on failure 686 687 */ 687 bond *molecule::AddBond(atom *atom1, atom *atom2, int degree)688 { 689 bond *Binder = NULL;688 bond::ptr molecule::AddBond(atom *atom1, atom *atom2, int degree) 689 { 690 bond::ptr Binder = NULL; 690 691 691 692 // some checks to make sure we are able to create the bond … … 720 721 * \return true - bound found and removed, false - bond not found/removed 721 722 */ 722 bool molecule::RemoveBond(bond *pointer)723 bool molecule::RemoveBond(bond::ptr pointer) 723 724 { 724 725 //ELOG(1, "molecule::RemoveBond: Function not implemented yet."); -
src/molecule.hpp
rd6b6ce r88c8ec 247 247 /// Add/remove atoms to/from molecule. 248 248 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); 252 252 bool RemoveBonds(atom *BondPartner); 253 253 bool hasBondStructure() const; … … 287 287 void OutputBondsList() const; 288 288 289 bond * CopyBond(atom *left, atom *right, bond *CopyBond);289 bond::ptr CopyBond(atom *left, atom *right, bond::ptr CopyBond); 290 290 291 291 molecule *CopyMolecule(const Vector &offset = zeroVec) const; -
src/molecule_graph.cpp
rd6b6ce r88c8ec 190 190 * \return pointer to new bond 191 191 */ 192 bond * molecule::CopyBond(atom *left, atom *right, bond *CopyBond)193 { 194 bond *Binder = AddBond(left, right, CopyBond->BondDegree);192 bond::ptr molecule::CopyBond(atom *left, atom *right, bond::ptr CopyBond) 193 { 194 bond::ptr Binder = AddBond(left, right, CopyBond->BondDegree); 195 195 Binder->Cyclic = CopyBond->Cyclic; 196 196 Binder->Type = CopyBond->Type; … … 273 273 bool molecule::ScanForPeriodicCorrection() 274 274 { 275 bond *Binder = NULL;276 //bond *OtherBinder = NULL;275 bond::ptr Binder = NULL; 276 //bond::ptr OtherBinder = NULL; 277 277 atom *Walker = NULL; 278 278 atom *OtherWalker = NULL; -
src/moleculelist.cpp
rd6b6ce r88c8ec 299 299 bool MoleculeListClass::AddHydrogenCorrection(std::string &path) 300 300 { 301 const bond *Binder = NULL;301 bond::ptr Binder = NULL; 302 302 double ***FitConstant = NULL, **correction = NULL; 303 303 int a, b; -
src/unittests/ListOfBondsUnitTest.cpp
rd6b6ce r88c8ec 126 126 void ListOfBondsTest::AddingBondTest() 127 127 { 128 bond *Binder = NULL;128 bond::ptr Binder = NULL; 129 129 molecule::iterator iter = TestMolecule->begin(); 130 130 atom *atom1 = *iter; … … 147 147 BondList::const_iterator bonditer; 148 148 bonditer = bondlist1.begin(); 149 bond *TestBond1 = *bonditer;149 bond::ptr TestBond1 = *bonditer; 150 150 CPPUNIT_ASSERT_EQUAL( TestBond1, Binder ); 151 151 const BondList &bondlist2 = atom2->getListOfBonds(); 152 152 bonditer = bondlist2.begin(); 153 bond *TestBond2 = *bonditer;153 bond::ptr TestBond2 = *bonditer; 154 154 CPPUNIT_ASSERT_EQUAL( TestBond2, Binder ); 155 155 }; … … 160 160 void ListOfBondsTest::RemovingBondTest() 161 161 { 162 bond *Binder = NULL;162 bond::ptr Binder = NULL; 163 163 molecule::iterator iter = TestMolecule->begin(); 164 164 atom *atom1 = *iter; … … 194 194 void ListOfBondsTest::RemovingBondsTest() 195 195 { 196 bond *Binder = NULL;196 bond::ptr Binder = NULL; 197 197 molecule::iterator iter = TestMolecule->begin(); 198 198 atom *atom1 = *iter; … … 249 249 }; 250 250 251 /** Unit Test of delete(bond *)251 /** Unit Test of delete(bond::ptr ) 252 252 * 253 253 */ 254 254 void ListOfBondsTest::DeleteBondTest() 255 255 { 256 bond *Binder = NULL;256 bond::ptr Binder = NULL; 257 257 molecule::iterator iter = TestMolecule->begin(); 258 258 atom *atom1 = *iter; … … 288 288 void ListOfBondsTest::RemoveAtomTest() 289 289 { 290 bond *Binder = NULL;290 bond::ptr Binder = NULL; 291 291 molecule::iterator iter = TestMolecule->begin(); 292 292 atom *atom1 = *iter; … … 320 320 atom *atom1 = NULL; 321 321 atom *atom2 = NULL; 322 bond *Binder = NULL;322 bond::ptr Binder = NULL; 323 323 { 324 324 molecule::iterator iter = TestMolecule->begin(); … … 366 366 atom *atom1 = NULL; 367 367 atom *atom2 = NULL; 368 bond *Binder = NULL;368 bond::ptr Binder = NULL; 369 369 { 370 370 molecule::iterator iter = TestMolecule->begin();
Note:
See TracChangeset
for help on using the changeset viewer.