Changeset 1668 for trunk/Cbc/src


Ignore:
Timestamp:
Jun 13, 2011 12:32:06 PM (8 years ago)
Author:
stefan
Message:

use CoinFileIO::have*Support to decide whether compressed files can be read

Location:
trunk/Cbc/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/Makefile.in

    r1665 r1668  
    278278COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@
    279279COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@
    280 COIN_HAS_ZLIB_FALSE = @COIN_HAS_ZLIB_FALSE@
    281 COIN_HAS_ZLIB_TRUE = @COIN_HAS_ZLIB_TRUE@
    282280COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@
    283281COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@
  • trunk/Cbc/src/OsiCbc/Makefile.in

    r1660 r1668  
    197197COIN_HAS_XPR_FALSE = @COIN_HAS_XPR_FALSE@
    198198COIN_HAS_XPR_TRUE = @COIN_HAS_XPR_TRUE@
    199 COIN_HAS_ZLIB_FALSE = @COIN_HAS_ZLIB_FALSE@
    200 COIN_HAS_ZLIB_TRUE = @COIN_HAS_ZLIB_TRUE@
    201199COIN_PKG_CONFIG_PATH = @COIN_PKG_CONFIG_PATH@
    202200COIN_PKG_CONFIG_PATH_UNINSTALLED = @COIN_PKG_CONFIG_PATH_UNINSTALLED@
  • trunk/Cbc/src/config.h.in

    r1660 r1668  
    7474#undef COIN_HAS_XPR
    7575
    76 /* Define to 1 if zlib is available */
    77 #undef COIN_HAS_ZLIB
    78 
    7976/* Define to 1 if you have the <cfloat> header file. */
    8077#undef HAVE_CFLOAT
     
    128125#undef HAVE_UNISTD_H
    129126
    130 /* Define to 1 if you have the <zlib.h> header file. */
    131 #undef HAVE_ZLIB_H
    132 
    133127/* define to the name of the default solver interface class, e.g.,
    134128   OsiClpSolverInterface */
  • trunk/Cbc/src/unitTest.cpp

    r1640 r1668  
    1616
    1717#include "CoinHelperFunctions.hpp"
     18#include "CoinFileIO.hpp"
    1819
    1920#ifdef COIN_HAS_CBC
     
    5859        fclose(fp);
    5960    }
    60 #ifdef COIN_USE_ZLIB
    61     test1 += ".gz";
    62     fp = fopen(test1.c_str(), "r");
    63     if (fp) {
     61    if (!doTest && CoinFileInput::haveGzipSupport())
     62    {
     63      test1 += ".gz";
     64      fp = fopen(test1.c_str(), "r");
     65      if (fp) {
    6466        doTest = true;
    6567        fclose(fp);
    66     }
    67 #endif
     68      }
     69    }
    6870    if (!doTest)
    6971        return;
  • trunk/Cbc/src/unitTestClp.cpp

    r1645 r1668  
    1111
    1212#include "CoinTime.hpp"
     13#include "CoinFileIO.hpp"
    1314#include "CbcModel.hpp"
    1415#include "CbcHeuristic.hpp"
     
    6263        return true;
    6364    }
    64 #ifdef COIN_HAS_ZLIB
    65     if (CbcTestFile(fname + ".gz")) {
    66         return true;
    67     }
    68     if (CbcTestFile(fname + ".mps.gz")) {
     65    if (CoinFileInput::haveGzipSupport()) {
     66      if (CbcTestFile(fname + ".gz")) {
     67        return true;
     68      }
     69      if (CbcTestFile(fname + ".mps.gz")) {
    6970        fname += ".mps";
    7071        return true;
    71     }
    72     if (CbcTestFile(fname + ".MPS.gz")) {
     72      }
     73      if (CbcTestFile(fname + ".MPS.gz")) {
    7374        fname += ".MPS";
    7475        return true;
    75     }
    76     if (CbcTestFile(fname + ".MPS.GZ")) {
     76      }
     77      if (CbcTestFile(fname + ".MPS.GZ")) {
    7778        fname += ".MPS";
    7879        return true;
    79     }
    80 #endif
     80      }
     81    }
     82    if (CoinFileInput::haveBzip2Support()) {
     83      if (CbcTestFile(fname + ".bz2")) {
     84        return true;
     85      }
     86      if (CbcTestFile(fname + ".mps.bz2")) {
     87        fname += ".mps";
     88        return true;
     89      }
     90      if (CbcTestFile(fname + ".MPS.bz2")) {
     91        fname += ".MPS";
     92        return true;
     93      }
     94      if (CbcTestFile(fname + ".MPS.BZ2")) {
     95        fname += ".MPS";
     96        return true;
     97      }
     98    }
    8199    return false;
    82100}
Note: See TracChangeset for help on using the changeset viewer.