Definition at line 91 of file WeightedFeatureList.h. References GetFeature(), GetWeight(), ILOG_DEBUG, ILOG_ERROR, and Size(). Referenced by Impala::Core::Training::FikSvm::Diff(). 00092 { 00093 if (Size() != arg->Size()) 00094 { 00095 ILOG_ERROR("Size differs: " << Size() << " vs " << arg->Size()); 00096 return 1; 00097 } 00098 int nDiff = 0; 00099 for (int i=0 ; i<Size() ; i++) 00100 { 00101 if (GetFeature(i) != arg->GetFeature(i)) 00102 { 00103 ILOG_DEBUG("Feature " << i << " differs " << GetFeature(i) 00104 << " vs " << arg->GetFeature(i)); 00105 nDiff++; 00106 } 00107 if (fabs(GetWeight(i) - arg->GetWeight(i)) > 0.00001) 00108 { 00109 ILOG_DEBUG("Weight " << i << " differs " << GetWeight(i) 00110 << " vs " << arg->GetWeight(i)); 00111 nDiff++; 00112 } 00113 } 00114 if (nDiff > 0) 00115 ILOG_ERROR("Found " << nDiff << " differences in features/weights"); 00116 return nDiff; 00117 }
Here is the call graph for this function:
|