COIN-OR::LEMON - Graph Library

Changeset 1194:699c7eac2c6d in lemon for test


Ignore:
Timestamp:
01/11/12 22:21:07 (8 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Renamings in BpGraphs? (#69)

Location:
test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • test/bpgraph_test.cc

    r1193 r1194  
    102102
    103103  checkGraphNodeMap(G);
    104   checkGraphRedMap(G);
    105   checkGraphBlueMap(G);
     104  checkGraphRedNodeMap(G);
     105  checkGraphBlueNodeMap(G);
    106106  checkGraphArcMap(G);
    107107  checkGraphEdgeMap(G);
     
    261261
    262262  checkGraphNodeMap(G);
    263   checkGraphRedMap(G);
    264   checkGraphBlueMap(G);
     263  checkGraphRedNodeMap(G);
     264  checkGraphBlueNodeMap(G);
    265265  checkGraphArcMap(G);
    266266  checkGraphEdgeMap(G);
     
    370370  checkGraphArcList(G, 2 * redNum * blueNum);
    371371
    372   for (RedIt n(G); n != INVALID; ++n) {
     372  for (RedNodeIt n(G); n != INVALID; ++n) {
    373373    checkGraphOutArcList(G, n, blueNum);
    374374    checkGraphInArcList(G, n, blueNum);
     
    376376  }
    377377
    378   for (BlueIt n(G); n != INVALID; ++n) {
     378  for (BlueNodeIt n(G); n != INVALID; ++n) {
    379379    checkGraphOutArcList(G, n, redNum);
    380380    checkGraphInArcList(G, n, redNum);
     
    394394
    395395  checkGraphNodeMap(G);
    396   checkGraphRedMap(G);
    397   checkGraphBlueMap(G);
     396  checkGraphRedNodeMap(G);
     397  checkGraphBlueNodeMap(G);
    398398  checkGraphArcMap(G);
    399399  checkGraphEdgeMap(G);
  • test/graph_copy_test.cc

    r1193 r1194  
    217217  SmartBpGraph from;
    218218  SmartBpGraph::NodeMap<int> fnm(from);
    219   SmartBpGraph::RedMap<int> frnm(from);
    220   SmartBpGraph::BlueMap<int> fbnm(from);
     219  SmartBpGraph::RedNodeMap<int> frnm(from);
     220  SmartBpGraph::BlueNodeMap<int> fbnm(from);
    221221  SmartBpGraph::ArcMap<int> fam(from);
    222222  SmartBpGraph::EdgeMap<int> fem(from);
     
    262262  GR to;
    263263  typename GR::template NodeMap<int> tnm(to);
    264   typename GR::template RedMap<int> trnm(to);
    265   typename GR::template BlueMap<int> tbnm(to);
     264  typename GR::template RedNodeMap<int> trnm(to);
     265  typename GR::template BlueNodeMap<int> tbnm(to);
    266266  typename GR::template ArcMap<int> tam(to);
    267267  typename GR::template EdgeMap<int> tem(to);
     
    273273
    274274  SmartBpGraph::NodeMap<typename GR::Node> nr(from);
    275   SmartBpGraph::RedMap<typename GR::RedNode> rnr(from);
    276   SmartBpGraph::BlueMap<typename GR::BlueNode> bnr(from);
     275  SmartBpGraph::RedNodeMap<typename GR::RedNode> rnr(from);
     276  SmartBpGraph::BlueNodeMap<typename GR::BlueNode> bnr(from);
    277277  SmartBpGraph::ArcMap<typename GR::Arc> ar(from);
    278278  SmartBpGraph::EdgeMap<typename GR::Edge> er(from);
    279279
    280280  typename GR::template NodeMap<SmartBpGraph::Node> ncr(to);
    281   typename GR::template RedMap<SmartBpGraph::RedNode> rncr(to);
    282   typename GR::template BlueMap<SmartBpGraph::BlueNode> bncr(to);
     281  typename GR::template RedNodeMap<SmartBpGraph::RedNode> rncr(to);
     282  typename GR::template BlueNodeMap<SmartBpGraph::BlueNode> bncr(to);
    283283  typename GR::template ArcMap<SmartBpGraph::Arc> acr(to);
    284284  typename GR::template EdgeMap<SmartBpGraph::Edge> ecr(to);
    285285
    286286  bpGraphCopy(from, to).
    287     nodeMap(fnm, tnm).redMap(frnm, trnm).blueMap(fbnm, tbnm).
     287    nodeMap(fnm, tnm).
     288    redNodeMap(frnm, trnm).blueNodeMap(fbnm, tbnm).
    288289    arcMap(fam, tam).edgeMap(fem, tem).
    289290    nodeRef(nr).redRef(rnr).blueRef(bnr).
     
    305306  }
    306307
    307   for (SmartBpGraph::RedIt it(from); it != INVALID; ++it) {
     308  for (SmartBpGraph::RedNodeIt it(from); it != INVALID; ++it) {
    308309    check(ncr[nr[it]] == it, "Wrong copy.");
    309310    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
     
    314315  }
    315316
    316   for (SmartBpGraph::BlueIt it(from); it != INVALID; ++it) {
     317  for (SmartBpGraph::BlueNodeIt it(from); it != INVALID; ++it) {
    317318    check(ncr[nr[it]] == it, "Wrong copy.");
    318319    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
     
    344345    check(nr[ncr[it]] == it, "Wrong copy.");
    345346  }
    346   for (typename GR::RedIt it(to); it != INVALID; ++it) {
     347  for (typename GR::RedNodeIt it(to); it != INVALID; ++it) {
    347348    check(rncr[it] == ncr[it], "Wrong copy.");
    348349    check(rnr[rncr[it]] == it, "Wrong copy.");
    349350  }
    350   for (typename GR::BlueIt it(to); it != INVALID; ++it) {
     351  for (typename GR::BlueNodeIt it(to); it != INVALID; ++it) {
    351352    check(bncr[it] == ncr[it], "Wrong copy.");
    352353    check(bnr[bncr[it]] == it, "Wrong copy.");
  • test/graph_test.h

    r1193 r1194  
    4444  void checkGraphRedNodeList(const Graph &G, int cnt)
    4545  {
    46     typename Graph::RedIt n(G);
     46    typename Graph::RedNodeIt n(G);
    4747    for(int i=0;i<cnt;i++) {
    4848      check(n!=INVALID,"Wrong red Node list linking.");
     
    6666  void checkGraphBlueNodeList(const Graph &G, int cnt)
    6767  {
    68     typename Graph::BlueIt n(G);
     68    typename Graph::BlueNodeIt n(G);
    6969    for(int i=0;i<cnt;i++) {
    7070      check(n!=INVALID,"Wrong blue Node list linking.");
     
    226226    typedef typename Graph::RedNode RedNode;
    227227    std::set<int> values;
    228     for (typename Graph::RedIt n(G); n != INVALID; ++n) {
     228    for (typename Graph::RedNodeIt n(G); n != INVALID; ++n) {
    229229      check(G.red(n), "Wrong partition");
    230230      check(values.find(G.id(n)) == values.end(), "Wrong id");
     
    239239    typedef typename Graph::BlueNode BlueNode;
    240240    std::set<int> values;
    241     for (typename Graph::BlueIt n(G); n != INVALID; ++n) {
     241    for (typename Graph::BlueNodeIt n(G); n != INVALID; ++n) {
    242242      check(G.blue(n), "Wrong partition");
    243243      check(values.find(G.id(n)) == values.end(), "Wrong id");
     
    305305
    306306  template <typename Graph>
    307   void checkGraphRedMap(const Graph& G) {
     307  void checkGraphRedNodeMap(const Graph& G) {
    308308    typedef typename Graph::Node Node;
    309     typedef typename Graph::RedIt RedIt;
    310 
    311     typedef typename Graph::template RedMap<int> IntRedMap;
    312     IntRedMap map(G, 42);
    313     for (RedIt it(G); it != INVALID; ++it) {
     309    typedef typename Graph::RedNodeIt RedNodeIt;
     310
     311    typedef typename Graph::template RedNodeMap<int> IntRedNodeMap;
     312    IntRedNodeMap map(G, 42);
     313    for (RedNodeIt it(G); it != INVALID; ++it) {
    314314      check(map[it] == 42, "Wrong map constructor.");
    315315    }
    316316    int s = 0;
    317     for (RedIt it(G); it != INVALID; ++it) {
     317    for (RedNodeIt it(G); it != INVALID; ++it) {
    318318      map[it] = 0;
    319319      check(map[it] == 0, "Wrong operator[].");
     
    323323    }
    324324    s = s * (s - 1) / 2;
    325     for (RedIt it(G); it != INVALID; ++it) {
     325    for (RedNodeIt it(G); it != INVALID; ++it) {
    326326      s -= map[it];
    327327    }
     
    335335
    336336  template <typename Graph>
    337   void checkGraphBlueMap(const Graph& G) {
     337  void checkGraphBlueNodeMap(const Graph& G) {
    338338    typedef typename Graph::Node Node;
    339     typedef typename Graph::BlueIt BlueIt;
    340 
    341     typedef typename Graph::template BlueMap<int> IntBlueMap;
    342     IntBlueMap map(G, 42);
    343     for (BlueIt it(G); it != INVALID; ++it) {
     339    typedef typename Graph::BlueNodeIt BlueNodeIt;
     340
     341    typedef typename Graph::template BlueNodeMap<int> IntBlueNodeMap;
     342    IntBlueNodeMap map(G, 42);
     343    for (BlueNodeIt it(G); it != INVALID; ++it) {
    344344      check(map[it] == 42, "Wrong map constructor.");
    345345    }
    346346    int s = 0;
    347     for (BlueIt it(G); it != INVALID; ++it) {
     347    for (BlueNodeIt it(G); it != INVALID; ++it) {
    348348      map[it] = 0;
    349349      check(map[it] == 0, "Wrong operator[].");
     
    353353    }
    354354    s = s * (s - 1) / 2;
    355     for (BlueIt it(G); it != INVALID; ++it) {
     355    for (BlueNodeIt it(G); it != INVALID; ++it) {
    356356      s -= map[it];
    357357    }
Note: See TracChangeset for help on using the changeset viewer.