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
components.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file components.cpp
1
/* This software is distributed under the GNU Lesser General Public License */
2
//==========================================================================
3
//
4
// components.cpp
5
//
6
//==========================================================================
7
// $Id: components.cpp,v 1.5 2001/11/07 13:58:09 pick Exp $
8
9
#include <
GTL/components.h
>
10
11
#ifdef __GTL_MSVCC
12
# ifdef _DEBUG
13
# ifndef SEARCH_MEMORY_LEAKS_ENABLED
14
# error SEARCH NOT ENABLED
15
# endif
16
# define new DEBUG_NEW
17
# undef THIS_FILE
18
static
char
THIS_FILE[] = __FILE__;
19
# endif // _DEBUG
20
#endif // __GTL_MSVCC
21
22
__GTL_BEGIN_NAMESPACE
23
24
components::components
() :
dfs
()
25
{
26
scan_whole_graph
(
true
);
27
num_of_components
= 0;
28
}
29
30
void
components::reset
()
31
{
32
dfs::reset
();
33
comp
.erase (
comp
.begin(),
comp
.end());
34
num_of_components
= 0;
35
}
36
37
int
components::check
(
graph
& G)
38
{
39
return
G.
is_undirected
() &&
whole_graph
&&
40
dfs::check
(G) ==
GTL_OK
?
GTL_OK
:
GTL_ERROR
;
41
}
42
43
44
//--------------------------------------------------------------------------
45
// Handler
46
//--------------------------------------------------------------------------
47
48
49
void
components::new_start_handler
(
graph
& G,
node
& st)
50
{
51
li
=
comp
.insert (
comp
.end(),
52
pair<list<node>,list<edge> > (list<node> (), list<edge> ()));
53
(*li).first.push_back (st);
54
++
num_of_components
;
55
}
56
57
void
components::before_recursive_call_handler
(
graph
& G,
edge
&
e
,
node
&
n
)
58
{
59
(*li).first.push_back (n);
60
// (*li).second.push_back (e);
61
}
62
63
64
void
components::old_adj_node_handler
(
graph
& G,
edge
&
e
,
node
&
n
)
65
{
66
node
curr = n.
opposite
(e);
67
68
//
69
// Store backedges at lower endpoint
70
//
71
72
if
(
dfs_num
(curr) >
dfs_num
(n)) {
73
(*li).second.push_back (e);
74
}
75
}
76
77
78
__GTL_END_NAMESPACE
79
80
//--------------------------------------------------------------------------
81
// end of file
82
//--------------------------------------------------------------------------
JETSCAPE
blob
main
external_packages
gtl
src
components.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:23
using
1.8.2 with
sPHENIX GitHub integration