]> git.lyx.org Git - lyx.git/blobdiff - src/Graph.h
* sk.po
[lyx.git] / src / Graph.h
index ef7fd4bcc08ac862effe21956f62fe2271b24c47..239cbcb90a095de706785ccc7e6a95e5597fe746 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef GRAPH_H
 #define GRAPH_H
 
+
 #include <list>
 #include <queue>
 #include <vector>
@@ -29,9 +30,9 @@ public:
        ///
        typedef std::vector<int> EdgePath;
        /// \return a vector of the vertices from which "to" can be reached
-       std::vector<int> const getReachableTo(int to, bool clear_visited);
+       EdgePath const getReachableTo(int to, bool clear_visited);
        /// \return a vector of the vertices that can be reached from "from"
-       std::vector<int> const
+       EdgePath const
                getReachable(int from, bool only_viewable, bool clear_visited);
        /// can "from" be reached from "to"?
        bool isReachable(int from, int to);
@@ -45,21 +46,14 @@ public:
 
 private:
        ///
-       bool bfs_init(int, bool clear_visited = true);
-       /// clears the "marks" on the arrows. should be called
-       /// before any new marking begins.
-       void clearMarks();
-       /// used to recover a marked path 
-       void getMarkedPath(int from, int to, EdgePath & path);
-       ///
-       void dumpGraph() const;
+       bool bfs_init(int, bool clear_visited, std::queue<int> & Q);
        /// these represent the arrows connecting the nodes of the graph.
        /// this is the basic representation of the graph: as a bunch of 
        /// arrows.
        struct Arrow {
                ///
                Arrow(int f, int t, int i): 
-                       from(f), to(t), id(i), marked(false) {}
+                       from(f), to(t), id(i) {}
                /// the vertex at the tail of the arrow
                int from;
                /// the vertex at the head
@@ -67,9 +61,6 @@ private:
                /// an id for this arrow, e.g., for use in describing paths 
                /// through the graph
                int id;
-               /// used for "marking" paths, i.e., constructing sub-graphs
-               /// without really doing so.
-               bool marked;
        };
        /// a container for the arrows
        /// we use a list because we want pointers to the arrows,
@@ -95,8 +86,7 @@ private:
        /// of Format, this is easy, since the Format objects already have ints
        /// as identifiers.)
        std::vector<Vertex> vertices_;
-       ///
-       std::queue<int> Q_;
+       
        /// a counter that we use to assign id's to the arrows
        /// FIXME This technique assumes a correspondence between the
        /// ids of the arrows and ids associated with Converters that