Ignore:
Timestamp:
Dec 6, 2010, 7:37:05 PM (15 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, Candidate_v1.7.0, 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:
4c1230
Parents:
fd19ff
git-author:
Frederik Heber <heber@…> (12/06/10 19:15:03)
git-committer:
Frederik Heber <heber@…> (12/06/10 19:37:05)
Message:

Removed ancient StackClass, replaced by std::deque.

  • all PopLast replaced by pop_front.
  • all PopFirst replaced by pop_front.
  • and we have two remove items in two steps, first get item, then pop.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_fragmentation.cpp

    rfd19ff ra564be  
    3636#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3737#include "Box.hpp"
    38 #include "stackclass.hpp"
    3938
    4039/************************************* Functions for class molecule *********************************/
     
    613612  fstream File;
    614613  bool FragmentationToDo = true;
    615   class StackClass<bond *> *BackEdgeStack = NULL, *LocalBackEdgeStack = NULL;
     614  std::deque<bond *> *BackEdgeStack = NULL, *LocalBackEdgeStack = NULL;
    616615  bool CheckOrder = false;
    617616  Graph **FragmentList = NULL;
     
    656655    MolecularWalker->FillBondStructureFromReference(this, ListOfAtoms, false);  // we want to keep the created ListOfLocalAtoms
    657656    DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    658     LocalBackEdgeStack = new StackClass<bond *> (MolecularWalker->Leaf->BondCount);
     657    LocalBackEdgeStack = new std::deque<bond *>; // (MolecularWalker->Leaf->BondCount);
    659658//    // check the list of local atoms for debugging
    660659//    Log() << Verbose(0) << "ListOfLocalAtoms for this subgraph is:" << endl;
     
    884883
    885884
    886 /** Looks through a StackClass<atom *> and returns the likeliest removal candiate.
     885/** Looks through a std::deque<atom *> and returns the likeliest removal candiate.
    887886 * \param *out output stream for debugging messages
    888887 * \param *&Leaf KeySet to look through
     
    17431742  double tmp;
    17441743  Vector Translationvector;
    1745   //class StackClass<atom *> *CompStack = NULL;
    1746   class StackClass<atom *> *AtomStack = new StackClass<atom *>(getAtomCount());
     1744  //std::deque<atom *> *CompStack = NULL;
     1745  std::deque<atom *> *AtomStack = new std::deque<atom *>; // (getAtomCount());
    17471746  bool flag = true;
    17481747
     
    17851784      for (int i=getAtomCount();i--;)
    17861785        ColorList[i] = white;
    1787       AtomStack->Push(Binder->leftatom);
    1788       while (!AtomStack->IsEmpty()) {
    1789         Walker = AtomStack->PopFirst();
     1786      AtomStack->push_front(Binder->leftatom);
     1787      while (!AtomStack->empty()) {
     1788        Walker = AtomStack->front();
     1789        AtomStack->pop_front();
    17901790        //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl;
    17911791        ColorList[Walker->nr] = black;    // mark as explored
     
    17951795            OtherWalker = (*Runner)->GetOtherAtom(Walker);
    17961796            if (ColorList[OtherWalker->nr] == white) {
    1797               AtomStack->Push(OtherWalker); // push if yet unexplored
     1797              AtomStack->push_front(OtherWalker); // push if yet unexplored
    17981798            }
    17991799          }
Note: See TracChangeset for help on using the changeset viewer.