Changeset 1936


Ignore:
Timestamp:
Apr 9, 2013 6:29:27 AM (6 years ago)
Author:
forrest
Message:

fixes so examples will work

Location:
trunk/Clp/src
Files:
4 edited

Legend:

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

    r1676 r1936  
    101101     startColumn_[0] = 0;
    102102     cost_ = new double[maximumGubColumns_];
    103      dynamicStatus_ = new unsigned char [maximumGubColumns_];
     103     dynamicStatus_ = new unsigned char [2*maximumGubColumns_];
    104104     memset(dynamicStatus_, 0, maximumGubColumns_);
    105105     id_ = new int[maximumGubColumns_];
     
    158158               columnUpper[i] = 1.0e10;
    159159     }
     160     status_ = new unsigned char [2*numberSets_+4];
    160161     if (status) {
    161           status_ = ClpCopyOfArray(status, numberSets_);
     162          memcpy(status_,status, numberSets_ * sizeof(char));
    162163          assert (dynamicStatus);
    163164          CoinMemcpyN(dynamicStatus, numberIds, dynamicStatus_);
     
    165166     } else {
    166167          assert (!numberIds);
    167           status_ = new unsigned char [numberSets_];
    168168          memset(status_, 0, numberSets_);
    169169          for (i = 0; i < numberSets_; i++) {
     
    220220     }
    221221}
     222#if 0
    222223// This constructor just takes over ownership
    223224ClpDynamicExampleMatrix::ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
     
    260261     startColumn_[0] = 0;
    261262     cost_ = new double[maximumGubColumns_];
    262      dynamicStatus_ = new unsigned char [maximumGubColumns_];
     263     dynamicStatus_ = new unsigned char [2*maximumGubColumns_];
    263264     memset(dynamicStatus_, 0, maximumGubColumns_);
    264265     id_ = new int[maximumGubColumns_];
     
    310311               columnUpper[i] = 1.0e10;
    311312     }
     313     status_ = new unsigned char [2*numberSets_+4];
    312314     if (status) {
    313           status_ = ClpCopyOfArray(status, numberSets_);
     315          memcpy(status_,status, numberSets_ * sizeof(char));
    314316          assert (dynamicStatus);
    315317          CoinMemcpyN(dynamicStatus, numberIds, dynamicStatus_);
     
    317319     } else {
    318320          assert (!numberIds);
    319           status_ = new unsigned char [numberSets_];
    320321          memset(status_, 0, numberSets_);
    321322          for (i = 0; i < numberSets_; i++) {
     
    373374     }
    374375}
     376#endif
    375377//-------------------------------------------------------------------
    376378// Destructor
  • trunk/Clp/src/ClpDynamicExampleMatrix.hpp

    r1665 r1936  
    7272                             const unsigned char * dynamicStatus = NULL,
    7373                             int numberIds = 0, const int *ids = NULL);
     74#if 0
    7475     /// This constructor just takes over ownership (except for lower, upper)
    7576     ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
     
    8283                             const unsigned char * dynamicStatus = NULL,
    8384                             int numberIds = 0, const int *ids = NULL);
    84 
     85#endif
    8586     /** Destructor */
    8687     virtual ~ClpDynamicExampleMatrix();
  • trunk/Clp/src/ClpDynamicMatrix.cpp

    r1732 r1936  
    156156               next_[last] = -iSet - 1;
    157157          }
    158      }
    159      startSet_[numberSets_] = starts[numberSets_];
     158          startSet_[numberSets_] = starts[numberSets_];
     159     }
    160160     int numberColumns = model->numberColumns();
    161161     int numberRows = model->numberRows();
     
    177177     startColumn_ = ClpCopyOfArray(startColumn, numberGubColumns_ + 1);
    178178     if (!numberGubColumns_) {
    179        //startColumn_ = new CoinBigIndex [1];
     179       if (!startColumn_)
     180         startColumn_ = new CoinBigIndex [1];
    180181       startColumn_[0] = 0;
    181182     }
  • trunk/Clp/src/ClpModel.cpp

    r1926 r1936  
    22862286          }
    22872287#endif
    2288           //if (elements)
    2289           matrix_->appendMatrix(number, 1, columnStarts, rows, elements);
     2288          if (elements)
     2289            matrix_->appendMatrix(number, 1, columnStarts, rows, elements);
    22902290     }
    22912291}
Note: See TracChangeset for help on using the changeset viewer.