src/hugo/skeletons/sym_graph.h
author alpar
Tue, 28 Sep 2004 07:00:58 +0000
changeset 911 89a4fbb99cad
parent 909 6a22e0dfd453
permissions -rw-r--r--
Fix many doxygen command bugs.
deba@909
     1
/* -*- C++ -*-
deba@909
     2
 * src/hugo/skeletons/graph.h - Part of HUGOlib, a generic C++ optimization library
deba@909
     3
 *
deba@909
     4
 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
deba@909
     5
 * (Egervary Combinatorial Optimization Research Group, EGRES).
deba@909
     6
 *
deba@909
     7
 * Permission to use, modify and distribute this software is granted
deba@909
     8
 * provided that this copyright notice appears in all copies. For
deba@909
     9
 * precise terms see the accompanying LICENSE file.
deba@909
    10
 *
deba@909
    11
 * This software is provided "AS IS" with no warranty of any kind,
deba@909
    12
 * express or implied, and with no claim as to its suitability for any
deba@909
    13
 * purpose.
deba@909
    14
 *
deba@909
    15
 */
deba@909
    16
deba@909
    17
#ifndef HUGO_SKELETON_SYM_GRAPH_H
deba@909
    18
#define HUGO_SKELETON_SYM_GRAPH_H
deba@909
    19
deba@909
    20
///\ingroup skeletons
deba@909
    21
///\file
deba@909
    22
///\brief Declaration of SymGraph.
deba@909
    23
deba@909
    24
#include <hugo/invalid.h>
deba@909
    25
#include <hugo/skeletons/graph.h>
deba@909
    26
#include <hugo/skeletons/maps.h>
deba@909
    27
deba@909
    28
namespace hugo {
deba@909
    29
  namespace skeleton {
deba@909
    30
    
deba@909
    31
    /// \addtogroup skeletons
deba@909
    32
    /// @{
deba@909
    33
deba@909
    34
    /// An empty static graph class.
deba@909
    35
  
deba@909
    36
    /// This class provides all the common features of a symmetric
deba@909
    37
    /// graph structure, however completely without implementations and 
deba@909
    38
    /// real data structures behind the interface.
deba@909
    39
    /// All graph algorithms should compile with this class, but it will not
deba@909
    40
    /// run properly, of course.
deba@909
    41
    ///
deba@909
    42
    /// It can be used for checking the interface compatibility,
deba@909
    43
    /// or it can serve as a skeleton of a new symmetric graph structure.
deba@909
    44
    /// 
deba@909
    45
    /// Also, you will find here the full documentation of a certain graph
deba@909
    46
    /// feature, the documentation of a real symmetric graph imlementation
deba@909
    47
    /// like @ref SymListGraph or
alpar@911
    48
    /// @ref hugo::SymSmartGraph will just refer to this structure.
deba@909
    49
    class StaticSymGraph
deba@909
    50
    {
deba@909
    51
    public:
deba@909
    52
      /// Defalult constructor.
deba@909
    53
deba@909
    54
      /// Defalult constructor.
deba@909
    55
      ///
deba@909
    56
      StaticSymGraph() { }
deba@909
    57
      ///Copy consructor.
deba@909
    58
deba@909
    59
//       ///\todo It is not clear, what we expect from a copy constructor.
deba@909
    60
//       ///E.g. How to assign the nodes/edges to each other? What about maps?
deba@909
    61
//       StaticGraph(const StaticGraph& g) { }
deba@909
    62
deba@909
    63
      /// The base type of node iterators, 
deba@909
    64
      /// or in other words, the trivial node iterator.
deba@909
    65
deba@909
    66
      /// This is the base type of each node iterator,
deba@909
    67
      /// thus each kind of node iterator converts to this.
deba@909
    68
      /// More precisely each kind of node iterator should be inherited 
deba@909
    69
      /// from the trivial node iterator.
deba@909
    70
      class Node {
deba@909
    71
      public:
deba@909
    72
	/// Default constructor
deba@909
    73
deba@909
    74
	/// @warning The default constructor sets the iterator
deba@909
    75
	/// to an undefined value.
deba@909
    76
	Node() { }
deba@909
    77
	/// Copy constructor.
deba@909
    78
deba@909
    79
	/// Copy constructor.
deba@909
    80
	///
deba@909
    81
	Node(const Node&) { }
deba@909
    82
deba@909
    83
	/// Invalid constructor \& conversion.
deba@909
    84
deba@909
    85
	/// This constructor initializes the iterator to be invalid.
deba@909
    86
	/// \sa Invalid for more details.
deba@909
    87
	Node(Invalid) { }
deba@909
    88
	/// Equality operator
deba@909
    89
deba@909
    90
	/// Two iterators are equal if and only if they point to the
deba@909
    91
	/// same object or both are invalid.
deba@909
    92
	bool operator==(Node) const { return true; }
deba@909
    93
deba@909
    94
	/// Inequality operator
deba@909
    95
	
alpar@911
    96
	/// \sa operator==(Node n)
deba@909
    97
	///
deba@909
    98
	bool operator!=(Node) const { return true; }
deba@909
    99
deba@909
   100
 	///Comparison operator.
deba@909
   101
deba@909
   102
	///This is a strict ordering between the nodes.
deba@909
   103
	///
deba@909
   104
	///This ordering can be different from the order in which NodeIt
deba@909
   105
	///goes through the nodes.
deba@909
   106
	///\todo Possibly we don't need it.
deba@909
   107
	bool operator<(Node) const { return true; }
deba@909
   108
      };
deba@909
   109
    
deba@909
   110
      /// This iterator goes through each node.
deba@909
   111
deba@909
   112
      /// This iterator goes through each node.
deba@909
   113
      /// Its usage is quite simple, for example you can count the number
deba@909
   114
      /// of nodes in graph \c g of type \c Graph like this:
deba@909
   115
      /// \code
deba@909
   116
      /// int count=0;
deba@909
   117
      /// for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count;
deba@909
   118
      /// \endcode
deba@909
   119
      class NodeIt : public Node {
deba@909
   120
      public:
deba@909
   121
	/// Default constructor
deba@909
   122
deba@909
   123
	/// @warning The default constructor sets the iterator
deba@909
   124
	/// to an undefined value.
deba@909
   125
	NodeIt() { }
deba@909
   126
	/// Copy constructor.
deba@909
   127
	
deba@909
   128
	/// Copy constructor.
deba@909
   129
	///
deba@909
   130
	NodeIt(const NodeIt&) { }
deba@909
   131
	/// Invalid constructor \& conversion.
deba@909
   132
deba@909
   133
	/// Initialize the iterator to be invalid.
deba@909
   134
	/// \sa Invalid for more details.
deba@909
   135
	NodeIt(Invalid) { }
deba@909
   136
	/// Sets the iterator to the first node.
deba@909
   137
deba@909
   138
	/// Sets the iterator to the first node of \c g.
deba@909
   139
	///
deba@909
   140
	NodeIt(const StaticSymGraph& g) { }
deba@909
   141
	/// Node -> NodeIt conversion.
deba@909
   142
deba@909
   143
	/// Sets the iterator to the node of \c g pointed by the trivial 
deba@909
   144
	/// iterator n.
deba@909
   145
	/// This feature necessitates that each time we 
deba@909
   146
	/// iterate the edge-set, the iteration order is the same.
deba@909
   147
	NodeIt(const StaticSymGraph& g, const Node& n) { }
deba@909
   148
	/// Next node.
deba@909
   149
deba@909
   150
	/// Assign the iterator to the next node.
deba@909
   151
	///
deba@909
   152
	NodeIt& operator++() { return *this; }
deba@909
   153
      };
deba@909
   154
    
deba@909
   155
    
deba@909
   156
      /// The base type of the symmetric edge iterators.
deba@909
   157
deba@909
   158
      /// The base type of the symmetric edge iterators.
deba@909
   159
      ///
deba@909
   160
      class SymEdge {
deba@909
   161
      public:
deba@909
   162
	/// Default constructor
deba@909
   163
deba@909
   164
	/// @warning The default constructor sets the iterator
deba@909
   165
	/// to an undefined value.
deba@909
   166
	SymEdge() { }
deba@909
   167
	/// Copy constructor.
deba@909
   168
deba@909
   169
	/// Copy constructor.
deba@909
   170
	///
deba@909
   171
	SymEdge(const SymEdge&) { }
deba@909
   172
	/// Initialize the iterator to be invalid.
deba@909
   173
deba@909
   174
	/// Initialize the iterator to be invalid.
deba@909
   175
	///
deba@909
   176
	SymEdge(Invalid) { }
deba@909
   177
	/// Equality operator
deba@909
   178
deba@909
   179
	/// Two iterators are equal if and only if they point to the
deba@909
   180
	/// same object or both are invalid.
deba@909
   181
	bool operator==(SymEdge) const { return true; }
deba@909
   182
	/// Inequality operator
deba@909
   183
alpar@911
   184
	/// \sa operator==(Node n)
deba@909
   185
	///
deba@909
   186
	bool operator!=(SymEdge) const { return true; }
deba@909
   187
 	///Comparison operator.
deba@909
   188
deba@909
   189
	///This is a strict ordering between the nodes.
deba@909
   190
	///
deba@909
   191
	///This ordering can be different from the order in which NodeIt
deba@909
   192
	///goes through the nodes.
deba@909
   193
	///\todo Possibly we don't need it.
deba@909
   194
 	bool operator<(SymEdge) const { return true; }
deba@909
   195
      };
deba@909
   196
deba@909
   197
deba@909
   198
      /// The base type of the edge iterators.
deba@909
   199
deba@909
   200
      /// The base type of the edge iterators.
deba@909
   201
      ///
deba@909
   202
      class Edge : public SymEdge {
deba@909
   203
      public:
deba@909
   204
	/// Default constructor
deba@909
   205
deba@909
   206
	/// @warning The default constructor sets the iterator
deba@909
   207
	/// to an undefined value.
deba@909
   208
	Edge() { }
deba@909
   209
	/// Copy constructor.
deba@909
   210
deba@909
   211
	/// Copy constructor.
deba@909
   212
	///
deba@909
   213
	Edge(const Edge&) { }
deba@909
   214
	/// Initialize the iterator to be invalid.
deba@909
   215
deba@909
   216
	/// Initialize the iterator to be invalid.
deba@909
   217
	///
deba@909
   218
	Edge(Invalid) { }
deba@909
   219
	/// Equality operator
deba@909
   220
deba@909
   221
	/// Two iterators are equal if and only if they point to the
deba@909
   222
	/// same object or both are invalid.
deba@909
   223
	bool operator==(Edge) const { return true; }
deba@909
   224
	/// Inequality operator
deba@909
   225
alpar@911
   226
	/// \sa operator==(Node n)
deba@909
   227
	///
deba@909
   228
	bool operator!=(Edge) const { return true; }
deba@909
   229
 	///Comparison operator.
deba@909
   230
deba@909
   231
	///This is a strict ordering between the nodes.
deba@909
   232
	///
deba@909
   233
	///This ordering can be different from the order in which NodeIt
deba@909
   234
	///goes through the nodes.
deba@909
   235
	///\todo Possibly we don't need it.
deba@909
   236
 	bool operator<(Edge) const { return true; }
deba@909
   237
      };
deba@909
   238
    
deba@909
   239
      /// This iterator goes trough the outgoing edges of a node.
deba@909
   240
deba@909
   241
      /// This iterator goes trough the \e outgoing edges of a certain node
deba@909
   242
      /// of a graph.
deba@909
   243
      /// Its usage is quite simple, for example you can count the number
deba@909
   244
      /// of outgoing edges of a node \c n
deba@909
   245
      /// in graph \c g of type \c Graph as follows.
deba@909
   246
      /// \code
deba@909
   247
      /// int count=0;
deba@909
   248
      /// for (Graph::OutEdgeIt e(g, n); e!=INVALID; ++e) ++count;
deba@909
   249
      /// \endcode
deba@909
   250
    
deba@909
   251
      class OutEdgeIt : public Edge {
deba@909
   252
      public:
deba@909
   253
	/// Default constructor
deba@909
   254
deba@909
   255
	/// @warning The default constructor sets the iterator
deba@909
   256
	/// to an undefined value.
deba@909
   257
	OutEdgeIt() { }
deba@909
   258
	/// Copy constructor.
deba@909
   259
deba@909
   260
	/// Copy constructor.
deba@909
   261
	///
deba@909
   262
	OutEdgeIt(const OutEdgeIt&) { }
deba@909
   263
	/// Initialize the iterator to be invalid.
deba@909
   264
deba@909
   265
	/// Initialize the iterator to be invalid.
deba@909
   266
	///
deba@909
   267
	OutEdgeIt(Invalid) { }
deba@909
   268
	/// This constructor sets the iterator to first outgoing edge.
deba@909
   269
    
deba@909
   270
	/// This constructor set the iterator to the first outgoing edge of
deba@909
   271
	/// node
deba@909
   272
	///@param n the node
deba@909
   273
	///@param g the graph
deba@909
   274
	OutEdgeIt(const StaticSymGraph& g, const Node& n) { }
deba@909
   275
	/// Edge -> OutEdgeIt conversion
deba@909
   276
deba@909
   277
	/// Sets the iterator to the value of the trivial iterator \c e.
deba@909
   278
	/// This feature necessitates that each time we 
deba@909
   279
	/// iterate the edge-set, the iteration order is the same.
deba@909
   280
	OutEdgeIt(const StaticSymGraph& g, const Edge& e) { }
deba@909
   281
	///Next outgoing edge
deba@909
   282
	
deba@909
   283
	/// Assign the iterator to the next 
deba@909
   284
	/// outgoing edge of the corresponding node.
deba@909
   285
	OutEdgeIt& operator++() { return *this; }
deba@909
   286
      };
deba@909
   287
deba@909
   288
      /// This iterator goes trough the incoming edges of a node.
deba@909
   289
deba@909
   290
      /// This iterator goes trough the \e incoming edges of a certain node
deba@909
   291
      /// of a graph.
deba@909
   292
      /// Its usage is quite simple, for example you can count the number
deba@909
   293
      /// of outgoing edges of a node \c n
deba@909
   294
      /// in graph \c g of type \c Graph as follows.
deba@909
   295
      /// \code
deba@909
   296
      /// int count=0;
deba@909
   297
      /// for(Graph::InEdgeIt e(g, n); e!=INVALID; ++e) ++count;
deba@909
   298
      /// \endcode
deba@909
   299
deba@909
   300
      class InEdgeIt : public Edge {
deba@909
   301
      public:
deba@909
   302
	/// Default constructor
deba@909
   303
deba@909
   304
	/// @warning The default constructor sets the iterator
deba@909
   305
	/// to an undefined value.
deba@909
   306
	InEdgeIt() { }
deba@909
   307
	/// Copy constructor.
deba@909
   308
deba@909
   309
	/// Copy constructor.
deba@909
   310
	///
deba@909
   311
	InEdgeIt(const InEdgeIt&) { }
deba@909
   312
	/// Initialize the iterator to be invalid.
deba@909
   313
deba@909
   314
	/// Initialize the iterator to be invalid.
deba@909
   315
	///
deba@909
   316
	InEdgeIt(Invalid) { }
deba@909
   317
	/// This constructor sets the iterator to first incoming edge.
deba@909
   318
    
deba@909
   319
	/// This constructor set the iterator to the first incoming edge of
deba@909
   320
	/// node
deba@909
   321
	///@param n the node
deba@909
   322
	///@param g the graph
deba@909
   323
	InEdgeIt(const StaticSymGraph& g, const Node& n) { }
deba@909
   324
	/// Edge -> InEdgeIt conversion
deba@909
   325
deba@909
   326
	/// Sets the iterator to the value of the trivial iterator \c e.
deba@909
   327
	/// This feature necessitates that each time we 
deba@909
   328
	/// iterate the edge-set, the iteration order is the same.
deba@909
   329
	InEdgeIt(const StaticSymGraph& g, const Edge& n) { }
deba@909
   330
	/// Next incoming edge
deba@909
   331
deba@909
   332
	/// Assign the iterator to the next inedge of the corresponding node.
deba@909
   333
	///
deba@909
   334
	InEdgeIt& operator++() { return *this; }
deba@909
   335
      };
deba@909
   336
      /// This iterator goes through each symmetric edge.
deba@909
   337
deba@909
   338
      /// This iterator goes through each symmetric edge of a graph.
deba@909
   339
      /// Its usage is quite simple, for example you can count the number
deba@909
   340
      /// of symmetric edges in a graph \c g of type \c Graph as follows:
deba@909
   341
      /// \code
deba@909
   342
      /// int count=0;
deba@909
   343
      /// for(Graph::SymEdgeIt e(g); e!=INVALID; ++e) ++count;
deba@909
   344
      /// \endcode
deba@909
   345
      class SymEdgeIt : public SymEdge {
deba@909
   346
      public:
deba@909
   347
	/// Default constructor
deba@909
   348
deba@909
   349
	/// @warning The default constructor sets the iterator
deba@909
   350
	/// to an undefined value.
deba@909
   351
	SymEdgeIt() { }
deba@909
   352
	/// Copy constructor.
deba@909
   353
deba@909
   354
	/// Copy constructor.
deba@909
   355
	///
deba@909
   356
	SymEdgeIt(const SymEdgeIt&) { }
deba@909
   357
	/// Initialize the iterator to be invalid.
deba@909
   358
deba@909
   359
	/// Initialize the iterator to be invalid.
deba@909
   360
	///
deba@909
   361
	SymEdgeIt(Invalid) { }
deba@909
   362
	/// This constructor sets the iterator to first edge.
deba@909
   363
    
deba@909
   364
	/// This constructor set the iterator to the first edge of
deba@909
   365
	/// node
deba@909
   366
	///@param g the graph
deba@909
   367
	SymEdgeIt(const StaticSymGraph& g) { }
deba@909
   368
	/// Edge -> EdgeIt conversion
deba@909
   369
deba@909
   370
	/// Sets the iterator to the value of the trivial iterator \c e.
deba@909
   371
	/// This feature necessitates that each time we 
deba@909
   372
	/// iterate the edge-set, the iteration order is the same.
deba@909
   373
	SymEdgeIt(const StaticSymGraph&, const SymEdge&) { } 
deba@909
   374
    	///Next edge
deba@909
   375
	
deba@909
   376
	/// Assign the iterator to the next 
deba@909
   377
	/// edge of the corresponding node.
deba@909
   378
	SymEdgeIt& operator++() { return *this; }
deba@909
   379
      };
deba@909
   380
      /// This iterator goes through each edge.
deba@909
   381
deba@909
   382
      /// This iterator goes through each edge of a graph.
deba@909
   383
      /// Its usage is quite simple, for example you can count the number
deba@909
   384
      /// of edges in a graph \c g of type \c Graph as follows:
deba@909
   385
      /// \code
deba@909
   386
      /// int count=0;
deba@909
   387
      /// for(Graph::EdgeIt e(g); e!=INVALID; ++e) ++count;
deba@909
   388
      /// \endcode
deba@909
   389
      class EdgeIt : public Edge {
deba@909
   390
      public:
deba@909
   391
	/// Default constructor
deba@909
   392
deba@909
   393
	/// @warning The default constructor sets the iterator
deba@909
   394
	/// to an undefined value.
deba@909
   395
	EdgeIt() { }
deba@909
   396
	/// Copy constructor.
deba@909
   397
deba@909
   398
	/// Copy constructor.
deba@909
   399
	///
deba@909
   400
	EdgeIt(const EdgeIt&) { }
deba@909
   401
	/// Initialize the iterator to be invalid.
deba@909
   402
deba@909
   403
	/// Initialize the iterator to be invalid.
deba@909
   404
	///
deba@909
   405
	EdgeIt(Invalid) { }
deba@909
   406
	/// This constructor sets the iterator to first edge.
deba@909
   407
    
deba@909
   408
	/// This constructor set the iterator to the first edge of
deba@909
   409
	/// node
deba@909
   410
	///@param g the graph
deba@909
   411
	EdgeIt(const StaticSymGraph& g) { }
deba@909
   412
	/// Edge -> EdgeIt conversion
deba@909
   413
deba@909
   414
	/// Sets the iterator to the value of the trivial iterator \c e.
deba@909
   415
	/// This feature necessitates that each time we 
deba@909
   416
	/// iterate the edge-set, the iteration order is the same.
deba@909
   417
	EdgeIt(const StaticSymGraph&, const Edge&) { } 
deba@909
   418
    	///Next edge
deba@909
   419
	
deba@909
   420
	/// Assign the iterator to the next 
deba@909
   421
	/// edge of the corresponding node.
deba@909
   422
	EdgeIt& operator++() { return *this; }
deba@909
   423
      };
deba@909
   424
deba@909
   425
      /// First node of the graph.
deba@909
   426
deba@909
   427
      /// \retval i the first node.
deba@909
   428
      /// \return the first node.
deba@909
   429
      ///
deba@909
   430
      NodeIt& first(NodeIt& i) const { return i; }
deba@909
   431
deba@909
   432
      /// The first incoming edge.
deba@909
   433
deba@909
   434
      /// The first incoming edge.
deba@909
   435
      ///
deba@909
   436
      InEdgeIt& first(InEdgeIt &i, Node) const { return i; }
deba@909
   437
      /// The first outgoing edge.
deba@909
   438
deba@909
   439
      /// The first outgoing edge.
deba@909
   440
      ///
deba@909
   441
      OutEdgeIt& first(OutEdgeIt& i, Node) const { return i; }
deba@909
   442
      /// The first edge of the Graph.
deba@909
   443
deba@909
   444
      /// The first edge of the Graph.
deba@909
   445
      ///
deba@909
   446
      EdgeIt& first(EdgeIt& i) const { return i; }
deba@909
   447
      /// The first symmetric edge of the Graph.
deba@909
   448
deba@909
   449
      /// The first symmetric edge of the Graph.
deba@909
   450
      ///
deba@909
   451
      SymEdgeIt& first(SymEdgeIt& i) const { return i; }
deba@909
   452
deba@909
   453
      ///Gives back the head node of an edge.
deba@909
   454
deba@909
   455
      ///Gives back the head node of an edge.
deba@909
   456
      ///
deba@909
   457
      Node head(Edge) const { return INVALID; }
deba@909
   458
      ///Gives back the tail node of an edge.
deba@909
   459
deba@909
   460
      ///Gives back the tail node of an edge.
deba@909
   461
      ///
deba@909
   462
      Node tail(Edge) const { return INVALID; }
deba@909
   463
  
deba@909
   464
      ///Gives back the first node of an symmetric edge.
deba@909
   465
deba@909
   466
      ///Gives back the first node of an symmetric edge.
deba@909
   467
      ///
deba@909
   468
      Node head(SymEdge) const { return INVALID; }
deba@909
   469
      ///Gives back the second node of an symmetric edge.
deba@909
   470
deba@909
   471
      ///Gives back the second node of an symmetric edge.
deba@909
   472
      ///
deba@909
   473
      Node tail(SymEdge) const { return INVALID; }
deba@909
   474
      ///Gives back the \e id of a node.
deba@909
   475
deba@909
   476
      ///\warning Not all graph structures provide this feature.
deba@909
   477
      ///
deba@909
   478
      ///\todo Should each graph provide \c id?
deba@909
   479
      int id(const Node&) const { return 0; }
deba@909
   480
      ///Gives back the \e id of an edge.
deba@909
   481
deba@909
   482
      ///\warning Not all graph structures provide this feature.
deba@909
   483
      ///
deba@909
   484
      ///\todo Should each graph provide \c id?
deba@909
   485
      int id(const Edge&) const { return 0; }
deba@909
   486
deba@909
   487
      ///\warning Not all graph structures provide this feature.
deba@909
   488
      ///
deba@909
   489
      ///\todo Should each graph provide \c id?
deba@909
   490
      int id(const SymEdge&) const { return 0; }
deba@909
   491
alpar@911
   492
      ///\e
deba@909
   493
      
deba@909
   494
      ///\todo Should it be in the concept?
deba@909
   495
      ///
deba@909
   496
      int nodeNum() const { return 0; }
alpar@911
   497
      ///\e
deba@909
   498
deba@909
   499
      ///\todo Should it be in the concept?
deba@909
   500
      ///
deba@909
   501
      int edgeNum() const { return 0; }
deba@909
   502
deba@909
   503
      ///\todo Should it be in the concept?
deba@909
   504
      ///
deba@909
   505
      int symEdgeNum() const { return 0; }
deba@909
   506
deba@909
   507
deba@909
   508
      /// Gives back the forward directed edge of the symmetric edge.
deba@909
   509
      Edge forward(SymEdge) const {return INVALID;} 
deba@909
   510
deba@909
   511
      /// Gives back the backward directed edge of the symmetric edge.
deba@909
   512
      Edge backward(SymEdge) const {return INVALID;};
deba@909
   513
deba@909
   514
      /// Gives back the opposite of the edge.
deba@909
   515
      Edge opposite(Edge) const {return INVALID;}
deba@909
   516
deba@909
   517
      ///Reference map of the nodes to type \c T.
deba@909
   518
      /// \ingroup skeletons
deba@909
   519
      ///Reference map of the nodes to type \c T.
deba@909
   520
      /// \sa Reference
deba@909
   521
      /// \warning Making maps that can handle bool type (NodeMap<bool>)
deba@909
   522
      /// needs some extra attention!
deba@909
   523
      template<class T> class NodeMap : public ReferenceMap< Node, T >
deba@909
   524
      {
deba@909
   525
      public:
deba@909
   526
alpar@911
   527
	///\e
deba@909
   528
	NodeMap(const StaticSymGraph&) { }
alpar@911
   529
	///\e
deba@909
   530
	NodeMap(const StaticSymGraph&, T) { }
deba@909
   531
deba@909
   532
	///Copy constructor
deba@909
   533
	template<typename TT> NodeMap(const NodeMap<TT>&) { }
deba@909
   534
	///Assignment operator
deba@909
   535
	template<typename TT> NodeMap& operator=(const NodeMap<TT>&)
deba@909
   536
	{ return *this; }
deba@909
   537
      };
deba@909
   538
deba@909
   539
      ///Reference map of the edges to type \c T.
deba@909
   540
deba@909
   541
      /// \ingroup skeletons
deba@909
   542
      ///Reference map of the edges to type \c T.
deba@909
   543
      /// \sa Reference
deba@909
   544
      /// \warning Making maps that can handle bool type (EdgeMap<bool>)
deba@909
   545
      /// needs some extra attention!
deba@909
   546
      template<class T> class EdgeMap
deba@909
   547
	: public ReferenceMap<Edge,T>
deba@909
   548
      {
deba@909
   549
      public:
deba@909
   550
alpar@911
   551
	///\e
deba@909
   552
	EdgeMap(const StaticSymGraph&) { }
alpar@911
   553
	///\e
deba@909
   554
	EdgeMap(const StaticSymGraph&, T) { }
deba@909
   555
    
deba@909
   556
	///Copy constructor
deba@909
   557
	template<typename TT> EdgeMap(const EdgeMap<TT>&) { }
deba@909
   558
	///Assignment operator
deba@909
   559
	template<typename TT> EdgeMap &operator=(const EdgeMap<TT>&)
deba@909
   560
	{ return *this; }
deba@909
   561
      };
deba@909
   562
deba@909
   563
      ///Reference map of the edges to type \c T.
deba@909
   564
deba@909
   565
      /// \ingroup skeletons
deba@909
   566
      ///Reference map of the symmetric edges to type \c T.
deba@909
   567
      /// \sa Reference
deba@909
   568
      /// \warning Making maps that can handle bool type (EdgeMap<bool>)
deba@909
   569
      /// needs some extra attention!
deba@909
   570
      template<class T> class SymEdgeMap
deba@909
   571
	: public ReferenceMap<SymEdge,T>
deba@909
   572
      {
deba@909
   573
      public:
deba@909
   574
alpar@911
   575
	///\e
deba@909
   576
	SymEdgeMap(const StaticSymGraph&) { }
alpar@911
   577
	///\e
deba@909
   578
	SymEdgeMap(const StaticSymGraph&, T) { }
deba@909
   579
    
deba@909
   580
	///Copy constructor
deba@909
   581
	template<typename TT> SymEdgeMap(const SymEdgeMap<TT>&) { }
deba@909
   582
	///Assignment operator
deba@909
   583
	template<typename TT> SymEdgeMap &operator=(const SymEdgeMap<TT>&)
deba@909
   584
	{ return *this; }
deba@909
   585
      };
deba@909
   586
    };
deba@909
   587
deba@909
   588
deba@909
   589
  
deba@909
   590
    /// An empty non-static graph class.
deba@909
   591
deba@909
   592
    /// This class provides everything that \ref StaticGraph
deba@909
   593
    /// with additional functionality which enables to build a
deba@909
   594
    /// graph from scratch.
deba@909
   595
    class ExtendableSymGraph : public StaticSymGraph
deba@909
   596
    {
deba@909
   597
    public:
deba@909
   598
      /// Defalult constructor.
deba@909
   599
deba@909
   600
      /// Defalult constructor.
deba@909
   601
      ///
deba@909
   602
      ExtendableSymGraph() { }
deba@909
   603
      ///Add a new node to the graph.
deba@909
   604
deba@909
   605
      /// \return the new node.
deba@909
   606
      ///
deba@909
   607
      Node addNode() { return INVALID; }
deba@909
   608
      ///Add a new edge to the graph.
deba@909
   609
deba@909
   610
      ///Add a new symmetric edge to the graph with tail node \c t
deba@909
   611
      ///and head node \c h.
deba@909
   612
      ///\return the new edge.
deba@909
   613
      SymEdge addEdge(Node h, Node t) { return INVALID; }
deba@909
   614
    
deba@909
   615
      /// Resets the graph.
deba@909
   616
deba@909
   617
      /// This function deletes all edges and nodes of the graph.
deba@909
   618
      /// It also frees the memory allocated to store them.
deba@909
   619
      /// \todo It might belong to \ref ErasableGraph.
deba@909
   620
      void clear() { }
deba@909
   621
    };
deba@909
   622
deba@909
   623
    /// An empty erasable graph class.
deba@909
   624
  
deba@909
   625
    /// This class is an extension of \ref ExtendableGraph. It also makes it
deba@909
   626
    /// possible to erase edges or nodes.
deba@909
   627
    class ErasableSymGraph : public ExtendableSymGraph
deba@909
   628
    {
deba@909
   629
    public:
deba@909
   630
      /// Defalult constructor.
deba@909
   631
deba@909
   632
      /// Defalult constructor.
deba@909
   633
      ///
deba@909
   634
      ErasableSymGraph() { }
deba@909
   635
      /// Deletes a node.
deba@909
   636
deba@909
   637
      /// Deletes node \c n node.
deba@909
   638
      ///
deba@909
   639
      void erase(Node n) { }
deba@909
   640
      /// Deletes an edge.
deba@909
   641
deba@909
   642
      /// Deletes edge \c e edge.
deba@909
   643
      ///
deba@909
   644
      void erase(SymEdge e) { }
deba@909
   645
    };
deba@909
   646
deba@909
   647
    // @}
deba@909
   648
  } //namespace skeleton  
deba@909
   649
} //namespace hugo
deba@909
   650
deba@909
   651
deba@909
   652
deba@909
   653
#endif // HUGO_SKELETON_GRAPH_H