X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FGraph.h;h=3955c3e60c154c886de4be7affdcb0a1d00759f1;hb=0fb63fb10ee905de33fb5217cb8954446dbfebc1;hp=f2296b85a97b56d7c3f8cefa4017ea3c11cac415;hpb=288e249ba2931cd7804d83daeccb0bc713b7b0fd;p=features.git diff --git a/src/Graph.h b/src/Graph.h index f2296b85a9..3955c3e60c 100644 --- a/src/Graph.h +++ b/src/Graph.h @@ -24,20 +24,18 @@ public: Graph() : numedges_(0) {}; /// typedef std::vector EdgePath; - /// - std::vector const - getReachableTo(int, bool clear_visited); - /// + /// \return a vector of the vertices from which "to" can be reached + std::vector const getReachableTo(int to, bool clear_visited); + /// \return a vector of the vertices that can be reached from "from" std::vector const - getReachable(int, bool only_viewable, - bool clear_visited); - /// - bool isReachable(int, int); - /// - EdgePath const getPath(int, int); - /// - void addEdge(int s, int t); - /// + getReachable(int from, bool only_viewable, bool clear_visited); + /// Can "from" be reached from "to"? + bool isReachable(int from, int to); + /// Find a path from "from" to "to". + EdgePath const getPath(int from, int to); + /// Called repeatedly to build the graph. + void addEdge(int from, int to); + /// Reset the internal data structures. void init(int size); private: @@ -52,8 +50,7 @@ private: std::vector out_edges; }; /// - static - std::vector vertices_; + static std::vector vertices_; /// std::vector visited_; ///