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
st_number.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file st_number.h
1
/* This software is distributed under the GNU Lesser General Public License */
2
//==========================================================================
3
//
4
// st_number.h
5
//
6
//==========================================================================
7
// $Id: st_number.h,v 1.17 2002/12/20 08:26:08 chris Exp $
8
9
#ifndef GTL_ST_NUMBER_H
10
#define GTL_ST_NUMBER_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 <list>
19
#include <utility>
20
21
__GTL_BEGIN_NAMESPACE
22
26
class
GTL_EXTERN
pathfinder
27
{
28
public
:
29
//---------------------------------------------------------- CONSTRUCTOR
30
34
pathfinder
(
const
graph
&
G
,
edge
st,
node
s
);
35
39
bool
is_valid
()
40
{
41
return
is_biconn;
42
}
43
44
//------------------------------------------------------------- ITERATOR
45
49
class
const_iterator
50
{
51
public
:
55
const_iterator
(
pathfinder
& _pf) : pf (_pf)
56
{
57
}
58
62
const_iterator
(
pathfinder
& _pf,
node
n
);
63
67
const_iterator
& operator++();
71
const_iterator
operator++(
int
);
75
const
node
&
operator*
()
const
76
{
77
return
curr;
78
}
79
83
bool
operator==
(
const
const_iterator
&
it
)
84
{
85
return
curr == it.
curr
;
86
}
87
91
bool
operator!=
(
const
const_iterator
&
it
)
92
{
93
return
curr != it.
curr
;
94
}
95
private
:
99
enum
iteration_state
{END,
UP
, DOWN};
100
104
iteration_state
state
;
105
109
node
curr
;
110
114
pathfinder
&
pf
;
115
};
116
120
const_iterator
path
(
node
n
)
121
{
122
return
const_iterator
(*
this
, n);
123
}
124
128
const_iterator
end
()
129
{
130
return
const_iterator
(*
this
);
131
}
132
133
private
:
134
//------------------------------------------------------------ FUNCTIONS
135
139
void
dfs_sub (
node
&,
node
&);
140
141
//-------------------------------------------------------------- MEMBERS
142
146
node_map<int>
dfs_num
;
147
151
node_map<int>
low_num
;
152
156
node_map<list<edge>
>
tree
;
157
161
node_map<list<edge>
>
back
;
162
166
node_map<list<edge>
>
forward
;
167
171
node_map<list<edge>::iterator
>
to_low
;
172
176
node_map<list<edge>::iterator
>
to_father
;
177
181
typedef
pair<list<edge>::iterator, list<edge>::iterator>
pos_pair
;
182
186
edge_map<pos_pair >
pos
;
187
191
node_map<int>
used
;
192
196
int
act_dfs_num
;
197
201
int
new_nodes
;
202
206
bool
is_biconn
;
207
212
friend
class
const_iterator
;
213
};
214
233
class
GTL_EXTERN
st_number
:
public
algorithm
234
{
235
public
:
243
st_number
() :
algorithm
()
244
{
245
}
246
250
virtual
~
st_number
()
251
{
252
}
253
259
void
st_edge(
edge
e
)
260
{
261
st =
e
;
262
}
263
269
edge
st_edge()
const
270
{
271
return
st;
272
}
273
283
void
s_node(
node
n
)
284
{
285
s
=
n
;
286
}
287
293
node
s_node()
const
294
{
295
return
s
;
296
}
297
305
int
& operator[](
const
node
&
n
)
306
{
307
return
st_num[
n
];
308
}
309
313
typedef
list<node>::iterator
iterator
;
314
318
typedef
list<node>::reverse_iterator
reverse_iterator
;
319
326
iterator
begin
()
327
{
328
return
st_ord.begin();
329
}
330
336
iterator
end
()
337
{
338
return
st_ord.end();
339
}
340
348
reverse_iterator
rbegin()
349
{
350
return
st_ord.rbegin();
351
}
352
359
reverse_iterator
rend()
360
{
361
return
st_ord.rend();
362
}
363
364
380
int
check
(
graph
& G);
381
382
395
int
run
(
graph
& G);
396
397
405
void
reset
()
406
{
407
st_ord.erase (st_ord.begin(), st_ord.end());
408
}
409
protected
:
413
edge
st
;
414
418
node
s
;
419
423
pathfinder
*
pf
;
424
428
list<node>
st_ord
;
429
433
node_map<int>
st_num
;
434
};
435
436
__GTL_END_NAMESPACE
437
438
#endif // GTL_ST_NUMBER_H
439
440
//--------------------------------------------------------------------------
441
// end of file
442
//--------------------------------------------------------------------------
JETSCAPE
blob
main
external_packages
gtl
include
GTL
st_number.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:23
using
1.8.2 with
sPHENIX GitHub integration