Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
biconnectivity.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file biconnectivity.h
1 /* This software is distributed under the GNU Lesser General Public License */
2 //==========================================================================
3 //
4 // biconnectivity.h
5 //
6 //==========================================================================
7 // $Id: biconnectivity.h,v 1.18 2003/03/26 13:37:14 raitner Exp $
8 
9 #ifndef GTL_BICONNECTIVITY_H
10 #define GTL_BICONNECTIVITY_H
11 
12 #include <GTL/GTL.h>
13 #include <GTL/dfs.h>
14 
15 #include <list>
16 #include <stack>
17 
19 
36 class GTL_EXTERN biconnectivity : public dfs
37 {
38 public:
44  biconnectivity ();
45 
51  virtual ~biconnectivity () {}
52 
66  virtual int check (graph& G);
67 
68  virtual void reset ();
69 
76  int low_number (const node& n) const
77  {return low_num[n];}
78 
84  bool is_biconnected () const
85  {return num_of_components == 1;}
86 
93  bool store_components () const
94  { return store_comp; }
95 
106  void store_components (bool set)
107  { store_comp = set; if (set) scan_whole_graph (set); }
108 
120  void make_biconnected (bool set)
121  { add_edges = set; if (set) scan_whole_graph (set); }
122 
130  bool make_biconnected () const
131  { return add_edges; }
132 
139  list<edge>::iterator additional_begin ()
140  { return additional.begin (); }
141 
148  list<edge>::iterator additional_end ()
149  { return additional.end (); }
150 
154  typedef list<node>::iterator cutpoint_iterator;
155 
165  cutpoint_iterator cut_points_begin ()
166  { return cut_points.begin(); }
167 
174  cutpoint_iterator cut_points_end ()
175  { return cut_points.end(); }
176 
177 
181  typedef list<pair<list<node>, list<edge> > >::iterator component_iterator;
182 
196  component_iterator components_begin ()
197  { return components.begin(); }
198 
199 
206  component_iterator components_end ()
207  { return components.end(); }
208 
214  int number_of_components () const
215  {return num_of_components; }
216 
217  //-----------------------------------------------------------------------
218  // Handler used to extend dfs to biconnectivity
219  //-----------------------------------------------------------------------
223  virtual void init_handler (graph&);
224 
228  virtual void entry_handler (graph&, node&, node&);
229 
233  virtual void before_recursive_call_handler (graph&, edge&, node&);
234 
238  virtual void after_recursive_call_handler (graph&, edge&, node&);
239 
243  virtual void old_adj_node_handler (graph&, edge&, node&);
244 
248  virtual void new_start_handler (graph&, node&);
249 
253  virtual void leave_handler (graph&, node&, node&);
254 
258  virtual void end_handler (graph&);
259 
260 
261 protected:
265  list<edge> self_loops;
266 
271 
287  bool add_edges;
295  stack<node> node_stack;
299  stack<edge> edge_stack;
303  list<pair<list<node>, list<edge> > > components;
307  list<node> cut_points;
315  list<edge> additional;
320 };
321 
323 
324 #endif // GTL_BICONNECTIVITY_H
325 
326 //--------------------------------------------------------------------------
327 // end of file
328 //--------------------------------------------------------------------------