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

bool Impala::Core::Training::Equals ( const svm_parameter p1,
const svm_parameter p2 
)

All Equals functions compare the objects (they do not test for 0 pointers).

Definition at line 20 of file Equals.h.

References svm_parameter::C, cPrecision, svm_parameter::gamma, svm_parameter::kernel_type, svm_parameter::nr_weight, svm_parameter::probability, svm_parameter::svm_type, svm_parameter::weight, and svm_parameter::weight_label.

Referenced by Equals(), and Impala::Core::Training::Tester::Test().

00021 {
00022     if(p1->svm_type != p2->svm_type)
00023         return false;
00024     if(p1->kernel_type != p2->kernel_type)
00025         return false;
00026     if(abs(p1->C - p2->C) > cPrecision)
00027         return false;
00028     if(abs(p1->gamma - p2->gamma) > cPrecision)
00029         return false;
00030     if(p1->probability != p2->probability)
00031         return false;
00032     if(p1->nr_weight != p2->nr_weight)
00033         return false;
00034     for(int i=0 ; i<p1->nr_weight ; ++i)
00035     {
00036         if(p1->weight_label[i] != p2->weight_label[i])
00037             return false;
00038         if(p1->weight[i] != p2->weight[i])
00039             return false;
00040     }
00041     return true;
00042 }


Generated on Fri Mar 19 11:22:57 2010 for ImpalaSrc by  doxygen 1.5.1