/** * Replaces the current top/max value in the heap with the new one. The new * max value should be <= the old one. * * @param upper_bound The heap. * @param new_bound The new value that should replace the old top one. * @throws Exception if the new value is greater than the old value. */ protected void update(MyHeap upper_bound, double new_bound) throws Exception { upper_bound.putBySubstitute(new_bound); }
/** * Replaces the current top/max value in the heap with the new one. The new * max value should be <= the old one. * * @param upper_bound The heap. * @param new_bound The new value that should replace the old top one. * @throws Exception if the new value is greater than the old value. */ protected void update(MyHeap upper_bound, double new_bound) throws Exception { upper_bound.putBySubstitute(new_bound); }