lemon/concepts/graph_components.h
changeset 964 7fdaa05a69a1
parent 877 141f9c0db4a3
parent 963 761fe0846f49
child 966 08712a8c3afe
child 970 d216e1c8b3fa
equal deleted inserted replaced
20:1de95988bd99 24:3f9e9da174ff
   113           b = (ia < ib);
   113           b = (ia < ib);
   114         }
   114         }
   115 
   115 
   116         const _GraphItem &ia;
   116         const _GraphItem &ia;
   117         const _GraphItem &ib;
   117         const _GraphItem &ib;
       
   118         Constraints() {}
   118       };
   119       };
   119     };
   120     };
   120 
   121 
   121     /// \brief Base skeleton class for directed graphs.
   122     /// \brief Base skeleton class for directed graphs.
   122     ///
   123     ///
   172             n = digraph.oppositeNode(n, e);
   173             n = digraph.oppositeNode(n, e);
   173           }
   174           }
   174         }
   175         }
   175 
   176 
   176         const _Digraph& digraph;
   177         const _Digraph& digraph;
       
   178         Constraints() {}
   177       };
   179       };
   178     };
   180     };
   179 
   181 
   180     /// \brief Base skeleton class for undirected graphs.
   182     /// \brief Base skeleton class for undirected graphs.
   181     ///
   183     ///
   288             ignore_unused_variable_warning(d);
   290             ignore_unused_variable_warning(d);
   289           }
   291           }
   290         }
   292         }
   291 
   293 
   292         const _Graph& graph;
   294         const _Graph& graph;
       
   295       Constraints() {}
   293       };
   296       };
   294 
   297 
   295     };
   298     };
   296 
   299 
   297     /// \brief Skeleton class for \e idable directed graphs.
   300     /// \brief Skeleton class for \e idable directed graphs.
   367           eid = digraph.maxArcId();
   370           eid = digraph.maxArcId();
   368           ignore_unused_variable_warning(eid);
   371           ignore_unused_variable_warning(eid);
   369         }
   372         }
   370 
   373 
   371         const _Digraph& digraph;
   374         const _Digraph& digraph;
       
   375         Constraints() {}
   372       };
   376       };
   373     };
   377     };
   374 
   378 
   375     /// \brief Skeleton class for \e idable undirected graphs.
   379     /// \brief Skeleton class for \e idable undirected graphs.
   376     ///
   380     ///
   419           ueid = graph.maxEdgeId();
   423           ueid = graph.maxEdgeId();
   420           ignore_unused_variable_warning(ueid);
   424           ignore_unused_variable_warning(ueid);
   421         }
   425         }
   422 
   426 
   423         const _Graph& graph;
   427         const _Graph& graph;
       
   428         Constraints() {}
   424       };
   429       };
   425     };
   430     };
   426 
   431 
   427     /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
   432     /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
   428     ///
   433     ///
   487           checkConcept<GraphItem<>, _GraphItemIt>();
   492           checkConcept<GraphItem<>, _GraphItemIt>();
   488           _GraphItemIt it1(g);
   493           _GraphItemIt it1(g);
   489           _GraphItemIt it2;
   494           _GraphItemIt it2;
   490           _GraphItemIt it3 = it1;
   495           _GraphItemIt it3 = it1;
   491           _GraphItemIt it4 = INVALID;
   496           _GraphItemIt it4 = INVALID;
       
   497           ignore_unused_variable_warning(it3);
       
   498           ignore_unused_variable_warning(it4);
   492 
   499 
   493           it2 = ++it1;
   500           it2 = ++it1;
   494           ++it2 = it1;
   501           ++it2 = it1;
   495           ++(++it1);
   502           ++(++it1);
   496 
   503 
   497           Item bi = it1;
   504           Item bi = it1;
   498           bi = it2;
   505           bi = it2;
   499         }
   506         }
   500         const GR& g;
   507         const GR& g;
       
   508         Constraints() {}
   501       };
   509       };
   502     };
   510     };
   503 
   511 
   504     /// \brief Concept class for \c InArcIt, \c OutArcIt and
   512     /// \brief Concept class for \c InArcIt, \c OutArcIt and
   505     /// \c IncEdgeIt types.
   513     /// \c IncEdgeIt types.
   575           checkConcept<GraphItem<sel>, _GraphIncIt>();
   583           checkConcept<GraphItem<sel>, _GraphIncIt>();
   576           _GraphIncIt it1(graph, node);
   584           _GraphIncIt it1(graph, node);
   577           _GraphIncIt it2;
   585           _GraphIncIt it2;
   578           _GraphIncIt it3 = it1;
   586           _GraphIncIt it3 = it1;
   579           _GraphIncIt it4 = INVALID;
   587           _GraphIncIt it4 = INVALID;
       
   588           ignore_unused_variable_warning(it3);
       
   589           ignore_unused_variable_warning(it4);
   580 
   590 
   581           it2 = ++it1;
   591           it2 = ++it1;
   582           ++it2 = it1;
   592           ++it2 = it1;
   583           ++(++it1);
   593           ++(++it1);
   584           Item e = it1;
   594           Item e = it1;
   585           e = it2;
   595           e = it2;
   586         }
   596         }
   587         const Base& node;
   597         const Base& node;
   588         const GR& graph;
   598         const GR& graph;
       
   599         Constraints() {}
   589       };
   600       };
   590     };
   601     };
   591 
   602 
   592     /// \brief Skeleton class for iterable directed graphs.
   603     /// \brief Skeleton class for iterable directed graphs.
   593     ///
   604     ///
   760             ignore_unused_variable_warning(n);
   771             ignore_unused_variable_warning(n);
   761           }
   772           }
   762         }
   773         }
   763 
   774 
   764         const _Digraph& digraph;
   775         const _Digraph& digraph;
       
   776         Constraints() {}
   765       };
   777       };
   766     };
   778     };
   767 
   779 
   768     /// \brief Skeleton class for iterable undirected graphs.
   780     /// \brief Skeleton class for iterable undirected graphs.
   769     ///
   781     ///
   884             n = graph.runningNode(ieit);
   896             n = graph.runningNode(ieit);
   885           }
   897           }
   886         }
   898         }
   887 
   899 
   888         const _Graph& graph;
   900         const _Graph& graph;
       
   901         Constraints() {}
   889       };
   902       };
   890     };
   903     };
   891 
   904 
   892     /// \brief Skeleton class for alterable directed graphs.
   905     /// \brief Skeleton class for alterable directed graphs.
   893     ///
   906     ///
   941           ignore_unused_variable_warning(nn);
   954           ignore_unused_variable_warning(nn);
   942           ignore_unused_variable_warning(en);
   955           ignore_unused_variable_warning(en);
   943         }
   956         }
   944 
   957 
   945         const _Digraph& digraph;
   958         const _Digraph& digraph;
       
   959         Constraints() {}
   946       };
   960       };
   947     };
   961     };
   948 
   962 
   949     /// \brief Skeleton class for alterable undirected graphs.
   963     /// \brief Skeleton class for alterable undirected graphs.
   950     ///
   964     ///
   982             = graph.notifier(typename _Graph::Edge());
   996             = graph.notifier(typename _Graph::Edge());
   983           ignore_unused_variable_warning(uen);
   997           ignore_unused_variable_warning(uen);
   984         }
   998         }
   985 
   999 
   986         const _Graph& graph;
  1000         const _Graph& graph;
       
  1001         Constraints() {}
   987       };
  1002       };
   988     };
  1003     };
   989 
  1004 
   990     /// \brief Concept class for standard graph maps.
  1005     /// \brief Concept class for standard graph maps.
   991     ///
  1006     ///
  1059         }
  1074         }
  1060 
  1075 
  1061         const _Map &m;
  1076         const _Map &m;
  1062         const GR &g;
  1077         const GR &g;
  1063         const typename GraphMap::Value &t;
  1078         const typename GraphMap::Value &t;
       
  1079         Constraints() {}
  1064       };
  1080       };
  1065 
  1081 
  1066     };
  1082     };
  1067 
  1083 
  1068     /// \brief Skeleton class for mappable directed graphs.
  1084     /// \brief Skeleton class for mappable directed graphs.
  1197               DummyArcMap >();
  1213               DummyArcMap >();
  1198           }
  1214           }
  1199         }
  1215         }
  1200 
  1216 
  1201         const _Digraph& digraph;
  1217         const _Digraph& digraph;
       
  1218         Constraints() {}
  1202       };
  1219       };
  1203     };
  1220     };
  1204 
  1221 
  1205     /// \brief Skeleton class for mappable undirected graphs.
  1222     /// \brief Skeleton class for mappable undirected graphs.
  1206     ///
  1223     ///
  1282               DummyEdgeMap >();
  1299               DummyEdgeMap >();
  1283           }
  1300           }
  1284         }
  1301         }
  1285 
  1302 
  1286         const _Graph& graph;
  1303         const _Graph& graph;
       
  1304         Constraints() {}
  1287       };
  1305       };
  1288     };
  1306     };
  1289 
  1307 
  1290     /// \brief Skeleton class for extendable directed graphs.
  1308     /// \brief Skeleton class for extendable directed graphs.
  1291     ///
  1309     ///
  1326           typename _Digraph::Arc arc;
  1344           typename _Digraph::Arc arc;
  1327           arc = digraph.addArc(node_a, node_b);
  1345           arc = digraph.addArc(node_a, node_b);
  1328         }
  1346         }
  1329 
  1347 
  1330         _Digraph& digraph;
  1348         _Digraph& digraph;
       
  1349         Constraints() {}
  1331       };
  1350       };
  1332     };
  1351     };
  1333 
  1352 
  1334     /// \brief Skeleton class for extendable undirected graphs.
  1353     /// \brief Skeleton class for extendable undirected graphs.
  1335     ///
  1354     ///
  1370           typename _Graph::Edge edge;
  1389           typename _Graph::Edge edge;
  1371           edge = graph.addEdge(node_a, node_b);
  1390           edge = graph.addEdge(node_a, node_b);
  1372         }
  1391         }
  1373 
  1392 
  1374         _Graph& graph;
  1393         _Graph& graph;
       
  1394         Constraints() {}
  1375       };
  1395       };
  1376     };
  1396     };
  1377 
  1397 
  1378     /// \brief Skeleton class for erasable directed graphs.
  1398     /// \brief Skeleton class for erasable directed graphs.
  1379     ///
  1399     ///
  1409           const typename _Digraph::Arc arc(INVALID);
  1429           const typename _Digraph::Arc arc(INVALID);
  1410           digraph.erase(arc);
  1430           digraph.erase(arc);
  1411         }
  1431         }
  1412 
  1432 
  1413         _Digraph& digraph;
  1433         _Digraph& digraph;
       
  1434         Constraints() {}
  1414       };
  1435       };
  1415     };
  1436     };
  1416 
  1437 
  1417     /// \brief Skeleton class for erasable undirected graphs.
  1438     /// \brief Skeleton class for erasable undirected graphs.
  1418     ///
  1439     ///
  1448           const typename _Graph::Edge edge(INVALID);
  1469           const typename _Graph::Edge edge(INVALID);
  1449           graph.erase(edge);
  1470           graph.erase(edge);
  1450         }
  1471         }
  1451 
  1472 
  1452         _Graph& graph;
  1473         _Graph& graph;
       
  1474         Constraints() {}
  1453       };
  1475       };
  1454     };
  1476     };
  1455 
  1477 
  1456     /// \brief Skeleton class for clearable directed graphs.
  1478     /// \brief Skeleton class for clearable directed graphs.
  1457     ///
  1479     ///
  1476           checkConcept<Base, _Digraph>();
  1498           checkConcept<Base, _Digraph>();
  1477           digraph.clear();
  1499           digraph.clear();
  1478         }
  1500         }
  1479 
  1501 
  1480         _Digraph& digraph;
  1502         _Digraph& digraph;
       
  1503         Constraints() {}
  1481       };
  1504       };
  1482     };
  1505     };
  1483 
  1506 
  1484     /// \brief Skeleton class for clearable undirected graphs.
  1507     /// \brief Skeleton class for clearable undirected graphs.
  1485     ///
  1508     ///
  1504           checkConcept<Base, _Graph>();
  1527           checkConcept<Base, _Graph>();
  1505           graph.clear();
  1528           graph.clear();
  1506         }
  1529         }
  1507 
  1530 
  1508         _Graph& graph;
  1531         _Graph& graph;
       
  1532         Constraints() {}
  1509       };
  1533       };
  1510     };
  1534     };
  1511 
  1535 
  1512   }
  1536   }
  1513 
  1537