[Lemon-commits] Peter Kovacs: Clarify type names in NetworkSimpl...
Lemon HG
hg at lemon.cs.elte.hu
Thu Mar 4 12:32:19 CET 2010
details: http://lemon.cs.elte.hu/hg/lemon/rev/b6f76c95992e
changeset: 936:b6f76c95992e
user: Peter Kovacs <kpeter [at] inf.elte.hu>
date: Thu Mar 04 10:03:14 2010 +0100
description:
Clarify type names in NetworkSimplex (#353)
This patch clarifies the misleading effects of the renamings in
[f3bc4e9b5f3a].
diffstat:
lemon/network_simplex.h | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diffs (75 lines):
diff --git a/lemon/network_simplex.h b/lemon/network_simplex.h
--- a/lemon/network_simplex.h
+++ b/lemon/network_simplex.h
@@ -170,12 +170,16 @@
// Note: vector<char> is used instead of vector<bool> for efficiency reasons
// State constants for arcs
- enum ArcStateEnum {
+ enum ArcState {
STATE_UPPER = -1,
STATE_TREE = 0,
STATE_LOWER = 1
};
+ typedef std::vector<signed char> StateVector;
+ // Note: vector<signed char> is used instead of vector<ArcState> for
+ // efficiency reasons
+
private:
// Data related to the underlying digraph
@@ -215,7 +219,7 @@
IntVector _last_succ;
IntVector _dirty_revs;
BoolVector _forward;
- BoolVector _state;
+ StateVector _state;
int _root;
// Temporary data used in the current pivot iteration
@@ -246,7 +250,7 @@
const IntVector &_source;
const IntVector &_target;
const CostVector &_cost;
- const BoolVector &_state;
+ const StateVector &_state;
const CostVector &_pi;
int &_in_arc;
int _search_arc_num;
@@ -298,7 +302,7 @@
const IntVector &_source;
const IntVector &_target;
const CostVector &_cost;
- const BoolVector &_state;
+ const StateVector &_state;
const CostVector &_pi;
int &_in_arc;
int _search_arc_num;
@@ -337,7 +341,7 @@
const IntVector &_source;
const IntVector &_target;
const CostVector &_cost;
- const BoolVector &_state;
+ const StateVector &_state;
const CostVector &_pi;
int &_in_arc;
int _search_arc_num;
@@ -410,7 +414,7 @@
const IntVector &_source;
const IntVector &_target;
const CostVector &_cost;
- const BoolVector &_state;
+ const StateVector &_state;
const CostVector &_pi;
int &_in_arc;
int _search_arc_num;
@@ -513,7 +517,7 @@
const IntVector &_source;
const IntVector &_target;
const CostVector &_cost;
- const BoolVector &_state;
+ const StateVector &_state;
const CostVector &_pi;
int &_in_arc;
int _search_arc_num;
More information about the Lemon-commits
mailing list