Changeset 1134:f70f688d9ef9 in lemon-main
- Timestamp:
- 04/28/15 18:07:07 (10 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r1123 r1134 66 66 FIND_PACKAGE(Doxygen) 67 67 FIND_PACKAGE(Ghostscript) 68 69 IF(WIN32) 70 SET(LEMON_WIN32 TRUE) 71 ENDIF(WIN32) 68 72 69 73 SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.") -
lemon/bits/windows.cc
r1092 r1134 22 22 #include<lemon/bits/windows.h> 23 23 24 #ifdef WIN3224 #ifdef LEMON_WIN32 25 25 #ifndef WIN32_LEAN_AND_MEAN 26 26 #define WIN32_LEAN_AND_MEAN … … 41 41 #include <unistd.h> 42 42 #include <ctime> 43 #ifndef WIN3243 #ifndef LEMON_WIN32 44 44 #include <sys/times.h> 45 45 #endif … … 56 56 double &cutime, double &cstime) 57 57 { 58 #ifdef WIN3258 #ifdef LEMON_WIN32 59 59 static const double ch = 4294967296.0e-7; 60 60 static const double cl = 1.0e-7; … … 95 95 { 96 96 std::ostringstream os; 97 #ifdef WIN3297 #ifdef LEMON_WIN32 98 98 SYSTEMTIME time; 99 99 GetSystemTime(&time); 100 100 char buf1[11], buf2[9], buf3[5]; 101 101 if (GetDateFormat(MY_LOCALE, 0, &time, 102 102 ("ddd MMM dd"), buf1, 11) && 103 103 GetTimeFormat(MY_LOCALE, 0, &time, … … 121 121 int getWinRndSeed() 122 122 { 123 #ifdef WIN32123 #ifdef LEMON_WIN32 124 124 FILETIME time; 125 125 GetSystemTimeAsFileTime(&time); … … 133 133 134 134 WinLock::WinLock() { 135 #ifdef WIN32135 #ifdef LEMON_WIN32 136 136 CRITICAL_SECTION *lock = new CRITICAL_SECTION; 137 137 InitializeCriticalSection(lock); … … 143 143 144 144 WinLock::~WinLock() { 145 #ifdef WIN32145 #ifdef LEMON_WIN32 146 146 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 147 147 DeleteCriticalSection(lock); … … 151 151 152 152 void WinLock::lock() { 153 #ifdef WIN32153 #ifdef LEMON_WIN32 154 154 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 155 155 EnterCriticalSection(lock); … … 158 158 159 159 void WinLock::unlock() { 160 #ifdef WIN32160 #ifdef LEMON_WIN32 161 161 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 162 162 LeaveCriticalSection(lock); -
lemon/bits/windows.h
r1092 r1134 20 20 #define LEMON_BITS_WINDOWS_H 21 21 22 #include <lemon/config.h> 22 23 #include <string> 23 24 … … 35 36 ~WinLock(); 36 37 void lock(); 37 void unlock(); 38 void unlock();\ 38 39 private: 39 40 void *_repr; -
lemon/config.h.in
r1108 r1134 1 #ifndef LEMON_CONFIG_H 2 #define LEMON_CONFIG_H 3 1 4 #define LEMON_VERSION "@PROJECT_VERSION@" 2 5 #cmakedefine LEMON_HAVE_LONG_LONG 1 6 7 #cmakedefine LEMON_WIN32 1 3 8 4 9 #cmakedefine LEMON_HAVE_LP 1 … … 10 15 #cmakedefine LEMON_HAVE_CBC 1 11 16 12 #define _LEMON_CPLEX113 #define _LEMON_CLP214 #define _LEMON_GLPK315 #define _LEMON_SOPLEX416 #define _LEMON_CBC517 #define LEMON_CPLEX_ 1 18 #define LEMON_CLP_ 2 19 #define LEMON_GLPK_ 3 20 #define LEMON_SOPLEX_ 4 21 #define LEMON_CBC_ 5 17 22 18 #cmakedefine LEMON_DEFAULT_LP _LEMON_@LEMON_DEFAULT_LP@19 #cmakedefine LEMON_DEFAULT_MIP _LEMON_@LEMON_DEFAULT_MIP@23 #cmakedefine LEMON_DEFAULT_LP LEMON_@LEMON_DEFAULT_LP@_ 24 #cmakedefine LEMON_DEFAULT_MIP LEMON_@LEMON_DEFAULT_MIP@_ 20 25 21 26 #cmakedefine LEMON_USE_PTHREAD 1 22 27 #cmakedefine LEMON_USE_WIN32_THREADS 1 28 29 #endif -
lemon/graph_to_eps.h
r1099 r1134 26 26 #include<vector> 27 27 28 #ifndef WIN3228 #ifndef LEMON_WIN32 29 29 #include<sys/time.h> 30 30 #include<ctime> … … 675 675 { 676 676 os << "%%CreationDate: "; 677 #ifndef WIN32677 #ifndef LEMON_WIN32 678 678 timeval tv; 679 679 gettimeofday(&tv, 0); -
lemon/lp.h
r1120 r1134 23 23 24 24 25 #if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK25 #if LEMON_DEFAULT_LP == LEMON_GLPK_ || LEMON_DEFAULT_MIP == LEMON_GLPK_ 26 26 #include <lemon/glpk.h> 27 27 #endif 28 #if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX28 #if LEMON_DEFAULT_LP == LEMON_CPLEX_ || LEMON_DEFAULT_MIP == LEMON_CPLEX_ 29 29 #include <lemon/cplex.h> 30 30 #endif 31 #if LEMON_DEFAULT_LP == _LEMON_SOPLEX31 #if LEMON_DEFAULT_LP == LEMON_SOPLEX_ 32 32 #include <lemon/soplex.h> 33 33 #endif 34 #if LEMON_DEFAULT_LP == _LEMON_CLP34 #if LEMON_DEFAULT_LP == LEMON_CLP_ 35 35 #include <lemon/clp.h> 36 36 #endif 37 #if LEMON_DEFAULT_MIP == _LEMON_CBC37 #if LEMON_DEFAULT_MIP == LEMON_CBC_ 38 38 #include <lemon/cbc.h> 39 39 #endif … … 50 50 ///\ingroup lp_group 51 51 /// 52 ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX,53 ///\c _LEMON_SOPLEX or \c LEMON__CLP52 ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_, 53 ///\c LEMON_SOPLEX_ or \c LEMON_CLP_ 54 54 #define LEMON_DEFAULT_LP SOLVER 55 55 ///The default LP solver … … 66 66 ///\ingroup lp_group 67 67 /// 68 ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX69 ///or \c _LEMON_CBC68 ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_ 69 ///or \c LEMON_CBC_ 70 70 #define LEMON_DEFAULT_MIP SOLVER 71 71 ///The default MIP solver. … … 77 77 typedef GlpkMip Mip; 78 78 #else 79 #if LEMON_DEFAULT_LP == _LEMON_GLPK79 #if LEMON_DEFAULT_LP == LEMON_GLPK_ 80 80 typedef GlpkLp Lp; 81 #elif LEMON_DEFAULT_LP == _LEMON_CPLEX81 #elif LEMON_DEFAULT_LP == LEMON_CPLEX_ 82 82 typedef CplexLp Lp; 83 #elif LEMON_DEFAULT_LP == _LEMON_SOPLEX83 #elif LEMON_DEFAULT_LP == LEMON_SOPLEX_ 84 84 typedef SoplexLp Lp; 85 #elif LEMON_DEFAULT_LP == _LEMON_CLP85 #elif LEMON_DEFAULT_LP == LEMON_CLP_ 86 86 typedef ClpLp Lp; 87 87 #endif 88 #if LEMON_DEFAULT_MIP == _LEMON_GLPK88 #if LEMON_DEFAULT_MIP == LEMON_GLPK_ 89 89 typedef GlpkMip Mip; 90 #elif LEMON_DEFAULT_MIP == _LEMON_CPLEX90 #elif LEMON_DEFAULT_MIP == LEMON_CPLEX_ 91 91 typedef CplexMip Mip; 92 #elif LEMON_DEFAULT_MIP == _LEMON_CBC92 #elif LEMON_DEFAULT_MIP == LEMON_CBC_ 93 93 typedef CbcMip Mip; 94 94 #endif -
lemon/random.h
r1124 r1134 63 63 #define LEMON_RANDOM_H 64 64 65 #include <lemon/config.h> 66 65 67 #include <algorithm> 66 68 #include <iterator> … … 72 74 #include <lemon/dim2.h> 73 75 74 #ifndef WIN3276 #ifndef LEMON_WIN32 75 77 #include <sys/time.h> 76 78 #include <ctime> … … 606 608 /// \return Currently always \c true. 607 609 bool seed() { 608 #ifndef WIN32610 #ifndef LEMON_WIN32 609 611 if (seedFromFile("/dev/urandom", 0)) return true; 610 612 #endif … … 626 628 /// \param offset The offset, from the file read. 627 629 /// \return \c true when the seeding successes. 628 #ifndef WIN32630 #ifndef LEMON_WIN32 629 631 bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0) 630 632 #else … … 648 650 /// \return Currently always \c true. 649 651 bool seedFromTime() { 650 #ifndef WIN32652 #ifndef LEMON_WIN32 651 653 timeval tv; 652 654 gettimeofday(&tv, 0); -
lemon/time_measure.h
r1092 r1134 24 24 ///\brief Tools for measuring cpu usage 25 25 26 #ifdef WIN32 26 #include <lemon/config.h> 27 28 #ifdef LEMON_WIN32 27 29 #include <lemon/bits/windows.h> 28 30 #else … … 103 105 void stamp() 104 106 { 105 #ifndef WIN32107 #ifndef LEMON_WIN32 106 108 timeval tv; 107 109 gettimeofday(&tv, 0);
Note: See TracChangeset
for help on using the changeset viewer.