@Override public void apply(int nodeId, SPTEntry b) { if (!lms.setWeight(lmIdx, nodeId, rowSize, b.weight, from)) { maxedout.incrementAndGet(); finalMaxWeight.setValue(Math.max(b.weight, finalMaxWeight.getValue())); } } });
lms.setWeight(0, 0, 16, Math.pow(2, 18), true); assertEquals((int) Math.pow(2, 18) - 2, lms.getFromWeight(0, 0)); lms.setWeight(0, 0, 16, 999999, true); assertEquals((int) Math.pow(2, 18) - 2, lms.getFromWeight(0, 0)); lms.setWeight(0, 0, 16, 999999, false); assertEquals((int) (Math.pow(2, 18) - 2 + Math.pow(2, 13) - 2), lms.getToWeight(0, 0)); lms.setWeight(0, 0, 16, 1, false); assertEquals((int) (Math.pow(2, 18) - 2 + -Math.pow(2, 13)), lms.getToWeight(0, 0)); lms.setWeight(0, 0, 16, 999999, true); assertFalse(lms.isInfinity(0));
@Override public void apply(int nodeId, SPTEntry b) { if (!lms.setWeight(lmIdx, nodeId, rowSize, b.weight, from)) { maxedout.incrementAndGet(); finalMaxWeight.setValue(Math.max(b.weight, finalMaxWeight.getValue())); } } });
@Override public void apply(int nodeId, SPTEntry b) { if (!lms.setWeight(nodeId * rowSize + lmIdx * 4 + offset, b.weight)) { maxedout.incrementAndGet(); finalMaxWeight.setValue(Math.max(b.weight, finalMaxWeight.getValue())); } } });