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

Comparing:
branches/development/src/math/Vector3.hpp (file contents), Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
branches/devel_omp/src/math/Vector3.hpp (file contents), Revision 1594 by chuckv, Tue Jul 19 16:45:30 2011 UTC

# Line 132 | Line 132 | namespace OpenMD {
132     * @see #vector::dot
133     */
134    template<typename Real>
135 <  Vector3<Real> cross( const Vector3<Real>& v1, const Vector3<Real>& v2 ) {
135 >  inline Vector3<Real> cross( const Vector3<Real>& v1, const Vector3<Real>& v2 ) {
136      Vector3<Real> result;
137      
138      result.x() = v1.y() * v2.z() - v1.z() * v2.y();
# Line 142 | Line 142 | namespace OpenMD {
142      return result;
143    }
144  
145 +
146 +  /**
147 +   * Returns the linear indexing for integer vectors. Compare to
148 +   * Rapaport's VLinear
149 +   *
150 +   * @param p first vector
151 +   * @param s second vector
152 +   */
153 +  template<typename Real>
154 +  inline Real Vlinear( const Vector3<Real>& p, const Vector3<Real>& s ) {
155 +    return (p.z() * s.y() + p.y()) * s.x() + p.x();
156 +  }
157 +
158    typedef Vector3<int> Vector3i;
159    
160    typedef Vector3<RealType> Vector3d;    
# Line 149 | Line 162 | namespace OpenMD {
162    const Vector3d V3Zero(0.0 , 0.0, 0.0);
163    const Vector3d V3X( 1.0, 0.0, 0.0 ) ;
164    const Vector3d V3Y( 0.0, 1.0, 0.0 ) ;
165 <  const Vector3d V3Z ( 0.0, 0.0, 1.0 ) ;    
166 <  
165 >  const Vector3d V3Z ( 0.0, 0.0, 1.0 ) ;
166 >
167   }
168  
169   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines