COIN-OR::LEMON - Graph Library

Changes in / [1133:93d455c647be:1136:20f95cd51aba] in lemon-main


Ignore:
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1131 r1136  
    7171FIND_PACKAGE(Ghostscript)
    7272
     73IF(WIN32)
     74  SET(LEMON_WIN32 TRUE)
     75ENDIF(WIN32)
     76
    7377SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
    7478SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.")
  • lemon/bits/windows.cc

    r1092 r1135  
    2222#include<lemon/bits/windows.h>
    2323
    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
    2529#ifndef WIN32_LEAN_AND_MEAN
    2630#define WIN32_LEAN_AND_MEAN
     
    4145#include <unistd.h>
    4246#include <ctime>
    43 #ifndef WIN32
     47#ifndef LEMON_WIN32
    4448#include <sys/times.h>
    4549#endif
     
    5660                         double &cutime, double &cstime)
    5761    {
    58 #ifdef WIN32
     62#ifdef LEMON_WIN32
    5963      static const double ch = 4294967296.0e-7;
    6064      static const double cl = 1.0e-7;
     
    9599    {
    96100      std::ostringstream os;
    97 #ifdef WIN32
     101#ifdef LEMON_WIN32
    98102      SYSTEMTIME time;
    99103      GetSystemTime(&time);
    100104      char buf1[11], buf2[9], buf3[5];
    101           if (GetDateFormat(MY_LOCALE, 0, &time,
     105      if (GetDateFormat(MY_LOCALE, 0, &time,
    102106                        ("ddd MMM dd"), buf1, 11) &&
    103107          GetTimeFormat(MY_LOCALE, 0, &time,
     
    121125    int getWinRndSeed()
    122126    {
    123 #ifdef WIN32
     127#ifdef LEMON_WIN32
    124128      FILETIME time;
    125129      GetSystemTimeAsFileTime(&time);
     
    133137
    134138    WinLock::WinLock() {
    135 #ifdef WIN32
     139#ifdef LEMON_WIN32
    136140      CRITICAL_SECTION *lock = new CRITICAL_SECTION;
    137141      InitializeCriticalSection(lock);
     
    143147
    144148    WinLock::~WinLock() {
    145 #ifdef WIN32
     149#ifdef LEMON_WIN32
    146150      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    147151      DeleteCriticalSection(lock);
     
    151155
    152156    void WinLock::lock() {
    153 #ifdef WIN32
     157#ifdef LEMON_WIN32
    154158      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    155159      EnterCriticalSection(lock);
     
    158162
    159163    void WinLock::unlock() {
    160 #ifdef WIN32
     164#ifdef LEMON_WIN32
    161165      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    162166      LeaveCriticalSection(lock);
  • lemon/bits/windows.h

    r1092 r1134  
    2020#define LEMON_BITS_WINDOWS_H
    2121
     22#include <lemon/config.h>
    2223#include <string>
    2324
     
    3536      ~WinLock();
    3637      void lock();
    37       void unlock();
     38      void unlock();\
    3839    private:
    3940      void *_repr;
  • lemon/config.h.in

    r1131 r1136  
     1#ifndef LEMON_CONFIG_H
     2#define LEMON_CONFIG_H
     3
    14#define LEMON_VERSION "@PROJECT_VERSION@"
    25#cmakedefine LEMON_HAVE_LONG_LONG 1
    36
    47#cmakedefine LEMON_CXX11 1
     8
     9#cmakedefine LEMON_WIN32 1
    510
    611#cmakedefine LEMON_HAVE_LP 1
     
    1217#cmakedefine LEMON_HAVE_CBC 1
    1318
    14 #define _LEMON_CPLEX 1
    15 #define _LEMON_CLP 2
    16 #define _LEMON_GLPK 3
    17 #define _LEMON_SOPLEX 4
    18 #define _LEMON_CBC 5
     19#define LEMON_CPLEX_ 1
     20#define LEMON_CLP_ 2
     21#define LEMON_GLPK_ 3
     22#define LEMON_SOPLEX_ 4
     23#define LEMON_CBC_ 5
    1924
    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@_
    2227
    2328#cmakedefine LEMON_USE_PTHREAD 1
    2429#cmakedefine LEMON_USE_WIN32_THREADS 1
     30
     31#endif
  • lemon/core.h

    r1123 r1135  
    2020#define LEMON_CORE_H
    2121
    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.
    2928
    3029// Disable the following warnings when compiling with MSVC:
     
    4443#endif
    4544
    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
    5254
    5355namespace lemon {
  • lemon/graph_to_eps.h

    r1099 r1134  
    2626#include<vector>
    2727
    28 #ifndef WIN32
     28#ifndef LEMON_WIN32
    2929#include<sys/time.h>
    3030#include<ctime>
     
    675675    {
    676676      os << "%%CreationDate: ";
    677 #ifndef WIN32
     677#ifndef LEMON_WIN32
    678678      timeval tv;
    679679      gettimeofday(&tv, 0);
  • lemon/lp.h

    r1120 r1134  
    2323
    2424
    25 #if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK
     25#if LEMON_DEFAULT_LP == LEMON_GLPK_ || LEMON_DEFAULT_MIP == LEMON_GLPK_
    2626#include <lemon/glpk.h>
    2727#endif
    28 #if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX
     28#if LEMON_DEFAULT_LP == LEMON_CPLEX_ || LEMON_DEFAULT_MIP == LEMON_CPLEX_
    2929#include <lemon/cplex.h>
    3030#endif
    31 #if LEMON_DEFAULT_LP == _LEMON_SOPLEX
     31#if LEMON_DEFAULT_LP == LEMON_SOPLEX_
    3232#include <lemon/soplex.h>
    3333#endif
    34 #if LEMON_DEFAULT_LP == _LEMON_CLP
     34#if LEMON_DEFAULT_LP == LEMON_CLP_
    3535#include <lemon/clp.h>
    3636#endif
    37 #if LEMON_DEFAULT_MIP == _LEMON_CBC
     37#if LEMON_DEFAULT_MIP == LEMON_CBC_
    3838#include <lemon/cbc.h>
    3939#endif
     
    5050  ///\ingroup lp_group
    5151  ///
    52   ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX,
    53   ///\c _LEMON_SOPLEX or \c LEMON__CLP
     52  ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_,
     53  ///\c LEMON_SOPLEX_ or \c LEMON_CLP_
    5454#define LEMON_DEFAULT_LP SOLVER
    5555  ///The default LP solver
     
    6666  ///\ingroup lp_group
    6767  ///
    68   ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX
    69   ///or \c _LEMON_CBC
     68  ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_
     69  ///or \c LEMON_CBC_
    7070#define LEMON_DEFAULT_MIP SOLVER
    7171  ///The default MIP solver.
     
    7777  typedef GlpkMip Mip;
    7878#else
    79 #if LEMON_DEFAULT_LP == _LEMON_GLPK
     79#if LEMON_DEFAULT_LP == LEMON_GLPK_
    8080  typedef GlpkLp Lp;
    81 #elif LEMON_DEFAULT_LP == _LEMON_CPLEX
     81#elif LEMON_DEFAULT_LP == LEMON_CPLEX_
    8282  typedef CplexLp Lp;
    83 #elif LEMON_DEFAULT_LP == _LEMON_SOPLEX
     83#elif LEMON_DEFAULT_LP == LEMON_SOPLEX_
    8484  typedef SoplexLp Lp;
    85 #elif LEMON_DEFAULT_LP == _LEMON_CLP
     85#elif LEMON_DEFAULT_LP == LEMON_CLP_
    8686  typedef ClpLp Lp;
    8787#endif
    88 #if LEMON_DEFAULT_MIP == _LEMON_GLPK
     88#if LEMON_DEFAULT_MIP == LEMON_GLPK_
    8989  typedef GlpkMip Mip;
    90 #elif LEMON_DEFAULT_MIP == _LEMON_CPLEX
     90#elif LEMON_DEFAULT_MIP == LEMON_CPLEX_
    9191  typedef CplexMip Mip;
    92 #elif LEMON_DEFAULT_MIP == _LEMON_CBC
     92#elif LEMON_DEFAULT_MIP == LEMON_CBC_
    9393  typedef CbcMip Mip;
    9494#endif
  • lemon/random.h

    r1132 r1136  
    6363#define LEMON_RANDOM_H
    6464
     65#include <lemon/config.h>
     66
    6567#include <algorithm>
    6668#include <iterator>
     
    7274#include <lemon/dim2.h>
    7375
    74 #ifndef WIN32
     76#ifndef LEMON_WIN32
    7577#include <sys/time.h>
    7678#include <ctime>
     
    606608    /// \return Currently always \c true.
    607609    bool seed() {
    608 #ifndef WIN32
     610#ifndef LEMON_WIN32
    609611      if (seedFromFile("/dev/urandom", 0)) return true;
    610612#endif
     
    626628    /// \param offset The offset, from the file read.
    627629    /// \return \c true when the seeding successes.
    628 #ifndef WIN32
     630#ifndef LEMON_WIN32
    629631    bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
    630632#else
     
    648650    /// \return Currently always \c true.
    649651    bool seedFromTime() {
    650 #ifndef WIN32
     652#ifndef LEMON_WIN32
    651653      timeval tv;
    652654      gettimeofday(&tv, 0);
  • lemon/time_measure.h

    r1092 r1134  
    2424///\brief Tools for measuring cpu usage
    2525
    26 #ifdef WIN32
     26#include <lemon/config.h>
     27
     28#ifdef LEMON_WIN32
    2729#include <lemon/bits/windows.h>
    2830#else
     
    103105    void stamp()
    104106    {
    105 #ifndef WIN32
     107#ifndef LEMON_WIN32
    106108      timeval tv;
    107109      gettimeofday(&tv, 0);
  • test/radix_sort_test.cc

    r1092 r1135  
    1616 *
    1717 */
     18
     19#include <lemon/core.h>
    1820
    1921#include <lemon/time_measure.h>
Note: See TracChangeset for help on using the changeset viewer.