Changeset 1791:62e7d237e1fb in lemon-0.x
- Timestamp:
- 11/14/05 19:38:41 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2332
- Location:
- lemon
- Files:
-
- 1 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/full_graph.h
r1726 r1791 24 24 #include <lemon/bits/alteration_notifier.h> 25 25 #include <lemon/bits/static_map.h> 26 27 #include <lemon/bits/undir_graph_extender.h> 26 #include <lemon/bits/graph_extender.h> 28 27 29 28 #include <lemon/invalid.h> … … 71 70 /// Maximum node ID. 72 71 ///\sa id(Node) 73 int max Id(Node = INVALID) const { return _nodeNum-1; }72 int maxNodeId() const { return _nodeNum-1; } 74 73 /// Maximum edge ID. 75 74 76 75 /// Maximum edge ID. 77 76 ///\sa id(Edge) 78 int max Id(Edge = INVALID) const { return _edgeNum-1; }77 int maxEdgeId() const { return _edgeNum-1; } 79 78 80 79 Node source(Edge e) const { return e.id % _nodeNum; } … … 102 101 static int id(Edge e) { return e.id; } 103 102 104 static Node fromId(int id, Node) { return Node(id);}105 106 static Edge fromId(int id, Edge) { return Edge(id);}103 static Node nodeFromId(int id) { return Node(id);} 104 105 static Edge edgeFromId(int id) { return Edge(id);} 107 106 108 107 typedef True FindEdgeTag; … … 191 190 }; 192 191 193 194 typedef AlterableGraphExtender<FullGraphBase>195 AlterableFullGraphBase;196 typedef IterableGraphExtender<AlterableFullGraphBase>197 IterableFullGraphBase;198 192 typedef StaticMappableGraphExtender< 199 193 IterableGraphExtender< 200 AlterableGraphExtender<FullGraphBase> > > ExtendedFullGraphBase; 194 AlterableGraphExtender< 195 GraphExtender<FullGraphBase> > > > ExtendedFullGraphBase; 201 196 202 197 /// \ingroup graphs … … 218 213 }; 219 214 220 ///@}221 215 222 216 class UndirFullGraphBase { … … 253 247 /// Maximum node ID. 254 248 ///\sa id(Node) 255 int max Id(Node = INVALID) const { return _nodeNum-1; }249 int maxNodeId() const { return _nodeNum-1; } 256 250 /// Maximum edge ID. 257 251 258 252 /// Maximum edge ID. 259 253 ///\sa id(Edge) 260 int max Id(Edge = INVALID) const { return _edgeNum-1; }254 int maxEdgeId() const { return _edgeNum-1; } 261 255 262 256 Node source(Edge e) const { -
lemon/graph_adaptor.h
r1755 r1791 34 34 #include <lemon/bits/alteration_notifier.h> 35 35 #include <lemon/bits/default_map.h> 36 #include <lemon/bits/ undir_graph_extender.h>36 #include <lemon/bits/graph_extender.h> 37 37 #include <iostream> 38 38 … … 1860 1860 int id(const Edge& edge) const { return edge.id; } 1861 1861 1862 Node fromId(int id, Node) const { return graph->fromId(id, Node()); }1863 Edge fromId(int id, Edge) const { return Edge(id); }1864 1865 int max Id(Node) const { return graph->maxId(Node()); };1866 int max Id(Edge) const { return edges.size() - 1; }1862 Node nodeFromId(int id) const { return graph->fromId(id, Node()); } 1863 Edge edgeFromId(int id) const { return Edge(id); } 1864 1865 int maxNodeId() const { return graph->maxId(Node()); }; 1866 int maxEdgeId() const { return edges.size() - 1; } 1867 1867 1868 1868 Node source(const Edge& edge) const { return edges[edge.id].source;} -
lemon/grid_graph.h
r1703 r1791 25 25 #include <lemon/bits/alteration_notifier.h> 26 26 #include <lemon/bits/static_map.h> 27 28 #include <lemon/bits/undir_graph_extender.h> 27 #include <lemon/bits/graph_extender.h> 29 28 30 29 #include <lemon/xy.h> … … 165 164 /// Maximum node ID. 166 165 ///\sa id(Node) 167 int max Id(Node = INVALID) const { return nodeNum() - 1; }166 int maxNodeId() const { return nodeNum() - 1; } 168 167 /// Maximum edge ID. 169 168 170 169 /// Maximum edge ID. 171 170 ///\sa id(Edge) 172 int max Id(Edge = INVALID) const { return edgeNum() - 1; }171 int maxEdgeId() const { return edgeNum() - 1; } 173 172 174 173 /// \brief Gives back the source node of an edge. … … 216 215 static int id(Edge e) { return e.id; } 217 216 218 static Node fromId(int id, Node) { return Node(id);}219 220 static Edge fromId(int id, Edge) { return Edge(id);}217 static Node nodeFromId(int id) { return Node(id);} 218 219 static Edge edgeFromId(int id) { return Edge(id);} 221 220 222 221 typedef True FindEdgeTag; … … 359 358 /// GridGraph graph(h, w); 360 359 /// GridGraph::NodeMap<int> val(graph); 361 /// for (int i = 0; i < graph. height(); ++i) {362 /// for (int j = 0; j < graph. width(); ++j) {360 /// for (int i = 0; i < graph.width(); ++i) { 361 /// for (int j = 0; j < graph.height(); ++j) { 363 362 /// val[graph(i, j)] = i + j; 364 363 /// } … … 504 503 /// \brief Row map of the grid graph 505 504 /// 506 /// Just returns a nRowMap for the grid graph.505 /// Just returns a RowMap for the grid graph. 507 506 GridGraph::RowMap rowMap(const GridGraph& graph) { 508 507 return GridGraph::RowMap(graph); 509 508 } 510 509 511 /// \brief Col oumn map of the grid graph512 /// 513 /// Just returns a nColMap for the grid graph.510 /// \brief Column map of the grid graph 511 /// 512 /// Just returns a ColMap for the grid graph. 514 513 GridGraph::ColMap colMap(const GridGraph& graph) { 515 514 return GridGraph::ColMap(graph); -
lemon/hypercube_graph.h
r1703 r1791 22 22 #include <lemon/invalid.h> 23 23 #include <lemon/utility.h> 24 #include <lemon/error.h> 24 25 25 26 #include <lemon/bits/iterable_graph_extender.h> 26 27 #include <lemon/bits/alteration_notifier.h> 27 28 #include <lemon/bits/default_map.h> 29 #include <lemon/bits/graph_extender.h> 28 30 29 31 ///\ingroup graphs … … 33 35 namespace lemon { 34 36 35 /// \brief Base graph for Hyper Graph.37 /// \brief Base graph for HyperCubeGraph. 36 38 /// 37 39 /// Base graph for hyper-cube graph. It describes some member functions … … 78 80 /// Maximum node ID. 79 81 ///\sa id(Node) 80 int max Id(Node = INVALID) const { return nodeNum() - 1; }82 int maxNodeId() const { return nodeNum() - 1; } 81 83 /// Maximum edge ID. 82 84 83 85 /// Maximum edge ID. 84 86 ///\sa id(Edge) 85 int max Id(Edge = INVALID) const { return edgeNum() - 1; }87 int maxEdgeId() const { return edgeNum() - 1; } 86 88 87 89 /// \brief Gives back the source node of an edge. … … 119 121 static int id(Edge e) { return e.id; } 120 122 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);} 124 126 125 127 class Node { … … 236 238 IterableGraphExtender< 237 239 AlterableGraphExtender< 238 HyperCubeGraphBase > > > ExtendedHyperCubeGraphBase; 240 GraphExtender< 241 HyperCubeGraphBase> > > > ExtendedHyperCubeGraphBase; 239 242 240 243 /// \ingroup graphs … … 308 311 T fv = 0.0, const BF& bf = BF()) 309 312 : _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"); 311 315 } 312 316 -
lemon/list_graph.h
r1774 r1791 28 28 #include <lemon/bits/alteration_notifier.h> 29 29 #include <lemon/bits/default_map.h> 30 31 #include <lemon/bits/undir_graph_extender.h> 30 #include <lemon/bits/graph_extender.h> 32 31 33 32 #include <lemon/error.h> … … 106 105 /// Maximum node ID. 107 106 ///\sa id(Node) 108 int max Id(Node = INVALID) const { return nodes.size()-1; }107 int maxNodeId() const { return nodes.size()-1; } 109 108 110 109 /// Maximum edge ID. … … 112 111 /// Maximum edge ID. 113 112 ///\sa id(Edge) 114 int max Id(Edge = INVALID) const { return edges.size()-1; }113 int maxEdgeId() const { return edges.size()-1; } 115 114 116 115 Node source(Edge e) const { return edges[e.id].source; } … … 165 164 static int id(Edge e) { return e.id; } 166 165 167 static Node fromId(int id, Node) { return Node(id);}168 static Edge fromId(int id, Edge) { return Edge(id);}166 static Node nodeFromId(int id) { return Node(id);} 167 static Edge edgeFromId(int id) { return Edge(id);} 169 168 170 169 /// Adds a new node to the graph. … … 316 315 MappableGraphExtender< 317 316 IterableGraphExtender< 318 AlterableGraphExtender<ListGraphBase> > > > > > ExtendedListGraphBase; 317 AlterableGraphExtender< 318 GraphExtender<ListGraphBase> > > > > > > ExtendedListGraphBase; 319 319 320 320 /// \addtogroup graphs -
lemon/smart_graph.h
r1770 r1791 31 31 #include <lemon/bits/alteration_notifier.h> 32 32 #include <lemon/bits/default_map.h> 33 34 #include <lemon/bits/undir_graph_extender.h> 33 #include <lemon/bits/graph_extender.h> 35 34 36 35 #include <lemon/utility.h> … … 91 90 /// Maximum node ID. 92 91 ///\sa id(Node) 93 int max Id(Node) const { return nodes.size()-1; }92 int maxNodeId() const { return nodes.size()-1; } 94 93 /// Maximum edge ID. 95 94 96 95 /// Maximum edge ID. 97 96 ///\sa id(Edge) 98 int max Id(Edge) const { return edges.size()-1; }97 int maxEdgeId() const { return edges.size()-1; } 99 98 100 99 Node source(Edge e) const { return edges[e.n].source; } … … 104 103 105 104 /// The ID of a valid Node is a nonnegative integer not greater than 106 /// \ref max Id(Node). The range of the ID's is not surely continuous107 /// and the greatest node ID can be actually less then \ref max Id(Node).105 /// \ref maxNodeId(). The range of the ID's is not surely continuous 106 /// and the greatest node ID can be actually less then \ref maxNodeId(). 108 107 /// 109 108 /// The ID of the \ref INVALID node is -1. … … 113 112 114 113 /// The ID of a valid Edge is a nonnegative integer not greater than 115 /// \ref max Id(Edge). The range of the ID's is not surely continuous116 /// and the greatest edge ID can be actually less then \ref max Id(Edge).114 /// \ref maxEdgeId(). The range of the ID's is not surely continuous 115 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). 117 116 /// 118 117 /// The ID of the \ref INVALID edge is -1. … … 120 119 static int id(Edge e) { return e.n; } 121 120 122 static Node fromId(int id, Node) { return Node(id);}123 124 static Edge fromId(int id, Edge) { return Edge(id);}121 static Node nodeFromId(int id) { return Node(id);} 122 123 static Edge edgeFromId(int id) { return Edge(id);} 125 124 126 125 Node addNode() { … … 152 151 protected: 153 152 int n; 154 ///\e155 156 ///\todo It should be removed (or at least define a setToId() instead).157 ///158 153 Node(int nn) {n=nn;} 159 154 public: … … 172 167 protected: 173 168 int n; 174 ///\todo It should be removed (or at least define a setToId() instead).175 ///176 169 Edge(int nn) {n=nn;} 177 170 public: … … 231 224 MappableGraphExtender< 232 225 IterableGraphExtender< 233 AlterableGraphExtender< SmartGraphBase> > > > > ExtendedSmartGraphBase;234 235 /// \addtogroup graphs 236 /// @{226 AlterableGraphExtender< 227 GraphExtender<SmartGraphBase> > > > > > ExtendedSmartGraphBase; 228 229 /// \ingroup graphs 237 230 238 231 ///A smart graph class.
Note: See TracChangeset
for help on using the changeset viewer.