Consider the case where there is not any layout name.
[lyx.git] / src / graph.h
bloba856073d6fd1251e59e6f9708ab2d4c57aaa2cf2
1 // -*- C++ -*-
2 /**
3 * \file graph.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Dekel Tsur
9 * Full author contact details are available in file CREDITS.
12 #ifndef GRAPH_H
13 #define GRAPH_H
15 #include <queue>
16 #include <vector>
19 class Graph {
20 public:
21 Graph() : numedges_(0) {};
22 ///
23 typedef std::vector<int> EdgePath;
24 ///
25 std::vector<int> const
26 getReachableTo(int, bool clear_visited);
27 ///
28 std::vector<int> const
29 getReachable(int, bool only_viewable,
30 bool clear_visited);
31 ///
32 bool isReachable(int, int);
33 ///
34 EdgePath const getPath(int, int);
35 ///
36 void addEdge(int s, int t);
37 ///
38 void init(int size);
40 private:
41 ///
42 int bfs_init(int, bool clear_visited = true);
44 ///
45 class Vertex {
46 public:
47 std::vector<int> in_vertices;
48 std::vector<int> out_vertices;
49 std::vector<int> out_edges;
51 ///
52 static
53 std::vector<Vertex> vertices_;
54 ///
55 std::vector<bool> visited_;
56 ///
57 std::queue<int> Q_;
59 int numedges_;
64 #endif //GRAPH_H