lemon/hypercube_graph.h
changeset 1791 62e7d237e1fb
parent 1703 eb90e3d6bddc
child 1875 98698b69a902
     1.1 --- a/lemon/hypercube_graph.h	Mon Nov 14 18:36:45 2005 +0000
     1.2 +++ b/lemon/hypercube_graph.h	Mon Nov 14 18:38:41 2005 +0000
     1.3 @@ -21,10 +21,12 @@
     1.4  #include <vector>
     1.5  #include <lemon/invalid.h>
     1.6  #include <lemon/utility.h>
     1.7 +#include <lemon/error.h>
     1.8  
     1.9  #include <lemon/bits/iterable_graph_extender.h>
    1.10  #include <lemon/bits/alteration_notifier.h>
    1.11  #include <lemon/bits/default_map.h>
    1.12 +#include <lemon/bits/graph_extender.h>
    1.13  
    1.14  ///\ingroup graphs
    1.15  ///\file
    1.16 @@ -32,7 +34,7 @@
    1.17  
    1.18  namespace lemon {
    1.19  
    1.20 -  /// \brief Base graph for HyperGraph.
    1.21 +  /// \brief Base graph for HyperCubeGraph.
    1.22    ///
    1.23    /// Base graph for hyper-cube graph. It describes some member functions
    1.24    /// which can be used in the HyperCubeGraph.
    1.25 @@ -77,12 +79,12 @@
    1.26      
    1.27      /// Maximum node ID.
    1.28      ///\sa id(Node)
    1.29 -    int maxId(Node = INVALID) const { return nodeNum() - 1; }
    1.30 +    int maxNodeId() const { return nodeNum() - 1; }
    1.31      /// Maximum edge ID.
    1.32      
    1.33      /// Maximum edge ID.
    1.34      ///\sa id(Edge)
    1.35 -    int maxId(Edge = INVALID) const { return edgeNum() - 1; }
    1.36 +    int maxEdgeId() const { return edgeNum() - 1; }
    1.37  
    1.38      /// \brief Gives back the source node of an edge.
    1.39      ///    
    1.40 @@ -118,9 +120,9 @@
    1.41      ///\return The ID of the edge \c e. 
    1.42      static int id(Edge e) { return e.id; }
    1.43  
    1.44 -    static Node fromId(int id, Node) { return Node(id);}
    1.45 +    static Node nodeFromId(int id) { return Node(id);}
    1.46      
    1.47 -    static Edge fromId(int id, Edge) { return Edge(id);}
    1.48 +    static Edge edgeFromId(int id) { return Edge(id);}
    1.49  
    1.50      class Node {
    1.51        friend class HyperCubeGraphBase;
    1.52 @@ -235,7 +237,8 @@
    1.53    typedef StaticMappableGraphExtender<
    1.54      IterableGraphExtender<
    1.55      AlterableGraphExtender<
    1.56 -    HyperCubeGraphBase > > > ExtendedHyperCubeGraphBase;
    1.57 +    GraphExtender<
    1.58 +    HyperCubeGraphBase> > > > ExtendedHyperCubeGraphBase;
    1.59  
    1.60    /// \ingroup graphs
    1.61    ///
    1.62 @@ -307,7 +310,8 @@
    1.63        HyperMap(const Graph& graph, It begin, It end, 
    1.64  		   T fv = 0.0, const BF& bf = BF()) 
    1.65  	: _graph(graph), _values(begin, end), _first_value(fv), _bin_func(bf) {
    1.66 -	if (_values.size() != graph.dimension()) {}
    1.67 +	LEMON_ASSERT(_values.size() != graph.dimension(), 
    1.68 +		     "Wrong size of dimension");
    1.69        }
    1.70  
    1.71        /// \brief Gives back the partial accumulated value.