[Lemon-commits] Alpar Juttner: Rename markToBottom() to dirtyTop...
Lemon HG
hg at lemon.cs.elte.hu
Fri Nov 21 11:53:56 CET 2008
details: http://lemon.cs.elte.hu/hg/lemon/rev/d916b8995e22
changeset: 395:d916b8995e22
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Mon Nov 17 15:41:15 2008 +0000
description:
Rename markToBottom() to dirtyTopButOne() + better doc (#174)
diffstat:
1 file changed, 17 insertions(+), 19 deletions(-)
lemon/elevator.h | 36 +++++++++++++++++-------------------
diffs (70 lines):
diff -r 1bab3a47be88 -r d916b8995e22 lemon/elevator.h
--- a/lemon/elevator.h Mon Nov 17 15:41:15 2008 +0000
+++ b/lemon/elevator.h Mon Nov 17 15:41:15 2008 +0000
@@ -380,20 +380,19 @@
if(new_level>_highest_active) _highest_active=new_level;
}
- ///Mark the node as it did not reach the max level
+ ///Move an inactive item to the top but one level (in a dirty way).
- ///Mark the node as it did not reach the max level. It sets the
- ///level to the under the max level value. The node will be never
- ///more activated because the push operation from the maximum
- ///level is forbidden in the push-relabel algorithms. The node
- ///should be lifted previously to the top level.
- void markToBottom(Item i) {
+ ///This function moves an inactive item to the top but one level.
+ ///It makes the underlying datastructure corrupt, so use is only if
+ ///you really know what it is for.
+ ///\pre The item is on the top level.
+ void dirtyTopButOne(Item i) {
_level[i] = _max_level - 1;
}
- ///Lift all nodes on and above a level to the top (and deactivate them).
+ ///Lift all items on and above a level to the top (and deactivate them).
- ///This function lifts all nodes on and above level \c l to \c
+ ///This function lifts all items on and above level \c l to \c
///maxLevel(), and also deactivates them.
void liftToTop(int l)
{
@@ -749,7 +748,7 @@
///Lift the highest active to top.
///Lift the item returned by highestActive() to the top level and
- ///deactivates the node.
+ ///deactivates the item.
///
void liftHighestActiveToTop() {
Item i = _first[_highest_active];
@@ -897,20 +896,19 @@
}
}
- ///Mark the node as it did not reach the max level
+ ///Move an inactive item to the top but one level (in a dirty way).
- ///Mark the node as it did not reach the max level. It sets the
- ///level to the under the max level value. The node will be never
- ///more activated because the push operation from the maximum
- ///level is forbidden in the push-relabel algorithms. The node
- ///should be lifted previously to the top level.
- void markToBottom(Item i) {
+ ///This function moves an inactive item to the top but one level.
+ ///It makes the underlying datastructure corrupt, so use is only if
+ ///you really know what it is for.
+ ///\pre The item is on the top level.
+ void dirtyTopButOne(Item i) {
_level.set(i, _max_level - 1);
}
- ///Lift all nodes on and above a level to the top (and deactivate them).
+ ///Lift all items on and above a level to the top (and deactivate them).
- ///This function lifts all nodes on and above level \c l to \c
+ ///This function lifts all items on and above level \c l to \c
///maxLevel(), and also deactivates them.
void liftToTop(int l) {
for (int i = l + 1; _first[i] != INVALID; ++i) {
More information about the Lemon-commits
mailing list