Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ArrayT>
void Impala::Core::Vector::Sum ( typename VectorSet< ArrayT >::VectorT *  dst,
VectorSet< ArrayT > *  src,
int  size,
bool *  filter 
) [inline]

Definition at line 53 of file Sum.h.

References AddAssign(), Impala::Core::Vector::VectorSet< ArrayT >::GetVector(), Impala::Core::Vector::VectorSet< ArrayT >::GetVectorLength(), and Impala::Core::Vector::VectorSet< ArrayT >::HasConstVectorSize().

Referenced by Impala::Core::Feature::VisSem::DoUNC(), and Impala::Core::Feature::MarkovStationaryFeature().

00055 {
00056     typedef typename VectorSet<ArrayT>::VectorT VectorT;
00057 
00058     if (!src->HasConstVectorSize())
00059     {
00060         std::cout << "Vector::Sum: works for constant vector size only" << std::endl;
00061         return;
00062     }
00063     VectorT res(src->GetVectorLength(0));
00064     res = 0;
00065     for (int i=0 ; i<size ; i++)
00066     {
00067         if (!filter || filter[i])
00068         {
00069             AddAssign(res, src->GetVector(i, true));
00070         }
00071     }
00072     if (!dst)
00073         dst = new VectorT(res);
00074     else
00075         *dst = res;
00076 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:27:24 2010 for ImpalaSrc by  doxygen 1.5.1