lemon/list_graph.h
changeset 787 c2230649a493
parent 741 10c9c3a35b83
child 788 c92296660262
equal deleted inserted replaced
25:259b84cdc2f0 27:9a5ddce4b90b
   322   ///This type fully conforms to the \ref concepts::Digraph "Digraph concept"
   322   ///This type fully conforms to the \ref concepts::Digraph "Digraph concept"
   323   ///and it also provides several useful additional functionalities.
   323   ///and it also provides several useful additional functionalities.
   324   ///Most of its member functions and nested classes are documented
   324   ///Most of its member functions and nested classes are documented
   325   ///only in the concept class.
   325   ///only in the concept class.
   326   ///
   326   ///
       
   327   ///This class provides only linear time counting for nodes and arcs.
       
   328   ///
   327   ///\sa concepts::Digraph
   329   ///\sa concepts::Digraph
   328   ///\sa ListGraph
   330   ///\sa ListGraph
   329   class ListDigraph : public ExtendedListDigraphBase {
   331   class ListDigraph : public ExtendedListDigraphBase {
   330     typedef ExtendedListDigraphBase Parent;
   332     typedef ExtendedListDigraphBase Parent;
   331 
   333 
   358       return Parent::addArc(s, t);
   360       return Parent::addArc(s, t);
   359     }
   361     }
   360 
   362 
   361     ///\brief Erase a node from the digraph.
   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     void erase(Node n) { Parent::erase(n); }
   370     void erase(Node n) { Parent::erase(n); }
   365 
   371 
   366     ///\brief Erase an arc from the digraph.
   372     ///\brief Erase an arc from the digraph.
   367     ///
   373     ///
   368     ///This function erases the given arc from the digraph.
   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     void erase(Arc a) { Parent::erase(a); }
   378     void erase(Arc a) { Parent::erase(a); }
   370 
   379 
   371     /// Node validity check
   380     /// Node validity check
   372 
   381 
   373     /// This function gives back \c true if the given node is valid,
   382     /// This function gives back \c true if the given node is valid,
   508 
   517 
   509     ///Clear the digraph.
   518     ///Clear the digraph.
   510 
   519 
   511     ///This function erases all nodes and arcs from the digraph.
   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     void clear() {
   523     void clear() {
   514       Parent::clear();
   524       Parent::clear();
   515     }
   525     }
   516 
   526 
   517     /// Reserve memory for nodes.
   527     /// Reserve memory for nodes.
  1177   ///This type fully conforms to the \ref concepts::Graph "Graph concept"
  1187   ///This type fully conforms to the \ref concepts::Graph "Graph concept"
  1178   ///and it also provides several useful additional functionalities.
  1188   ///and it also provides several useful additional functionalities.
  1179   ///Most of its member functions and nested classes are documented
  1189   ///Most of its member functions and nested classes are documented
  1180   ///only in the concept class.
  1190   ///only in the concept class.
  1181   ///
  1191   ///
       
  1192   ///This class provides only linear time counting for nodes, edges and arcs.
       
  1193   ///
  1182   ///\sa concepts::Graph
  1194   ///\sa concepts::Graph
  1183   ///\sa ListDigraph
  1195   ///\sa ListDigraph
  1184   class ListGraph : public ExtendedListGraphBase {
  1196   class ListGraph : public ExtendedListGraphBase {
  1185     typedef ExtendedListGraphBase Parent;
  1197     typedef ExtendedListGraphBase Parent;
  1186 
  1198 
  1215       return Parent::addEdge(u, v);
  1227       return Parent::addEdge(u, v);
  1216     }
  1228     }
  1217 
  1229 
  1218     ///\brief Erase a node from the graph.
  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     void erase(Node n) { Parent::erase(n); }
  1237     void erase(Node n) { Parent::erase(n); }
  1222 
  1238 
  1223     ///\brief Erase an edge from the graph.
  1239     ///\brief Erase an edge from the graph.
  1224     ///
  1240     ///
  1225     /// This function erases the given edge from the graph.
  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     void erase(Edge e) { Parent::erase(e); }
  1245     void erase(Edge e) { Parent::erase(e); }
  1227     /// Node validity check
  1246     /// Node validity check
  1228 
  1247 
  1229     /// This function gives back \c true if the given node is valid,
  1248     /// This function gives back \c true if the given node is valid,
  1230     /// i.e. it is a real node of the graph.
  1249     /// i.e. it is a real node of the graph.
  1310 
  1329 
  1311     ///Clear the graph.
  1330     ///Clear the graph.
  1312 
  1331 
  1313     ///This function erases all nodes and arcs from the graph.
  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     void clear() {
  1335     void clear() {
  1316       Parent::clear();
  1336       Parent::clear();
  1317     }
  1337     }
  1318 
  1338 
  1319     /// Reserve memory for nodes.
  1339     /// Reserve memory for nodes.