test/graph_copy_test.cc
changeset 290 f6899946c1ac
parent 220 a5d8c039f218
child 416 bb871cb8ac06
equal deleted inserted replaced
2:4fec780b0e3c 3:fb4de2823fac
    61   SmartDigraph::ArcMap<ListDigraph::Arc> er(from);
    61   SmartDigraph::ArcMap<ListDigraph::Arc> er(from);
    62 
    62 
    63   ListDigraph::NodeMap<SmartDigraph::Node> ncr(to);
    63   ListDigraph::NodeMap<SmartDigraph::Node> ncr(to);
    64   ListDigraph::ArcMap<SmartDigraph::Arc> ecr(to);
    64   ListDigraph::ArcMap<SmartDigraph::Arc> ecr(to);
    65 
    65 
    66   DigraphCopy<ListDigraph, SmartDigraph>(to, from).
    66   digraphCopy(from, to).
    67     nodeMap(tnm, fnm).arcMap(tam, fam).
    67     nodeMap(fnm, tnm).arcMap(fam, tam).
    68     nodeRef(nr).arcRef(er).
    68     nodeRef(nr).arcRef(er).
    69     nodeCrossRef(ncr).arcCrossRef(ecr).
    69     nodeCrossRef(ncr).arcCrossRef(ecr).
    70     node(tn, fn).arc(ta, fa).run();
    70     node(fn, tn).arc(fa, ta).run();
    71 
    71 
    72   for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
    72   for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
    73     check(ncr[nr[it]] == it, "Wrong copy.");
    73     check(ncr[nr[it]] == it, "Wrong copy.");
    74     check(fnm[it] == tnm[nr[it]], "Wrong copy.");
    74     check(fnm[it] == tnm[nr[it]], "Wrong copy.");
    75   }
    75   }
   136 
   136 
   137   ListGraph::NodeMap<SmartGraph::Node> ncr(to);
   137   ListGraph::NodeMap<SmartGraph::Node> ncr(to);
   138   ListGraph::ArcMap<SmartGraph::Arc> acr(to);
   138   ListGraph::ArcMap<SmartGraph::Arc> acr(to);
   139   ListGraph::EdgeMap<SmartGraph::Edge> ecr(to);
   139   ListGraph::EdgeMap<SmartGraph::Edge> ecr(to);
   140 
   140 
   141   GraphCopy<ListGraph, SmartGraph>(to, from).
   141   graphCopy(from, to).
   142     nodeMap(tnm, fnm).arcMap(tam, fam).edgeMap(tem, fem).
   142     nodeMap(fnm, tnm).arcMap(fam, tam).edgeMap(fem, tem).
   143     nodeRef(nr).arcRef(ar).edgeRef(er).
   143     nodeRef(nr).arcRef(ar).edgeRef(er).
   144     nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr).
   144     nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr).
   145     node(tn, fn).arc(ta, fa).edge(te, fe).run();
   145     node(fn, tn).arc(fa, ta).edge(fe, te).run();
   146 
   146 
   147   for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
   147   for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
   148     check(ncr[nr[it]] == it, "Wrong copy.");
   148     check(ncr[nr[it]] == it, "Wrong copy.");
   149     check(fnm[it] == tnm[nr[it]], "Wrong copy.");
   149     check(fnm[it] == tnm[nr[it]], "Wrong copy.");
   150   }
   150   }