COIN-OR::LEMON - Graph Library

Changeset 503:769f31e9f7b0 in lemon-0.x for src/include


Ignore:
Timestamp:
05/03/04 09:27:29 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@663
Message:

test/graph_test.cc added.
It discovered several bugs and warnings in 'include/smart_graph.h',
in 'include/skeletons/graph.h' and in 'work/alpar/list_graph.h'.
They have also been fixed.

Location:
src/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/include/skeletons/graph.h

    r463 r503  
    11// -*- c++ -*-
    2 #ifndef HUGO_GRAPH_H
    3 #define HUGO_GRAPH_H
     2#ifndef HUGO_SKELETON_GRAPH_H
     3#define HUGO_SKELETON_GRAPH_H
    44
    55///\file
     
    5959      /// Two iterators are equal if and only if they point to the
    6060      /// same object or both are invalid.
    61       bool operator==(Node n) const { return true; }
     61      bool operator==(Node) const { return true; }
    6262
    6363      /// \sa \ref operator==(Node n)
    6464      ///
    65       bool operator!=(Node n) const { return true; }
    66 
    67       bool operator<(Node n) const { return true; }
     65      bool operator!=(Node) const { return true; }
     66
     67      bool operator<(Node) const { return true; }
    6868    };
    6969   
     
    9191      /// @warning The default constructor sets the iterator
    9292      /// to an undefined value.
    93       NodeIt(const NodeIt &) {}
     93      NodeIt(const NodeIt &n) : Node(n) {}
    9494    };
    9595   
     
    105105      /// Two iterators are equal if and only if they point to the
    106106      /// same object or both are invalid.
    107       bool operator==(Edge n) const { return true; }
    108       bool operator!=(Edge n) const { return true; }
    109       bool operator<(Edge n) const { return true; }
     107      bool operator==(Edge) const { return true; }
     108      bool operator!=(Edge) const { return true; }
     109      bool operator<(Edge) const { return true; }
    110110    };
    111111   
     
    188188
    189189    /// The first incoming edge.
    190     InEdgeIt &first(InEdgeIt &i, Node n) const { return i;}
     190    InEdgeIt &first(InEdgeIt &i, Node) const { return i;}
    191191    /// The first outgoing edge.
    192     OutEdgeIt &first(OutEdgeIt &i, Node n) const { return i;}
     192    OutEdgeIt &first(OutEdgeIt &i, Node) const { return i;}
    193193    //  SymEdgeIt &first(SymEdgeIt &, Node) const { return i;}
    194194    /// The first edge of the Graph.
     
    259259    ///and head node \c head.
    260260    ///\return the new edge.
    261     Edge addEdge(Node tail, Node head) { return INVALID;}
     261    Edge addEdge(Node, Node) { return INVALID;}
    262262   
    263263    /// Resets the graph.
     
    295295      /// Sets the value associated with node \c i to the value \c t.
    296296      ///
    297       void set(Node i, T t) {}
    298       /// Gets the value of a node.
    299       T get(Node i) const {return *(T*)0;}  //FIXME: Is it necessary
    300       T &operator[](Node i) {return *(T*)0;}
    301       const T &operator[](Node i) const {return *(T*)0;}
     297      void set(Node, T) {}
     298      // Gets the value of a node.
     299      //T get(Node i) const {return *(T*)0;}  //FIXME: Is it necessary?
     300      T &operator[](Node) {return *(T*)0;}
     301      const T &operator[](Node) const {return *(T*)0;}
    302302
    303303      /// Updates the map if the graph has been changed
     
    327327      EdgeMap(const GraphSkeleton &G, T t) {}
    328328   
    329       void set(Edge i, T t) {}
    330       T get(Edge i) const {return *(T*)0;}
    331       T &operator[](Edge i) {return *(T*)0;}
     329      ///\todo It can copy between different types.
     330      ///
     331      template<typename TT> EdgeMap(const EdgeMap<TT> &m) {}
     332
     333      void set(Edge, T) {}
     334      //T get(Edge) const {return *(T*)0;}
     335      T &operator[](Edge) {return *(T*)0;}
     336      const T &operator[](Edge) const {return *(T*)0;}
    332337   
    333338      void update() {}
     
    392397// }
    393398
    394 #endif // HUGO_GRAPH_H
     399#endif // HUGO_SKELETON_GRAPH_H
  • src/include/smart_graph.h

    r491 r503  
    8181  public:
    8282
     83
    8384    class NodeIt;
    8485    class EdgeIt;
     
    139140    bool valid(Node n) const { return n.n!=-1; }
    140141   
     142    ///\deprecated Use
     143    ///\code
     144    ///  e=INVALID;
     145    ///\endcode
     146    ///instead.
    141147    void setInvalid(Edge &e) { e.n=-1; }
     148    ///\deprecated Use
     149    ///\code
     150    ///  e=INVALID;
     151    ///\endcode
     152    ///instead.
    142153    void setInvalid(Node &n) { n.n=-1; }
    143154   
     
    198209    public:
    199210      Node() {}
    200       Node (Invalid i) { n=-1; }
     211      Node (Invalid) { n=-1; }
    201212      bool operator==(const Node i) const {return n==i.n;}
    202213      bool operator!=(const Node i) const {return n!=i.n;}
     
    380391        DynMapBase<Edge>(*m.G), container(m.container)
    381392      {
    382         G->dyn_node_maps.push_back(this);
     393        G->dyn_edge_maps.push_back(this);
    383394      }
    384395
     
    390401        DynMapBase<Edge>(*m.G)
    391402      {
    392         G->dyn_node_maps.push_back(this);
     403        G->dyn_edge_maps.push_back(this);
    393404        typename std::vector<TT>::const_iterator i;
    394405        for(typename std::vector<TT>::const_iterator i=m.container.begin();
Note: See TracChangeset for help on using the changeset viewer.