Changeset 30c753 for src


Ignore:
Timestamp:
Dec 28, 2011, 3:25:48 PM (13 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:
59fff1
Parents:
f99714
git-author:
Frederik Heber <heber@…> (12/22/11 13:14:16)
git-committer:
Frederik Heber <heber@…> (12/28/11 15:25:48)
Message:

Removed atomSet atoms in class molecule and replaced by a boost::transform_iterator.

  • atoms causes us a O(N2) complexity due to having to remove atoms from this linearized vector (in O(N) not O(log N) as for the atomIds.
  • marked Molecules/BondFile and Tesselation/BigNonConvex as XFAIL due to interchanged ids.
  • thanks to Jan Hamaekers for pointing this out.
  • NOTE: so far we have not specialized molecule::const_iterator, it simply points to molecule::iterator.
Location:
src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/Dynamics/LinearInterpolationBetweenSteps.hpp

    rf99714 r30c753  
    5656      LOG(1, "STATUS: Constructing atom mapping from start to end position.");
    5757      molecule::atomSet atoms_list;
    58       copy(atoms.begin(), atoms.end(), atoms_list.begin());
     58      for (typename AtomSetMixin<Set>::const_iterator iter = atoms.begin();
     59          iter != atoms.end(); ++iter)
     60        atoms_list.insert(*iter);
    5961      MinimiseConstrainedPotential Minimiser(atoms_list, PermutationMap);
    6062      Minimiser(startstep, endstep, IsAngstroem);
  • src/Dynamics/VerletForceIntegration.hpp

    rf99714 r30c753  
    9999      std::map<atom *, atom*> PermutationMap;
    100100      molecule::atomSet atoms_list;
    101       copy(atoms.begin(), atoms.end(), atoms_list.begin());
     101      for (typename AtomSetMixin<T>::const_iterator iter = atoms.begin();
     102          iter != atoms.end(); ++iter)
     103        atoms_list.insert(*iter);
    102104      MinimiseConstrainedPotential Minimiser(atoms_list, PermutationMap);
    103105      //double ConstrainedPotentialEnergy =
  • src/Parser/FormatParserStorage.cpp

    rf99714 r30c753  
    278278      MolIter != molecules.end();
    279279      ++MolIter) {
    280     for(molecule::atomSet::const_iterator AtomIter = (*MolIter)->begin();
     280    for(molecule::const_iterator AtomIter = (*MolIter)->begin();
    281281        AtomIter != (*MolIter)->end();
    282282        ++AtomIter) {
  • src/molecule.cpp

    rf99714 r30c753  
    150150
    151151molecule::iterator molecule::begin(){
    152   return molecule::iterator(atoms.begin(),this);
     152  return iterator(atomIds.begin(), FromIdToAtom());
    153153}
    154154
    155155molecule::const_iterator molecule::begin() const{
    156   return atoms.begin();
     156  return const_iterator(atomIds.begin(), FromIdToAtom());
    157157}
    158158
    159159molecule::iterator molecule::end(){
    160   return molecule::iterator(atoms.end(),this);
     160  return iterator(atomIds.end(), FromIdToAtom());
    161161}
    162162
    163163molecule::const_iterator molecule::end() const{
    164   return atoms.end();
     164  return const_iterator(atomIds.end(), FromIdToAtom());
    165165}
    166166
    167167bool molecule::empty() const
    168168{
    169   return (begin() == end());
     169  return (atomIds.empty());
    170170}
    171171
     
    182182  OBSERVE;
    183183  molecule::const_iterator iter = loc;
    184   iter++;
     184  ++iter;
    185185  atom* atom = *loc;
    186186  atomIds.erase( atom->getId() );
    187   atoms.remove( atom );
    188187  formula-=atom->getType();
    189188  atom->removeFromMolecule();
     
    196195  molecule::const_iterator iter = find(key);
    197196  if (iter != end()){
    198     iter++;
     197    ++iter;
    199198    atomIds.erase( key->getId() );
    200     atoms.remove( key );
    201199    formula-=key->getType();
    202200    key->removeFromMolecule();
     
    207205molecule::const_iterator molecule::find ( atom * key ) const
    208206{
    209   molecule::const_iterator iter;
    210   for (molecule::const_iterator Runner = begin(); Runner != end(); ++Runner) {
    211     if (*Runner == key)
    212       return molecule::const_iterator(Runner);
    213   }
    214   return molecule::const_iterator(atoms.end());
     207  return const_iterator(atomIds.find(key->getId()), FromIdToAtom());
    215208}
    216209
     
    220213  pair<atomIdSet::iterator,bool> res = atomIds.insert(key->getId());
    221214  if (res.second) { // push atom if went well
    222     atoms.push_back(key);
    223215    formula+=key->getType();
    224     return pair<iterator,bool>(molecule::iterator(--end()),res.second);
     216    return pair<iterator,bool>(iterator(res.first, FromIdToAtom()),res.second);
    225217  } else {
    226     return pair<iterator,bool>(molecule::iterator(end()),res.second);
     218    return pair<iterator,bool>(end(),res.second);
    227219  }
    228220}
     
    235227{
    236228  World::AtomComposite vector_of_atoms;
    237   BOOST_FOREACH(atom *_atom, atoms)
    238     vector_of_atoms.push_back(_atom);
     229//  std::copy(MyIter(atomIds.begin(), FromIdToAtom()),
     230//      MyIter(atomIds.end(), FromIdToAtom()),
     231//      vector_of_atoms.begin());
     232//  for (MyIter iter = MyIter(atomIds.begin(), FromIdToAtom());
     233//      iter != MyIter(atomIds.end(), FromIdToAtom());
     234//      ++iter)
     235  for (molecule::const_iterator iter = begin(); iter != end(); ++iter)
     236    vector_of_atoms.push_back(*iter);
    239237  return vector_of_atoms;
    240238}
     
    635633
    636634  // copy all atoms
    637   for_each(atoms.begin(),atoms.end(),bind1st(mem_fun(&molecule::AddCopyAtom),copy));
     635  std::map< const atom *, atom *> FatherFinder;
     636  for (const_iterator iter = begin(); iter != end(); ++iter) {
     637    atom *const copy_atom = copy->AddCopyAtom(*iter);
     638    FatherFinder.insert( std::make_pair( *iter, copy_atom ) );
     639  }
     640
     641  // copy all bonds
     642  for(const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) {
     643    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
     644    for(BondList::const_iterator BondRunner = ListOfBonds.begin();
     645        BondRunner != ListOfBonds.end();
     646        ++BondRunner)
     647      if ((*BondRunner)->leftatom == *AtomRunner) {
     648        bond *Binder = (*BondRunner);
     649        // get the pendant atoms of current bond in the copy molecule
     650        ASSERT(FatherFinder.count(Binder->leftatom),
     651            "molecule::CopyMolecule() - No copy of original left atom for bond copy found");
     652        ASSERT(FatherFinder.count(Binder->rightatom),
     653            "molecule::CopyMolecule() - No copy of original right atom for bond copy found");
     654        atom * const LeftAtom = FatherFinder[Binder->leftatom];
     655        atom * const RightAtom = FatherFinder[Binder->rightatom];
     656
     657        bond * const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
     658        NewBond->Cyclic = Binder->Cyclic;
     659        if (Binder->Cyclic)
     660          copy->NoCyclicBonds++;
     661        NewBond->Type = Binder->Type;
     662      }
     663  }
     664  // correct fathers
     665  //for_each(begin(),end(),mem_fun(&atom::CorrectFather));
     666
     667  return copy;
     668};
     669
     670
     671/** Destroys all atoms inside this molecule.
     672 */
     673void molecule::removeAtomsinMolecule()
     674{
     675  // remove each atom from world
     676  for(const_iterator AtomRunner = begin(); !empty(); AtomRunner = begin())
     677    World::getInstance().destroyAtom(*AtomRunner);
     678};
     679
     680
     681/**
     682 * Copies all atoms of a molecule which are within the defined parallelepiped.
     683 *
     684 * @param offest for the origin of the parallelepiped
     685 * @param three vectors forming the matrix that defines the shape of the parallelpiped
     686 */
     687molecule* molecule::CopyMoleculeFromSubRegion(const Shape &region) const {
     688  molecule *copy = World::getInstance().createMolecule();
     689
     690  // copy all atoms
     691  std::map< const atom *, atom *> FatherFinder;
     692  for (const_iterator iter = begin(); iter != end(); ++iter) {
     693    if((*iter)->IsInShape(region)){
     694      atom *const copy_atom = copy->AddCopyAtom(*iter);
     695      FatherFinder.insert( std::make_pair( *iter, copy_atom ) );
     696    }
     697  }
    638698
    639699  // copy all bonds
     
    645705      if ((*BondRunner)->leftatom == *AtomRunner) {
    646706        bond *Binder = (*BondRunner);
    647         // get the pendant atoms of current bond in the copy molecule
    648         atomSet::iterator leftiter=find_if(copy->atoms.begin(),copy->atoms.end(),bind2nd(mem_fun(&atom::isFather),Binder->leftatom));
    649         atomSet::iterator rightiter=find_if(copy->atoms.begin(),copy->atoms.end(),bind2nd(mem_fun(&atom::isFather),Binder->rightatom));
    650         ASSERT(leftiter!=copy->atoms.end(),"No copy of original left atom for bond copy found");
    651         ASSERT(leftiter!=copy->atoms.end(),"No copy of original right atom for bond copy found");
    652         atom *LeftAtom = *leftiter;
    653         atom *RightAtom = *rightiter;
    654 
    655         bond *NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
    656         NewBond->Cyclic = Binder->Cyclic;
    657         if (Binder->Cyclic)
    658           copy->NoCyclicBonds++;
    659         NewBond->Type = Binder->Type;
     707        if ((FatherFinder.count(Binder->leftatom))
     708            && (FatherFinder.count(Binder->rightatom))) {
     709          // if copy present, then it must be from subregion
     710          atom * const LeftAtom = FatherFinder[Binder->leftatom];
     711          atom * const RightAtom = FatherFinder[Binder->rightatom];
     712
     713          bond * const NewBond = copy->AddBond(LeftAtom, RightAtom, Binder->BondDegree);
     714          NewBond->Cyclic = Binder->Cyclic;
     715          if (Binder->Cyclic)
     716            copy->NoCyclicBonds++;
     717          NewBond->Type = Binder->Type;
     718        }
    660719      }
    661720  }
    662721  // correct fathers
    663   //for_each(atoms.begin(),atoms.end(),mem_fun(&atom::CorrectFather));
    664 
    665   return copy;
    666 };
    667 
    668 
    669 /** Destroys all atoms inside this molecule.
    670  */
    671 void molecule::removeAtomsinMolecule()
    672 {
    673   // remove each atom from world
    674   for(molecule::const_iterator AtomRunner = begin(); !empty(); AtomRunner = begin())
    675     World::getInstance().destroyAtom(*AtomRunner);
    676 };
    677 
    678 
    679 /**
    680  * Copies all atoms of a molecule which are within the defined parallelepiped.
    681  *
    682  * @param offest for the origin of the parallelepiped
    683  * @param three vectors forming the matrix that defines the shape of the parallelpiped
    684  */
    685 molecule* molecule::CopyMoleculeFromSubRegion(const Shape &region) const {
    686   molecule *copy = World::getInstance().createMolecule();
    687 
    688   BOOST_FOREACH(atom *iter,atoms){
    689     if(iter->IsInShape(region)){
    690       copy->AddCopyAtom(iter);
    691     }
    692   }
     722  //for_each(begin(),end(),mem_fun(&atom::CorrectFather));
    693723
    694724  //TODO: copy->BuildInducedSubgraph(this);
     
    878908    enumeration<const element*> elementLookup = formula.enumerateElements();
    879909    *output << "#Ion_TypeNr._Nr.R[0]    R[1]    R[2]    MoveType (0 MoveIon, 1 FixedIon)" << endl;
    880     for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputArrayIndexed,_1,output,elementLookup,AtomNo,(const char*)0));
     910    for_each(begin(),end(),boost::bind(&atom::OutputArrayIndexed,_1,output,elementLookup,AtomNo,(const char*)0));
    881911    return true;
    882912  }
     
    900930      memset(AtomNo,0,(MAX_ELEMENTS-1)*sizeof(*AtomNo));
    901931      enumeration<const element*> elementLookup = formula.enumerateElements();
    902       for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputTrajectory,_1,output,elementLookup, AtomNo, (const int)step));
     932      for_each(begin(),end(),boost::bind(&atom::OutputTrajectory,_1,output,elementLookup, AtomNo, (const int)step));
    903933    }
    904934    return true;
     
    941971    for (int step=0;step<MDSteps;step++) {
    942972      *output << getAtomCount() << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
    943       for_each(atoms.begin(),atoms.end(),boost::bind(&atom::OutputTrajectoryXYZ,_1,output,step));
     973      for_each(begin(),end(),boost::bind(&atom::OutputTrajectoryXYZ,_1,output,step));
    944974    }
    945975    return true;
     
    958988    now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    959989    *output << getAtomCount() << "\n\tCreated by molecuilder on " << ctime(&now);
    960     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputXYZLine),output));
     990    for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputXYZLine),output));
    961991    return true;
    962992  } else
     
    9721002  int i = 0;
    9731003  NoNonHydrogen = 0;
    974   for (molecule::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
     1004  for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    9751005    (*iter)->setNr(i);   // update number in molecule (for easier referencing in FragmentMolecule lateron)
    9761006    if ((*iter)->getType()->getAtomicNumber() != 1) // count non-hydrogen atoms whilst at it
  • src/molecule.hpp

    rf99714 r30c753  
    2121#include <vector>
    2222
     23#include <boost/iterator/transform_iterator.hpp>
     24
    2325#include <string>
    2426
    25 #include "types.hpp"
     27#include "AtomSet.hpp"
    2628#include "CodePatterns/Observer.hpp"
    2729#include "CodePatterns/ObservedIterator.hpp"
    2830#include "CodePatterns/Cacheable.hpp"
     31#include "Descriptors/AtomIdDescriptor.hpp"
    2932#include "Fragmentation/HydrogenSaturation_enum.hpp"
     33#include "Formula.hpp"
    3034#include "Helpers/defs.hpp"
    31 #include "Formula.hpp"
    32 #include "AtomSet.hpp"
    33 
     35#include "types.hpp"
     36
     37// TODO: Was is the include of MoleculeDescriptor_impl.hpp doing in molecule.hpp
    3438#include "Descriptors/MoleculeDescriptor_impl.hpp"
    3539
     
    5559/******************************** Some definitions for easier reading **********************************/
    5660
     61struct FromIdToAtom :
     62  public std::unary_function<atom *, atomId_t>
     63{
     64    atom * operator()(atomId_t id) const {
     65     return World::getInstance().getAtom(AtomById(id));
     66    }
     67};
     68
    5769/************************************* Class definitions ****************************************/
    5870
     
    6678
    6779public:
    68   typedef ATOMSET(std::list) atomSet;
     80  typedef ATOMSET(std::set) atomSet;
    6981  typedef std::set<atomId_t> atomIdSet;
    70   typedef ObservedIterator<atomSet> iterator;
    71   typedef atomSet::const_iterator const_iterator;
     82  typedef boost::transform_iterator<FromIdToAtom, atomIdSet::iterator, atom *, atomId_t> iterator;
     83  typedef iterator const_iterator;
    7284
    7385  const periodentafel * const elemente; //!< periodic table with each element
     
    91103  Cacheable<int> BondCount; //!< number of atoms, brought up-to-date by doCountBonds()
    92104  moleculeId_t id;
    93   atomSet atoms; //<!list of atoms
    94105  atomIdSet atomIds; //<!set of atomic ids to check uniqueness of atoms
    95106protected:
  • src/molecule_geometry.cpp

    rf99714 r30c753  
    5555
    5656  // go through all atoms
    57   BOOST_FOREACH(atom* iter, atoms){
    58     std::cout << "atom before is at " << *iter << std::endl;
    59     *iter -= *Center;
    60     *iter += *CenterBox;
    61     std::cout << "atom after is at " << *iter << std::endl;
    62   }
    63   atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
     57  for (iterator iter = begin(); iter != end(); ++iter) {
     58    if (DoLog(4) && (*Center != *CenterBox))
     59      LOG(4, "INFO: atom before is at " << **iter);
     60    **iter -= *Center;
     61    **iter += *CenterBox;
     62    if (DoLog(4) && (*Center != *CenterBox))
     63      LOG(4, "INFO: atom after is at " << **iter);
     64  }
     65  getAtomSet().transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
    6466
    6567  delete(Center);
     
    7880
    7981  // go through all atoms
    80   atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
     82  getAtomSet().transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
    8183
    8284  return status;
     
    9294  Vector *min = new Vector;
    9395
    94   molecule::const_iterator iter = begin();  // start at first in list
     96  const_iterator iter = begin();  // start at first in list
    9597  if (iter != end()) { //list not empty?
    9698    for (int i=NDIM;i--;) {
     
    120122{
    121123  int Num = 0;
    122   molecule::const_iterator iter = begin();  // start at first in list
     124  const_iterator iter = begin();  // start at first in list
    123125  Vector Center;
    124126
     
    139141Vector * molecule::DetermineCenterOfAll() const
    140142{
    141   molecule::const_iterator iter = begin();  // start at first in list
     143  const_iterator iter = begin();  // start at first in list
    142144  Vector *a = new Vector();
    143145  double Num = 0;
     
    172174Vector * molecule::DetermineCenterOfGravity() const
    173175{
    174   molecule::const_iterator iter = begin();  // start at first in list
     176  const_iterator iter = begin();  // start at first in list
    175177  Vector *a = new Vector();
    176178  Vector tmp;
     
    200202  DeterminePeriodicCenter(NewCenter);
    201203  // go through all atoms
    202   BOOST_FOREACH(atom* iter, atoms){
    203     *iter -= NewCenter;
     204  for (iterator iter = begin(); iter != end(); ++iter) {
     205    **iter -= NewCenter;
    204206  }
    205207};
     
    213215{
    214216  // go through all atoms
    215   BOOST_FOREACH(atom* iter, atoms){
    216     *iter -= *newcenter;
     217  for (iterator iter = begin(); iter != end(); ++iter) {
     218    **iter -= *newcenter;
    217219  }
    218220};
     
    231233
    232234  // sum up inertia tensor
    233   for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     235  for (const_iterator iter = begin(); iter != end(); ++iter) {
    234236    Vector x = (*iter)->getPosition();
    235237    x -= *CenterOfGravity;
     
    284286
    285287  // and rotate
    286   for (molecule::iterator iter = begin(); iter != end(); ++iter) {
     288  for (iterator iter = begin(); iter != end(); ++iter) {
    287289    *(*iter) -= *CenterOfGravity;
    288290    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha));
     
    304306void molecule::Scale(const double ** const factor)
    305307{
    306   for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     308  for (const_iterator iter = begin(); iter != end(); ++iter) {
    307309    for (size_t j=0;j<(*iter)->getTrajectorySize();j++) {
    308310      Vector temp = (*iter)->getPositionAtStep(j);
     
    318320void molecule::Translate(const Vector *trans)
    319321{
    320   for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     322  for (const_iterator iter = begin(); iter != end(); ++iter) {
    321323    for (size_t j=0;j<(*iter)->getTrajectorySize();j++) {
    322324      (*iter)->setPositionAtStep(j, (*iter)->getPositionAtStep(j) + (*trans));
     
    334336
    335337  // go through all atoms
    336   BOOST_FOREACH(atom* iter, atoms){
    337     *iter += *trans;
    338   }
    339   atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
     338  for (iterator iter = begin(); iter != end(); ++iter) {
     339    **iter += *trans;
     340  }
     341  getAtomSet().transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));
    340342
    341343};
     
    349351  OBSERVE;
    350352  Plane p(*n,0);
    351   atoms.transformNodes(boost::bind(&Plane::mirrorVector,p,_1));
     353  getAtomSet().transformNodes(boost::bind(&Plane::mirrorVector,p,_1));
    352354};
    353355
     
    369371    Center.Zero();
    370372    flag = true;
    371     for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     373    for (const_iterator iter = begin(); iter != end(); ++iter) {
    372374      if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) {
    373375        Testvector = inversematrix * (*iter)->getPosition();
     
    433435  alpha = atan(-n->at(0)/n->at(2));
    434436  LOG(1, "INFO: Z-X-angle: " << alpha << " ... ");
    435   for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     437  for (const_iterator iter = begin(); iter != end(); ++iter) {
    436438    tmp = (*iter)->at(0);
    437439    (*iter)->set(0,  cos(alpha) * tmp + sin(alpha) * (*iter)->at(2));
     
    453455  alpha = atan(-n->at(1)/n->at(2));
    454456  LOG(1, "INFO: Z-Y-angle: " << alpha << " ... ");
    455   for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     457  for (const_iterator iter = begin(); iter != end(); ++iter) {
    456458    tmp = (*iter)->at(1);
    457459    (*iter)->set(1,  cos(alpha) * tmp + sin(alpha) * (*iter)->at(2));
  • src/molecule_graph.cpp

    rf99714 r30c753  
    154154  if (AdjacencyFile.good()) {
    155155    AdjacencyFile << "m\tn" << endl;
    156     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
     156    for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
    157157    AdjacencyFile.close();
    158158    LOG(1, "\t... done.");
     
    186186  if (BondFile.good()) {
    187187    BondFile << "m\tn" << endl;
    188     for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
     188    for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
    189189    BondFile.close();
    190190    LOG(1, "\t... done.");
Note: See TracChangeset for help on using the changeset viewer.