COIN-OR::LEMON - Graph Library

Changeset 1694:6d81e6f7a88d in lemon-0.x


Ignore:
Timestamp:
10/03/05 12:11:29 (14 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2220
Message:

Fixing naming conventions
Temporarly bugfix with named-parameters
Removing dead codes

Location:
lemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lemon/bfs.h

    r1665 r1694  
    550550    ///\return The next node to be processed or INVALID if the queue is
    551551    /// empty.
    552     Node NextNode()
     552    Node nextNode()
    553553    {
    554554      return _queue_tail<_queue_head?_queue[_queue_tail]:INVALID;
  • lemon/dfs.h

    r1666 r1694  
    337337    ///
    338338    template <class T>
    339     class DefProcessedMap : public Dfs< Graph,
    340                                         DefProcessedMapTraits<T> > { };
     339    struct DefProcessedMap : public Dfs< Graph, DefProcessedMapTraits<T> > {
     340      typedef Dfs< Graph, DefProcessedMapTraits<T> > Dfs;
     341    };
    341342   
    342343    struct DefGraphProcessedMapTraits : public Traits {
     
    564565    ///\return The next edge to be processed or INVALID if the stack is
    565566    /// empty.
    566     OutEdgeIt NextEdge()
     567    OutEdgeIt nextEdge()
    567568    {
    568569      return _stack_head>=0?_stack[_stack_head]:INVALID;
    569570    }
    570      
     571
    571572    ///\brief Returns \c false if there are nodes
    572573    ///to be processed in the queue
  • lemon/dijkstra.h

    r1665 r1694  
    7979      return new PredMap(G);
    8080    }
    81 //     ///\brief The type of the map that stores the last but one
    82 //     ///nodes of the shortest paths.
    83 //     ///
    84 //     ///The type of the map that stores the last but one
    85 //     ///nodes of the shortest paths.
    86 //     ///It must meet the \ref concept::WriteMap "WriteMap" concept.
    87 //     ///
    88 //     typedef NullMap<typename Graph::Node,typename Graph::Node> PredNodeMap;
    89 //     ///Instantiates a PredNodeMap.
    90    
    91 //     ///This function instantiates a \ref PredNodeMap.
    92 //     ///\param G is the graph, to which
    93 //     ///we would like to define the \ref PredNodeMap
    94 //     static PredNodeMap *createPredNodeMap(const GR &G)
    95 //     {
    96 //       return new PredNodeMap();
    97 //     }
    9881
    9982    ///The type of the map that stores whether a nodes is processed.
     
    210193    ///edges of the shortest paths.
    211194    typedef typename TR::PredMap PredMap;
    212 //     ///\brief The type of the map that stores the last but one
    213 //     ///nodes of the shortest paths.
    214 //     typedef typename TR::PredNodeMap PredNodeMap;
    215195    ///The type of the map indicating if a node is processed.
    216196    typedef typename TR::ProcessedMap ProcessedMap;
     
    228208    ///Indicates if \ref _pred is locally allocated (\c true) or not.
    229209    bool local_pred;
    230 //     ///Pointer to the map of predecessors nodes.
    231 //     PredNodeMap *_predNode;
    232 //     ///Indicates if \ref _predNode is locally allocated (\c true) or not.
    233 //     bool local_predNode;
    234210    ///Pointer to the map of distances.
    235211    DistMap *_dist;
     
    241217    bool local_processed;
    242218
    243 //     ///The source node of the last execution.
    244 //     Node source;
    245 
    246219    ///Creates the maps if necessary.
    247220   
     
    254227        _pred = Traits::createPredMap(*G);
    255228      }
    256 //       if(!_predNode) {
    257 //      local_predNode = true;
    258 //      _predNode = Traits::createPredNodeMap(*G);
    259 //       }
    260229      if(!_dist) {
    261230        local_dist = true;
     
    290259                                        LengthMap,
    291260                                        DefPredMapTraits<T> > { };
    292    
    293 //     template <class T>
    294 //     struct DefPredNodeMapTraits : public Traits {
    295 //       typedef T PredNodeMap;
    296 //       static PredNodeMap *createPredNodeMap(const Graph &G)
    297 //       {
    298 //      throw UninitializedParameter();
    299 //       }
    300 //     };
    301 //     ///\ref named-templ-param "Named parameter" for setting PredNodeMap type
    302 
    303 //     ///\ref named-templ-param "Named parameter" for setting PredNodeMap type
    304 //     ///
    305 //     template <class T>
    306 //     class DefPredNodeMap : public Dijkstra< Graph,
    307 //                                          LengthMap,
    308 //                                          DefPredNodeMapTraits<T> > { };
    309261   
    310262    template <class T>
     
    376328      G(&_G), length(&_length),
    377329      _pred(NULL), local_pred(false),
    378 //       _predNode(NULL), local_predNode(false),
    379330      _dist(NULL), local_dist(false),
    380331      _processed(NULL), local_processed(false),
     
    386337    {
    387338      if(local_pred) delete _pred;
    388 //       if(local_predNode) delete _predNode;
    389339      if(local_dist) delete _dist;
    390340      if(local_processed) delete _processed;
     
    418368    }
    419369
    420 //     ///Sets the map storing the predecessor nodes.
    421 
    422 //     ///Sets the map storing the predecessor nodes.
    423 //     ///If you don't use this function before calling \ref run(),
    424 //     ///it will allocate one. The destuctor deallocates this
    425 //     ///automatically allocated map, of course.
    426 //     ///\return <tt> (*this) </tt>
    427 //     Dijkstra &predNodeMap(PredNodeMap &m)
    428 //     {
    429 //       if(local_predNode) {
    430 //      delete _predNode;
    431 //      local_predNode=false;
    432 //       }
    433 //       _predNode = &m;
    434 //       return *this;
    435 //     }
    436 
    437370    ///Sets the map storing the distances calculated by the algorithm.
    438371
     
    457390      _processed->set(v,true);
    458391      _dist->set(v, dst);
    459 //       if((*_pred)[v]!=INVALID)
    460 //       _predNode->set(v,G->source((*_pred)[v])); ///\todo What to do?
    461392    }
    462393
     
    486417      for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
    487418        _pred->set(u,INVALID);
    488 //      _predNode->set(u,INVALID);
    489419        _processed->set(u,false);
    490420        _heap_map.set(u,Heap::PRE_HEAP);
     
    503433    void addSource(Node s,Value dst=0)
    504434    {
    505 //       source = s;
    506435      if(_heap.state(s) != Heap::IN_HEAP) _heap.push(s,dst);
    507436      else if(_heap[s]<dst) {
     
    531460          _heap.push(w,oldvalue+(*length)[e]);
    532461          _pred->set(w,e);
    533 //        _predNode->set(w,v);
    534462          break;
    535463        case Heap::IN_HEAP:
     
    537465            _heap.decrease(w, oldvalue+(*length)[e]);
    538466            _pred->set(w,e);
    539 //          _predNode->set(w,v);
    540467          }
    541468          break;
     
    553480    ///\return The next node to be processed or INVALID if the priority heap
    554481    /// is empty.
    555     Node NextNode()
     482    Node nextNode()
    556483    {
    557484      return _heap.empty()?_heap.top():INVALID;
     
    743670    const PredMap &predMap() const { return *_pred;}
    744671 
    745 //     ///Returns a reference to the map of nodes of shortest paths.
    746 
    747 //     ///Returns a reference to the NodeMap of the last but one nodes of the
    748 //     ///shortest path tree.
    749 //     ///\pre \ref run() must be called before using this function.
    750 //     const PredNodeMap &predNodeMap() const { return *_predNode;}
    751 
    752672    ///Checks if a node is reachable from the root.
    753673
     
    11021022
    11031023#endif
    1104 
Note: See TracChangeset for help on using the changeset viewer.