Changes in / [1339:93d455c647be:1343:20f95cd51aba] in lemon
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r1337 r1343 71 71 FIND_PACKAGE(Ghostscript) 72 72 73 IF(WIN32) 74 SET(LEMON_WIN32 TRUE) 75 ENDIF(WIN32) 76 73 77 SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.") 74 78 SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.") -
lemon/bits/windows.cc
r1270 r1341 22 22 #include<lemon/bits/windows.h> 23 23 24 #ifdef WIN32 24 #if defined(LEMON_WIN32) && defined(__GNUC__) 25 #pragma GCC diagnostic ignored "-Wold-style-cast" 26 #endif 27 28 #ifdef LEMON_WIN32 25 29 #ifndef WIN32_LEAN_AND_MEAN 26 30 #define WIN32_LEAN_AND_MEAN … … 41 45 #include <unistd.h> 42 46 #include <ctime> 43 #ifndef WIN3247 #ifndef LEMON_WIN32 44 48 #include <sys/times.h> 45 49 #endif … … 56 60 double &cutime, double &cstime) 57 61 { 58 #ifdef WIN3262 #ifdef LEMON_WIN32 59 63 static const double ch = 4294967296.0e-7; 60 64 static const double cl = 1.0e-7; … … 95 99 { 96 100 std::ostringstream os; 97 #ifdef WIN32101 #ifdef LEMON_WIN32 98 102 SYSTEMTIME time; 99 103 GetSystemTime(&time); 100 104 char buf1[11], buf2[9], buf3[5]; 101 105 if (GetDateFormat(MY_LOCALE, 0, &time, 102 106 ("ddd MMM dd"), buf1, 11) && 103 107 GetTimeFormat(MY_LOCALE, 0, &time, … … 121 125 int getWinRndSeed() 122 126 { 123 #ifdef WIN32127 #ifdef LEMON_WIN32 124 128 FILETIME time; 125 129 GetSystemTimeAsFileTime(&time); … … 133 137 134 138 WinLock::WinLock() { 135 #ifdef WIN32139 #ifdef LEMON_WIN32 136 140 CRITICAL_SECTION *lock = new CRITICAL_SECTION; 137 141 InitializeCriticalSection(lock); … … 143 147 144 148 WinLock::~WinLock() { 145 #ifdef WIN32149 #ifdef LEMON_WIN32 146 150 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 147 151 DeleteCriticalSection(lock); … … 151 155 152 156 void WinLock::lock() { 153 #ifdef WIN32157 #ifdef LEMON_WIN32 154 158 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 155 159 EnterCriticalSection(lock); … … 158 162 159 163 void WinLock::unlock() { 160 #ifdef WIN32164 #ifdef LEMON_WIN32 161 165 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 162 166 LeaveCriticalSection(lock); -
lemon/bits/windows.h
r1270 r1340 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
r1337 r1343 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 3 6 4 7 #cmakedefine LEMON_CXX11 1 8 9 #cmakedefine LEMON_WIN32 1 5 10 6 11 #cmakedefine LEMON_HAVE_LP 1 … … 12 17 #cmakedefine LEMON_HAVE_CBC 1 13 18 14 #define _LEMON_CPLEX115 #define _LEMON_CLP216 #define _LEMON_GLPK317 #define _LEMON_SOPLEX418 #define _LEMON_CBC519 #define LEMON_CPLEX_ 1 20 #define LEMON_CLP_ 2 21 #define LEMON_GLPK_ 3 22 #define LEMON_SOPLEX_ 4 23 #define LEMON_CBC_ 5 19 24 20 #cmakedefine LEMON_DEFAULT_LP _LEMON_@LEMON_DEFAULT_LP@21 #cmakedefine LEMON_DEFAULT_MIP _LEMON_@LEMON_DEFAULT_MIP@25 #cmakedefine LEMON_DEFAULT_LP LEMON_@LEMON_DEFAULT_LP@_ 26 #cmakedefine LEMON_DEFAULT_MIP LEMON_@LEMON_DEFAULT_MIP@_ 22 27 23 28 #cmakedefine LEMON_USE_PTHREAD 1 24 29 #cmakedefine LEMON_USE_WIN32_THREADS 1 30 31 #endif -
lemon/core.h
r1327 r1341 20 20 #define LEMON_CORE_H 21 21 22 #include <vector> 23 #include <algorithm> 24 25 #include <lemon/config.h> 26 #include <lemon/bits/enable_if.h> 27 #include <lemon/bits/traits.h> 28 #include <lemon/assert.h> 22 ///\file 23 ///\brief LEMON core utilities. 24 /// 25 ///This header file contains core utilities for LEMON. 26 ///It is automatically included by all graph types, therefore it usually 27 ///do not have to be included directly. 29 28 30 29 // Disable the following warnings when compiling with MSVC: … … 44 43 #endif 45 44 46 ///\file 47 ///\brief LEMON core utilities. 48 /// 49 ///This header file contains core utilities for LEMON. 50 ///It is automatically included by all graph types, therefore it usually 51 ///do not have to be included directly. 45 #include <vector> 46 #include <algorithm> 47 48 #include <lemon/config.h> 49 #include <lemon/bits/enable_if.h> 50 #include <lemon/bits/traits.h> 51 #include <lemon/assert.h> 52 53 52 54 53 55 namespace lemon { -
lemon/graph_to_eps.h
r1291 r1340 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
r1323 r1340 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
r1338 r1343 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
r1270 r1340 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); -
test/radix_sort_test.cc
r1270 r1341 16 16 * 17 17 */ 18 19 #include <lemon/core.h> 18 20 19 21 #include <lemon/time_measure.h>
Note: See TracChangeset
for help on using the changeset viewer.