COIN-OR::LEMON - Graph Library

Changeset 1791:62e7d237e1fb in lemon-0.x for lemon/hypercube_graph.h


Ignore:
Timestamp:
11/14/05 19:38:41 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2332
Message:

Modification on the base graph concept
The extended interface does not changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/hypercube_graph.h

    r1703 r1791  
    2222#include <lemon/invalid.h>
    2323#include <lemon/utility.h>
     24#include <lemon/error.h>
    2425
    2526#include <lemon/bits/iterable_graph_extender.h>
    2627#include <lemon/bits/alteration_notifier.h>
    2728#include <lemon/bits/default_map.h>
     29#include <lemon/bits/graph_extender.h>
    2830
    2931///\ingroup graphs
     
    3335namespace lemon {
    3436
    35   /// \brief Base graph for HyperGraph.
     37  /// \brief Base graph for HyperCubeGraph.
    3638  ///
    3739  /// Base graph for hyper-cube graph. It describes some member functions
     
    7880    /// Maximum node ID.
    7981    ///\sa id(Node)
    80     int maxId(Node = INVALID) const { return nodeNum() - 1; }
     82    int maxNodeId() const { return nodeNum() - 1; }
    8183    /// Maximum edge ID.
    8284   
    8385    /// Maximum edge ID.
    8486    ///\sa id(Edge)
    85     int maxId(Edge = INVALID) const { return edgeNum() - 1; }
     87    int maxEdgeId() const { return edgeNum() - 1; }
    8688
    8789    /// \brief Gives back the source node of an edge.
     
    119121    static int id(Edge e) { return e.id; }
    120122
    121     static Node fromId(int id, Node) { return Node(id);}
    122    
    123     static Edge fromId(int id, Edge) { return Edge(id);}
     123    static Node nodeFromId(int id) { return Node(id);}
     124   
     125    static Edge edgeFromId(int id) { return Edge(id);}
    124126
    125127    class Node {
     
    236238    IterableGraphExtender<
    237239    AlterableGraphExtender<
    238     HyperCubeGraphBase > > > ExtendedHyperCubeGraphBase;
     240    GraphExtender<
     241    HyperCubeGraphBase> > > > ExtendedHyperCubeGraphBase;
    239242
    240243  /// \ingroup graphs
     
    308311                   T fv = 0.0, const BF& bf = BF())
    309312        : _graph(graph), _values(begin, end), _first_value(fv), _bin_func(bf) {
    310         if (_values.size() != graph.dimension()) {}
     313        LEMON_ASSERT(_values.size() != graph.dimension(),
     314                     "Wrong size of dimension");
    311315      }
    312316
Note: See TracChangeset for help on using the changeset viewer.