# Changeset 70:851ca9a60e90 in lemon-0.x for doc/flf-graph.texi

Ignore:
Timestamp:
02/10/04 14:29:15 (17 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@86
Message:

.

File:
1 edited

Unmodified
Added
Removed
• ## doc/flf-graph.texi

 r26 @anchor{Graph-NodeIterator} @deftp {Type} Graph::NodePoint @deftp {Type} Graph::NodeIt @deftpx {Type} Graph::NodeIterator These types points a node uniquely. The difference between the @code{NodePoint} and the @code{NodeIterator} is that @code{NodePoint} @code{NodeIt} and the @code{NodeIterator} is that @code{NodeIt} requires the graph structure itself for most of the operations. For examples using iterators you can go through all nodes as follows. Graph G; int nodenum=0; for(Graph::NodeIterator n(G);n.Valid();++n) ++nodenum; for(Graph::NodeIterator n(G);n.valid();++n) ++nodenum; @end verbatim @end quotation Using @code{NodePoint} the last line looks like this. Using @code{NodeIt} the last line looks like this. @quotation @verbatim for(MyGraph::NodePoint n(G);n.Valid();n=G.Next(n)) ++nodenum; for(Graph::NodeIt n(G);n.valid();n=G.next(n)) ++nodenum; @end verbatim @end quotation @quotation @verbatim MyGraph::NodePoint n; for(G.GetFirst(n);G.Valid(n);G.GoNext(n)) ++nodenum; MyGraph::NodeIt n; for(G.getFirst(n);G.valid(n);G.goNext(n)) ++nodenum; @end verbatim @end quotation @end deftp @deftp {Type} Graph::EdgePoint @deftpx {Type} Graph::InEdgePoint @deftpx {Type} Graph::OutEdgePoint @deftpx {Type} Graph::BiEdgePoint @deftpx {Type} Graph::SymEdgePoint @deftp {Type} Graph::EdgeIt @deftpx {Type} Graph::InEdgeIt @deftpx {Type} Graph::OutEdgeIt @deftpx {Type} Graph::BiEdgeIt @deftpx {Type} Graph::SymEdgeIt Each of these types points an edge uniquely. The difference between the @code{EdgePoint} and the @code{EdgeIt} and the @c @mref{Graph-NodeIterator,@code{EdgeIterator}} @mref{Graph-NodeIterator , EdgeIterator} series is that @code{EdgePoint} requires the graph structure itself for most of the @code{EdgeIt} requires the graph structure itself for most of the operations. @end deftp @deftpx {Type} Graph::BiEdgeIterator @deftpx {Type} Graph::SymEdgeIterator @deftpx {Type} Graph::AllEdgeIterator @deftpx {Type} Graph::EachEdgeIterator Each of these types points an edge uniquely. The difference between the @code{EdgePoint} and the @code{EdgeIterator} series is that @code{EdgePoint} requires the graph structure itself for most of the @code{EdgeIt} and the @code{EdgeIterator} series is that @code{EdgeIt} requires the graph structure itself for most of the operations. @subsubsection Graph Maintenence Operations @deftypefun NodeIterator Graph::AddNode () @deftypefun NodeIterator Graph::addNode () Adds a new node to the graph and returns a @code{NodeIterator} pointing to it. @end deftypefun @deftypefun EdgeIterator Graph::AddEdge (@w{const @mref{Graph-NodeIterator,NodeIterator} @var{from}}, @w{const @mref{Graph-NodeIterator,NodeIterator} @var{to}}) @deftypefun EdgeIterator Graph::addEdge (@w{const @mref{Graph-NodeIterator,NodeIterator} @var{from}}, @w{const @mref{Graph-NodeIterator,NodeIterator} @var{to}}) Adds a new edge with tail @var{from} and head @var{to} to the graph and returns an @code{EdgeIterator} pointing to it. @end deftypefun @deftypefun void Graph::Delete (@w{const @mref{Graph-NodeIterator,NodeIterator} @var{n}}) @deftypefun void Graph::delete (@w{const @mref{Graph-NodeIterator,NodeIterator} @var{n}}) Deletes the node @var{n}. It also deletes the adjacent edges. @end deftypefun @deftypefun void Graph::Delete (@w{const @mref{Graph-EdgeIterator,EdgeIterator} @var{e}}) @deftypefun void Graph::delete (@w{const @mref{Graph-EdgeIterator,EdgeIterator} @var{e}}) Deletes the edge @var{n}. @end deftypefun @deftypefun void Graph::Clean () @deftypefun void Graph::clean () Deletes all edges and nodes from the graph. @end deftypefun @deftypefun int Graph::NodeNum () @deftypefun int Graph::nodeNum () Returns the number of the nodes in the graph. @end deftypefun @subsubsection NodePoint Operations @deftypefun NodePoint Graph::GetFirst (NodePoint &@var{n}) @deftypefunx NodePoint Graph::Next (const NodePoint @var{n}) @deftypefunx {NodePoint &} Graph::GoNext (NodePoint &@var{n}) @subsubsection NodeIt Operations @deftypefun NodeIt Graph::getFirst (NodeIt &@var{n}) @deftypefunx NodeIt Graph::next (const NodeIt @var{n}) @deftypefunx {NodeIt &} Graph::goNext (NodeIt &@var{n}) The nodes in the graph forms a list. @code{GetFirst(n)} sets @var{n} to be the first node. @code{Next(n)} gives back the subsequent be the first node. @code{next(n)} gives back the subsequent node. @code{Next(n)} is equivalent to @code{n=Next(n)}, though it might be faster.  ??? What should be the return value ??? @end deftypefun @deftypefun bool Graph::Valid (NodePoint &@var{e}) @deftypefunx bool NodePoint::Valid () These functions check if and NodePoint is valid or not. @deftypefun bool Graph::valid (NodeIt &@var{e}) @deftypefunx bool NodeIt::valid () These functions check if and NodeIt is valid or not. ??? Which one should be implemented ??? @end deftypefun @subsubsection EdgePoint Operations @deftypefun AllEdgePoint Graph::GetFirst (const AllEdgePoint & @var{e}) @deftypefunx AllEdgePoint Graph::Next (const AllEdgePoint @var{n}) @deftypefunx {AllEdgePoint &} Graph::GoNext (AllEdgePoint &@var{n}) @subsubsection EdgeIt Operations @deftypefun EachEdgeIt Graph::getFirst (const EachEdgeIt & @var{e}) @deftypefunx EachEdgeIt Graph::next (const EachEdgeIt @var{n}) @deftypefunx {EachEdgeIt &} Graph::goNext (EachEdgeIt &@var{n}) With these functions you can go though all the edges of the graph. ??? What should be the return value ??? @end deftypefun @deftypefun InEdgePoint Graph::GetFirst (const InEdgePoint & @var{e}, const NodePoint @var{n}) @deftypefunx OutEdgePoint Graph::GetFirst (const OutEdgePoint & @var{e}, const NodePoint @var{n}) @deftypefunx SymEdgePoint Graph::GetFirst (const SymEdgePoint & @var{e}, const NodePoint @var{n}) @deftypefun InEdgeIt Graph::getFirst (const InEdgeIt & @var{e}, const NodeIt @var{n}) @deftypefunx OutEdgeIt Graph::getFirst (const OutEdgeIt & @var{e}, const NodeIt @var{n}) @deftypefunx SymEdgeIt Graph::getFirst (const SymEdgeIt & @var{e}, const NodeIt @var{n}) The edges leaving from, arriving at or adjacent with a node forms a list.  These functions give back the first elements of these lists. The exact behavior depends on the type of @var{e}. If @var{e} is an @code{InEdgePoint} or an @code{OutEdgePoint} then @code{GetFirst} sets @var{e} to be the first incoming or outgoing edge If @var{e} is an @code{InEdgeIt} or an @code{OutEdgeIt} then @code{getFirst} sets @var{e} to be the first incoming or outgoing edge of the node @var{n}, respectively. If @var{e} is a @code{SymEdgePoint} then @code{GetFirst} sets @var{e} to be the first incoming if there exists one If @var{e} is a @code{SymEdgeIt} then @code{getFirst} sets @var{e} to be the first incoming if there exists one otherwise the first outgoing edge. @end deftypefun @deftypefun InEdgePoint Graph::Next (const InEdgePoint @var{e}) @deftypefunx OutEdgePoint Graph::Next (const OutEdgePoint @var{e}) @deftypefunx SymEdgePoint Graph::Next (const SymEdgePoint @var{e}) @deftypefun InEdgeIt Graph::next (const InEdgeIt @var{e}) @deftypefunx OutEdgeIt Graph::next (const OutEdgeIt @var{e}) @deftypefunx SymEdgeIt Graph::next (const SymEdgeIt @var{e}) These functions give back the edge that follows @var{e} @end deftypefun @deftypefun {InEdgePoint &} Graph::GoNext (InEdgePoint &@var{e}) @deftypefunx {OutEdgePoint &} Graph::GoNext (OutEdgePoint &@var{e}) @deftypefunx {SymEdgePoint &} Graph::GoNext (SymEdgePoint &@var{e}) @code{G.GoNext(e)} is equivalent to @code{e=G.Next(e)}, though it @deftypefun {InEdgeIt &} Graph::goNext (InEdgeIt &@var{e}) @deftypefunx {OutEdgeIt &} Graph::goNext (OutEdgeIt &@var{e}) @deftypefunx {SymEdgeIt &} Graph::goNext (SymEdgeIt &@var{e}) @code{G.goNext(e)} is equivalent to @code{e=G.next(e)}, though it might be faster. ??? What should be the return value ??? @end deftypefun @deftypefun bool Graph::Valid (EdgePoint &@var{e}) @deftypefunx bool EdgePoint::Valid () These functions check if and EdgePoint is valid or not. @deftypefun bool Graph::valid (EdgeIt &@var{e}) @deftypefunx bool EdgeIt::valid () These functions check if and EdgeIt is valid or not. ??? Which one should be implemented ??? @end deftypefun @deftypefun NodePoint Graph::From (const EdgePoint @var{e}) @deftypefunx NodePoint Graph::To (const EdgePoint @var{e}) @deftypefunx NodePoint Graph::ANode (const InEdgePoint @var{e}) @deftypefunx NodePoint Graph::ANode (const OutEdgePoint @var{e}) @deftypefunx NodePoint Graph::ANode (const SymEdgePoint @var{e}) @deftypefunx NodePoint Graph::BNode (const InEdgePoint @var{e}) @deftypefunx NodePoint Graph::BNode (const OutEdgePoint @var{e}) @deftypefunx NodePoint Graph::BNode (const SymEdgePoint @var{e}) @deftypefun NodeIt Graph::tail (const EdgeIt @var{e}) @deftypefunx NodeIt Graph::head (const EdgeIt @var{e}) @deftypefunx NodeIt Graph::aNode (const InEdgeIt @var{e}) @deftypefunx NodeIt Graph::aNode (const OutEdgeIt @var{e}) @deftypefunx NodeIt Graph::aNode (const SymEdgeIt @var{e}) @deftypefunx NodeIt Graph::bNode (const InEdgeIt @var{e}) @deftypefunx NodeIt Graph::bNode (const OutEdgeIt @var{e}) @deftypefunx NodeIt Graph::bNode (const SymEdgeIt @var{e}) There queries give back the two endpoints of the edge @var{e}.  For a directed edge @var{e}, @code{From(e)} and @code{To(e)} is its tail and directed edge @var{e}, @code{tail(e)} and @code{head(e)} is its tail and its head, respectively. For an undirected @var{e}, they are two endpoints, but you should not rely on which end is which. @code{ANode(e)} is the node which @var{e} is bounded to, i.e. it is equal to @code{From(e)} if @var{e} is an @code{OutEdgePoint} and @code{To(e)} if @var{e} is an @code{InEdgePoint}. If @var{e} is a @code{SymEdgePoint} and it or its first preceding edge was created by @code{GetFirst(e,n)}, then @code{ANode(e)} is equal to @var{n}. @code{BNode(e)} is the other end of the edge. ???It it implemented in an other way now. (Member function <-> Graph global)??? @code{aNode(e)} is the node which @var{e} is bounded to, i.e. it is equal to @code{tail(e)} if @var{e} is an @code{OutEdgeIt} and @code{head(e)} if @var{e} is an @code{InEdgeIt}. If @var{e} is a @code{SymEdgeIt} and it or its first preceding edge was created by @code{getFirst(e,n)}, then @code{aNode(e)} is equal to @var{n}. @code{bNode(e)} is the other end of the edge. ???It is implemented in an other way now. (Member function <-> Graph global)??? @end deftypefun
Note: See TracChangeset for help on using the changeset viewer.