test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Wed, 29 Apr 2009 03:15:24 +0200
changeset 640 6c408d864fa1
parent 620 c3ce597c11ae
child 627 20dac2104519
permissions -rw-r--r--
Support negative costs and bounds in NetworkSimplex (#270)

* The interface is reworked to support negative costs and bounds.
- ProblemType and problemType() are renamed to
SupplyType and supplyType(), see also #234.
- ProblemType type is introduced similarly to the LP interface.
- 'bool run()' is replaced by 'ProblemType run()' to handle
unbounded problem instances, as well.
- Add INF public member constant similarly to the LP interface.
* Remove capacityMap() and boundMaps(), see also #266.
* Update the problem definition in the MCF module.
* Remove the usage of Circulation (and adaptors) for checking feasibility.
Check feasibility by examining the artifical arcs instead (after solving
the problem).
* Additional check for unbounded negative cycles found during the
algorithm (it is possible now, since negative costs are allowed).
* Fix in the constructor (the value types needn't be integer any more),
see also #254.
* Improve and extend the doc.
* Rework the test file and add test cases for negative costs and bounds.
     1 INCLUDE_DIRECTORIES(
     2   ${PROJECT_SOURCE_DIR}
     3   ${PROJECT_BINARY_DIR}
     4 )
     5 
     6 LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
     7 
     8 SET(TESTS
     9   adaptors_test
    10   bfs_test
    11   circulation_test
    12   counter_test
    13   dfs_test
    14   digraph_test
    15   dijkstra_test
    16   dim_test
    17   edge_set_test
    18   error_test
    19   euler_test
    20   gomory_hu_test
    21   graph_copy_test
    22   graph_test
    23   graph_utils_test
    24   hao_orlin_test
    25   heap_test
    26   kruskal_test
    27   maps_test
    28   matching_test
    29   min_cost_arborescence_test
    30   min_cost_flow_test
    31   path_test
    32   preflow_test
    33   radix_sort_test
    34   random_test
    35   suurballe_test
    36   time_measure_test
    37   unionfind_test)
    38 
    39 IF(HAVE_LP)
    40   ADD_EXECUTABLE(lp_test lp_test.cc)
    41   SET(LP_TEST_LIBS lemon)
    42   IF(HAVE_GLPK)
    43     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    44   ENDIF(HAVE_GLPK)
    45   IF(HAVE_CPLEX)
    46     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    47   ENDIF(HAVE_CPLEX)
    48   IF(HAVE_CLP)
    49     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    50   ENDIF(HAVE_CLP)
    51   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    52   ADD_TEST(lp_test lp_test)
    53 
    54   IF(WIN32 AND HAVE_GLPK)
    55     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    56     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    57     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    58       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    59       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    60       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    61     )
    62   ENDIF(WIN32 AND HAVE_GLPK)
    63   IF(WIN32 AND HAVE_CPLEX)
    64     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    65     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    66     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    67       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    68     )
    69   ENDIF(WIN32 AND HAVE_CPLEX)
    70 ENDIF(HAVE_LP)
    71 
    72 IF(HAVE_MIP)
    73   ADD_EXECUTABLE(mip_test mip_test.cc)
    74   SET(MIP_TEST_LIBS lemon)
    75   IF(HAVE_GLPK)
    76     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    77   ENDIF(HAVE_GLPK)
    78   IF(HAVE_CPLEX)
    79     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    80   ENDIF(HAVE_CPLEX)
    81   IF(HAVE_CBC)
    82     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    83   ENDIF(HAVE_CBC)
    84   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    85   ADD_TEST(mip_test mip_test)
    86 
    87   IF(WIN32 AND HAVE_GLPK)
    88     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    89     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    90     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    91       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    92       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    93       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    94     )
    95   ENDIF(WIN32 AND HAVE_GLPK)
    96   IF(WIN32 AND HAVE_CPLEX)
    97     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    98     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    99     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   100       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   101     )
   102   ENDIF(WIN32 AND HAVE_CPLEX)
   103 ENDIF(HAVE_MIP)
   104 
   105 FOREACH(TEST_NAME ${TESTS})
   106   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
   107   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   108   ADD_TEST(${TEST_NAME} ${TEST_NAME})
   109 ENDFOREACH(TEST_NAME)