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

Equals.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Equals_h
00002 #define Impala_Core_Equals_h
00003 
00004 #include <vector>
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 
00011 bool
00012 Equals(std::vector<double> v1, std::vector<double> v2, double tolerance)
00013 {
00014     if(v1.size() != v2.size())
00015         return false;
00016     for(int i=0 ; i<v1.size() ; ++i)
00017     {
00018         if(abs(v1[i] - v2[i]) < tolerance)
00019             return false;
00020     }
00021     return true;
00022 }
00023 
00024 bool
00025 Equals(std::vector<double> v1, std::vector<double> v2)
00026 {
00027     if(v1.size() != v2.size())
00028         return false;
00029     for(int i=0 ; i<v1.size() ; ++i)
00030     {
00031         if(v1[i] != v2[i])
00032             return false;
00033     }
00034     return true;
00035 }
00036 
00037 bool
00038 Equals(double d1, double d2)
00039 {
00040     return d1 == d2;
00041 }
00042 
00043 
00044 }//namespace Core
00045 }//Impala
00046 
00047 #endif

Generated on Fri Mar 19 09:30:45 2010 for ImpalaSrc by  doxygen 1.5.1