# HG changeset patch # User kpeter # Date 1223305697 0 # Node ID 90defb96ee616b295e2119c46710dcef1e6aa98e # Parent fa287765102260c388b1cdb1ee6d01a567c55712 Add missing pointer initializing in min cost flow classes diff -r fa2877651022 -r 90defb96ee61 lemon/capacity_scaling.h --- a/lemon/capacity_scaling.h Sun Oct 05 20:08:13 2008 +0000 +++ b/lemon/capacity_scaling.h Mon Oct 06 15:08:17 2008 +0000 @@ -255,9 +255,9 @@ const CostMap &cost, const SupplyMap &supply ) : _graph(graph), _lower(&lower), _capacity(graph), _cost(cost), - _supply(graph), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), - _res_cap(graph), _excess(graph), _pred(graph) + _supply(graph), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), + _res_cap(graph), _excess(graph), _pred(graph), _dijkstra(NULL) { // Removing non-zero lower bounds _capacity = subMap(capacity, lower); @@ -288,9 +288,9 @@ const CostMap &cost, const SupplyMap &supply ) : _graph(graph), _lower(NULL), _capacity(capacity), _cost(cost), - _supply(supply), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), - _res_cap(capacity), _excess(graph), _pred(graph) + _supply(supply), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), + _res_cap(capacity), _excess(graph), _pred(graph), _dijkstra(NULL) { // Checking the sum of supply values Supply sum = 0; @@ -317,9 +317,9 @@ Node s, Node t, Supply flow_value ) : _graph(graph), _lower(&lower), _capacity(graph), _cost(cost), - _supply(graph), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), - _res_cap(graph), _excess(graph), _pred(graph) + _supply(graph), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), + _res_cap(graph), _excess(graph), _pred(graph), _dijkstra(NULL) { // Removing non-zero lower bounds _capacity = subMap(capacity, lower); @@ -354,9 +354,9 @@ Node s, Node t, Supply flow_value ) : _graph(graph), _lower(NULL), _capacity(capacity), _cost(cost), - _supply(graph, 0), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), - _res_cap(capacity), _excess(graph), _pred(graph) + _supply(graph, 0), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), + _res_cap(capacity), _excess(graph), _pred(graph), _dijkstra(NULL) { _supply[s] = flow_value; _supply[t] = -flow_value; diff -r fa2877651022 -r 90defb96ee61 lemon/cost_scaling.h --- a/lemon/cost_scaling.h Sun Oct 05 20:08:13 2008 +0000 +++ b/lemon/cost_scaling.h Mon Oct 06 15:08:17 2008 +0000 @@ -181,10 +181,10 @@ PotentialMap *_potential; bool _local_potential; + // The residual cost map + ResidualCostMap _res_cost; // The residual graph ResGraph *_res_graph; - // The residual cost map - ResidualCostMap _res_cost; // The reduced cost map ReducedCostMap *_red_cost; // The excess map @@ -209,9 +209,9 @@ const CostMap &cost, const SupplyMap &supply ) : _graph(graph), _lower(&lower), _capacity(graph), _orig_cost(cost), - _cost(graph), _supply(graph), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost), - _excess(graph, 0) + _cost(graph), _supply(graph), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_cost(_cost), + _res_graph(NULL), _red_cost(NULL), _excess(graph, 0) { // Removing non-zero lower bounds _capacity = subMap(capacity, lower); @@ -241,9 +241,9 @@ const CostMap &cost, const SupplyMap &supply ) : _graph(graph), _lower(NULL), _capacity(capacity), _orig_cost(cost), - _cost(graph), _supply(supply), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost), - _excess(graph, 0) + _cost(graph), _supply(supply), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_cost(_cost), + _res_graph(NULL), _red_cost(NULL), _excess(graph, 0) { // Checking the sum of supply values Supply sum = 0; @@ -270,9 +270,9 @@ Node s, Node t, Supply flow_value ) : _graph(graph), _lower(&lower), _capacity(graph), _orig_cost(cost), - _cost(graph), _supply(graph), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost), - _excess(graph, 0) + _cost(graph), _supply(graph), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_cost(_cost), + _res_graph(NULL), _red_cost(NULL), _excess(graph, 0) { // Removing nonzero lower bounds _capacity = subMap(capacity, lower); @@ -306,9 +306,9 @@ Node s, Node t, Supply flow_value ) : _graph(graph), _lower(NULL), _capacity(capacity), _orig_cost(cost), - _cost(graph), _supply(graph, 0), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost), - _excess(graph, 0) + _cost(graph), _supply(graph, 0), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_cost(_cost), + _res_graph(NULL), _red_cost(NULL), _excess(graph, 0) { _supply[s] = flow_value; _supply[t] = -flow_value; diff -r fa2877651022 -r 90defb96ee61 lemon/cycle_canceling.h --- a/lemon/cycle_canceling.h Sun Oct 05 20:08:13 2008 +0000 +++ b/lemon/cycle_canceling.h Mon Oct 06 15:08:17 2008 +0000 @@ -168,8 +168,9 @@ const CostMap &cost, const SupplyMap &supply ) : _graph(graph), _lower(&lower), _capacity(graph), _cost(cost), - _supply(graph), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost) + _supply(graph), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_graph(NULL), + _res_cost(_cost) { // Removing non-zero lower bounds _capacity = subMap(capacity, lower); @@ -198,8 +199,9 @@ const CostMap &cost, const SupplyMap &supply ) : _graph(graph), _lower(NULL), _capacity(capacity), _cost(cost), - _supply(supply), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost) + _supply(supply), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_graph(NULL), + _res_cost(_cost) { // Checking the sum of supply values Supply sum = 0; @@ -226,8 +228,9 @@ Node s, Node t, Supply flow_value ) : _graph(graph), _lower(&lower), _capacity(graph), _cost(cost), - _supply(graph), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost) + _supply(graph), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_graph(NULL), + _res_cost(_cost) { // Removing non-zero lower bounds _capacity = subMap(capacity, lower); @@ -261,8 +264,9 @@ Node s, Node t, Supply flow_value ) : _graph(graph), _lower(NULL), _capacity(capacity), _cost(cost), - _supply(graph, 0), _flow(0), _local_flow(false), - _potential(0), _local_potential(false), _res_cost(_cost) + _supply(graph, 0), _flow(NULL), _local_flow(false), + _potential(NULL), _local_potential(false), _res_graph(NULL), + _res_cost(_cost) { _supply[s] = flow_value; _supply[t] = -flow_value; diff -r fa2877651022 -r 90defb96ee61 lemon/network_simplex.h --- a/lemon/network_simplex.h Sun Oct 05 20:08:13 2008 +0000 +++ b/lemon/network_simplex.h Mon Oct 06 15:08:17 2008 +0000 @@ -32,8 +32,6 @@ #include #include -#define _DEBUG_ - namespace lemon { /// \addtogroup min_cost_flow @@ -609,7 +607,7 @@ _potential(_graph), _depth(_graph), _parent(_graph), _pred_edge(_graph), _thread(_graph), _forward(_graph), _state(_graph), _red_cost(_graph, _cost, _potential), - _flow_result(0), _potential_result(0), + _flow_result(NULL), _potential_result(NULL), _local_flow(false), _local_potential(false), _node_ref(graph), _edge_ref(graph) { @@ -659,7 +657,7 @@ _potential(_graph), _depth(_graph), _parent(_graph), _pred_edge(_graph), _thread(_graph), _forward(_graph), _state(_graph), _red_cost(_graph, _cost, _potential), - _flow_result(0), _potential_result(0), + _flow_result(NULL), _potential_result(NULL), _local_flow(false), _local_potential(false), _node_ref(graph), _edge_ref(graph) { @@ -703,7 +701,7 @@ _potential(_graph), _depth(_graph), _parent(_graph), _pred_edge(_graph), _thread(_graph), _forward(_graph), _state(_graph), _red_cost(_graph, _cost, _potential), - _flow_result(0), _potential_result(0), + _flow_result(NULL), _potential_result(NULL), _local_flow(false), _local_potential(false), _node_ref(graph), _edge_ref(graph) { @@ -753,7 +751,7 @@ _potential(_graph), _depth(_graph), _parent(_graph), _pred_edge(_graph), _thread(_graph), _forward(_graph), _state(_graph), _red_cost(_graph, _cost, _potential), - _flow_result(0), _potential_result(0), + _flow_result(NULL), _potential_result(NULL), _local_flow(false), _local_potential(false), _node_ref(graph), _edge_ref(graph) {