ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/math/DynamicVector.hpp
(Generate patch)

Comparing trunk/src/math/DynamicVector.hpp (file contents):
Revision 891 by tim, Wed Feb 22 20:35:16 2006 UTC vs.
Revision 1349 by cli2, Wed May 20 19:35:05 2009 UTC

# Line 126 | Line 126 | namespace oopse {
126          DynamicVector(_InputIterator first, _InputIterator last,
127                 const allocator_type& alloc = allocator_type())
128          : std::vector<Real, Alloc>(first, last, alloc) {}
129 <            
129 >      
130 >    inline Real operator()(unsigned int i) const{
131 >      return (*this)[i];
132 >    }
133 >    
134 >    inline Real& operator()(unsigned int i){
135 >      return (*this)[i];
136 >    }    
137      /**
138       * Tests if this vetor is equal to other vector
139       * @return true if equal, otherwise return false
# Line 300 | Line 307 | namespace oopse {
307      inline bool isNormalized() {
308        return equal(lengthSquare(), 1.0);
309      }          
310 +
311 +    template<class VectorType>
312 +    void getSubVector(unsigned int beginning, VectorType& v) {
313 +        assert(beginning + v.size() -1 <= this->size());
314 +
315 +        for (unsigned int i = 0; i < v.size(); ++i)
316 +             v(i) = (*this)[beginning+i];
317 +    }
318 +
319      
320    };
321  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines