Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bid_dijkstra.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file bid_dijkstra.h
1 /* This software is distributed under the GNU Lesser General Public License */
2 //==========================================================================
3 //
4 // bid_dijkstra.h
5 //
6 //==========================================================================
7 // $Id: bid_dijkstra.h,v 1.3 2003/03/24 15:58:54 raitner Exp $
8 
9 #ifndef GTL_BID_DIJKSTRA_H
10 #define GTL_BID_DIJKSTRA_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 
19 
37 {
38 public:
42  typedef list<node>::const_iterator shortest_path_node_iterator;
43 
47  typedef list<edge>::const_iterator shortest_path_edge_iterator;
48 
52  enum node_color {white, grey, black};
53 
61  bid_dijkstra();
62 
68  virtual ~bid_dijkstra();
69 
78  void source_target(const node& s, const node& t);
79 
87  void weights(const edge_map<double>& weight);
88 
100  void store_path(bool set);
101 
120  virtual int check(graph& G);
121 
136  int run(graph& G);
137 
143  node source() const;
144 
150  node target() const;
151 
159  bool store_path() const;
160 
166  bool reached() const;
167 
174  double distance() const;
175 
187  shortest_path_node_iterator shortest_path_nodes_begin();
188 
200  shortest_path_node_iterator shortest_path_nodes_end();
201 
213  shortest_path_edge_iterator shortest_path_edges_begin();
214 
226  shortest_path_edge_iterator shortest_path_edges_end();
227 
238  virtual void reset();
239 private:
247 
255 
263 
270  bool path_set;
271 
279 
285  double dist;
286 
292  bool reached_t;
293 
300 
307 
314 
321 
328 
335 
346 
357 
362  void reset_algorithm();
363 
368  void init(graph& G);
369 
378  void fill_node_edge_lists(const node& n);
379 };
380 
382 
383 #endif // GTL_BID_DIJKSTRA_H
384 
385 //--------------------------------------------------------------------------
386 // end of file
387 //--------------------------------------------------------------------------