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

Diff.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Vector_Diff_h
00002 #define Impala_Core_Vector_Diff_h
00003 
00004 #include "Core/Vector/VectorTem.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Vector
00011 {
00012 
00013 
00014 template <class ElemT>
00015 inline int
00016 Diff(const VectorTem<ElemT>& v1, const VectorTem<ElemT>& v2, Real64 epsilon)
00017 {
00018     ILOG_VAR(Impala.Core.Vector.Diff);
00019     int nDiff = 0;
00020     for (int i=0 ; i<v1.Size() ; i++)
00021     {
00022         if (fabs((Real64) v1[i] - (Real64) v2[i]) > epsilon)
00023         {
00024             ILOG_DEBUG("V[" << i << "] differs: " << v1[i] << " vs " << v2[i]);
00025             nDiff++;
00026         }
00027     }
00028     return nDiff;
00029 }
00030 
00031 } // namespace Vector
00032 } // namespace Core
00033 } // namespace Impala
00034 
00035 #endif

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