Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
maxflow_pp.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file maxflow_pp.h
1
/* This software is distributed under the GNU Lesser General Public License */
2
//==========================================================================
3
//
4
// maxflow_pp.h
5
//
6
//==========================================================================
7
// $Id: maxflow_pp.h,v 1.5 2003/01/31 08:15:05 chris Exp $
8
9
#ifndef GTL_MAXFLOW_PP_H
10
#define GTL_MAXFLOW_PP_H
11
12
#include <
GTL/GTL.h
>
13
#include <
GTL/graph.h
>
14
#include <
GTL/node_map.h
>
15
#include <
GTL/edge_map.h
>
16
#include <
GTL/algorithm.h
>
17
18
#include <queue>
19
20
__GTL_BEGIN_NAMESPACE
21
25
class
GTL_EXTERN
maxflow_pp
:
public
algorithm
26
{
27
public
:
34
maxflow_pp
();
35
41
virtual
~
maxflow_pp
();
42
50
void
set_vars(
const
edge_map<double>
& edge_capacity);
51
59
void
set_vars(
60
const
edge_map<double>
& edge_capacity,
61
const
node
& net_source,
const
node
& net_target);
62
81
virtual
int
check
(
graph
&
G
);
82
91
int
run
(
graph
& G);
92
99
double
get_max_flow(
const
edge
&
e
)
const
;
100
106
double
get_max_flow()
const
;
107
114
double
get_rem_cap(
const
edge
& e)
const
;
115
121
virtual
void
reset
();
122
protected
:
126
enum
{TARGET_FROM_SOURCE_REACHABLE = 2, TARGET_FROM_SOURCE_NOT_REACHABLE = 3};
127
131
bool
artif_source_target
;
132
136
bool
set_vars_executed
;
137
141
double
max_graph_flow
;
142
146
node
net_source
;
147
151
node
net_target
;
152
156
list<edge>
edges_not_org
;
157
161
edge_map<bool>
edge_org
;
162
166
edge_map<bool>
back_edge_exists
;
167
171
edge_map<edge>
back_edge
;
172
176
edge_map<double>
edge_capacity
;
177
181
edge_map<double>
edge_max_flow
;
182
186
edge_map<double>
flow_update
;
187
191
list<edge>
full_edges
;
192
196
list<node>
temp_unvisible_nodes
;
197
201
list<edge>
temp_unvisible_edges
;
202
206
void
create_artif_source_target(
graph
& G);
207
211
void
prepare_run(
const
graph
& G);
212
216
int
leveling(
graph
& G);
217
221
void
hide_unreachable_nodes(
graph
& G);
222
226
void
store_temp_unvisible_edges(
const
node
& cur_node);
227
231
void
min_throughput_node(
const
graph
& G,
node
& min_tp_node,
double
& min_value);
232
236
double
comp_min_throughput(
const
node
cur_node)
const
;
237
241
void
get_sp_ahead(
const
graph
& G,
const
node
& start_node,
242
node_map<edge>
& last_edge);
243
247
void
get_sp_backwards(
const
graph
& G,
const
node
& start_node,
248
node_map<edge>
& prev_edge);
249
253
void
push(
graph
& G,
const
node
& start_node,
const
double
flow_value);
254
258
void
pull(
graph
& G,
const
node
& start_node,
const
double
flow_value);
259
263
void
comp_rem_net(
graph
& G);
264
268
void
single_edge_update(
graph
& G,
edge
cur_edge);
269
273
double
extra_charge_ahead(
const
node
& start_node,
const
274
node_map<edge>
& last_edge)
const
;
275
279
double
extra_charge_backwards(
const
node
& start_node,
280
const
node_map<edge>
& prev_edge)
const
;
281
285
void
create_back_edge(
graph
& G,
const
edge
& org_edge);
286
290
void
comp_max_flow(
const
graph
& G);
291
295
void
restore_graph(
graph
& G);
296
private
:
297
};
298
299
__GTL_END_NAMESPACE
300
301
#endif // GTL_MAXFLOW_PP_H
302
303
//--------------------------------------------------------------------------
304
// end of file
305
//--------------------------------------------------------------------------
JETSCAPE
blob
main
external_packages
gtl
include
GTL
maxflow_pp.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:23
using
1.8.2 with
sPHENIX GitHub integration