MCPcopy Create free account
hub / github.com/bwaldvogel/liblinear-java / pop

Method pop

src/main/java/de/bwaldvogel/liblinear/Heap.java:47–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 }
46
47 void pop() {
48 size--;
49 a[0] = a[size];
50 int i = 0;
51 while (i * 2 + 1 < size) {
52 int l = i * 2 + 1;
53 int r = i * 2 + 2;
54 if (r < size && cmp(a[l], a[r])) {
55 l = r;
56 }
57 if (cmp(a[i], a[l])) {
58 Linear.swap(a, i, l);
59 i = l;
60 } else {
61 break;
62 }
63 }
64 }
65
66 Feature top() {
67 return this.a[0];

Callers 1

solve_oneclass_svmMethod · 0.95

Calls 2

cmpMethod · 0.95
swapMethod · 0.95

Tested by

no test coverage detected