Changeset 204 for libs/suds/src


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

added dot product

Location:
libs/suds/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libs/suds/src/Image.cpp

    r113 r204  
    3232        if (m_Image==NULL) cerr<<"Could not open image: "<<filename<<endl; 
    3333        assert(m_Image); 
     34cerr<<filename<<" "<<m_Image->nChannels<<endl; 
     35 
    3436} 
    3537 
  • 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.