test/graph_adaptor_test.cc
author deba
Tue, 31 Jan 2006 19:33:48 +0000
changeset 1931 6abf67b02ff5
parent 1875 98698b69a902
child 1956 a055123339d5
permissions -rw-r--r--
New iterable map with comparable values
it uses linked lists and balanced binary tree

IterableBoolMap has ItemIt type as the other iterable maps

InvertableMap got ValueIterator
     1 /* -*- C++ -*-
     2  * test/graph_adaptor_test.cc - Part of LEMON, a generic C++ optimization library
     3  *
     4  * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6  *
     7  * Permission to use, modify and distribute this software is granted
     8  * provided that this copyright notice appears in all copies. For
     9  * precise terms see the accompanying LICENSE file.
    10  *
    11  * This software is provided "AS IS" with no warranty of any kind,
    12  * express or implied, and with no claim as to its suitability for any
    13  * purpose.
    14  *
    15  */
    16 
    17 #include<iostream>
    18 #include<lemon/concept_check.h>
    19 
    20 #include<lemon/smart_graph.h>
    21 #include<lemon/concept/graph.h>
    22 #include<lemon/concept/ugraph.h>
    23 
    24 #include<lemon/list_graph.h>
    25 #include<lemon/full_graph.h>
    26 #include<lemon/graph_adaptor.h>
    27 
    28 #include"test/test_tools.h"
    29 #include"test/graph_test.h"
    30 
    31 /**
    32 \file
    33 This test makes consistency checks of graph adaptors.
    34 
    35 \todo More extensive tests are needed 
    36 */
    37 
    38 using namespace lemon;
    39 using namespace lemon::concept;
    40 
    41 
    42 
    43 int main() 
    44 {
    45   {
    46     typedef StaticGraph Graph;
    47     checkConcept<StaticGraph, GraphAdaptor<Graph> >();
    48 
    49     checkConcept<StaticGraph, RevGraphAdaptor<Graph> >();
    50 
    51     checkConcept<StaticGraph, SubGraphAdaptor<Graph, 
    52       Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
    53     checkConcept<StaticGraph, NodeSubGraphAdaptor<Graph, 
    54       Graph::NodeMap<bool> > >();
    55     checkConcept<StaticGraph, EdgeSubGraphAdaptor<Graph, 
    56       Graph::EdgeMap<bool> > >();
    57     
    58     checkConcept<StaticGraph, SubBidirGraphAdaptor<Graph, 
    59       Graph::EdgeMap<bool>, Graph::EdgeMap<bool> > >();
    60     //    checkConcept<StaticGraph, BidirGraph<Graph> >();
    61     checkConcept<StaticGraph, ResGraphAdaptor<Graph, int, 
    62       Graph::EdgeMap<int>, Graph::EdgeMap<int> > >();
    63 
    64     checkConcept<StaticGraph, ErasingFirstGraphAdaptor<Graph, 
    65       Graph::NodeMap<Graph::Edge> > >(); 
    66 
    67     /// \bug why does not compile with StaticGraph
    68     checkConcept<BaseIterableUGraphConcept, UGraphAdaptor<ListGraph> >();
    69     checkConcept<IterableUGraphConcept, UGraphAdaptor<ListGraph> >();
    70     checkConcept<MappableUGraphConcept, UGraphAdaptor<ListGraph> >();
    71   }
    72   std::cout << __FILE__ ": All tests passed.\n";
    73 
    74   return 0;
    75 }