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 }
00028 }
00029 }
00030
00031 #endif