Changeset 967:6563019430ba in lemon-0.x for src/lemon
- Timestamp:
- 11/08/04 16:22:39 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1354
- Location:
- src/lemon
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/bin_heap.h
r921 r967 33 33 34 34 /// A Binary Heap implementation. 35 36 ///\todo Please document... 37 /// 38 ///\sa FibHeap 39 ///\sa Dijkstra 35 40 template <typename Item, typename Prio, typename ItemIntMap, 36 41 typename Compare = std::less<Prio> > … … 68 73 69 74 public: 75 ///\e 70 76 BinHeap(ItemIntMap &_iim) : iim(_iim) {} 77 ///\e 71 78 BinHeap(ItemIntMap &_iim, const Compare &_comp) : comp(_comp), iim(_iim) {} 72 79 73 80 81 ///\e 74 82 int size() const { return data.size(); } 83 ///\e 75 84 bool empty() const { return data.empty(); } 76 85 … … 102 111 103 112 public: 113 ///\e 104 114 void push(const PairType &p) { 105 115 int n = data.size(); … … 107 117 bubble_up(n, p); 108 118 } 119 ///\e 109 120 void push(const Item &i, const Prio &p) { push(PairType(i,p)); } 110 121 122 ///\e 111 123 Item top() const { 112 124 return data[0].first; … … 117 129 } 118 130 131 ///\e 119 132 void pop() { 120 133 rmidx(0); 121 134 } 122 135 136 ///\e 123 137 void erase(const Item &i) { 124 138 rmidx(iim[i]); 125 139 } 126 140 141 ///\e 127 142 Prio operator[](const Item &i) const { 128 143 int idx = iim[i]; … … 130 145 } 131 146 147 ///\e 132 148 void set(const Item &i, const Prio &p) { 133 149 int idx = iim[i]; … … 143 159 } 144 160 161 ///\e 145 162 void decrease(const Item &i, const Prio &p) { 146 163 int idx = iim[i]; 147 164 bubble_up(idx, PairType(i,p)); 148 165 } 166 ///\e 149 167 void increase(const Item &i, const Prio &p) { 150 168 int idx = iim[i]; … … 152 170 } 153 171 172 ///\e 154 173 state_enum state(const Item &i) const { 155 174 int s = iim[i]; -
src/lemon/concept/path.h
r959 r967 30 30 31 31 32 //! \brief A skeleto mstructure for representing directed paths in a graph.32 //! \brief A skeleton structure for representing directed paths in a graph. 33 33 //! 34 34 //! A skeleton structure for representing directed paths in a graph. -
src/lemon/fib_heap.h
r921 r967 50 50 ///default is \c std::less<Prio>. 51 51 /// 52 ///\sa BinHeap 53 ///\sa Dijkstra 52 54 ///\author Jacint Szabo 53 55 -
src/lemon/graph_utils.h
r964 r967 90 90 } 91 91 return num; 92 } 93 94 /// Finds an edge between two nodes of a graph. 95 96 /// Finds an edge from node \c u to node \c v in graph \c g. 97 /// 98 /// If \c prev is \ref INVALID (this is the default value), then 99 /// it finds the first edge from \c u to \c v. Otherwise it looks for 100 /// the next edge from \c u to \c v after \c prev. 101 /// \return The found edge or \ref INVALID if there is no such an edge. 102 /// 103 /// Thus you can iterate through each edge from \c u to \c v as it follows. 104 /// \code 105 /// for(Edge e=findEdge(g,u,v);e!=INVALID;e=findEdge(g,u,v,e)) { 106 /// ... 107 /// } 108 /// \endcode 109 /// \todo We may want to use the \ref concept::GraphBase "GraphBase" 110 /// interface here... 111 /// \bug Untested ... 112 template <typename Graph> 113 typename Graph::Edge findEdge(const Graph &g, 114 typename Graph::Node u, typename Graph::Node v, 115 typename Graph::Edge prev = INVALID) 116 { 117 typename Graph::OutEdgeIt e(g,prev); 118 if(prev==INVALID) g.first(e,u); 119 else ++e; 120 while(e!=INVALID && g.tail(e)!=v) ++e; 121 return e; 92 122 } 93 123 -
src/lemon/xy.h
r964 r967 138 138 ///Read a plainvector from a stream 139 139 140 ///Read a plainvector from a stream 140 141 ///\relates xy 141 142 /// … … 151 152 ///Write a plainvector to a stream 152 153 154 ///Write a plainvector to a stream 153 155 ///\relates xy 154 156 ///
Note: See TracChangeset
for help on using the changeset viewer.