test/lp_test.cc
changeset 1361 df2d4bf31fcb
parent 1300 62dba6c90f35
child 1427 57abff252556
equal deleted inserted replaced
22:d677c58cf607 23:ae155e35588d
    18 
    18 
    19 #include <sstream>
    19 #include <sstream>
    20 #include <lemon/lp_skeleton.h>
    20 #include <lemon/lp_skeleton.h>
    21 #include "test_tools.h"
    21 #include "test_tools.h"
    22 #include <lemon/tolerance.h>
    22 #include <lemon/tolerance.h>
    23 
    23 #include <lemon/concept_check.h>
    24 #include <lemon/config.h>
    24 #include <lemon/config.h>
    25 
    25 
    26 #ifdef LEMON_HAVE_GLPK
    26 #ifdef LEMON_HAVE_GLPK
    27 #include <lemon/glpk.h>
    27 #include <lemon/glpk.h>
    28 #endif
    28 #endif
    45 using namespace lemon;
    45 using namespace lemon;
    46 
    46 
    47 int countCols(LpBase & lp) {
    47 int countCols(LpBase & lp) {
    48   int count=0;
    48   int count=0;
    49   for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count;
    49   for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count;
       
    50 #ifdef LEMON_CXX11
       
    51   int cnt = 0;
       
    52   for(auto c: lp.cols()) { cnt++; ::lemon::ignore_unused_variable_warning(c); }
       
    53   check(count == cnt, "Wrong STL iterator");
       
    54 #endif
    50   return count;
    55   return count;
    51 }
    56 }
    52 
    57 
    53 int countRows(LpBase & lp) {
    58 int countRows(LpBase & lp) {
    54   int count=0;
    59   int count=0;
    55   for (LpBase::RowIt r(lp); r!=INVALID; ++r) ++count;
    60   for (LpBase::RowIt r(lp); r!=INVALID; ++r) ++count;
       
    61 #ifdef LEMON_CXX11
       
    62   int cnt = 0;
       
    63   for(auto r: lp.rows()) { cnt++; ::lemon::ignore_unused_variable_warning(r); }
       
    64   check(count == cnt, "Wrong STL iterator");
       
    65 #endif
    56   return count;
    66   return count;
    57 }
    67 }
    58 
    68 
    59 
    69 
    60 void lpTest(LpSolver& lp)
    70 void lpTest(LpSolver& lp)