COIN-OR::LEMON - Graph Library

Changeset 415:4b6112235fad in lemon-1.2 for test


Ignore:
Timestamp:
11/30/08 19:00:30 (11 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Improvements in graph adaptors (#67)

Remove DigraphAdaptor? and GraphAdaptor?
Remove docs of base classes
Move the member documentations to real adaptors
Minor improvements in documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/graph_adaptor_test.cc

    r414 r415  
    3838using namespace lemon;
    3939
    40 void checkDigraphAdaptor() {
    41   checkConcept<concepts::Digraph, DigraphAdaptor<concepts::Digraph> >();
    42 
    43   typedef ListDigraph Digraph;
    44   typedef DigraphAdaptor<Digraph> Adaptor;
    45 
    46   Digraph digraph;
    47   Adaptor adaptor(digraph);
    48 
    49   Digraph::Node n1 = digraph.addNode();
    50   Digraph::Node n2 = digraph.addNode();
    51   Digraph::Node n3 = digraph.addNode();
    52 
    53   Digraph::Arc a1 = digraph.addArc(n1, n2);
    54   Digraph::Arc a2 = digraph.addArc(n1, n3);
    55   Digraph::Arc a3 = digraph.addArc(n2, n3);
    56  
    57   checkGraphNodeList(adaptor, 3);
    58   checkGraphArcList(adaptor, 3);
    59   checkGraphConArcList(adaptor, 3);
    60 
    61   checkGraphOutArcList(adaptor, n1, 2);
    62   checkGraphOutArcList(adaptor, n2, 1);
    63   checkGraphOutArcList(adaptor, n3, 0);
    64 
    65   checkGraphInArcList(adaptor, n1, 0);
    66   checkGraphInArcList(adaptor, n2, 1);
    67   checkGraphInArcList(adaptor, n3, 2);
    68 
    69   checkNodeIds(adaptor);
    70   checkArcIds(adaptor);
    71 
    72   checkGraphNodeMap(adaptor);
    73   checkGraphArcMap(adaptor);
    74 }
    75 
    7640void checkRevDigraphAdaptor() {
    7741  checkConcept<concepts::Digraph, RevDigraphAdaptor<concepts::Digraph> >();
     
    586550}
    587551
    588 void checkGraphAdaptor() {
    589   checkConcept<concepts::Graph, GraphAdaptor<concepts::Graph> >();
    590 
    591   typedef ListGraph Graph;
    592   typedef GraphAdaptor<Graph> Adaptor;
    593 
    594   Graph graph;
    595   Adaptor adaptor(graph);
    596 
    597   Graph::Node n1 = graph.addNode();
    598   Graph::Node n2 = graph.addNode();
    599   Graph::Node n3 = graph.addNode();
    600   Graph::Node n4 = graph.addNode();
    601 
    602   Graph::Edge a1 = graph.addEdge(n1, n2);
    603   Graph::Edge a2 = graph.addEdge(n1, n3);
    604   Graph::Edge a3 = graph.addEdge(n2, n3);
    605   Graph::Edge a4 = graph.addEdge(n3, n4);
    606  
    607   checkGraphNodeList(adaptor, 4);
    608   checkGraphArcList(adaptor, 8);
    609   checkGraphEdgeList(adaptor, 4);
    610   checkGraphConArcList(adaptor, 8);
    611   checkGraphConEdgeList(adaptor, 4);
    612 
    613   checkGraphOutArcList(adaptor, n1, 2);
    614   checkGraphOutArcList(adaptor, n2, 2);
    615   checkGraphOutArcList(adaptor, n3, 3);
    616   checkGraphOutArcList(adaptor, n4, 1);
    617 
    618   checkGraphInArcList(adaptor, n1, 2);
    619   checkGraphInArcList(adaptor, n2, 2);
    620   checkGraphInArcList(adaptor, n3, 3);
    621   checkGraphInArcList(adaptor, n4, 1);
    622 
    623   checkGraphIncEdgeList(adaptor, n1, 2);
    624   checkGraphIncEdgeList(adaptor, n2, 2);
    625   checkGraphIncEdgeList(adaptor, n3, 3);
    626   checkGraphIncEdgeList(adaptor, n4, 1);
    627 
    628 
    629   checkNodeIds(adaptor);
    630   checkArcIds(adaptor);
    631   checkEdgeIds(adaptor);
    632 
    633   checkGraphNodeMap(adaptor);
    634   checkGraphArcMap(adaptor);
    635   checkGraphEdgeMap(adaptor);
    636 }
    637 
    638552void checkSubGraphAdaptor() {
    639553  checkConcept<concepts::Graph,
     
    1054968int main(int, const char **) {
    1055969
    1056   checkDigraphAdaptor();
    1057970  checkRevDigraphAdaptor();
    1058971  checkSubDigraphAdaptor();
     
    1063976  checkSplitDigraphAdaptor();
    1064977
    1065   checkGraphAdaptor();
    1066978  checkSubGraphAdaptor();
    1067979  checkNodeSubGraphAdaptor();
Note: See TracChangeset for help on using the changeset viewer.