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

Method cut

JSAT/src/jsat/utils/FibHeap.java:243–258  ·  view source on GitHub ↗

@param x the child @param y the parent

(FibNode<T> x, FibNode<T> y)

Source from the content-addressed store, hash-verified

241 * @param y the parent
242 */
243 private void cut(FibNode<T> x, FibNode<T> y)
244 {
245 //1| remove x from the child list of y, decrementing y.degree
246 if(y.child == x)//if we removed but x was the child pointer, we would get messed up
247 y.child = delink(x);
248 else
249 delink(x);
250 y.degree--;//removal of 'x' from y
251 y.degree-= x.degree;//removal of everyone x owned from y
252 //2| add x to the root list of H
253 min = merge(min, x);
254 //3| x.p = NIL
255 x.p = null;
256 //4| x.mark = FALSE
257 x.mark = false;
258 }
259
260 private void cascadingCut(FibNode<T> y)
261 {

Callers 2

decreaseKeyMethod · 0.95
cascadingCutMethod · 0.95

Calls 2

delinkMethod · 0.95
mergeMethod · 0.95

Tested by

no test coverage detected