doc/flf-graph.texi
changeset 425 4fbe868c1fb4
parent 70 851ca9a60e90
equal deleted inserted replaced
2:0a2cb5d791ac 3:6e92b9282fea
    19 @c @var{N} and @var{E} statically attached to it.
    19 @c @var{N} and @var{E} statically attached to it.
    20 @end deftp
    20 @end deftp
    21 
    21 
    22 @subsection Types
    22 @subsection Types
    23 
    23 
    24 @deftp {Type} Graph::NodeType
    24 @c @deftp {Type} Graph::NodeType
    25 @deftpx {Type} Graph::EdgeType
    25 @c @deftpx {Type} Graph::EdgeType
    26 The type of the data stored statically for each node and edge.
    26 @c The type of the data stored statically for each node and edge.
    27 @end deftp
    27 @c @end deftp
    28 
    28 
    29 @anchor{Graph-NodeIterator}
    29 @anchor{Graph-NodeIterator}
    30 @deftp {Type} Graph::NodeIt
    30 @deftp {Type} Graph::NodeIt
    31 @deftpx {Type} Graph::NodeIterator
    31 @c @deftpx {Type} Graph::NodeIterator
    32 These types points a node uniquely. The difference between the
    32 These types points a node uniquely. The difference between the
    33 @code{NodeIt} and the @code{NodeIterator} is that @code{NodeIt}
    33 @code{NodeIt} and the @code{NodeIterator} is that @code{NodeIt}
    34 requires the graph structure itself for most of the operations.
    34 requires the graph structure itself for most of the operations.
    35 For examples using iterators you can go through all nodes as follows.
    35 For examples using iterators you can go through all nodes as follows.
    36 @quotation
    36 @quotation
    56 @end deftp
    56 @end deftp
    57 
    57 
    58 @deftp {Type} Graph::EdgeIt
    58 @deftp {Type} Graph::EdgeIt
    59 @deftpx {Type} Graph::InEdgeIt
    59 @deftpx {Type} Graph::InEdgeIt
    60 @deftpx {Type} Graph::OutEdgeIt
    60 @deftpx {Type} Graph::OutEdgeIt
    61 @deftpx {Type} Graph::BiEdgeIt
    61 @deftpx {Type} Graph::EachEdgeIt
    62 @deftpx {Type} Graph::SymEdgeIt
    62 @c @deftpx {Type} Graph::BiEdgeIt
       
    63 @c @deftpx {Type} Graph::SymEdgeIt
    63 Each of these types points an edge uniquely. The difference between the
    64 Each of these types points an edge uniquely. The difference between the
    64 @code{EdgeIt} and the
    65 @code{EdgeIt} and the
    65 @c @mref{Graph-NodeIterator,@code{EdgeIterator}}
    66 @c @mref{Graph-NodeIterator,@code{EdgeIterator}}
    66 @mref{Graph-NodeIterator , EdgeIterator}
    67 @mref{Graph-NodeIterator , EdgeIterator}
    67 series is that
    68 series is that
    68 @code{EdgeIt} requires the graph structure itself for most of the
    69 @code{EdgeIt} requires the graph structure itself for most of the
    69 operations.
    70 operations.
    70 @end deftp
    71 @end deftp
    71 
    72 
    72 @anchor{Graph-EdgeIterator}
    73 @anchor{Graph-EdgeIterator}
    73 @deftp {Type} Graph::EdgeIterator
    74 @c @deftp {Type} Graph::EdgeIterator
    74 @deftpx {Type} Graph::InEdgeIterator
    75 @c @deftpx {Type} Graph::InEdgeIterator
    75 @deftpx {Type} Graph::OutEdgeIterator
    76 @c @deftpx {Type} Graph::OutEdgeIterator
    76 @deftpx {Type} Graph::BiEdgeIterator
    77 @c @deftpx {Type} Graph::BiEdgeIterator
    77 @deftpx {Type} Graph::SymEdgeIterator
    78 @c @deftpx {Type} Graph::SymEdgeIterator
    78 @deftpx {Type} Graph::EachEdgeIterator
    79 @c @deftpx {Type} Graph::EachEdgeIterator
    79 Each of these types points an edge uniquely. The difference between the
    80 @c Each of these types points an edge uniquely. The difference between the
    80 @code{EdgeIt} and the @code{EdgeIterator} series is that
    81 @c @code{EdgeIt} and the @code{EdgeIterator} series is that
    81 @code{EdgeIt} requires the graph structure itself for most of the
    82 @c @code{EdgeIt} requires the graph structure itself for most of the
    82 operations. 
    83 @c operations. 
    83 
    84 
    84 For the @code{EdgeIterator} types you can use operator @code{++}
    85 @c For the @code{EdgeIterator} types you can use operator @code{++}
    85 (both the prefix and the posfix one) to obtain the next edge.
    86 @c (both the prefix and the posfix one) to obtain the next edge.
    86 @end deftp
    87 @c @end deftp
    87 
    88 
    88 @deftp {Type} Graph::NodeMap
    89 @deftp {Type} Graph::NodeMap<typename T>
    89 @deftpx {Type} Graph::EdgeMap
    90 @deftpx {Type} Graph::EdgeMap<typename T>
    90 There are the default property maps for the edges and the nodes.
    91 There are the default property maps for the edges and the nodes.
    91 @end deftp
    92 @end deftp
    92 
    93 
       
    94 @deftp {Type} Graph::DynNodeMap<typename T>
       
    95 @deftpx {Type} Graph::DynEdgeMap<typename T>
       
    96 There are the default @emph{dynamic} property maps for the edges and the nodes.
       
    97 @end deftp
    93 
    98 
    94 @subsection Member Functions
    99 @subsection Member Functions
    95 
   100 
    96 @subsubsection Constructors
   101 @subsubsection Constructors
    97 
       
    98 
   102 
    99 @deftypefun { } Graph::Graph ()
   103 @deftypefun { } Graph::Graph ()
   100 The default constructor.
   104 The default constructor.
   101 @end deftypefun
   105 @end deftypefun
   102 
   106 
   103 @c @deftypefun { } Graph::Graph (Graph@tie{}&)
   107 @c @deftypefun { } Graph::Graph (Graph@tie{}&)
   104 @deftypefun { } Graph::Graph (Graph &)
   108 @deftypefun { } Graph::Graph (Graph &)
   105 The copy constructor. Not yet implemented.
   109 The copy constructor.
   106 @end deftypefun
   110 @end deftypefun
   107 
   111 
   108 @subsubsection Graph Maintenence Operations
   112 @subsubsection Graph Maintenence Operations
   109 
   113 
   110 @deftypefun NodeIterator Graph::addNode ()
   114 @deftypefun NodeIt Graph::addNode ()
   111 Adds a new node to the graph and returns a @code{NodeIterator} pointing to it.
   115 Adds a new node to the graph and returns a @code{NodeIt} pointing to it.
   112 @end deftypefun
   116 @end deftypefun
   113 
   117 
   114 @deftypefun EdgeIterator Graph::addEdge (@w{const @mref{Graph-NodeIterator,NodeIterator} @var{from}}, @w{const @mref{Graph-NodeIterator,NodeIterator} @var{to}})
   118 @deftypefun EdgeIt Graph::addEdge (@w{const @mref{Graph-NodeIterator,NodeIt} @var{from}}, @w{const @mref{Graph-NodeIterator,NodeIt} @var{to}})
   115 Adds a new edge with tail @var{from} and head @var{to} to the graph
   119 Adds a new edge with tail @var{from} and head @var{to} to the graph
   116 and returns an @code{EdgeIterator} pointing to it.
   120 and returns an @code{EdgeIt} pointing to it.
   117 @end deftypefun
   121 @end deftypefun
   118 
   122 
   119 @deftypefun void Graph::delete (@w{const @mref{Graph-NodeIterator,NodeIterator} @var{n}})
   123 @deftypefun void Graph::delete (@w{const @mref{Graph-NodeIterator,NodeIt} @var{n}})
   120 Deletes the node @var{n}. It also deletes the adjacent edges.
   124 Deletes the node @var{n}. It also deletes the adjacent edges.
   121 @end deftypefun
   125 @end deftypefun
   122 
   126 
   123 @deftypefun void Graph::delete (@w{const @mref{Graph-EdgeIterator,EdgeIterator} @var{e}})
   127 @deftypefun void Graph::delete (@w{const @mref{Graph-EdgeIterator,EdgeIt} @var{e}})
   124 Deletes the edge @var{n}.
   128 Deletes the edge @var{n}.
   125 @end deftypefun
   129 @end deftypefun
   126 
   130 
   127 @deftypefun void Graph::clean ()
   131 @deftypefun void Graph::clear ()
   128 Deletes all edges and nodes from the graph.
   132 Deletes all edges and nodes from the graph.
   129 @end deftypefun
   133 @end deftypefun
   130 
   134 
   131 @deftypefun int Graph::nodeNum ()
   135 @deftypefun int Graph::nodeNum ()
   132 Returns the number of the nodes in the graph.
   136 Returns the number of the nodes in the graph.
       
   137 ??? Is it necessary???
   133 @end deftypefun
   138 @end deftypefun
   134 
   139 
   135 @subsubsection NodeIt Operations
   140 @subsubsection NodeIt Operations
   136 
   141 
   137 @deftypefun NodeIt Graph::getFirst (NodeIt &@var{n})
   142 @deftypefun NodeIt Graph::getFirst (NodeIt &@var{n}) const
   138 @deftypefunx NodeIt Graph::next (const NodeIt @var{n})
   143 @deftypefunx NodeIt Graph::getNext (NodeIt @var{n}) const
   139 @deftypefunx {NodeIt &} Graph::goNext (NodeIt &@var{n})
   144 @deftypefunx {NodeIt &} Graph::next (NodeIt &@var{n})
   140 The nodes in the graph forms a list. @code{GetFirst(n)} sets @var{n} to
   145 The nodes in the graph forms a list. @code{getFirst(n)} sets @var{n} to
   141 be the first node. @code{next(n)} gives back the subsequent
   146 be the first node. @code{getNext(n)} gives back the subsequent
   142 node. @code{Next(n)} is equivalent to @code{n=Next(n)}, though it
   147 node. @code{next(n)} is equivalent to @code{n=getNext(n)}, though it
   143 might be faster.  ??? What should be the return value ???
   148 might be faster.  ??? What should be the return value ???
   144 @end deftypefun
   149 @end deftypefun
   145 
   150 
   146 @deftypefun bool Graph::valid (NodeIt &@var{e})
   151 @deftypefun bool Graph::valid (NodeIt &@var{e})
   147 @deftypefunx bool NodeIt::valid ()
   152 @c @deftypefunx bool NodeIt::valid ()
   148 These functions check if and NodeIt is valid or not.
   153 These functions check if and NodeIt is valid or not.
   149 ??? Which one should be implemented ???
   154 @c ??? Which one should be implemented ???
   150 @end deftypefun
   155 @end deftypefun
   151 
   156 
   152 @subsubsection EdgeIt Operations
   157 @subsubsection EdgeIt Operations
   153 
   158 
   154 @deftypefun EachEdgeIt Graph::getFirst (const EachEdgeIt & @var{e})
   159 @deftypefun EachEdgeIt Graph::getFirst (const EachEdgeIt & @var{e}) const
   155 @deftypefunx EachEdgeIt Graph::next (const EachEdgeIt @var{n})
   160 @deftypefunx EachEdgeIt Graph::getNext (EachEdgeIt @var{n}) const
   156 @deftypefunx {EachEdgeIt &} Graph::goNext (EachEdgeIt &@var{n})
   161 @deftypefunx {EachEdgeIt &} Graph::next (EachEdgeIt &@var{n})
   157 With these functions you can go though all the edges of the graph.
   162 With these functions you can go though all the edges of the graph.
   158 ??? What should be the return value ???
   163 @c ??? What should be the return value ???
   159 @end deftypefun
   164 @end deftypefun
   160 
   165 
   161 @deftypefun InEdgeIt Graph::getFirst (const InEdgeIt & @var{e}, const NodeIt @var{n})
   166 @deftypefun InEdgeIt &Graph::getFirst (InEdgeIt & @var{e}, const NodeIt @var{n})
   162 @deftypefunx OutEdgeIt Graph::getFirst (const OutEdgeIt & @var{e}, const NodeIt @var{n})
   167 @deftypefunx OutEdgeIt &Graph::getFirst (OutEdgeIt & @var{e}, const NodeIt @var{n})
   163 @deftypefunx SymEdgeIt Graph::getFirst (const SymEdgeIt & @var{e}, const NodeIt @var{n})
   168 @c @deftypefunx SymEdgeIt &Graph::getFirst (SymEdgeIt & @var{e}, const NodeIt @var{n})
   164 The edges leaving from, arriving at or adjacent with a node forms a
   169 The edges leaving from
       
   170 or
       
   171 arriving at
       
   172 @c or adjacent with
       
   173 a node forms a
   165 list.  These functions give back the first elements of these
   174 list.  These functions give back the first elements of these
   166 lists. The exact behavior depends on the type of @var{e}.
   175 lists. The exact behavior depends on the type of @var{e}.
   167 
   176 
   168 If @var{e} is an @code{InEdgeIt} or an @code{OutEdgeIt} then
   177 If @var{e} is an @code{InEdgeIt} or an @code{OutEdgeIt} then
   169 @code{getFirst} sets @var{e} to be the first incoming or outgoing edge
   178 @code{getFirst} sets @var{e} to be the first incoming or outgoing edge
   170 of the node @var{n}, respectively.
   179 of the node @var{n}, respectively.
   171 
   180 
   172 If @var{e} is a @code{SymEdgeIt} then
   181 @c If @var{e} is a @code{SymEdgeIt} then
   173 @code{getFirst} sets @var{e} to be the first incoming if there exists one
   182 @c @code{getFirst} sets @var{e} to be the first incoming if there exists one
   174 otherwise the first outgoing edge.
   183 @c otherwise the first outgoing edge.
   175 
   184 
   176 If there are no such edges, @var{e} will be invalid.
   185 If there are no such edges, @var{e} will be invalid.
   177 
   186 
   178 @end deftypefun
   187 @end deftypefun
   179 
   188 
   216 @code{SymEdgeIt} and it or its first preceding edge was created by
   225 @code{SymEdgeIt} and it or its first preceding edge was created by
   217 @code{getFirst(e,n)}, then @code{aNode(e)} is equal to @var{n}.
   226 @code{getFirst(e,n)}, then @code{aNode(e)} is equal to @var{n}.
   218 
   227 
   219 @code{bNode(e)} is the other end of the edge.
   228 @code{bNode(e)} is the other end of the edge.
   220 
   229 
   221 ???It is implemented in an other way now. (Member function <-> Graph global)???
   230 @deftypefun void Graph::setInvalid (EdgeIt &@var{e})
       
   231 @deftypefunx void Graph::setInvalid (EdgeIt &@var{e})
       
   232 These functions set the corresponding iterator to be invalid.
       
   233 @end deftypefun
       
   234 
       
   235 @c ???It is implemented in an other way now. (Member function <-> Graph global)???
   222 @end deftypefun
   236 @end deftypefun
   223 
   237 
   224 
   238 
   225 
   239 
   226 @c @deftypevar int from
   240 @c @deftypevar int from