Changeset 2364


Ignore:
Timestamp:
Feb 22, 2018 7:01:40 AM (4 months ago)
Author:
forrest
Message:

should not be tolerance in SOS

File:
1 edited

Legend:

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

    r2070 r2364  
    204204    const double * upper = solver->getColUpper();
    205205    //double largestValue=0.0;
     206#define ZERO_SOS_TOLERANCE 1.0e-14
     207#ifndef ZERO_SOS_TOLERANCE
    206208    double integerTolerance =
    207209        model_->getDblParam(CbcModel::CbcIntegerTolerance);
     210#else
     211    double integerTolerance = ZERO_SOS_TOLERANCE;
     212#endif
    208213    double weight = 0.0;
    209214    double sum = 0.0;
     
    471476    const double * lower = solver->getColLower();
    472477    const double * upper = solver->getColUpper();
     478#ifndef ZERO_SOS_TOLERANCE
    473479    double integerTolerance =
    474480        model_->getDblParam(CbcModel::CbcIntegerTolerance);
     481#else
     482    double integerTolerance = ZERO_SOS_TOLERANCE;
     483#endif
    475484    double weight = 0.0;
    476485    double sum = 0.0;
     
    535544    int j;
    536545    const double * solution = model_->testSolution();
     546#ifndef ZERO_SOS_TOLERANCE
    537547    double integerTolerance =
    538548        model_->getDblParam(CbcModel::CbcIntegerTolerance);
     549#else
     550    double integerTolerance = ZERO_SOS_TOLERANCE;
     551#endif
    539552    //OsiSolverInterface * solver = model_->solver();
    540553    const double * lower = solver->getColLower();
     
    621634    bool feasible = iStatus != 1;
    622635    if (feasible) {
     636#ifndef ZERO_SOS_TOLERANCE
    623637        double integerTolerance =
    624             model_->getDblParam(CbcModel::CbcIntegerTolerance);
     638          model_->getDblParam(CbcModel::CbcIntegerTolerance);
     639#else
     640        double integerTolerance = ZERO_SOS_TOLERANCE;
     641#endif
    625642        const int * integerVariable = model_->integerVariable();
    626643        for (i = 0; i < numberIntegers; i++) {
     
    714731    int j;
    715732    const double * solution = model_->testSolution();
     733#ifndef ZERO_SOS_TOLERANCE
    716734    double integerTolerance =
    717735        model_->getDblParam(CbcModel::CbcIntegerTolerance);
     736#else
     737    double integerTolerance = ZERO_SOS_TOLERANCE;
     738#endif
    718739    OsiSolverInterface * solver = model_->solver();
    719740    const double * upper = solver->getColUpper();
Note: See TracChangeset for help on using the changeset viewer.