Changeset 1679 for trunk/Clp


Ignore:
Timestamp:
Feb 4, 2011 11:17:56 AM (9 years ago)
Author:
forrest
Message:

Add code to help when bad cuts are added by user i.e. ones with tiny
or zero elements. May not fix all problems as Cbc assumes users check
the cuts they generate and so does not do all checks.

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpPackedMatrix.cpp

    r1678 r1679  
    32643264     int * columnLength = matrix_->getMutableVectorLengths();
    32653265     double * elementByColumn = matrix_->getMutableElements();
    3266      bool deletedElements = false;
     3266     int deletedElements = 0;
    32673267     for (iColumn = 0; iColumn < numberColumns; iColumn++) {
    32683268          CoinBigIndex j;
     
    33013301          usefulColumn[iColumn] = useful;
    33023302          if (deleteSome) {
    3303                deletedElements = true;
    33043303               CoinBigIndex put = start;
    33053304               for (j = start; j < end; j++) {
     
    33103309                    }
    33113310               }
     3311               deletedElements += end - put;
    33123312               columnLength[iColumn] = put - start;
    33133313          }
    33143314     }
     3315     if (deletedElements)
     3316       matrix_->setNumElements(matrix_->getNumElements()-deletedElements);
    33153317     model->messageHandler()->message(CLP_PACKEDSCALE_INITIAL, *model->messagesPointer())
    33163318               << smallest << largest
  • trunk/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r1678 r1679  
    13361336                                                         which,whichC);
    13371337    int totalIterations = model2->numberIterations();
     1338    delete model2;
    13381339    //modelPtr_->setLogLevel(63);
    13391340    modelPtr_->primal(1);
    13401341    modelPtr_->setNumberIterations(totalIterations+modelPtr_->numberIterations());
    1341     delete model2;
    13421342  } else {
    13431343    modelPtr_->dual();
     
    28412841const CoinPackedMatrix * OsiClpSolverInterface::getMatrixByRow() const
    28422842{
    2843   if ( matrixByRow_ == NULL ) {
     2843  if ( matrixByRow_ == NULL ||
     2844       matrixByRow_->getNumElements() !=
     2845       modelPtr_->clpMatrix()->getNumElements() ) {
     2846    delete matrixByRow_;
    28442847    matrixByRow_ = new CoinPackedMatrix();
    28452848    matrixByRow_->setExtraGap(0.0);
Note: See TracChangeset for help on using the changeset viewer.