test/min_mean_cycle_test.cc
changeset 764 1fac515a59c1
parent 763 93cd93e82f9b
child 765 3b544a9c92db
equal deleted inserted replaced
0:5eb6ec6c5a76 1:50744cf65886
    19 #include <iostream>
    19 #include <iostream>
    20 #include <sstream>
    20 #include <sstream>
    21 
    21 
    22 #include <lemon/smart_graph.h>
    22 #include <lemon/smart_graph.h>
    23 #include <lemon/lgf_reader.h>
    23 #include <lemon/lgf_reader.h>
    24 #include <lemon/min_mean_cycle.h>
    24 #include <lemon/howard.h>
    25 #include <lemon/path.h>
    25 #include <lemon/path.h>
    26 #include <lemon/concepts/digraph.h>
    26 #include <lemon/concepts/digraph.h>
    27 #include <lemon/concept_check.h>
    27 #include <lemon/concept_check.h>
    28 
    28 
    29 #include "test_tools.h"
    29 #include "test_tools.h"
   139   #endif
   139   #endif
   140 
   140 
   141   // Check the interface
   141   // Check the interface
   142   {
   142   {
   143     typedef concepts::Digraph GR;
   143     typedef concepts::Digraph GR;
   144     typedef MinMeanCycle<GR, concepts::ReadMap<GR::Arc, int> > IntMmcAlg;
   144     typedef Howard<GR, concepts::ReadMap<GR::Arc, int> > IntMmcAlg;
   145     typedef MinMeanCycle<GR, concepts::ReadMap<GR::Arc, float> > FloatMmcAlg;
   145     typedef Howard<GR, concepts::ReadMap<GR::Arc, float> > FloatMmcAlg;
   146     
   146     
   147     checkConcept<MmcClassConcept<GR, int>, IntMmcAlg>();
   147     checkConcept<MmcClassConcept<GR, int>, IntMmcAlg>();
   148     checkConcept<MmcClassConcept<GR, float>, FloatMmcAlg>();
   148     checkConcept<MmcClassConcept<GR, float>, FloatMmcAlg>();
   149   
   149   
   150     if (IsSameType<IntMmcAlg::LargeValue, long_int>::result == 0)
   150     if (IsSameType<IntMmcAlg::LargeValue, long_int>::result == 0)
   172       arcMap("c2", c2).
   172       arcMap("c2", c2).
   173       arcMap("c3", c3).
   173       arcMap("c3", c3).
   174       arcMap("c4", c4).
   174       arcMap("c4", c4).
   175       run();
   175       run();
   176 
   176 
   177     checkMmcAlg<MinMeanCycle<GR, IntArcMap> >(gr, l1, c1,  6, 3);
   177     checkMmcAlg<Howard<GR, IntArcMap> >(gr, l1, c1,  6, 3);
   178     checkMmcAlg<MinMeanCycle<GR, IntArcMap> >(gr, l2, c2,  5, 2);
   178     checkMmcAlg<Howard<GR, IntArcMap> >(gr, l2, c2,  5, 2);
   179     checkMmcAlg<MinMeanCycle<GR, IntArcMap> >(gr, l3, c3,  0, 1);
   179     checkMmcAlg<Howard<GR, IntArcMap> >(gr, l3, c3,  0, 1);
   180     checkMmcAlg<MinMeanCycle<GR, IntArcMap> >(gr, l4, c4, -1, 1);
   180     checkMmcAlg<Howard<GR, IntArcMap> >(gr, l4, c4, -1, 1);
   181   }
   181   }
   182 
   182 
   183   return 0;
   183   return 0;
   184 }
   184 }