MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / dot_product

Function dot_product

src/test/test_kernelmatrix.cpp:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8float_type dot_product(const DataSet::node2d &instances, int x, int y) {
9 float_type sum = 0;
10 auto i = instances[x].begin();
11 auto j = instances[y].begin();
12 while (i != instances[x].end() && j != instances[y].end()) {
13 if (i->index < j->index) {
14 i++;
15 } else if (i->index > j->index) {
16 j++;
17 } else {
18 sum += i->value * j->value;
19 i++;
20 j++;
21 }
22 }
23 return sum;
24}
25
26kernel_type get_cpu_kernel(const DataSet::node2d &instances, int x, int y, const SvmParam &param) {
27 kernel_type r;

Callers 1

get_cpu_kernelFunction · 0.85

Calls 2

endMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected