Definition at line 258 of file svm.cpp. References svm_node::index, and svm_node::value. Referenced by k_function(), Kernel(), kernel_linear(), kernel_poly(), kernel_rbf(), and kernel_sigmoid(). 00259 { 00260 double sum = 0; 00261 while(px->index != -1 && py->index != -1) 00262 { 00263 if(px->index == py->index) 00264 { 00265 sum += px->value * py->value; 00266 ++px; 00267 ++py; 00268 } 00269 else 00270 { 00271 if(px->index > py->index) 00272 ++py; 00273 else 00274 ++px; 00275 } 00276 } 00277 return sum; 00278 }
|