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

DotProduct.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Vector_DotProduct_h
00002 #define Impala_Core_Vector_DotProduct_h
00003 
00004 #include "Core/Vector/VectorTem.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Vector
00011 {
00012 
00013 
00014 inline double
00015 DotProduct(const Vector::VectorTem<double>& v1,
00016            const Vector::VectorTem<double>& v2)
00017 {
00018     int length = v1.Size();
00019     double accumulator = 0;
00020     for (int i=0 ; i<length ; i++)
00021     {
00022         accumulator += (v1[i] * v2[i]);
00023     }
00024     return accumulator;
00025 }
00026 
00027 } // namespace Vector
00028 } // namespace Core
00029 } // namespace Impala
00030 
00031 #endif

Generated on Thu Jan 13 09:04:43 2011 for ImpalaSrc by  doxygen 1.5.1