COIN-OR::LEMON - Graph Library

Ignore:
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1340 r1327  
    6666FIND_PACKAGE(Doxygen)
    6767FIND_PACKAGE(Ghostscript)
    68 
    69 IF(WIN32)
    70   SET(LEMON_WIN32 TRUE)
    71 ENDIF(WIN32)
    7268
    7369SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
  • lemon/bits/windows.cc

    r1341 r1270  
    2222#include<lemon/bits/windows.h>
    2323
    24 #if defined(LEMON_WIN32) && defined(__GNUC__)
    25 #pragma GCC diagnostic ignored "-Wold-style-cast"
    26 #endif
    27 
    28 #ifdef LEMON_WIN32
     24#ifdef WIN32
    2925#ifndef WIN32_LEAN_AND_MEAN
    3026#define WIN32_LEAN_AND_MEAN
     
    4541#include <unistd.h>
    4642#include <ctime>
    47 #ifndef LEMON_WIN32
     43#ifndef WIN32
    4844#include <sys/times.h>
    4945#endif
     
    6056                         double &cutime, double &cstime)
    6157    {
    62 #ifdef LEMON_WIN32
     58#ifdef WIN32
    6359      static const double ch = 4294967296.0e-7;
    6460      static const double cl = 1.0e-7;
     
    9995    {
    10096      std::ostringstream os;
    101 #ifdef LEMON_WIN32
     97#ifdef WIN32
    10298      SYSTEMTIME time;
    10399      GetSystemTime(&time);
    104100      char buf1[11], buf2[9], buf3[5];
    105       if (GetDateFormat(MY_LOCALE, 0, &time,
     101          if (GetDateFormat(MY_LOCALE, 0, &time,
    106102                        ("ddd MMM dd"), buf1, 11) &&
    107103          GetTimeFormat(MY_LOCALE, 0, &time,
     
    125121    int getWinRndSeed()
    126122    {
    127 #ifdef LEMON_WIN32
     123#ifdef WIN32
    128124      FILETIME time;
    129125      GetSystemTimeAsFileTime(&time);
     
    137133
    138134    WinLock::WinLock() {
    139 #ifdef LEMON_WIN32
     135#ifdef WIN32
    140136      CRITICAL_SECTION *lock = new CRITICAL_SECTION;
    141137      InitializeCriticalSection(lock);
     
    147143
    148144    WinLock::~WinLock() {
    149 #ifdef LEMON_WIN32
     145#ifdef WIN32
    150146      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    151147      DeleteCriticalSection(lock);
     
    155151
    156152    void WinLock::lock() {
    157 #ifdef LEMON_WIN32
     153#ifdef WIN32
    158154      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    159155      EnterCriticalSection(lock);
     
    162158
    163159    void WinLock::unlock() {
    164 #ifdef LEMON_WIN32
     160#ifdef WIN32
    165161      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
    166162      LeaveCriticalSection(lock);
  • lemon/bits/windows.h

    r1340 r1270  
    2020#define LEMON_BITS_WINDOWS_H
    2121
    22 #include <lemon/config.h>
    2322#include <string>
    2423
     
    3635      ~WinLock();
    3736      void lock();
    38       void unlock();\
     37      void unlock();
    3938    private:
    4039      void *_repr;
  • lemon/config.h.in

    r1340 r1306  
    1 #ifndef LEMON_CONFIG_H
    2 #define LEMON_CONFIG_H
    3 
    41#define LEMON_VERSION "@PROJECT_VERSION@"
    52#cmakedefine LEMON_HAVE_LONG_LONG 1
    6 
    7 #cmakedefine LEMON_WIN32 1
    83
    94#cmakedefine LEMON_HAVE_LP 1
     
    1510#cmakedefine LEMON_HAVE_CBC 1
    1611
    17 #define LEMON_CPLEX_ 1
    18 #define LEMON_CLP_ 2
    19 #define LEMON_GLPK_ 3
    20 #define LEMON_SOPLEX_ 4
    21 #define LEMON_CBC_ 5
     12#define _LEMON_CPLEX 1
     13#define _LEMON_CLP 2
     14#define _LEMON_GLPK 3
     15#define _LEMON_SOPLEX 4
     16#define _LEMON_CBC 5
    2217
    23 #cmakedefine LEMON_DEFAULT_LP LEMON_@LEMON_DEFAULT_LP@_
    24 #cmakedefine LEMON_DEFAULT_MIP LEMON_@LEMON_DEFAULT_MIP@_
     18#cmakedefine LEMON_DEFAULT_LP _LEMON_@LEMON_DEFAULT_LP@
     19#cmakedefine LEMON_DEFAULT_MIP _LEMON_@LEMON_DEFAULT_MIP@
    2520
    2621#cmakedefine LEMON_USE_PTHREAD 1
    2722#cmakedefine LEMON_USE_WIN32_THREADS 1
    28 
    29 #endif
  • lemon/core.h

    r1341 r1327  
    2020#define LEMON_CORE_H
    2121
    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.
     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>
    2829
    2930// Disable the following warnings when compiling with MSVC:
     
    4344#endif
    4445
    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 
     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.
    5452
    5553namespace lemon {
  • lemon/graph_to_eps.h

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

    r1340 r1323  
    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

    r1340 r1328  
    6363#define LEMON_RANDOM_H
    6464
    65 #include <lemon/config.h>
    66 
    6765#include <algorithm>
    6866#include <iterator>
     
    7472#include <lemon/dim2.h>
    7573
    76 #ifndef LEMON_WIN32
     74#ifndef WIN32
    7775#include <sys/time.h>
    7876#include <ctime>
     
    608606    /// \return Currently always \c true.
    609607    bool seed() {
    610 #ifndef LEMON_WIN32
     608#ifndef WIN32
    611609      if (seedFromFile("/dev/urandom", 0)) return true;
    612610#endif
     
    628626    /// \param offset The offset, from the file read.
    629627    /// \return \c true when the seeding successes.
    630 #ifndef LEMON_WIN32
     628#ifndef WIN32
    631629    bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
    632630#else
     
    650648    /// \return Currently always \c true.
    651649    bool seedFromTime() {
    652 #ifndef LEMON_WIN32
     650#ifndef WIN32
    653651      timeval tv;
    654652      gettimeofday(&tv, 0);
  • lemon/time_measure.h

    r1340 r1270  
    2424///\brief Tools for measuring cpu usage
    2525
    26 #include <lemon/config.h>
    27 
    28 #ifdef LEMON_WIN32
     26#ifdef WIN32
    2927#include <lemon/bits/windows.h>
    3028#else
     
    105103    void stamp()
    106104    {
    107 #ifndef LEMON_WIN32
     105#ifndef WIN32
    108106      timeval tv;
    109107      gettimeofday(&tv, 0);
  • test/radix_sort_test.cc

    r1341 r1270  
    1616 *
    1717 */
    18 
    19 #include <lemon/core.h>
    2018
    2119#include <lemon/time_measure.h>
Note: See TracChangeset for help on using the changeset viewer.