↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -15,34 +15,36 @@
15 15
INCLUDE(FindGhostscript)
16 16
FIND_PACKAGE(GLPK 4.33)
17 17
FIND_PACKAGE(CPLEX)
18 18
FIND_PACKAGE(COIN)
19 19

	
20 20
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
21 21

	
22 22
IF(MSVC)
23 23
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
24 24
# Suppressed warnings:
25 25
# C4250: 'class1' : inherits 'class2::member' via dominance
26 26
# C4355: 'this' : used in base member initializer list
27 27
# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
28 28
# C4996: 'function': was declared deprecated
29 29
ENDIF(MSVC)
30 30

	
31
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
32

	
31 33
INCLUDE(CheckTypeSize)
32
CHECK_TYPE_SIZE("long long" LONG_LONG)
34
CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
33 35

	
34 36
ENABLE_TESTING()
35 37

	
36 38
ADD_SUBDIRECTORY(lemon)
37 39
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
38 40
  ADD_SUBDIRECTORY(demo)
39 41
  ADD_SUBDIRECTORY(tools)
40 42
  ADD_SUBDIRECTORY(doc)
41 43
  ADD_SUBDIRECTORY(test)
42 44
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
43 45

	
44 46
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
45 47
  IF(WIN32)
46 48
    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
47 49
    SET(CPACK_PACKAGE_VENDOR "EGRES")
48 50
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
Ignore white space 6 line context
... ...
@@ -48,21 +48,21 @@
48 48

	
49 49
MARK_AS_ADVANCED(
50 50
  COIN_INCLUDE_DIR
51 51
  COIN_CBC_LIBRARY
52 52
  COIN_CBC_SOLVER_LIBRARY
53 53
  COIN_CGL_LIBRARY
54 54
  COIN_CLP_LIBRARY
55 55
  COIN_COIN_UTILS_LIBRARY
56 56
  COIN_OSI_LIBRARY
57 57
  COIN_OSI_CBC_LIBRARY
58 58
  COIN_OSI_CLP_LIBRARY
59 59
  COIN_OSI_VOL_LIBRARY
60 60
  COIN_VOL_LIBRARY
61 61
)
62 62

	
63 63
IF(COIN_FOUND)
64
  SET(HAVE_LP TRUE)
65
  SET(HAVE_MIP TRUE)
66
  SET(HAVE_CLP TRUE)
67
  SET(HAVE_CBC TRUE)
64
  SET(LEMON_HAVE_LP TRUE)
65
  SET(LEMON_HAVE_MIP TRUE)
66
  SET(LEMON_HAVE_CLP TRUE)
67
  SET(LEMON_HAVE_CBC TRUE)
68 68
ENDIF(COIN_FOUND)
Ignore white space 6 line context
... ...
@@ -8,20 +8,20 @@
8 8

	
9 9
INCLUDE(FindPackageHandleStandardArgs)
10 10
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
11 11

	
12 12
FIND_PATH(CPLEX_BIN_DIR
13 13
  cplex91.dll
14 14
  PATHS "C:/ILOG/CPLEX91/bin/x86_win32")
15 15

	
16 16
IF(CPLEX_FOUND)
17 17
  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
18 18
  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
19 19
ENDIF(CPLEX_FOUND)
20 20

	
21 21
MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
22 22

	
23 23
IF(CPLEX_FOUND)
24
  SET(HAVE_LP TRUE)
25
  SET(HAVE_MIP TRUE)
26
  SET(HAVE_CPLEX TRUE)
24
  SET(LEMON_HAVE_LP TRUE)
25
  SET(LEMON_HAVE_MIP TRUE)
26
  SET(LEMON_HAVE_CPLEX TRUE)
27 27
ENDIF(CPLEX_FOUND)
Ignore white space 6 line context
... ...
@@ -8,20 +8,20 @@
8 8
FIND_LIBRARY(GLPK_LIBRARY
9 9
  NAMES glpk
10 10
  PATHS ${GLPK_REGKEY}/lib)
11 11

	
12 12
INCLUDE(FindPackageHandleStandardArgs)
13 13
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)
14 14

	
15 15
IF(GLPK_FOUND)
16 16
  SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
17 17
  SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
18 18
  SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
19 19
ENDIF(GLPK_FOUND)
20 20

	
21 21
MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
22 22

	
23 23
IF(GLPK_FOUND)
24
  SET(HAVE_LP TRUE)
25
  SET(HAVE_MIP TRUE)
26
  SET(HAVE_GLPK TRUE)
24
  SET(LEMON_HAVE_LP TRUE)
25
  SET(LEMON_HAVE_MIP TRUE)
26
  SET(LEMON_HAVE_GLPK TRUE)
27 27
ENDIF(GLPK_FOUND)
Ignore white space 6 line context
... ...
@@ -12,33 +12,33 @@
12 12
			   [lemon_version_number()])])
13 13

	
14 14
AC_PREREQ([2.59])
15 15
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
16 16
AC_CONFIG_AUX_DIR([build-aux])
17 17
AC_CONFIG_MACRO_DIR([m4])
18 18
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc])
19 19
AC_CONFIG_SRCDIR([lemon/list_graph.h])
20 20
AC_CONFIG_HEADERS([config.h lemon/config.h])
21 21

	
22 22
dnl Do compilation tests using the C++ compiler.
23 23
AC_LANG([C++])
24 24

	
25 25
dnl Check the existence of long long type.
26 26
AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
27 27
if test x"$long_long_found" = x"yes"; then
28
  AC_DEFINE([HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
28
  AC_DEFINE([LEMON_HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
29 29
fi
30 30

	
31 31
dnl Checks for programs.
32 32
AC_PROG_CXX
33 33
AC_PROG_CXXCPP
34 34
AC_PROG_INSTALL
35 35
AC_DISABLE_SHARED
36 36
AC_PROG_LIBTOOL
37 37

	
38 38
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
39 39
AC_CHECK_PROG([gs_found],[gs],[yes],[no])
40 40

	
41 41
dnl Detect Intel compiler.
42 42
AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
43 43
AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
44 44
choke me
Ignore white space 6 line context
... ...
@@ -5,53 +5,58 @@
5 5

	
6 6
CONFIGURE_FILE(
7 7
  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
8 8
  ${CMAKE_CURRENT_BINARY_DIR}/config.h
9 9
)
10 10

	
11 11
SET(LEMON_SOURCES
12 12
  arg_parser.cc
13 13
  base.cc
14 14
  color.cc
15 15
  lp_base.cc
16 16
  lp_skeleton.cc
17 17
  random.cc
18 18
  bits/windows.cc
19 19
)
20 20

	
21
IF(HAVE_GLPK)
21
IF(LEMON_HAVE_GLPK)
22 22
  SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
23 23
  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
24 24
  IF(WIN32)
25 25
    INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
26 26
    INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
27 27
    INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
28 28
  ENDIF(WIN32)
29
ENDIF(HAVE_GLPK)
29
ENDIF(LEMON_HAVE_GLPK)
30 30

	
31
IF(HAVE_CPLEX)
31
IF(LEMON_HAVE_CPLEX)
32 32
  SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
33 33
  INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
34
ENDIF(HAVE_CPLEX)
34
ENDIF(LEMON_HAVE_CPLEX)
35 35

	
36
IF(HAVE_CLP)
36
IF(LEMON_HAVE_CLP)
37 37
  SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
38 38
  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
39
ENDIF(HAVE_CLP)
39
ENDIF(LEMON_HAVE_CLP)
40 40

	
41
IF(HAVE_CBC)
41
IF(LEMON_HAVE_CBC)
42 42
  SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
43 43
  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
44
ENDIF(HAVE_CBC)
44
ENDIF(LEMON_HAVE_CBC)
45 45

	
46 46
ADD_LIBRARY(lemon ${LEMON_SOURCES})
47 47

	
48 48
INSTALL(
49 49
  TARGETS lemon
50 50
  ARCHIVE DESTINATION lib
51 51
  COMPONENT library)
52 52

	
53 53
INSTALL(
54 54
  DIRECTORY . bits concepts
55 55
  DESTINATION include/lemon
56 56
  COMPONENT headers
57 57
  FILES_MATCHING PATTERN "*.h")
58

	
59
INSTALL(
60
  FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
61
  DESTINATION include/lemon
62
  COMPONENT headers)
Ignore white space 6 line context
... ...
@@ -48,32 +48,33 @@
48 48
endif
49 49

	
50 50
if HAVE_CBC
51 51
lemon_libemon_la_SOURCES += lemon/cbc.cc
52 52
endif
53 53

	
54 54
lemon_HEADERS += \
55 55
	lemon/adaptors.h \
56 56
	lemon/arg_parser.h \
57 57
	lemon/assert.h \
58 58
	lemon/bfs.h \
59 59
	lemon/bin_heap.h \
60 60
	lemon/circulation.h \
61 61
	lemon/clp.h \
62 62
	lemon/color.h \
63 63
	lemon/concept_check.h \
64
	lemon/config.h \
64 65
	lemon/connectivity.h \
65 66
	lemon/counter.h \
66 67
	lemon/core.h \
67 68
	lemon/cplex.h \
68 69
	lemon/dfs.h \
69 70
	lemon/dijkstra.h \
70 71
	lemon/dim2.h \
71 72
	lemon/dimacs.h \
72 73
	lemon/edge_set.h \
73 74
	lemon/elevator.h \
74 75
	lemon/error.h \
75 76
	lemon/euler.h \
76 77
	lemon/full_graph.h \
77 78
	lemon/glpk.h \
78 79
	lemon/gomory_hu.h \
79 80
	lemon/graph_to_eps.h \
Ignore white space 6 line context
... ...
@@ -84,33 +84,33 @@
84 84
    typedef VectorMap<_Graph, _Item, unsigned short> Map;
85 85
  };
86 86

	
87 87

	
88 88
  // long
89 89
  template <typename _Graph, typename _Item>
90 90
  struct DefaultMapSelector<_Graph, _Item, signed long> {
91 91
    typedef VectorMap<_Graph, _Item, signed long> Map;
92 92
  };
93 93

	
94 94
  template <typename _Graph, typename _Item>
95 95
  struct DefaultMapSelector<_Graph, _Item, unsigned long> {
96 96
    typedef VectorMap<_Graph, _Item, unsigned long> Map;
97 97
  };
98 98

	
99 99

	
100
#if defined HAVE_LONG_LONG
100
#if defined LEMON_HAVE_LONG_LONG
101 101

	
102 102
  // long long
103 103
  template <typename _Graph, typename _Item>
104 104
  struct DefaultMapSelector<_Graph, _Item, signed long long> {
105 105
    typedef VectorMap<_Graph, _Item, signed long long> Map;
106 106
  };
107 107

	
108 108
  template <typename _Graph, typename _Item>
109 109
  struct DefaultMapSelector<_Graph, _Item, unsigned long long> {
110 110
    typedef VectorMap<_Graph, _Item, unsigned long long> Map;
111 111
  };
112 112

	
113 113
#endif
114 114

	
115 115

	
116 116
  // float
Ignore white space 6 line context
1
#cmakedefine HAVE_LONG_LONG 1
2
#cmakedefine HAVE_LP 1
3
#cmakedefine HAVE_MIP 1
4
#cmakedefine HAVE_GLPK 1
5
#cmakedefine HAVE_CPLEX 1
6
#cmakedefine HAVE_CLP 1
7
#cmakedefine HAVE_CBC 1
1
#cmakedefine LEMON_HAVE_LONG_LONG 1
2
#cmakedefine LEMON_HAVE_LP 1
3
#cmakedefine LEMON_HAVE_MIP 1
4
#cmakedefine LEMON_HAVE_GLPK 1
5
#cmakedefine LEMON_HAVE_CPLEX 1
6
#cmakedefine LEMON_HAVE_CLP 1
7
#cmakedefine LEMON_HAVE_CBC 1
Ignore white space 6 line context
1 1
/* Define to 1 if you have long long */
2
#undef HAVE_LONG_LONG
2
#undef LEMON_HAVE_LONG_LONG
3 3

	
4 4
/* Define to 1 if you have any LP solver. */
5
#undef HAVE_LP
5
#undef LEMON_HAVE_LP
6 6

	
7 7
/* Define to 1 if you have any MIP solver. */
8
#undef HAVE_MIP
8
#undef LEMON_HAVE_MIP
9 9

	
10 10
/* Define to 1 if you have CPLEX. */
11
#undef HAVE_CPLEX
11
#undef LEMON_HAVE_CPLEX
12 12

	
13 13
/* Define to 1 if you have GLPK. */
14
#undef HAVE_GLPK
14
#undef LEMON_HAVE_GLPK
15 15

	
16 16
/* Define to 1 if you have SOPLEX */
17
#undef HAVE_SOPLEX
17
#undef LEMON_HAVE_SOPLEX
18 18

	
19 19
/* Define to 1 if you have CLP */
20
#undef HAVE_CLP
20
#undef LEMON_HAVE_CLP
21 21

	
22 22
/* Define to 1 if you have CBC */
23
#undef HAVE_CBC
23
#undef LEMON_HAVE_CBC
Ignore white space 6 line context
... ...
@@ -9,39 +9,39 @@
9 9
 * Permission to use, modify and distribute this software is granted
10 10
 * provided that this copyright notice appears in all copies. For
11 11
 * precise terms see the accompanying LICENSE file.
12 12
 *
13 13
 * This software is provided "AS IS" with no warranty of any kind,
14 14
 * express or implied, and with no claim as to its suitability for any
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
#ifndef LEMON_LP_H
20 20
#define LEMON_LP_H
21 21

	
22 22
#include<lemon/config.h>
23 23

	
24 24

	
25
#ifdef HAVE_GLPK
25
#ifdef LEMON_HAVE_GLPK
26 26
#include <lemon/glpk.h>
27
#elif HAVE_CPLEX
27
#elif LEMON_HAVE_CPLEX
28 28
#include <lemon/cplex.h>
29
#elif HAVE_SOPLEX
29
#elif LEMON_HAVE_SOPLEX
30 30
#include <lemon/soplex.h>
31
#elif HAVE_CLP
31
#elif LEMON_HAVE_CLP
32 32
#include <lemon/clp.h>
33 33
#endif
34 34

	
35 35
///\file
36 36
///\brief Defines a default LP solver
37 37
///\ingroup lp_group
38 38
namespace lemon {
39 39

	
40 40
#ifdef DOXYGEN
41 41
  ///The default LP solver identifier
42 42

	
43 43
  ///The default LP solver identifier.
44 44
  ///\ingroup lp_group
45 45
  ///
46 46
  ///Currently, the possible values are \c GLPK, \c CPLEX,
47 47
  ///\c SOPLEX or \c CLP
... ...
@@ -56,38 +56,38 @@
56 56

	
57 57
  ///The default MIP solver identifier
58 58

	
59 59
  ///The default MIP solver identifier.
60 60
  ///\ingroup lp_group
61 61
  ///
62 62
  ///Currently, the possible values are \c GLPK or \c CPLEX
63 63
#define LEMON_DEFAULT_MIP SOLVER
64 64
  ///The default MIP solver.
65 65

	
66 66
  ///The default MIP solver.
67 67
  ///\ingroup lp_group
68 68
  ///
69 69
  ///Currently, it is either \c GlpkMip or \c CplexMip
70 70
  typedef GlpkMip Mip;
71 71
#else
72
#ifdef HAVE_GLPK
72
#ifdef LEMON_HAVE_GLPK
73 73
# define LEMON_DEFAULT_LP GLPK
74 74
  typedef GlpkLp Lp;
75 75
# define LEMON_DEFAULT_MIP GLPK
76 76
  typedef GlpkMip Mip;
77
#elif HAVE_CPLEX
77
#elif LEMON_HAVE_CPLEX
78 78
# define LEMON_DEFAULT_LP CPLEX
79 79
  typedef CplexLp Lp;
80 80
# define LEMON_DEFAULT_MIP CPLEX
81 81
  typedef CplexMip Mip;
82
#elif HAVE_SOPLEX
82
#elif LEMON_HAVE_SOPLEX
83 83
# define DEFAULT_LP SOPLEX
84 84
  typedef SoplexLp Lp;
85
#elif HAVE_CLP
85
#elif LEMON_HAVE_CLP
86 86
# define DEFAULT_LP CLP
87 87
  typedef ClpLp Lp;  
88 88
#endif
89 89
#endif
90 90

	
91 91
} //namespace lemon
92 92

	
93 93
#endif //LEMON_LP_H
Ignore white space 6 line context
... ...
@@ -42,35 +42,35 @@
42 42

	
43 43
      int main(int argc, char** argv)
44 44
      {
45 45
        ClpModel clp;
46 46
        return 0;
47 47
      }'
48 48

	
49 49
    AC_LANG_PUSH(C++)
50 50
    AC_LINK_IFELSE([$lx_clp_test_prog], [lx_clp_found=yes], [lx_clp_found=no])
51 51
    AC_LANG_POP(C++)
52 52

	
53 53
    CXXFLAGS="$lx_save_cxxflags"
54 54
    LDFLAGS="$lx_save_ldflags"
55 55
    LIBS="$lx_save_libs"
56 56

	
57 57
    if test x"$lx_clp_found" = x"yes"; then
58
      AC_DEFINE([HAVE_CLP], [1], [Define to 1 if you have CLP.])
58
      AC_DEFINE([LEMON_HAVE_CLP], [1], [Define to 1 if you have CLP.])
59 59
      lx_lp_found=yes
60
      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
60
      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
61 61
      AC_MSG_RESULT([yes])
62 62
    else
63 63
      CLP_CXXFLAGS=""
64 64
      CLP_LDFLAGS=""
65 65
      CLP_LIBS=""
66 66
      AC_MSG_RESULT([no])
67 67
    fi
68 68
  fi
69 69
  CLP_LIBS="$CLP_LDFLAGS $CLP_LIBS"
70 70
  AC_SUBST(CLP_CXXFLAGS)
71 71
  AC_SUBST(CLP_LIBS)
72 72
  AM_CONDITIONAL([HAVE_CLP], [test x"$lx_clp_found" = x"yes"])
73 73

	
74 74

	
75 75
  lx_cbc_found=no
76 76
  if test x"$lx_clp_found" = x"yes"; then
... ...
@@ -102,35 +102,35 @@
102 102

	
103 103
        int main(int argc, char** argv)
104 104
        {
105 105
          CbcModel cbc;
106 106
          return 0;
107 107
        }'
108 108

	
109 109
      AC_LANG_PUSH(C++)
110 110
      AC_LINK_IFELSE([$lx_cbc_test_prog], [lx_cbc_found=yes], [lx_cbc_found=no])
111 111
      AC_LANG_POP(C++)
112 112

	
113 113
      CXXFLAGS="$lx_save_cxxflags"
114 114
      LDFLAGS="$lx_save_ldflags"
115 115
      LIBS="$lx_save_libs"
116 116

	
117 117
      if test x"$lx_cbc_found" = x"yes"; then
118
        AC_DEFINE([HAVE_CBC], [1], [Define to 1 if you have CBC.])
118
        AC_DEFINE([LEMON_HAVE_CBC], [1], [Define to 1 if you have CBC.])
119 119
        lx_lp_found=yes
120
        AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
120
        AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
121 121
        lx_mip_found=yes
122
        AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
122
        AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
123 123
        AC_MSG_RESULT([yes])
124 124
      else
125 125
        CBC_CXXFLAGS=""
126 126
        CBC_LDFLAGS=""
127 127
        CBC_LIBS=""
128 128
        AC_MSG_RESULT([no])
129 129
      fi
130 130
    fi
131 131
  fi
132 132
  CBC_LIBS="$CBC_LDFLAGS $CBC_LIBS"
133 133
  AC_SUBST(CBC_CXXFLAGS)
134 134
  AC_SUBST(CBC_LIBS)
135 135
  AM_CONDITIONAL([HAVE_CBC], [test x"$lx_cbc_found" = x"yes"])
136 136
])
Ignore white space 32 line context
... ...
@@ -48,34 +48,34 @@
48 48

	
49 49
      int main(int argc, char** argv)
50 50
      {
51 51
        CPXENVptr env = NULL;
52 52
        return 0;
53 53
      }'
54 54

	
55 55
    AC_LANG_PUSH(C++)
56 56
    AC_LINK_IFELSE([$lx_cplex_test_prog], [lx_cplex_found=yes], [lx_cplex_found=no])
57 57
    AC_LANG_POP(C++)
58 58

	
59 59
    CXXFLAGS="$lx_save_cxxflags"
60 60
    LDFLAGS="$lx_save_ldflags"
61 61
    LIBS="$lx_save_libs"
62 62

	
63 63
    if test x"$lx_cplex_found" = x"yes"; then
64
      AC_DEFINE([HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
64
      AC_DEFINE([LEMON_HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
65 65
      lx_lp_found=yes
66
      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
66
      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
67 67
      lx_mip_found=yes
68
      AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
68
      AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
69 69
      AC_MSG_RESULT([yes])
70 70
    else
71 71
      CPLEX_CFLAGS=""
72 72
      CPLEX_LDFLAGS=""
73 73
      CPLEX_LIBS=""
74 74
      AC_MSG_RESULT([no])
75 75
    fi
76 76
  fi
77 77
  CPLEX_LIBS="$CPLEX_LDFLAGS $CPLEX_LIBS"
78 78
  AC_SUBST(CPLEX_CFLAGS)
79 79
  AC_SUBST(CPLEX_LIBS)
80 80
  AM_CONDITIONAL([HAVE_CPLEX], [test x"$lx_cplex_found" = x"yes"])
81 81
])
Ignore white space 6 line context
... ...
@@ -51,34 +51,34 @@
51 51
      {
52 52
        LPX *lp;
53 53
        lp = lpx_create_prob();
54 54
        lpx_delete_prob(lp);
55 55
        return 0;
56 56
      }'
57 57

	
58 58
    AC_LANG_PUSH(C++)
59 59
    AC_LINK_IFELSE([$lx_glpk_test_prog], [lx_glpk_found=yes], [lx_glpk_found=no])
60 60
    AC_LANG_POP(C++)
61 61

	
62 62
    CXXFLAGS="$lx_save_cxxflags"
63 63
    LDFLAGS="$lx_save_ldflags"
64 64
    LIBS="$lx_save_libs"
65 65

	
66 66
    if test x"$lx_glpk_found" = x"yes"; then
67
      AC_DEFINE([HAVE_GLPK], [1], [Define to 1 if you have GLPK.])
67
      AC_DEFINE([LEMON_HAVE_GLPK], [1], [Define to 1 if you have GLPK.])
68 68
      lx_lp_found=yes
69
      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
69
      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
70 70
      lx_mip_found=yes
71
      AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
71
      AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
72 72
      AC_MSG_RESULT([yes])
73 73
    else
74 74
      GLPK_CFLAGS=""
75 75
      GLPK_LDFLAGS=""
76 76
      GLPK_LIBS=""
77 77
      AC_MSG_RESULT([no])
78 78
    fi
79 79
  fi
80 80
  GLPK_LIBS="$GLPK_LDFLAGS $GLPK_LIBS"
81 81
  AC_SUBST(GLPK_CFLAGS)
82 82
  AC_SUBST(GLPK_LIBS)
83 83
  AM_CONDITIONAL([HAVE_GLPK], [test x"$lx_glpk_found" = x"yes"])
84 84
])
Ignore white space 6 line context
... ...
@@ -42,32 +42,32 @@
42 42

	
43 43
      int main(int argc, char** argv)
44 44
      {
45 45
        soplex::SoPlex soplex;
46 46
        return 0;
47 47
      }'
48 48

	
49 49
    AC_LANG_PUSH(C++)
50 50
    AC_LINK_IFELSE([$lx_soplex_test_prog], [lx_soplex_found=yes], [lx_soplex_found=no])
51 51
    AC_LANG_POP(C++)
52 52

	
53 53
    CXXFLAGS="$lx_save_cxxflags"
54 54
    LDFLAGS="$lx_save_ldflags"
55 55
    LIBS="$lx_save_libs"
56 56

	
57 57
    if test x"$lx_soplex_found" = x"yes"; then
58
      AC_DEFINE([HAVE_SOPLEX], [1], [Define to 1 if you have SOPLEX.])
58
      AC_DEFINE([LEMON_HAVE_SOPLEX], [1], [Define to 1 if you have SOPLEX.])
59 59
      lx_lp_found=yes
60
      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
60
      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
61 61
      AC_MSG_RESULT([yes])
62 62
    else
63 63
      SOPLEX_CXXFLAGS=""
64 64
      SOPLEX_LDFLAGS=""
65 65
      SOPLEX_LIBS=""
66 66
      AC_MSG_RESULT([no])
67 67
    fi
68 68
  fi
69 69
  SOPLEX_LIBS="$SOPLEX_LDFLAGS $SOPLEX_LIBS"
70 70
  AC_SUBST(SOPLEX_CXXFLAGS)
71 71
  AC_SUBST(SOPLEX_LIBS)
72 72
  AM_CONDITIONAL([HAVE_SOPLEX], [test x"$lx_soplex_found" = x"yes"])
73 73
])
Ignore white space 6 line context
... ...
@@ -23,87 +23,87 @@
23 23
  graph_utils_test
24 24
  hao_orlin_test
25 25
  heap_test
26 26
  kruskal_test
27 27
  maps_test
28 28
  matching_test
29 29
  min_cost_arborescence_test
30 30
  min_cost_flow_test
31 31
  path_test
32 32
  preflow_test
33 33
  radix_sort_test
34 34
  random_test
35 35
  suurballe_test
36 36
  time_measure_test
37 37
  unionfind_test)
38 38

	
39
IF(HAVE_LP)
39
IF(LEMON_HAVE_LP)
40 40
  ADD_EXECUTABLE(lp_test lp_test.cc)
41 41
  SET(LP_TEST_LIBS lemon)
42
  IF(HAVE_GLPK)
42
  IF(LEMON_HAVE_GLPK)
43 43
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
44
  ENDIF(HAVE_GLPK)
45
  IF(HAVE_CPLEX)
44
  ENDIF(LEMON_HAVE_GLPK)
45
  IF(LEMON_HAVE_CPLEX)
46 46
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
47
  ENDIF(HAVE_CPLEX)
48
  IF(HAVE_CLP)
47
  ENDIF(LEMON_HAVE_CPLEX)
48
  IF(LEMON_HAVE_CLP)
49 49
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
50
  ENDIF(HAVE_CLP)
50
  ENDIF(LEMON_HAVE_CLP)
51 51
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
52 52
  ADD_TEST(lp_test lp_test)
53 53

	
54
  IF(WIN32 AND HAVE_GLPK)
54
  IF(WIN32 AND LEMON_HAVE_GLPK)
55 55
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
56 56
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
57 57
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
58 58
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
59 59
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
60 60
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
61 61
    )
62
  ENDIF(WIN32 AND HAVE_GLPK)
63
  IF(WIN32 AND HAVE_CPLEX)
62
  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
63
  IF(WIN32 AND LEMON_HAVE_CPLEX)
64 64
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
65 65
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
66 66
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
67 67
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
68 68
    )
69
  ENDIF(WIN32 AND HAVE_CPLEX)
70
ENDIF(HAVE_LP)
69
  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
70
ENDIF(LEMON_HAVE_LP)
71 71

	
72
IF(HAVE_MIP)
72
IF(LEMON_HAVE_MIP)
73 73
  ADD_EXECUTABLE(mip_test mip_test.cc)
74 74
  SET(MIP_TEST_LIBS lemon)
75
  IF(HAVE_GLPK)
75
  IF(LEMON_HAVE_GLPK)
76 76
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
77
  ENDIF(HAVE_GLPK)
78
  IF(HAVE_CPLEX)
77
  ENDIF(LEMON_HAVE_GLPK)
78
  IF(LEMON_HAVE_CPLEX)
79 79
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
80
  ENDIF(HAVE_CPLEX)
81
  IF(HAVE_CBC)
80
  ENDIF(LEMON_HAVE_CPLEX)
81
  IF(LEMON_HAVE_CBC)
82 82
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
83
  ENDIF(HAVE_CBC)
83
  ENDIF(LEMON_HAVE_CBC)
84 84
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
85 85
  ADD_TEST(mip_test mip_test)
86 86

	
87
  IF(WIN32 AND HAVE_GLPK)
87
  IF(WIN32 AND LEMON_HAVE_GLPK)
88 88
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
89 89
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
90 90
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
91 91
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
92 92
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
93 93
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
94 94
    )
95
  ENDIF(WIN32 AND HAVE_GLPK)
96
  IF(WIN32 AND HAVE_CPLEX)
95
  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
96
  IF(WIN32 AND LEMON_HAVE_CPLEX)
97 97
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
98 98
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
99 99
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
100 100
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
101 101
    )
102
  ENDIF(WIN32 AND HAVE_CPLEX)
103
ENDIF(HAVE_MIP)
102
  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
103
ENDIF(LEMON_HAVE_MIP)
104 104

	
105 105
FOREACH(TEST_NAME ${TESTS})
106 106
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
107 107
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
108 108
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
109 109
ENDFOREACH(TEST_NAME)
Ignore white space 6 line context
... ...
@@ -12,45 +12,45 @@
12 12
 *
13 13
 * This software is provided "AS IS" with no warranty of any kind,
14 14
 * express or implied, and with no claim as to its suitability for any
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
#include <sstream>
20 20
#include <lemon/lp_skeleton.h>
21 21
#include "test_tools.h"
22 22
#include <lemon/tolerance.h>
23 23

	
24 24
#ifdef HAVE_CONFIG_H
25 25
#include <lemon/config.h>
26 26
#endif
27 27

	
28
#ifdef HAVE_GLPK
28
#ifdef LEMON_HAVE_GLPK
29 29
#include <lemon/glpk.h>
30 30
#endif
31 31

	
32
#ifdef HAVE_CPLEX
32
#ifdef LEMON_HAVE_CPLEX
33 33
#include <lemon/cplex.h>
34 34
#endif
35 35

	
36
#ifdef HAVE_SOPLEX
36
#ifdef LEMON_HAVE_SOPLEX
37 37
#include <lemon/soplex.h>
38 38
#endif
39 39

	
40
#ifdef HAVE_CLP
40
#ifdef LEMON_HAVE_CLP
41 41
#include <lemon/clp.h>
42 42
#endif
43 43

	
44 44
using namespace lemon;
45 45

	
46 46
void lpTest(LpSolver& lp)
47 47
{
48 48

	
49 49
  typedef LpSolver LP;
50 50

	
51 51
  std::vector<LP::Col> x(10);
52 52
  //  for(int i=0;i<10;i++) x.push_back(lp.addCol());
53 53
  lp.addColSet(x);
54 54
  lp.colLowerBound(x,1);
55 55
  lp.colUpperBound(x,1);
56 56
  lp.colBounds(x,1,2);
... ...
@@ -366,56 +366,56 @@
366 366
{
367 367
  //Test for clone/new
368 368

	
369 369
  LP* lp = new LP();
370 370
  LP* lpnew = lp->newSolver();
371 371
  LP* lpclone = lp->cloneSolver();
372 372
  delete lp;
373 373
  delete lpnew;
374 374
  delete lpclone;
375 375
}
376 376

	
377 377
int main()
378 378
{
379 379
  LpSkeleton lp_skel;
380 380
  lpTest(lp_skel);
381 381

	
382
#ifdef HAVE_GLPK
382
#ifdef LEMON_HAVE_GLPK
383 383
  {
384 384
    GlpkLp lp_glpk1,lp_glpk2;
385 385
    lpTest(lp_glpk1);
386 386
    aTest(lp_glpk2);
387 387
    cloneTest<GlpkLp>();
388 388
  }
389 389
#endif
390 390

	
391
#ifdef HAVE_CPLEX
391
#ifdef LEMON_HAVE_CPLEX
392 392
  try {
393 393
    CplexLp lp_cplex1,lp_cplex2;
394 394
    lpTest(lp_cplex1);
395 395
    aTest(lp_cplex2);
396 396
    cloneTest<CplexLp>();
397 397
  } catch (CplexEnv::LicenseError& error) {
398 398
    check(false, error.what());
399 399
  }
400 400
#endif
401 401

	
402
#ifdef HAVE_SOPLEX
402
#ifdef LEMON_HAVE_SOPLEX
403 403
  {
404 404
    SoplexLp lp_soplex1,lp_soplex2;
405 405
    lpTest(lp_soplex1);
406 406
    aTest(lp_soplex2);
407 407
    cloneTest<SoplexLp>();
408 408
  }
409 409
#endif
410 410

	
411
#ifdef HAVE_CLP
411
#ifdef LEMON_HAVE_CLP
412 412
  {
413 413
    ClpLp lp_clp1,lp_clp2;
414 414
    lpTest(lp_clp1);
415 415
    aTest(lp_clp2);
416 416
    cloneTest<ClpLp>();
417 417
  }
418 418
#endif
419 419

	
420 420
  return 0;
421 421
}
Ignore white space 6 line context
... ...
@@ -9,41 +9,41 @@
9 9
 * Permission to use, modify and distribute this software is granted
10 10
 * provided that this copyright notice appears in all copies. For
11 11
 * precise terms see the accompanying LICENSE file.
12 12
 *
13 13
 * This software is provided "AS IS" with no warranty of any kind,
14 14
 * express or implied, and with no claim as to its suitability for any
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
#include "test_tools.h"
20 20

	
21 21
#ifdef HAVE_CONFIG_H
22 22
#include <lemon/config.h>
23 23
#endif
24 24

	
25
#ifdef HAVE_CPLEX
25
#ifdef LEMON_HAVE_CPLEX
26 26
#include <lemon/cplex.h>
27 27
#endif
28 28

	
29
#ifdef HAVE_GLPK
29
#ifdef LEMON_HAVE_GLPK
30 30
#include <lemon/glpk.h>
31 31
#endif
32 32

	
33
#ifdef HAVE_CBC
33
#ifdef LEMON_HAVE_CBC
34 34
#include <lemon/cbc.h>
35 35
#endif
36 36

	
37 37

	
38 38
using namespace lemon;
39 39

	
40 40
void solveAndCheck(MipSolver& mip, MipSolver::ProblemType stat,
41 41
                   double exp_opt) {
42 42
  using std::string;
43 43

	
44 44
  mip.solve();
45 45
  //int decimal,sign;
46 46
  std::ostringstream buf;
47 47
  buf << "Type should be: " << int(stat)<<" and it is "<<int(mip.type());
48 48

	
49 49

	
... ...
@@ -116,45 +116,45 @@
116 116

	
117 117
template<class MIP>
118 118
void cloneTest()
119 119
{
120 120

	
121 121
  MIP* mip = new MIP();
122 122
  MIP* mipnew = mip->newSolver();
123 123
  MIP* mipclone = mip->cloneSolver();
124 124
  delete mip;
125 125
  delete mipnew;
126 126
  delete mipclone;
127 127
}
128 128

	
129 129
int main()
130 130
{
131 131

	
132
#ifdef HAVE_GLPK
132
#ifdef LEMON_HAVE_GLPK
133 133
  {
134 134
    GlpkMip mip1;
135 135
    aTest(mip1);
136 136
    cloneTest<GlpkMip>();
137 137
  }
138 138
#endif
139 139

	
140
#ifdef HAVE_CPLEX
140
#ifdef LEMON_HAVE_CPLEX
141 141
  try {
142 142
    CplexMip mip2;
143 143
    aTest(mip2);
144 144
    cloneTest<CplexMip>();
145 145
  } catch (CplexEnv::LicenseError& error) {
146 146
    check(false, error.what());
147 147
  }
148 148
#endif
149 149

	
150
#ifdef HAVE_CBC
150
#ifdef LEMON_HAVE_CBC
151 151
  {
152 152
    CbcMip mip1;
153 153
    aTest(mip1);
154 154
    cloneTest<CbcMip>();
155 155
  }
156 156
#endif
157 157

	
158 158
  return 0;
159 159

	
160 160
}
Ignore white space 6 line context
... ...
@@ -187,33 +187,33 @@
187 187

	
188 188
int main(int argc, const char *argv[]) {
189 189
  typedef SmartDigraph Digraph;
190 190

	
191 191
  typedef Digraph::Arc Arc;
192 192

	
193 193
  std::string inputName;
194 194
  std::string outputName;
195 195

	
196 196
  ArgParser ap(argc, argv);
197 197
  ap.other("[INFILE [OUTFILE]]",
198 198
           "If either the INFILE or OUTFILE file is missing the standard\n"
199 199
           "     input/output will be used instead.")
200 200
    .boolOption("q", "Do not print any report")
201 201
    .boolOption("int","Use 'int' for capacities, costs etc. (default)")
202 202
    .optionGroup("datatype","int")
203
#ifdef HAVE_LONG_LONG
203
#ifdef LEMON_HAVE_LONG_LONG
204 204
    .boolOption("long","Use 'long long' for capacities, costs etc.")
205 205
    .optionGroup("datatype","long")
206 206
#endif
207 207
    .boolOption("double","Use 'double' for capacities, costs etc.")
208 208
    .optionGroup("datatype","double")
209 209
    .boolOption("ldouble","Use 'long double' for capacities, costs etc.")
210 210
    .optionGroup("datatype","ldouble")
211 211
    .onlyOneGroup("datatype")
212 212
    .stringOption("infcap","Value used for 'very high' capacities","0")
213 213
    .run();
214 214

	
215 215
  std::ifstream input;
216 216
  std::ofstream output;
217 217

	
218 218
  switch(ap.files().size())
219 219
    {
... ...
@@ -254,24 +254,24 @@
254 254
        case DimacsDescriptor::MAT:
255 255
          std::cout << "mat";
256 256
          break;
257 257
        default:
258 258
          exit(1);
259 259
          break;
260 260
        }
261 261
      std::cout << "\nNum of nodes: " << desc.nodeNum;
262 262
      std::cout << "\nNum of arcs:  " << desc.edgeNum;
263 263
      std::cout << "\n\n";
264 264
    }
265 265
    
266 266
  if(ap.given("double"))
267 267
    solve<double>(ap,is,os,desc);
268 268
  else if(ap.given("ldouble"))
269 269
    solve<long double>(ap,is,os,desc);
270
#ifdef HAVE_LONG_LONG
270
#ifdef LEMON_HAVE_LONG_LONG
271 271
  else if(ap.given("long"))
272 272
    solve<long long>(ap,is,os,desc);
273 273
#endif
274 274
  else solve<int>(ap,is,os,desc);
275 275

	
276 276
  return 0;
277 277
}
0 comments (0 inline)