#include #include #include #include "test_tools.h" using namespace lemon; using namespace lemon::concept; struct A {}; struct B {}; class F { public: typedef A argument_type; typedef B result_type; B operator()(const A &) const {return B();} }; int func(A) {return 3;} int binc(int, B) {return 4;} typedef ReadMap DoubleMap; int main() { // checking graph components checkConcept, ReadMap >(); checkConcept, WriteMap >(); checkConcept, ReadWriteMap >(); checkConcept, ReferenceMap >(); checkConcept, AddMap >(); checkConcept, SubMap >(); checkConcept, MulMap >(); checkConcept, DivMap >(); checkConcept, NegMap >(); checkConcept, AbsMap >(); checkConcept, ShiftMap >(); checkConcept, ScaleMap >(); checkConcept, ComposeMap > >(); checkConcept, FunctorMap >(); int a; a=mapFunctor(constMap(2))(A()); check(a==2,"Something is wrong with mapFunctor"); B b; b=functorMap(F())[A()]; a=functorMap(&func)[A()]; check(a==3,"Something is wrong with functorMap"); a=combineMap(constMap(), identityMap(), &binc)[B()]; check(a==4,"Something is wrong with combineMap"); std::cout << __FILE__ ": All tests passed.\n"; return 0; }