Changeset 204


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

added dot product

Location:
libs/suds
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libs/suds/python/expression.py

    r153 r204  
    1414        print(p[param]) 
    1515 
    16 pca = load_pca("yalefaces-30x50.pca") 
     16pca = load_pca("../data/eigenspaces/yalefaces-30x50.pca") 
    1717w = 30 
    1818h = 50 
  • 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.