.
authoralpar
Mon, 15 Mar 2004 16:30:20 +0000
changeset 18647cd1716870e
parent 185 259540358bbf
child 187 35a2c1fd5d73
.
doc/Doxyfile
doc/makefile
src/work/alpar/emptygraph.h
src/work/alpar/mapskeleton.h
src/work/alpar/smart_graph.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/Doxyfile	Mon Mar 15 16:30:20 2004 +0000
     1.3 @@ -0,0 +1,210 @@
     1.4 +# Doxyfile 1.3.2
     1.5 +
     1.6 +#---------------------------------------------------------------------------
     1.7 +# General configuration options
     1.8 +#---------------------------------------------------------------------------
     1.9 +PROJECT_NAME           = hugo
    1.10 +PROJECT_NUMBER         = 0.1
    1.11 +OUTPUT_DIRECTORY       = 
    1.12 +OUTPUT_LANGUAGE        = English
    1.13 +USE_WINDOWS_ENCODING   = NO
    1.14 +EXTRACT_ALL            = NO
    1.15 +EXTRACT_PRIVATE        = NO
    1.16 +EXTRACT_STATIC         = NO
    1.17 +EXTRACT_LOCAL_CLASSES  = YES
    1.18 +HIDE_UNDOC_MEMBERS     = YES
    1.19 +HIDE_UNDOC_CLASSES     = YES
    1.20 +HIDE_FRIEND_COMPOUNDS  = NO
    1.21 +HIDE_IN_BODY_DOCS      = NO
    1.22 +BRIEF_MEMBER_DESC      = YES
    1.23 +REPEAT_BRIEF           = NO
    1.24 +ALWAYS_DETAILED_SEC    = NO
    1.25 +INLINE_INHERITED_MEMB  = NO
    1.26 +FULL_PATH_NAMES        = NO
    1.27 +STRIP_FROM_PATH        = 
    1.28 +INTERNAL_DOCS          = NO
    1.29 +CASE_SENSE_NAMES       = YES
    1.30 +SHORT_NAMES            = NO
    1.31 +HIDE_SCOPE_NAMES       = YES
    1.32 +SHOW_INCLUDE_FILES     = YES
    1.33 +JAVADOC_AUTOBRIEF      = NO
    1.34 +MULTILINE_CPP_IS_BRIEF = NO
    1.35 +DETAILS_AT_TOP         = NO
    1.36 +INHERIT_DOCS           = NO
    1.37 +INLINE_INFO            = YES
    1.38 +SORT_MEMBER_DOCS       = NO
    1.39 +DISTRIBUTE_GROUP_DOC   = NO
    1.40 +TAB_SIZE               = 8
    1.41 +GENERATE_TODOLIST      = YES
    1.42 +GENERATE_TESTLIST      = YES
    1.43 +GENERATE_BUGLIST       = YES
    1.44 +GENERATE_DEPRECATEDLIST= YES
    1.45 +ALIASES                = 
    1.46 +ENABLED_SECTIONS       = 
    1.47 +MAX_INITIALIZER_LINES  = 30
    1.48 +OPTIMIZE_OUTPUT_FOR_C  = YES
    1.49 +OPTIMIZE_OUTPUT_JAVA   = NO
    1.50 +SHOW_USED_FILES        = YES
    1.51 +#---------------------------------------------------------------------------
    1.52 +# configuration options related to warning and progress messages
    1.53 +#---------------------------------------------------------------------------
    1.54 +QUIET                  = NO
    1.55 +WARNINGS               = YES
    1.56 +WARN_IF_UNDOCUMENTED   = YES
    1.57 +WARN_IF_DOC_ERROR      = YES
    1.58 +WARN_FORMAT            = "$file:$line: $text"
    1.59 +WARN_LOGFILE           = 
    1.60 +#---------------------------------------------------------------------------
    1.61 +# configuration options related to the input files
    1.62 +#---------------------------------------------------------------------------
    1.63 +INPUT                  = ../src/demo/alpar/emptygraph.h \
    1.64 +                         ../src/doxy/invalid.h \
    1.65 +                         ../src/demo/alpar/smart_graph.h \
    1.66 +                         ../src/demo/alpar/mapskeleton.h
    1.67 +FILE_PATTERNS          = 
    1.68 +RECURSIVE              = NO
    1.69 +EXCLUDE                = 
    1.70 +EXCLUDE_SYMLINKS       = NO
    1.71 +EXCLUDE_PATTERNS       = 
    1.72 +EXAMPLE_PATH           = examples
    1.73 +EXAMPLE_PATTERNS       = 
    1.74 +EXAMPLE_RECURSIVE      = NO
    1.75 +IMAGE_PATH             = 
    1.76 +INPUT_FILTER           = 
    1.77 +FILTER_SOURCE_FILES    = NO
    1.78 +#---------------------------------------------------------------------------
    1.79 +# configuration options related to source browsing
    1.80 +#---------------------------------------------------------------------------
    1.81 +SOURCE_BROWSER         = YES
    1.82 +INLINE_SOURCES         = NO
    1.83 +STRIP_CODE_COMMENTS    = YES
    1.84 +REFERENCED_BY_RELATION = YES
    1.85 +REFERENCES_RELATION    = YES
    1.86 +VERBATIM_HEADERS       = YES
    1.87 +#---------------------------------------------------------------------------
    1.88 +# configuration options related to the alphabetical class index
    1.89 +#---------------------------------------------------------------------------
    1.90 +ALPHABETICAL_INDEX     = YES
    1.91 +COLS_IN_ALPHA_INDEX    = 2
    1.92 +IGNORE_PREFIX          = 
    1.93 +#---------------------------------------------------------------------------
    1.94 +# configuration options related to the HTML output
    1.95 +#---------------------------------------------------------------------------
    1.96 +GENERATE_HTML          = YES
    1.97 +HTML_OUTPUT            = html
    1.98 +HTML_FILE_EXTENSION    = .html
    1.99 +HTML_HEADER            = 
   1.100 +HTML_FOOTER            = 
   1.101 +HTML_STYLESHEET        = 
   1.102 +HTML_ALIGN_MEMBERS     = YES
   1.103 +GENERATE_HTMLHELP      = NO
   1.104 +CHM_FILE               = 
   1.105 +HHC_LOCATION           = 
   1.106 +GENERATE_CHI           = NO
   1.107 +BINARY_TOC             = NO
   1.108 +TOC_EXPAND             = NO
   1.109 +DISABLE_INDEX          = NO
   1.110 +ENUM_VALUES_PER_LINE   = 4
   1.111 +GENERATE_TREEVIEW      = YES
   1.112 +TREEVIEW_WIDTH         = 250
   1.113 +#---------------------------------------------------------------------------
   1.114 +# configuration options related to the LaTeX output
   1.115 +#---------------------------------------------------------------------------
   1.116 +GENERATE_LATEX         = YES
   1.117 +LATEX_OUTPUT           = latex
   1.118 +LATEX_CMD_NAME         = latex
   1.119 +MAKEINDEX_CMD_NAME     = makeindex
   1.120 +COMPACT_LATEX          = YES
   1.121 +PAPER_TYPE             = a4wide
   1.122 +EXTRA_PACKAGES         = 
   1.123 +LATEX_HEADER           = 
   1.124 +PDF_HYPERLINKS         = YES
   1.125 +USE_PDFLATEX           = YES
   1.126 +LATEX_BATCHMODE        = NO
   1.127 +LATEX_HIDE_INDICES     = NO
   1.128 +#---------------------------------------------------------------------------
   1.129 +# configuration options related to the RTF output
   1.130 +#---------------------------------------------------------------------------
   1.131 +GENERATE_RTF           = NO
   1.132 +RTF_OUTPUT             = rtf
   1.133 +COMPACT_RTF            = NO
   1.134 +RTF_HYPERLINKS         = NO
   1.135 +RTF_STYLESHEET_FILE    = 
   1.136 +RTF_EXTENSIONS_FILE    = 
   1.137 +#---------------------------------------------------------------------------
   1.138 +# configuration options related to the man page output
   1.139 +#---------------------------------------------------------------------------
   1.140 +GENERATE_MAN           = NO
   1.141 +MAN_OUTPUT             = man
   1.142 +MAN_EXTENSION          = .3
   1.143 +MAN_LINKS              = NO
   1.144 +#---------------------------------------------------------------------------
   1.145 +# configuration options related to the XML output
   1.146 +#---------------------------------------------------------------------------
   1.147 +GENERATE_XML           = NO
   1.148 +XML_OUTPUT             = xml
   1.149 +XML_SCHEMA             = 
   1.150 +XML_DTD                = 
   1.151 +#---------------------------------------------------------------------------
   1.152 +# configuration options for the AutoGen Definitions output
   1.153 +#---------------------------------------------------------------------------
   1.154 +GENERATE_AUTOGEN_DEF   = NO
   1.155 +#---------------------------------------------------------------------------
   1.156 +# configuration options related to the Perl module output
   1.157 +#---------------------------------------------------------------------------
   1.158 +GENERATE_PERLMOD       = NO
   1.159 +PERLMOD_LATEX          = NO
   1.160 +PERLMOD_PRETTY         = YES
   1.161 +PERLMOD_MAKEVAR_PREFIX = 
   1.162 +#---------------------------------------------------------------------------
   1.163 +# Configuration options related to the preprocessor   
   1.164 +#---------------------------------------------------------------------------
   1.165 +ENABLE_PREPROCESSING   = YES
   1.166 +MACRO_EXPANSION        = NO
   1.167 +EXPAND_ONLY_PREDEF     = NO
   1.168 +SEARCH_INCLUDES        = YES
   1.169 +INCLUDE_PATH           = 
   1.170 +INCLUDE_FILE_PATTERNS  = 
   1.171 +PREDEFINED             = DOXYGEN
   1.172 +EXPAND_AS_DEFINED      = 
   1.173 +SKIP_FUNCTION_MACROS   = YES
   1.174 +#---------------------------------------------------------------------------
   1.175 +# Configuration::addtions related to external references   
   1.176 +#---------------------------------------------------------------------------
   1.177 +TAGFILES               = 
   1.178 +GENERATE_TAGFILE       = 
   1.179 +ALLEXTERNALS           = NO
   1.180 +EXTERNAL_GROUPS        = YES
   1.181 +PERL_PATH              = /usr/bin/perl
   1.182 +#---------------------------------------------------------------------------
   1.183 +# Configuration options related to the dot tool   
   1.184 +#---------------------------------------------------------------------------
   1.185 +CLASS_DIAGRAMS         = YES
   1.186 +HIDE_UNDOC_RELATIONS   = NO
   1.187 +HAVE_DOT               = YES
   1.188 +CLASS_GRAPH            = YES
   1.189 +COLLABORATION_GRAPH    = YES
   1.190 +UML_LOOK               = NO
   1.191 +TEMPLATE_RELATIONS     = YES
   1.192 +INCLUDE_GRAPH          = YES
   1.193 +INCLUDED_BY_GRAPH      = YES
   1.194 +CALL_GRAPH             = YES
   1.195 +GRAPHICAL_HIERARCHY    = YES
   1.196 +DOT_IMAGE_FORMAT       = png
   1.197 +DOT_PATH               = 
   1.198 +DOTFILE_DIRS           = 
   1.199 +MAX_DOT_GRAPH_WIDTH    = 1024
   1.200 +MAX_DOT_GRAPH_HEIGHT   = 1024
   1.201 +MAX_DOT_GRAPH_DEPTH    = 0
   1.202 +GENERATE_LEGEND        = YES
   1.203 +DOT_CLEANUP            = YES
   1.204 +#---------------------------------------------------------------------------
   1.205 +# Configuration::addtions related to the search engine   
   1.206 +#---------------------------------------------------------------------------
   1.207 +SEARCHENGINE           = YES
   1.208 +CGI_NAME               = search.cgi
   1.209 +CGI_URL                = 
   1.210 +DOC_URL                = 
   1.211 +DOC_ABSPATH            = 
   1.212 +BIN_ABSPATH            = /usr/local/bin/
   1.213 +EXT_DOC_PATHS          = 
     2.1 --- a/doc/makefile	Sat Mar 13 22:53:07 2004 +0000
     2.2 +++ b/doc/makefile	Mon Mar 15 16:30:20 2004 +0000
     2.3 @@ -1,2 +1,9 @@
     2.4 -all: etikol.texi flf-graph.texi
     2.5 -	makeinfo etikol.texi&&makeinfo --html etikol.texi&&texi2pdf etikol.texi
     2.6 \ No newline at end of file
     2.7 +doxy:
     2.8 +	doxygen Doxyfile
     2.9 +
    2.10 +
    2.11 +texi: etikol.texi flf-graph.texi
    2.12 +	makeinfo etikol.texi&&makeinfo --html etikol.texi&&texi2pdf etikol.texi
    2.13 +
    2.14 +texi-html: etikol.texi flf-graph.texi
    2.15 +	makeinfo etikol.texi&&makeinfo --html etikol.texi
    2.16 \ No newline at end of file
     3.1 --- a/src/work/alpar/emptygraph.h	Sat Mar 13 22:53:07 2004 +0000
     3.2 +++ b/src/work/alpar/emptygraph.h	Mon Mar 15 16:30:20 2004 +0000
     3.3 @@ -12,8 +12,8 @@
     3.4  
     3.5    /// An empty graph class.
     3.6    
     3.7 -  /// This class provides all the common features of a grapf structure,
     3.8 -  /// however completely without implementations or real data structures
     3.9 +  /// This class provides all the common features of a graph structure,
    3.10 +  /// however completely without implementations and real data structures
    3.11    /// behind the interface.
    3.12    /// All graph algorithms should compile with this class, but it will not
    3.13    /// run properly, of course.
    3.14 @@ -31,7 +31,7 @@
    3.15      
    3.16      /// The base type of the node iterators.
    3.17  
    3.18 -    /// This \c Node is the base type of each node iterators,
    3.19 +    /// This is the base type of each node iterators,
    3.20      /// thus each kind of node iterator will convert to this.
    3.21      class Node {
    3.22      public:
    3.23 @@ -58,6 +58,14 @@
    3.24      };
    3.25      
    3.26      /// This iterator goes through each node.
    3.27 +
    3.28 +    /// This iterator goes through each node.
    3.29 +    /// Its usage is quite simple, for example you can count the number
    3.30 +    /// of nodes in graph \c G of type \c Graph like this:
    3.31 +    /// \code
    3.32 +    ///int count=0;
    3.33 +    ///for(Graph::NodeIt n(G);G.valid(n);G.next(n)) count++;
    3.34 +    /// \endcode
    3.35      class NodeIt : public Node {
    3.36      public:
    3.37        /// @warning The default constructor sets the iterator
    3.38 @@ -91,7 +99,17 @@
    3.39        bool operator<(Edge n) const { return true; }
    3.40      };
    3.41      
    3.42 -    /// This iterator goes trought the outgoing edges of a certain graph.
    3.43 +    /// This iterator goes trought the outgoing edges of a node.
    3.44 +
    3.45 +    /// This iterator goes trought the \e outgoing edges of a certain node
    3.46 +    /// of a graph.
    3.47 +    /// Its usage is quite simple, for example you can count the number
    3.48 +    /// of outgoing edges of a node \c n
    3.49 +    /// in graph \c G of type \c Graph as follows.
    3.50 +    /// \code
    3.51 +    ///int count=0;
    3.52 +    ///for(Graph::OutEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
    3.53 +    /// \endcode
    3.54      
    3.55      class OutEdgeIt : public Edge {
    3.56      public:
    3.57 @@ -109,6 +127,18 @@
    3.58        OutEdgeIt(const GraphSkeleton & G, Node n) {}
    3.59      };
    3.60  
    3.61 +    /// This iterator goes trought the incoming edges of a node.
    3.62 +
    3.63 +    /// This iterator goes trought the \e incoming edges of a certain node
    3.64 +    /// of a graph.
    3.65 +    /// Its usage is quite simple, for example you can count the number
    3.66 +    /// of outgoing edges of a node \c n
    3.67 +    /// in graph \c G of type \c Graph as follows.
    3.68 +    /// \code
    3.69 +    ///int count=0;
    3.70 +    ///for(Graph::InEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
    3.71 +    /// \endcode
    3.72 +
    3.73      class InEdgeIt : public Edge {
    3.74      public:
    3.75        /// @warning The default constructor sets the iterator
    3.76 @@ -119,6 +149,16 @@
    3.77        InEdgeIt(const GraphSkeleton &, Node) {}    
    3.78      };
    3.79      //  class SymEdgeIt : public Edge {};
    3.80 +
    3.81 +    /// This iterator goes through each edge.
    3.82 +
    3.83 +    /// This iterator goes through each edge of a graph.
    3.84 +    /// Its usage is quite simple, for example you can count the number
    3.85 +    /// of edges in a graph \c G of type \c Graph as follows:
    3.86 +    /// \code
    3.87 +    ///int count=0;
    3.88 +    ///for(Graph::EdgeIt e(G);G.valid(e);G.next(e)) count++;
    3.89 +    /// \endcode
    3.90      class EdgeIt : public Edge {
    3.91      public:
    3.92        /// @warning The default constructor sets the iterator
    3.93 @@ -173,8 +213,14 @@
    3.94      //   Node bNode(SymEdgeIt) const {}
    3.95  
    3.96      /// Checks if a node iterator is valid
    3.97 +
    3.98 +    ///\todo Maybe, it would be better if iterator converted to
    3.99 +    ///bool directly, as Jacint prefers.
   3.100      bool valid(const Node) const { return true;}
   3.101      /// Checks if an edge iterator is valid
   3.102 +
   3.103 +    ///\todo Maybe, it would be better if iterator converted to
   3.104 +    ///bool directly, as Jacint prefers.
   3.105      bool valid(const Edge) const { return true;}
   3.106  
   3.107      ///Gives back the \e id of a node.
   3.108 @@ -194,6 +240,7 @@
   3.109      ///Add a new node to the graph.
   3.110  
   3.111      /// \return the new node.
   3.112 +    ///
   3.113      Node addNode() { return INVALID;}
   3.114      ///Add a new edge to the graph.
   3.115  
   3.116 @@ -227,8 +274,10 @@
   3.117    
   3.118    
   3.119  
   3.120 -    ///Read/write map of the nodes to type \c T.
   3.121 +    ///Read/write/reference map of the nodes to type \c T.
   3.122  
   3.123 +    ///Read/write/reference map of the nodes to type \c T.
   3.124 +    /// \sa MemoryMapSkeleton
   3.125      /// \todo We may need copy constructor
   3.126      /// \todo We may need conversion from other nodetype
   3.127      /// \todo We may need operator=
   3.128 @@ -262,10 +311,15 @@
   3.129        void update(T a) {}   //FIXME: Is it necessary
   3.130      };
   3.131  
   3.132 -    ///Read/write map of the edges to type \c T.
   3.133 +    ///Read/write/reference map of the edges to type \c T.
   3.134  
   3.135 -    ///Read/write map of the edges to type \c T.
   3.136 -    ///It behaves exactly the same way as \ref NodeMap.
   3.137 +    ///Read/write/reference map of the edges to type \c T.
   3.138 +    ///It behaves exactly in the same way as \ref NodeMap.
   3.139 +    /// \sa NodeMap
   3.140 +    /// \sa MemoryMapSkeleton
   3.141 +    /// \todo We may need copy constructor
   3.142 +    /// \todo We may need conversion from other edgetype
   3.143 +    /// \todo We may need operator=
   3.144      template<class T> class EdgeMap
   3.145      {
   3.146      public:
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/work/alpar/mapskeleton.h	Mon Mar 15 16:30:20 2004 +0000
     4.3 @@ -0,0 +1,80 @@
     4.4 +// -*- c++ -*-
     4.5 +#ifndef HUGO_MAPSKELETON_H
     4.6 +#define HUGO_MAPSKELETON_H
     4.7 +
     4.8 +namespace hugo {
     4.9 +  
    4.10 +  ///Readable map skeleton
    4.11 +  template<typename K, typename T>
    4.12 +  class ReadMapSkeleton
    4.13 +  {
    4.14 +  public:
    4.15 +    /// Map value type.
    4.16 +    typedef T ValueType;
    4.17 +    /// Map key type.
    4.18 +    typedef K KeyType;
    4.19 +
    4.20 +    ///Default constructor.
    4.21 +    ReadMapSkeleton() {}
    4.22 +    
    4.23 +    ///Reads an element of the map.
    4.24 +    ValueType get(const KeyType &i) const {return ValueType();}
    4.25 +  };
    4.26 +
    4.27 +
    4.28 +  ///Writeable map skeleton
    4.29 +  template<typename K, typename T>
    4.30 +  class WriteMapSkeleton 
    4.31 +  {
    4.32 +  public:
    4.33 +    /// Map value type.
    4.34 +    typedef T ValueType;
    4.35 +    /// Map key type.
    4.36 +    typedef K KeyType;
    4.37 +
    4.38 +    ///Default constructor.
    4.39 +    WriteMapSkeleton() {}
    4.40 +    ///'Fill with' constructor.
    4.41 +    WriteMapSkeleton(const ValueType &t) {}
    4.42 +    
    4.43 +    ///Write an element of a map.
    4.44 +    void set(const KeyType &i,const ValueType &t) {}
    4.45 +  };
    4.46 +
    4.47 +  ///Read/Write map skeleton.
    4.48 +  template<typename K, typename T>
    4.49 +  class ReadWriteMapSkeleton : public ReadMapSkeleton<K,T>,
    4.50 +			       public WriteMapSkeleton<K,T>
    4.51 +  {
    4.52 +  public:
    4.53 +    ///Default constructor.
    4.54 +    ReadWriteMapSkeleton() : ReadMapSkeleton(), WriteMapSkeleton() {}
    4.55 +    ///'Fill with' constructor.
    4.56 +    ReadWriteMap(const ValueType &t) :ReadMapSkeleton(), WriteMapSkeleton(t) {}
    4.57 +  };
    4.58 +  
    4.59 +  
    4.60 +  ///Dereferable map skeleton
    4.61 +  template<typename K, typename T>
    4.62 +  class MemoryMapSkeleton : public ReadWriteMapSkeleton<K,T>
    4.63 +  {
    4.64 +  public:
    4.65 +    /// Map value type.
    4.66 +    typedef T ValueType;
    4.67 +    /// Map key type.
    4.68 +    typedef K KeyType;
    4.69 +
    4.70 +    ///Default constructor.
    4.71 +    ReferenceMapSkeleton() : ReadWriteMapSkeleton() {}
    4.72 +    ///'Fill with' constructor.
    4.73 +    ReferenceMapSkeleton(const ValueType &t) : ReadWriteMapSkeleton(t) {}    
    4.74 +
    4.75 +    ///Give a reference to the value belonging to a key.
    4.76 +    ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
    4.77 +    //    const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
    4.78 +  };
    4.79 +
    4.80 +
    4.81 +
    4.82 +}
    4.83 +#endif // HUGO_MAPSKELETON_H
     5.1 --- a/src/work/alpar/smart_graph.h	Sat Mar 13 22:53:07 2004 +0000
     5.2 +++ b/src/work/alpar/smart_graph.h	Mon Mar 15 16:30:20 2004 +0000
     5.3 @@ -12,8 +12,14 @@
     5.4  
     5.5    class SymSmartGraph;
     5.6  
     5.7 -  //  template<typename T> class SymSmartGraph::SymEdgeMap;
     5.8 -  
     5.9 +  ///A smart graph class.
    5.10 +
    5.11 +  ///This is a simple and fast graph implementation.
    5.12 +  ///It is also quite memory efficient, but at the price
    5.13 +  ///that <b> it does not support node and edge deletion</b>.
    5.14 +  ///Apart from this it conforms to the graph interface documented under
    5.15 +  ///the description of \ref GraphSkeleton.
    5.16 +  ///\sa \ref GraphSkeleton.
    5.17    class SmartGraph {
    5.18  
    5.19      struct NodeT 
    5.20 @@ -55,7 +61,7 @@
    5.21  
    5.22      //  protected:
    5.23      // HELPME:
    5.24 -  public:
    5.25 +  protected:
    5.26      ///\bug It must be public because of SymEdgeMap.
    5.27      ///
    5.28      mutable std::vector<DynMapBase<Node> * > dyn_node_maps;
    5.29 @@ -99,10 +105,13 @@
    5.30      int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
    5.31      int edgeNum() const { return edges.size(); }  //FIXME: What is this?
    5.32  
    5.33 +    ///\bug This function does something different than
    5.34 +    ///its name would suggests...
    5.35      int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
    5.36 +    ///\bug This function does something different than
    5.37 +    ///its name would suggests...
    5.38      int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
    5.39  
    5.40 -    
    5.41      Node tail(Edge e) const { return edges[e.n].tail; }
    5.42      Node head(Edge e) const { return edges[e.n].head; }
    5.43  
    5.44 @@ -480,15 +489,28 @@
    5.45  
    5.46    ///The purpose of this graph structure is to handle graphs
    5.47    ///having bidirectional edges. Here the function \c addEdge(u,v) adds a pair
    5.48 -  ///of oppositely directed edges. You can define edge maps which
    5.49 -  ///stores a common value for the edge pairs. The usual edge maps can be used
    5.50 +  ///of oppositely directed edges.
    5.51 +  ///There is a new edge map type called
    5.52 +  ///\ref SymSmartGraph::SymEdgeMap "SymEdgeMap"
    5.53 +  ///that complements this
    5.54 +  ///feature by
    5.55 +  ///storing shared values for the edge pairs. The usual
    5.56 +  ///\ref GraphSkeleton::EdgeMap "EdgeMap"
    5.57 +  ///can be used
    5.58    ///as well.
    5.59    ///
    5.60 -  ///The oppositely directed edge can also be obtained easily.
    5.61 +  ///The oppositely directed edge can also be obtained easily
    5.62 +  ///using \ref opposite.
    5.63 +  ///\warning It shares the similarity with \ref SmartGraph that
    5.64 +  ///it is not possible to delete edges or nodes from the graph.
    5.65 +  //\sa \ref SmartGraph.
    5.66  
    5.67    class SymSmartGraph : public SmartGraph
    5.68    {
    5.69    public:
    5.70 +    template<typename T> class SymEdgeMap;
    5.71 +    template<typename T> friend class SymEdgeMap;
    5.72 +
    5.73      SymSmartGraph() : SmartGraph() { }
    5.74      SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
    5.75      Edge addEdge(Node u, Node v)
    5.76 @@ -498,6 +520,10 @@
    5.77        return e;
    5.78      }
    5.79  
    5.80 +    ///The oppositely directed edge.
    5.81 +
    5.82 +    ///Returns the oppositely directed
    5.83 +    ///pair of the edge \c e.
    5.84      Edge opposite(Edge e) const
    5.85      {
    5.86        Edge f;
    5.87 @@ -505,6 +531,10 @@
    5.88        return f;
    5.89      }
    5.90      
    5.91 +    ///Common data storage for the edge pairs.
    5.92 +
    5.93 +    ///This map makes it possible to store data shared by the oppositely
    5.94 +    ///directed pairs of edges.
    5.95      template <typename T> class SymEdgeMap : public DynMapBase<Edge>
    5.96      {
    5.97        std::vector<T> container;
    5.98 @@ -513,12 +543,12 @@
    5.99        typedef T ValueType;
   5.100        typedef Edge KeyType;
   5.101  
   5.102 -      SymEdgeMap(const SmartGraph &_G) :
   5.103 +      SymEdgeMap(const SymSmartGraph &_G) :
   5.104  	DynMapBase<Edge>(_G), container(_G.maxEdgeId()/2)
   5.105        {
   5.106 -	G->dyn_edge_maps.push_back(this);
   5.107 +	static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.push_back(this);
   5.108        }
   5.109 -      SymEdgeMap(const SmartGraph &_G,const T &t) :
   5.110 +      SymEdgeMap(const SymSmartGraph &_G,const T &t) :
   5.111  	DynMapBase<Edge>(_G), container(_G.maxEdgeId()/2,t)
   5.112        {
   5.113  	G->dyn_edge_maps.push_back(this);
   5.114 @@ -550,13 +580,14 @@
   5.115        {
   5.116  	if(G) {
   5.117  	  std::vector<DynMapBase<Edge>* >::iterator i;
   5.118 -	  for(i=G->dyn_edge_maps.begin();
   5.119 -	      i!=G->dyn_edge_maps.end() && *i!=this; ++i) ;
   5.120 +	  for(i=static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.begin();
   5.121 +	      i!=static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.end()
   5.122 +		&& *i!=this; ++i) ;
   5.123  	  //if(*i==this) G->dyn_edge_maps.erase(i); //Way too slow...
   5.124  	  //A better way to do that: (Is this really important?)
   5.125  	  if(*i==this) {
   5.126 -	    *i=G->dyn_edge_maps.back();
   5.127 -	    G->dyn_edge_maps.pop_back();
   5.128 +	    *i=static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.back();
   5.129 +	    static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.pop_back();
   5.130  	  }
   5.131  	}
   5.132        }