gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Various doc improvements (#331) - Add notes to the graph classes about the time of item counting. - Clarify the doc for run() in BFS and DFS. - Other improvements.
0 11 0
default
11 files changed with 93 insertions and 43 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -359,8 +359,11 @@
359 359
  /// The adapted digraph can also be modified through this adaptor
360 360
  /// by adding or removing nodes or arcs, unless the \c GR template
361 361
  /// parameter is set to be \c const.
362 362
  ///
363
  /// This class provides item counting in the same time as the adapted
364
  /// digraph structure.
365
  ///
363 366
  /// \tparam DGR The type of the adapted digraph.
364 367
  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
365 368
  /// It can also be specified to be \c const.
366 369
  ///
... ...
@@ -718,8 +721,10 @@
718 721
  /// The adapted digraph can also be modified through this adaptor
719 722
  /// by adding or removing nodes or arcs, unless the \c GR template
720 723
  /// parameter is set to be \c const.
721 724
  ///
725
  /// This class provides only linear time counting for nodes and arcs.
726
  ///
722 727
  /// \tparam DGR The type of the adapted digraph.
723 728
  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
724 729
  /// It can also be specified to be \c const.
725 730
  /// \tparam NF The type of the node filter map.
... ...
@@ -1313,8 +1318,10 @@
1313 1318
  /// The adapted graph can also be modified through this adaptor
1314 1319
  /// by adding or removing nodes or edges, unless the \c GR template
1315 1320
  /// parameter is set to be \c const.
1316 1321
  ///
1322
  /// This class provides only linear time counting for nodes, edges and arcs.
1323
  ///
1317 1324
  /// \tparam GR The type of the adapted graph.
1318 1325
  /// It must conform to the \ref concepts::Graph "Graph" concept.
1319 1326
  /// It can also be specified to be \c const.
1320 1327
  /// \tparam NF The type of the node filter map.
... ...
@@ -1470,8 +1477,10 @@
1470 1477
  /// The adapted (di)graph can also be modified through this adaptor
1471 1478
  /// by adding or removing nodes or arcs/edges, unless the \c GR template
1472 1479
  /// parameter is set to be \c const.
1473 1480
  ///
1481
  /// This class provides only linear time item counting.
1482
  ///
1474 1483
  /// \tparam GR The type of the adapted digraph or graph.
1475 1484
  /// It must conform to the \ref concepts::Digraph "Digraph" concept
1476 1485
  /// or the \ref concepts::Graph "Graph" concept.
1477 1486
  /// It can also be specified to be \c const.
... ...
@@ -1618,8 +1627,10 @@
1618 1627
  /// The adapted digraph can also be modified through this adaptor
1619 1628
  /// by adding or removing nodes or arcs, unless the \c GR template
1620 1629
  /// parameter is set to be \c const.
1621 1630
  ///
1631
  /// This class provides only linear time counting for nodes and arcs.
1632
  ///
1622 1633
  /// \tparam DGR The type of the adapted digraph.
1623 1634
  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1624 1635
  /// It can also be specified to be \c const.
1625 1636
  /// \tparam AF The type of the arc filter map.
... ...
@@ -1728,8 +1739,10 @@
1728 1739
  /// The adapted graph can also be modified through this adaptor
1729 1740
  /// by adding or removing nodes or edges, unless the \c GR template
1730 1741
  /// parameter is set to be \c const.
1731 1742
  ///
1743
  /// This class provides only linear time counting for nodes, edges and arcs.
1744
  ///
1732 1745
  /// \tparam GR The type of the adapted graph.
1733 1746
  /// It must conform to the \ref concepts::Graph "Graph" concept.
1734 1747
  /// It can also be specified to be \c const.
1735 1748
  /// \tparam EF The type of the edge filter map.
... ...
@@ -2231,8 +2244,11 @@
2231 2244
  /// The adapted digraph can also be modified through this adaptor
2232 2245
  /// by adding or removing nodes or edges, unless the \c GR template
2233 2246
  /// parameter is set to be \c const.
2234 2247
  ///
2248
  /// This class provides item counting in the same time as the adapted
2249
  /// digraph structure.
2250
  ///
2235 2251
  /// \tparam DGR The type of the adapted digraph.
2236 2252
  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
2237 2253
  /// It can also be specified to be \c const.
2238 2254
  ///
... ...
@@ -2534,8 +2550,11 @@
2534 2550
  /// The adapted graph can also be modified through this adaptor
2535 2551
  /// by adding or removing nodes or arcs, unless the \c GR template
2536 2552
  /// parameter is set to be \c const.
2537 2553
  ///
2554
  /// This class provides item counting in the same time as the adapted
2555
  /// graph structure.
2556
  ///
2538 2557
  /// \tparam GR The type of the adapted graph.
2539 2558
  /// It must conform to the \ref concepts::Graph "Graph" concept.
2540 2559
  /// It can also be specified to be \c const.
2541 2560
  /// \tparam DM The type of the direction map.
... ...
@@ -2677,8 +2696,10 @@
2677 2696
  /// \f$ |A_{forward}| + |A_{backward}|\f$ arcs (it may have parallel
2678 2697
  /// arcs).
2679 2698
  /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
2680 2699
  ///
2700
  /// This class provides only linear time counting for nodes and arcs.
2701
  ///
2681 2702
  /// \tparam DGR The type of the adapted digraph.
2682 2703
  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
2683 2704
  /// It is implicitly \c const.
2684 2705
  /// \tparam CM The type of the capacity map.
... ...
@@ -3324,8 +3345,11 @@
3324 3345
  /// In this case you can use \c SplitNodes adaptor, and set the node
3325 3346
  /// costs/capacities of the original digraph to the \e bind \e arcs
3326 3347
  /// in the adaptor.
3327 3348
  ///
3349
  /// This class provides item counting in the same time as the adapted
3350
  /// digraph structure.
3351
  ///
3328 3352
  /// \tparam DGR The type of the adapted digraph.
3329 3353
  /// It must conform to the \ref concepts::Digraph "Digraph" concept.
3330 3354
  /// It is implicitly \c const.
3331 3355
  ///
Ignore white space 6 line context
... ...
@@ -700,14 +700,10 @@
700 700
    }
701 701

	
702 702
    ///Runs the algorithm to visit all nodes in the digraph.
703 703

	
704
    ///This method runs the %BFS algorithm in order to
705
    ///compute the shortest path to each node.
706
    ///
707
    ///The algorithm computes
708
    ///- the shortest path tree (forest),
709
    ///- the distance of each node from the root(s).
704
    ///This method runs the %BFS algorithm in order to visit all nodes
705
    ///in the digraph.
710 706
    ///
711 707
    ///\note <tt>b.run(s)</tt> is just a shortcut of the following code.
712 708
    ///\code
713 709
    ///  b.init();
... ...
@@ -1045,10 +1041,10 @@
1045 1041
    }
1046 1042

	
1047 1043
    ///Runs BFS algorithm to visit all nodes in the digraph.
1048 1044

	
1049
    ///This method runs BFS algorithm in order to compute
1050
    ///the shortest path to each node.
1045
    ///This method runs BFS algorithm in order to visit all nodes
1046
    ///in the digraph.
1051 1047
    void run()
1052 1048
    {
1053 1049
      run(INVALID);
1054 1050
    }
... ...
@@ -1694,14 +1690,10 @@
1694 1690
    }
1695 1691

	
1696 1692
    /// \brief Runs the algorithm to visit all nodes in the digraph.
1697 1693
    ///
1698
    /// This method runs the %BFS algorithm in order to
1699
    /// compute the shortest path to each node.
1700
    ///
1701
    /// The algorithm computes
1702
    /// - the shortest path tree (forest),
1703
    /// - the distance of each node from the root(s).
1694
    /// This method runs the %BFS algorithm in order to visit all nodes
1695
    /// in the digraph.
1704 1696
    ///
1705 1697
    /// \note <tt>b.run(s)</tt> is just a shortcut of the following code.
1706 1698
    ///\code
1707 1699
    ///  b.init();
Ignore white space 8 line context
... ...
@@ -632,14 +632,10 @@
632 632
    }
633 633

	
634 634
    ///Runs the algorithm to visit all nodes in the digraph.
635 635

	
636
    ///This method runs the %DFS algorithm in order to compute the
637
    ///%DFS path to each node.
638
    ///
639
    ///The algorithm computes
640
    ///- the %DFS tree (forest),
641
    ///- the distance of each node from the root(s) in the %DFS tree.
636
    ///This method runs the %DFS algorithm in order to visit all nodes
637
    ///in the digraph.
642 638
    ///
643 639
    ///\note <tt>d.run()</tt> is just a shortcut of the following code.
644 640
    ///\code
645 641
    ///  d.init();
... ...
@@ -975,10 +971,10 @@
975 971
      }
976 972

	
977 973
    ///Runs DFS algorithm to visit all nodes in the digraph.
978 974

	
979
    ///This method runs DFS algorithm in order to compute
980
    ///the DFS path to each node.
975
    ///This method runs DFS algorithm in order to visit all nodes
976
    ///in the digraph.
981 977
    void run()
982 978
    {
983 979
      run(INVALID);
984 980
    }
... ...
@@ -1577,14 +1573,10 @@
1577 1573
    }
1578 1574

	
1579 1575
    /// \brief Runs the algorithm to visit all nodes in the digraph.
1580 1576

	
1581
    /// This method runs the %DFS algorithm in order to
1582
    /// compute the %DFS path to each node.
1583
    ///
1584
    /// The algorithm computes
1585
    /// - the %DFS tree (forest),
1586
    /// - the distance of each node from the root(s) in the %DFS tree.
1577
    /// This method runs the %DFS algorithm in order to visit all nodes
1578
    /// in the digraph.
1587 1579
    ///
1588 1580
    /// \note <tt>d.run()</tt> is just a shortcut of the following code.
1589 1581
    ///\code
1590 1582
    ///   d.init();
Ignore white space 6 line context
... ...
@@ -205,9 +205,9 @@
205 205
    ///The type of the digraph the algorithm runs on.
206 206
    typedef typename TR::Digraph Digraph;
207 207

	
208 208
    ///The type of the arc lengths.
209
    typedef typename TR::LengthMap::Value Value;
209
    typedef typename TR::Value Value;
210 210
    ///The type of the map that stores the arc lengths.
211 211
    typedef typename TR::LengthMap LengthMap;
212 212
    ///\brief The type of the map that stores the predecessor arcs of the
213 213
    ///shortest paths.
Ignore white space 6 line context
... ...
@@ -254,15 +254,16 @@
254 254
  /// one arc can be erased in constant time. It also makes possible,
255 255
  /// that node can be removed from the underlying graph, in this case
256 256
  /// all arcs incident to the given node is erased from the arc set.
257 257
  ///
258
  /// This class fully conforms to the \ref concepts::Digraph
259
  /// "Digraph" concept.
260
  /// It provides only linear time counting for nodes and arcs.
261
  ///
258 262
  /// \param GR The type of the graph which shares its node set with
259 263
  /// this class. Its interface must conform to the
260 264
  /// \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph"
261 265
  /// concept.
262
  ///
263
  /// This class fully conforms to the \ref concepts::Digraph
264
  /// "Digraph" concept.
265 266
  template <typename GR>
266 267
  class ListArcSet : public ArcSetExtender<ListArcSetBase<GR> > {
267 268
    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
268 269

	
... ...
@@ -684,15 +685,16 @@
684 685
  /// erased in constant time. It also makes possible, that node can
685 686
  /// be removed from the underlying graph, in this case all edges
686 687
  /// incident to the given node is erased from the arc set.
687 688
  ///
689
  /// This class fully conforms to the \ref concepts::Graph "Graph"
690
  /// concept.
691
  /// It provides only linear time counting for nodes, edges and arcs.
692
  ///
688 693
  /// \param GR The type of the graph which shares its node set
689 694
  /// with this class. Its interface must conform to the
690 695
  /// \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph"
691 696
  /// concept.
692
  ///
693
  /// This class fully conforms to the \ref concepts::Graph "Graph"
694
  /// concept.
695 697
  template <typename GR>
696 698
  class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<GR> > {
697 699
    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
698 700

	
... ...
@@ -953,15 +955,16 @@
953 955
  /// because it uses continuous storage for arcs and it uses just
954 956
  /// single-linked lists for enumerate outgoing and incoming
955 957
  /// arcs. Therefore the arcs cannot be erased from the arc sets.
956 958
  ///
959
  /// This class fully conforms to the \ref concepts::Digraph "Digraph"
960
  /// concept.
961
  /// It provides only linear time counting for nodes and arcs.
962
  ///
957 963
  /// \warning If a node is erased from the underlying graph and this
958 964
  /// node is the source or target of one arc in the arc set, then
959 965
  /// the arc set is invalidated, and it cannot be used anymore. The
960 966
  /// validity can be checked with the \c valid() member function.
961
  ///
962
  /// This class fully conforms to the \ref concepts::Digraph
963
  /// "Digraph" concept.
964 967
  template <typename GR>
965 968
  class SmartArcSet : public ArcSetExtender<SmartArcSetBase<GR> > {
966 969
    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
967 970

	
... ...
@@ -1303,15 +1306,16 @@
1303 1306
  /// because it uses continuous storage for edges and it uses just
1304 1307
  /// single-linked lists for enumerate incident edges. Therefore the
1305 1308
  /// edges cannot be erased from the edge sets.
1306 1309
  ///
1310
  /// This class fully conforms to the \ref concepts::Graph "Graph"
1311
  /// concept.
1312
  /// It provides only linear time counting for nodes, edges and arcs.
1313
  ///
1307 1314
  /// \warning If a node is erased from the underlying graph and this
1308 1315
  /// node is incident to one edge in the edge set, then the edge set
1309 1316
  /// is invalidated, and it cannot be used anymore. The validity can
1310 1317
  /// be checked with the \c valid() member function.
1311
  ///
1312
  /// This class fully conforms to the \ref concepts::Graph
1313
  /// "Graph" concept.
1314 1318
  template <typename GR>
1315 1319
  class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<GR> > {
1316 1320
    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
1317 1321

	
Ignore white space 6 line context
... ...
@@ -161,8 +161,10 @@
161 161
  /// This type fully conforms to the \ref concepts::Digraph "Digraph concept".
162 162
  /// Most of its member functions and nested classes are documented
163 163
  /// only in the concept class.
164 164
  ///
165
  /// This class provides constant time counting for nodes and arcs.
166
  ///
165 167
  /// \note FullDigraph and FullGraph classes are very similar,
166 168
  /// but there are two differences. While this class conforms only
167 169
  /// to the \ref concepts::Digraph "Digraph" concept, FullGraph
168 170
  /// conforms to the \ref concepts::Graph "Graph" concept,
... ...
@@ -203,16 +205,18 @@
203 205
    ///
204 206
    /// Returns the node with the given index. Since this structure is 
205 207
    /// completely static, the nodes can be indexed with integers from
206 208
    /// the range <tt>[0..nodeNum()-1]</tt>.
209
    /// The index of a node is the same as its ID.
207 210
    /// \sa index()
208 211
    Node operator()(int ix) const { return Parent::operator()(ix); }
209 212

	
210 213
    /// \brief Returns the index of the given node.
211 214
    ///
212 215
    /// Returns the index of the given node. Since this structure is 
213 216
    /// completely static, the nodes can be indexed with integers from
214 217
    /// the range <tt>[0..nodeNum()-1]</tt>.
218
    /// The index of a node is the same as its ID.
215 219
    /// \sa operator()()
216 220
    static int index(const Node& node) { return Parent::index(node); }
217 221

	
218 222
    /// \brief Returns the arc connecting the given nodes.
... ...
@@ -534,8 +538,10 @@
534 538
  /// This type fully conforms to the \ref concepts::Graph "Graph concept".
535 539
  /// Most of its member functions and nested classes are documented
536 540
  /// only in the concept class.
537 541
  ///
542
  /// This class provides constant time counting for nodes, edges and arcs.
543
  ///
538 544
  /// \note FullDigraph and FullGraph classes are very similar,
539 545
  /// but there are two differences. While FullDigraph
540 546
  /// conforms only to the \ref concepts::Digraph "Digraph" concept,
541 547
  /// this class conforms to the \ref concepts::Graph "Graph" concept,
... ...
@@ -578,16 +584,18 @@
578 584
    ///
579 585
    /// Returns the node with the given index. Since this structure is 
580 586
    /// completely static, the nodes can be indexed with integers from
581 587
    /// the range <tt>[0..nodeNum()-1]</tt>.
588
    /// The index of a node is the same as its ID.
582 589
    /// \sa index()
583 590
    Node operator()(int ix) const { return Parent::operator()(ix); }
584 591

	
585 592
    /// \brief Returns the index of the given node.
586 593
    ///
587 594
    /// Returns the index of the given node. Since this structure is 
588 595
    /// completely static, the nodes can be indexed with integers from
589 596
    /// the range <tt>[0..nodeNum()-1]</tt>.
597
    /// The index of a node is the same as its ID.
590 598
    /// \sa operator()()
591 599
    static int index(const Node& node) { return Parent::index(node); }
592 600

	
593 601
    /// \brief Returns the arc connecting the given nodes.
Ignore white space 6 line context
... ...
@@ -502,8 +502,10 @@
502 502
  ///
503 503
  /// This type fully conforms to the \ref concepts::Graph "Graph concept".
504 504
  /// Most of its member functions and nested classes are documented
505 505
  /// only in the concept class.
506
  ///
507
  /// This class provides constant time counting for nodes, edges and arcs.
506 508
  class GridGraph : public ExtendedGridGraphBase {
507 509
    typedef ExtendedGridGraphBase Parent;
508 510

	
509 511
  public:
Ignore white space 6 line context
... ...
@@ -293,8 +293,10 @@
293 293
  /// This type fully conforms to the \ref concepts::Graph "Graph concept".
294 294
  /// Most of its member functions and nested classes are documented
295 295
  /// only in the concept class.
296 296
  ///
297
  /// This class provides constant time counting for nodes, edges and arcs.
298
  ///
297 299
  /// \note The type of the indices is chosen to \c int for efficiency
298 300
  /// reasons. Thus the maximum dimension of this implementation is 26
299 301
  /// (assuming that the size of \c int is 32 bit).
300 302
  class HypercubeGraph : public ExtendedHypercubeGraphBase {
Ignore white space 6 line context
... ...
@@ -323,8 +323,10 @@
323 323
  ///and it also provides several useful additional functionalities.
324 324
  ///Most of its member functions and nested classes are documented
325 325
  ///only in the concept class.
326 326
  ///
327
  ///This class provides only linear time counting for nodes and arcs.
328
  ///
327 329
  ///\sa concepts::Digraph
328 330
  ///\sa ListGraph
329 331
  class ListDigraph : public ExtendedListDigraphBase {
330 332
    typedef ExtendedListDigraphBase Parent;
... ...
@@ -359,14 +361,21 @@
359 361
    }
360 362

	
361 363
    ///\brief Erase a node from the digraph.
362 364
    ///
363
    ///This function erases the given node from the digraph.
365
    ///This function erases the given node along with its outgoing and
366
    ///incoming arcs from the digraph.
367
    ///
368
    ///\note All iterators referencing the removed node or the connected
369
    ///arcs are invalidated, of course.
364 370
    void erase(Node n) { Parent::erase(n); }
365 371

	
366 372
    ///\brief Erase an arc from the digraph.
367 373
    ///
368 374
    ///This function erases the given arc from the digraph.
375
    ///
376
    ///\note All iterators referencing the removed arc are invalidated,
377
    ///of course.
369 378
    void erase(Arc a) { Parent::erase(a); }
370 379

	
371 380
    /// Node validity check
372 381

	
... ...
@@ -509,8 +518,9 @@
509 518
    ///Clear the digraph.
510 519

	
511 520
    ///This function erases all nodes and arcs from the digraph.
512 521
    ///
522
    ///\note All iterators of the digraph are invalidated, of course.
513 523
    void clear() {
514 524
      Parent::clear();
515 525
    }
516 526

	
... ...
@@ -1178,8 +1188,10 @@
1178 1188
  ///and it also provides several useful additional functionalities.
1179 1189
  ///Most of its member functions and nested classes are documented
1180 1190
  ///only in the concept class.
1181 1191
  ///
1192
  ///This class provides only linear time counting for nodes, edges and arcs.
1193
  ///
1182 1194
  ///\sa concepts::Graph
1183 1195
  ///\sa ListDigraph
1184 1196
  class ListGraph : public ExtendedListGraphBase {
1185 1197
    typedef ExtendedListGraphBase Parent;
... ...
@@ -1216,14 +1228,21 @@
1216 1228
    }
1217 1229

	
1218 1230
    ///\brief Erase a node from the graph.
1219 1231
    ///
1220
    /// This function erases the given node from the graph.
1232
    /// This function erases the given node along with its incident arcs
1233
    /// from the graph.
1234
    ///
1235
    /// \note All iterators referencing the removed node or the incident
1236
    /// edges are invalidated, of course.
1221 1237
    void erase(Node n) { Parent::erase(n); }
1222 1238

	
1223 1239
    ///\brief Erase an edge from the graph.
1224 1240
    ///
1225 1241
    /// This function erases the given edge from the graph.
1242
    ///
1243
    /// \note All iterators referencing the removed edge are invalidated,
1244
    /// of course.
1226 1245
    void erase(Edge e) { Parent::erase(e); }
1227 1246
    /// Node validity check
1228 1247

	
1229 1248
    /// This function gives back \c true if the given node is valid,
... ...
@@ -1311,8 +1330,9 @@
1311 1330
    ///Clear the graph.
1312 1331

	
1313 1332
    ///This function erases all nodes and arcs from the graph.
1314 1333
    ///
1334
    ///\note All iterators of the graph are invalidated, of course.
1315 1335
    void clear() {
1316 1336
      Parent::clear();
1317 1337
    }
1318 1338

	
Ignore white space 6 line context
... ...
@@ -193,8 +193,10 @@
193 193
  ///and it also provides some additional functionalities.
194 194
  ///Most of its member functions and nested classes are documented
195 195
  ///only in the concept class.
196 196
  ///
197
  ///This class provides constant time counting for nodes and arcs.
198
  ///
197 199
  ///\sa concepts::Digraph
198 200
  ///\sa SmartGraph
199 201
  class SmartDigraph : public ExtendedSmartDigraphBase {
200 202
    typedef ExtendedSmartDigraphBase Parent;
... ...
@@ -619,8 +621,10 @@
619 621
  /// and it also provides some additional functionalities.
620 622
  /// Most of its member functions and nested classes are documented
621 623
  /// only in the concept class.
622 624
  ///
625
  /// This class provides constant time counting for nodes, edges and arcs.
626
  ///
623 627
  /// \sa concepts::Graph
624 628
  /// \sa SmartDigraph
625 629
  class SmartGraph : public ExtendedSmartGraphBase {
626 630
    typedef ExtendedSmartGraphBase Parent;
Ignore white space 6 line context
... ...
@@ -291,8 +291,10 @@
291 291
  /// This type fully conforms to the \ref concepts::Digraph "Digraph concept".
292 292
  /// Most of its member functions and nested classes are documented
293 293
  /// only in the concept class.
294 294
  ///
295
  /// This class provides constant time counting for nodes and arcs.
296
  ///
295 297
  /// \sa concepts::Digraph
296 298
  class StaticDigraph : public ExtendedStaticDigraphBase {
297 299
  public:
298 300

	
0 comments (0 inline)