Changeset 1643 for trunk/Cbc


Ignore:
Timestamp:
Apr 29, 2011 2:06:50 PM (8 years ago)
Author:
stefan
Message:

apply fixes for compiler warnings send by Alpar Juettner:

  • Every appearance of DBL_MAX was replaced by COIN_DBL_MAX.
  • The unused parameter warnings were resolved by removing their names from the declaration.
  • Finally, I weeded out all the old-style casts from the code.
Location:
trunk/Cbc/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcCutGenerator.cpp

    r1641 r1643  
    533533                    // not feasible -add infeasible cut
    534534                    OsiRowCut rc;
    535                     rc.setLb(DBL_MAX);
     535                    rc.setLb(COIN_DBL_MAX);
    536536                    rc.setUb(0.0);
    537537                    cs.insert(rc);
  • trunk/Cbc/src/CbcHeuristicDiveCoefficient.cpp

    r1573 r1643  
    7878    bestColumn = -1;
    7979    bestRound = -1; // -1 rounds down, +1 rounds up
    80     double bestFraction = DBL_MAX;
     80    double bestFraction = COIN_DBL_MAX;
    8181    int bestLocks = COIN_INT_MAX;
    8282    bool allTriviallyRoundableSoFar = true;
     
    9393                if (allTriviallyRoundableSoFar && nDownLocks > 0 && nUpLocks > 0) {
    9494                    allTriviallyRoundableSoFar = false;
    95                     bestFraction = DBL_MAX;
     95                    bestFraction = COIN_DBL_MAX;
    9696                    bestLocks = COIN_INT_MAX;
    9797                }
  • trunk/Cbc/src/CbcHeuristicDiveFractional.cpp

    r1573 r1643  
    7676    bestColumn = -1;
    7777    bestRound = -1; // -1 rounds down, +1 rounds up
    78     double bestFraction = DBL_MAX;
     78    double bestFraction = COIN_DBL_MAX;
    7979    bool allTriviallyRoundableSoFar = true;
    8080    for (int i = 0; i < numberIntegers; i++) {
     
    8888                if (allTriviallyRoundableSoFar && downLocks_[i] > 0 && upLocks_[i] > 0) {
    8989                    allTriviallyRoundableSoFar = false;
    90                     bestFraction = DBL_MAX;
     90                    bestFraction = COIN_DBL_MAX;
    9191                }
    9292
  • trunk/Cbc/src/CbcHeuristicDiveGuided.cpp

    r1573 r1643  
    8888    bestColumn = -1;
    8989    bestRound = -1; // -1 rounds down, +1 rounds up
    90     double bestFraction = DBL_MAX;
     90    double bestFraction = COIN_DBL_MAX;
    9191    bool allTriviallyRoundableSoFar = true;
    9292    for (int i = 0; i < numberIntegers; i++) {
     
    100100                if (allTriviallyRoundableSoFar && downLocks_[i] > 0 && upLocks_[i] > 0) {
    101101                    allTriviallyRoundableSoFar = false;
    102                     bestFraction = DBL_MAX;
     102                    bestFraction = COIN_DBL_MAX;
    103103                }
    104104
  • trunk/Cbc/src/CbcHeuristicDiveLineSearch.cpp

    r1573 r1643  
    7979    bestColumn = -1;
    8080    bestRound = -1; // -1 rounds down, +1 rounds up
    81     double bestRelDistance = DBL_MAX;
     81    double bestRelDistance = COIN_DBL_MAX;
    8282    bool allTriviallyRoundableSoFar = true;
    8383    for (int i = 0; i < numberIntegers; i++) {
     
    9292                if (allTriviallyRoundableSoFar && downLocks_[i] > 0 && upLocks_[i] > 0) {
    9393                    allTriviallyRoundableSoFar = false;
    94                     bestRelDistance = DBL_MAX;
     94                    bestRelDistance = COIN_DBL_MAX;
    9595                }
    9696
     
    104104                } else {
    105105                    round = -1;
    106                     relDistance = DBL_MAX;
     106                    relDistance = COIN_DBL_MAX;
    107107                }
    108108
  • trunk/Cbc/src/CbcHeuristicDiveVectorLength.cpp

    r1573 r1643  
    8080    bestColumn = -1;
    8181    bestRound = -1; // -1 rounds down, +1 rounds up
    82     double bestScore = DBL_MAX;
     82    double bestScore = COIN_DBL_MAX;
    8383    bool allTriviallyRoundableSoFar = true;
    8484    for (int i = 0; i < numberIntegers; i++) {
     
    9292                if (allTriviallyRoundableSoFar && downLocks_[i] > 0 && upLocks_[i] > 0) {
    9393                    allTriviallyRoundableSoFar = false;
    94                     bestScore = DBL_MAX;
     94                    bestScore = COIN_DBL_MAX;
    9595                }
    9696
  • trunk/Cbc/src/CbcObject.hpp

    r1573 r1643  
    135135    virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) = 0;
    136136#else
    137     virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) {
    138         return createBranch(solver, info, way);
    139     }
    140     virtual CbcBranchingObject * createBranch(OsiSolverInterface * /*solver*/,
    141             const OsiBranchingInformation * /*info*/, int /*way*/) {
     137  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *
     138                                               /* solver */,
     139                                               const OsiBranchingInformation *
     140                                               /* info */, int /* way */) {
     141        // return createBranch(solver, info, way);
     142      return NULL;
     143    }
     144    virtual OsiBranchingObject * createBranch(OsiSolverInterface * /*solver*/,
     145            const OsiBranchingInformation * /*info*/, int /*way*/) const {
    142146        throw CoinError("Need code", "createBranch", "CbcBranchBase");
    143147    }
  • trunk/Cbc/src/Cbc_ampl.cpp

    r1432 r1643  
    471471        columnLower = (double *) malloc(n_var * sizeof(double));
    472472        columnUpper = (double *) malloc(n_var * sizeof(double));
    473 #define COIN_DBL_MAX DBL_MAX
    474473        for (i = 0; i < n_var; i++) {
    475474            columnLower[i] = LUv[2*i];
     
    934933        columnLower = (double *) malloc(n_var * sizeof(double));
    935934        columnUpper = (double *) malloc(n_var * sizeof(double));
    936 #define COIN_DBL_MAX DBL_MAX
    937935        for (i = 0; i < n_var; i++) {
    938936            columnLower[i] = LUv[2*i];
  • trunk/Cbc/src/OsiCbc/OsiCbcSolverInterface.hpp

    r1572 r1643  
    1818class OsiRowCut;
    1919class OsiClpSolverInterface;
    20 #ifndef COIN_DBL_MAX
    21 static const double OsiCbcInfinity = DBL_MAX;
    22 #else
    2320static const double OsiCbcInfinity = COIN_DBL_MAX;
    24 #endif
    2521
    2622//#############################################################################
Note: See TracChangeset for help on using the changeset viewer.