Opened 8 years ago

Closed 8 months ago

#55 closed defect (migrated)

ClpSolve::infeasibleReturn ignored

Reported by: mlubin Owned by: somebody
Priority: minor Milestone:
Component: component1 Version:
Keywords: Cc:

Description

It seems that the ClpSolve::infeasibleReturn option is ignored when infeasibility is detected from tightening primal bounds. See the code below from trunk (ClpSolve?.cpp starting at line 915):

if (method == ClpSolve::useDual) {
          double * saveLower = NULL;
          double * saveUpper = NULL;
          if (presolve == ClpSolve::presolveOn) {
               int numberInfeasibilities = model2->tightenPrimalBounds(0.0, 0);
               if (numberInfeasibilities) {
                    handler_->message(CLP_INFEASIBLE, messages_)
                              << CoinMessageEol;
                    delete model2;
                    model2 = this;
                    presolve = ClpSolve::presolveOff;
               }
          } else if (numberRows_ + numberColumns_ > 5000) {
               // do anyway
               saveLower = new double[numberRows_+numberColumns_];
               CoinMemcpyN(model2->columnLower(), numberColumns_, saveLower);
               CoinMemcpyN(model2->rowLower(), numberRows_, saveLower + numberColumns_);
               saveUpper = new double[numberRows_+numberColumns_];
               CoinMemcpyN(model2->columnUpper(), numberColumns_, saveUpper);
               CoinMemcpyN(model2->rowUpper(), numberRows_, saveUpper + numberColumns_);
               int numberInfeasibilities = model2->tightenPrimalBounds();
               if (numberInfeasibilities) {
                    handler_->message(CLP_INFEASIBLE, messages_)
                              << CoinMessageEol;
                    CoinMemcpyN(saveLower, numberColumns_, model2->columnLower());
                    CoinMemcpyN(saveLower + numberColumns_, numberRows_, model2->rowLower());
                    delete [] saveLower;
                    saveLower = NULL;
                    CoinMemcpyN(saveUpper, numberColumns_, model2->columnUpper());
                    CoinMemcpyN(saveUpper + numberColumns_, numberRows_, model2->rowUpper());
                    delete [] saveUpper;
                    saveUpper = NULL;
               }
          }

At an earlier point in the same file (line 502), there is:

if (!model2) {
               handler_->message(CLP_INFEASIBLE, messages_)
                         << CoinMessageEol;
               model2 = this;
	       eventHandler()->event(ClpEventHandler::presolveInfeasible);
               problemStatus_ = pinfo->presolveStatus(); 
               if (options.infeasibleReturn() || (moreSpecialOptions_ & 1) != 0) {
		 delete pinfo;
                    return -1;
               }
               presolve = ClpSolve::presolveOff;
	  }

The code in the first snippet should include a check for options.infeasibleReturn() as in the second snippet.

Change History (1)

comment:1 Changed 8 months ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub and will be resolved there: ​https://github.com/coin-or/Clp/issues/55

Note: See TracTickets for help on using tickets.