MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / decreaseKey

Method decreaseKey

JSAT/src/jsat/utils/FibHeap.java:223–236  ·  view source on GitHub ↗
(FibNode<T> x, double k)

Source from the content-addressed store, hash-verified

221 }
222
223 public void decreaseKey(FibNode<T> x, double k)
224 {
225 if(k > x.key)
226 throw new RuntimeException("new key is greater than current key");
227 x.key = k;
228 FibNode<T> y = x.p;
229 if(y != null && x.key < y.key)
230 {
231 cut(x, y);
232 cascadingCut(y);
233 }
234 if(x.key < min.key)
235 min = x;
236 }
237
238 /**
239 *

Callers 4

testDecreaseKeyMethod · 0.95
testRandomMethod · 0.95
clusterMethod · 0.95
dijkstraMethod · 0.95

Calls 2

cutMethod · 0.95
cascadingCutMethod · 0.95

Tested by 2

testDecreaseKeyMethod · 0.76
testRandomMethod · 0.76