| 424 | } |
| 425 | |
| 426 | double |
| 427 | Kernel::dot(const svm_node* px, const svm_node* py) |
| 428 | { |
| 429 | double sum = 0; |
| 430 | |
| 431 | while (px->index != -1 && py->index != -1) { |
| 432 | if (px->index == py->index) { |
| 433 | sum += px->value * py->value; |
| 434 | ++px; |
| 435 | ++py; |
| 436 | } |
| 437 | else { |
| 438 | if (px->index > py->index) |
| 439 | ++py; |
| 440 | else |
| 441 | ++px; |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | return sum; |
| 446 | } |
| 447 | |
| 448 | double |
| 449 | Kernel::k_function(const svm_node* x, const svm_node* y, const svm_parameter& param) |
no outgoing calls