COIN-OR::LEMON - Graph Library

Ticket #57: hypercube_0549a6719af9.patch

File hypercube_0549a6719af9.patch, 3.9 KB (added by Peter Kovacs, 16 years ago)
  • lemon/hypercube_graph.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1220214586 -7200
    # Node ID 0549a6719af981be5c8d16850a49401ade0122eb
    # Parent  9654fcabeb820b1c205c396ff24d269d0373eddd
    Rename HyperCubeDigraph to HypercubeDigraph (ticket #57)
    
    diff -r 9654fcabeb82 -r 0549a6719af9 lemon/hypercube_graph.h
    a b  
    2929
    3030///\ingroup graphs
    3131///\file
    32 ///\brief HyperCubeDigraph class.
     32///\brief HypercubeDigraph class.
    3333
    3434namespace lemon {
    3535
    36   class HyperCubeDigraphBase {
     36  class HypercubeDigraphBase {
    3737
    3838  public:
    3939
    40     typedef HyperCubeDigraphBase Digraph;
     40    typedef HypercubeDigraphBase Digraph;
    4141
    4242    class Node;
    4343    class Arc;
    4444
    4545  public:
    4646
    47     HyperCubeDigraphBase() {}
     47    HypercubeDigraphBase() {}
    4848
    4949  protected:
    5050
     
    8080    static Arc arcFromId(int id) { return Arc(id); }
    8181
    8282    class Node {
    83       friend class HyperCubeDigraphBase;
     83      friend class HypercubeDigraphBase;
    8484    protected:
    8585      int id;
    8686      Node(int _id) { id = _id;}
     
    9393    };
    9494
    9595    class Arc {
    96       friend class HyperCubeDigraphBase;
     96      friend class HypercubeDigraphBase;
    9797    protected:
    9898      int id;
    9999      Arc(int _id) : id(_id) {}
     
    168168  };
    169169
    170170
    171   typedef DigraphExtender<HyperCubeDigraphBase> ExtendedHyperCubeDigraphBase;
     171  typedef DigraphExtender<HypercubeDigraphBase> ExtendedHypercubeDigraphBase;
    172172
    173173  /// \ingroup digraphs
    174174  ///
     
    184184  ///
    185185  /// The digraph type is fully conform to the \ref concepts::Digraph
    186186  /// concept but it does not conform to \ref concepts::Graph.
    187   class HyperCubeDigraph : public ExtendedHyperCubeDigraphBase {
     187  class HypercubeDigraph : public ExtendedHypercubeDigraphBase {
    188188  public:
    189189
    190     typedef ExtendedHyperCubeDigraphBase Parent;
     190    typedef ExtendedHypercubeDigraphBase Parent;
    191191
    192192    /// \brief Construct a hypercube digraph with \c dim dimension.
    193193    ///
    194194    /// Construct a hypercube digraph with \c dim dimension.
    195     HyperCubeDigraph(int dim) { construct(dim); }
     195    HypercubeDigraph(int dim) { construct(dim); }
    196196
    197197    /// \brief Gives back the number of the dimensions.
    198198    ///
     
    248248    ///
    249249    ///\code
    250250    /// const int DIM = 3;
    251     /// HyperCubeDigraph digraph(DIM);
     251    /// HypercubeDigraph digraph(DIM);
    252252    /// dim2::Point<double> base[DIM];
    253253    /// for (int k = 0; k < DIM; ++k) {
    254254    ///   base[k].x = rnd();
    255255    ///   base[k].y = rnd();
    256256    /// }
    257     /// HyperCubeDigraph::HyperMap<dim2::Point<double> >
     257    /// HypercubeDigraph::HyperMap<dim2::Point<double> >
    258258    ///   pos(digraph, base, base + DIM, dim2::Point<double>(0.0, 0.0));
    259259    ///\endcode
    260260    ///
    261     /// \see HyperCubeDigraph
     261    /// \see HypercubeDigraph
    262262    template <typename T, typename BF = std::plus<T> >
    263263    class HyperMap {
    264264    public:
  • test/digraph_test.cc

    diff -r 9654fcabeb82 -r 0549a6719af9 test/digraph_test.cc
    a b  
    7878  checkGraphArcMap(G);
    7979}
    8080
    81 void checkHyperCubeDigraph() {
    82   DIGRAPH_TYPEDEFS(HyperCubeDigraph);
     81void checkHypercubeDigraph() {
     82  DIGRAPH_TYPEDEFS(HypercubeDigraph);
    8383
    8484  for (int dim = 1; dim < 5; ++dim) {
    85     HyperCubeDigraph G(dim);
     85    HypercubeDigraph G(dim);
    8686    checkGraphNodeList(G, 1 << dim);
    8787    checkGraphArcList(G, (1 << dim) * dim);
    8888
     
    141141//  { // Checking FullDigraph
    142142//    checkConcept<Digraph, FullDigraph>();
    143143//  }
    144   { // Checking HyperCubeDigraph
    145     checkConcept<Digraph, HyperCubeDigraph>();
     144  { // Checking HypercubeDigraph
     145    checkConcept<Digraph, HypercubeDigraph>();
    146146  }
    147147}
    148148
     
    208208//  { // Checking FullDigraph
    209209//    checkFullDigraph();
    210210//  }
    211   { // Checking HyperCubeDigraph
    212     checkHyperCubeDigraph();
     211  { // Checking HypercubeDigraph
     212    checkHypercubeDigraph();
    213213  }
    214214}
    215215