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

Comparing trunk/src/math/Vector.hpp (file contents):
Revision 1348 by tim, Wed May 17 21:51:42 2006 UTC vs.
Revision 1349 by cli2, Wed May 20 19:35:05 2009 UTC

# Line 313 | Line 313 | namespace oopse {
313        return *this;
314      }
315  
316 +    /**
317 +     * Returns the sum of all elements of this vector.
318 +     * @return the sum of all elements of this vector
319 +     */
320 +    inline Real sum() {
321 +      Real tmp;
322 +      tmp = 0;
323 +      for (unsigned int i = 0; i < Dim; i++)
324 +        tmp += this->data_[i];
325 +      return tmp;  
326 +    }
327 +            
328      /**
329       * Returns the length of this vector.
330       * @return the length of this vector

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines