ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/types/MoleculeStamp.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/types/MoleculeStamp.cpp (file contents):
Revision 2493 by tim, Tue Dec 6 21:01:08 2005 UTC vs.
Revision 2515 by tim, Fri Dec 16 18:26:41 2005 UTC

# Line 44 | Line 44
44   #include <sstream>
45   #include "types/MoleculeStamp.hpp"
46   #include "utils/Tuple.hpp"
47 <
47 > #include "utils/MemoryUtils.hpp"
48   namespace oopse {
49  
50   template<class ContainerType>
# Line 77 | Line 77 | MoleculeStamp::~MoleculeStamp() {
77   }
78  
79   MoleculeStamp::~MoleculeStamp() {
80 <
80 >    MemoryUtils::deletePointers(atomStamps_);
81 >    MemoryUtils::deletePointers(bondStamps_);
82 >    MemoryUtils::deletePointers(bendStamps_);
83 >    MemoryUtils::deletePointers(torsionStamps_);
84 >    MemoryUtils::deletePointers(rigidBodyStamps_);
85 >    MemoryUtils::deletePointers(cutoffGroupStamps_);
86 >    MemoryUtils::deletePointers(fragmentStamps_);    
87   }
88  
89   bool MoleculeStamp::addAtomStamp( AtomStamp* atom) {
# Line 202 | Line 208 | struct BendLessThan : public std::binary_function<IntT
208      
209   }
210  
205 struct BendLessThan : public std::binary_function<IntTuple4, IntTuple4, bool> {
206    bool operator()(IntTuple3 b1, IntTuple3 b2) {
207        return b1.first < b2.first
208             || (!(b2.first < b1.first) && b1.second < b2.second)
209             || (!(b2.first < b1.first) && !(b2.second < b2.second) && b1.third < b2.third);
210    }
211 };
212
211   void MoleculeStamp::checkBends() {
212      for(int i = 0; i < getNBends(); ++i) {
213          BendStamp* bendStamp = getBendStamp(i);
# Line 257 | Line 255 | void MoleculeStamp::checkBends() {
255      }
256      
257      
258 <    std::set<IntTuple3, BendLessThan> allBends;
259 <    std::set<IntTuple3, BendLessThan>::iterator iter;
258 >    std::set<IntTuple3> allBends;
259 >    std::set<IntTuple3>::iterator iter;
260      for(int i = 0; i < getNBends(); ++i) {
261          BendStamp* bendStamp= getBendStamp(i);
262          std::vector<int> bend = bendStamp->getMembers();
# Line 345 | Line 343 | struct TorsionLessThan : public std::binary_function<I
343  
344   }
345  
348 struct TorsionLessThan : public std::binary_function<IntTuple4, IntTuple4, bool> {
349    bool operator()(IntTuple4 t1, IntTuple4 t2) {
350
351        return t1.first < t2.first
352             || (!(t2.first < t1.first) && t1.second < t2.second)
353             || (!(t2.first < t1.first) && !(t2.second < t2.second) && t1.third < t2.third)
354             ||(!(t2.first < t1.first) && !(t2.second < t2.second) && !(t2.third < t1.third) && t1.fourth < t2.fourth);
355    }
356
357
358
359 };
360
361
346   void MoleculeStamp::checkTorsions() {
347      for(int i = 0; i < getNTorsions(); ++i) {
348          TorsionStamp* torsionStamp = getTorsionStamp(i);
# Line 385 | Line 369 | void MoleculeStamp::checkTorsions() {
369          }
370      }    
371  
372 <    std::set<IntTuple4, TorsionLessThan> allTorsions;
373 <    std::set<IntTuple4, TorsionLessThan>::iterator iter;
372 >    std::set<IntTuple4> allTorsions;
373 >    std::set<IntTuple4>::iterator iter;
374       for(int i = 0; i < getNTorsions(); ++i) {
375           TorsionStamp* torsionStamp= getTorsionStamp(i);
376           std::vector<int> torsion = torsionStamp->getMembers();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines