Changeset 204 for libs/suds/src/Vector.h


Ignore:
Timestamp:
11/11/2009 10:56:36 AM (10 years ago)
Author:
dave
Message:

added dot product

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libs/suds/src/Vector.h

    r97 r204  
    6060        T DistanceFrom(const Vector &other) const; 
    6161        T Magnitude() const; 
     62        T Dot(const Vector<T> &other); 
    6263        Vector Normalised() const; 
    6364 
     
    187188 
    188189template<class T> 
     190T Vector<T>::Dot(const Vector<T> &other) 
     191{ 
     192        assert(m_Size==other.m_Size); 
     193        T acc=0; 
     194        for (unsigned int i=0; i<m_Size; i++) 
     195        { 
     196                acc+=(*this)[i]*other[i]; 
     197        } 
     198        return acc; 
     199} 
     200 
     201template<class T> 
    189202Vector<T> Vector<T>::Normalised() const 
    190203{ 
Note: See TracChangeset for help on using the changeset viewer.