Changeset 483


Ignore:
Timestamp:
Oct 21, 2004 4:20:31 PM (15 years ago)
Author:
forrest
Message:

Marc Pfetsch problems

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPrimalColumnSteepest.cpp

    r451 r483  
    27772777  const int * pivotVariable = model_->pivotVariable();
    27782778  bool doInfeasibilities=true;
    2779   if (mode==1&&weights_) {
    2780     if (pivotSequence_>=0) {
    2781       // clean array first
    2782       alternateWeights_->clear();
    2783       // save pivot order
    2784       memcpy(alternateWeights_->getIndices(),pivotVariable,
    2785              numberRows*sizeof(int));
    2786       // change from pivot row number to sequence number
    2787       pivotSequence_=pivotVariable[pivotSequence_];
    2788     } else {
    2789       alternateWeights_->clear();
    2790     }
    2791     state_=1;
     2779  if (mode==1) {
     2780    if(weights_) {
     2781      // Check if size has changed
     2782      if (infeasible_->capacity()==numberRows+numberColumns&&
     2783        alternateWeights_->capacity()==numberRows+
     2784          model_->factorization()->maximumPivots()) {
     2785        if (pivotSequence_>=0) {
     2786          // clean array first
     2787          alternateWeights_->clear();
     2788          // save pivot order
     2789          memcpy(alternateWeights_->getIndices(),pivotVariable,
     2790                 numberRows*sizeof(int));
     2791          // change from pivot row number to sequence number
     2792          pivotSequence_=pivotVariable[pivotSequence_];
     2793        } else {
     2794          alternateWeights_->clear();
     2795        }
     2796        state_=1;
     2797      } else {
     2798        // size has changed - clear everything
     2799        delete [] weights_;
     2800        weights_=NULL;
     2801        delete infeasible_;
     2802        infeasible_=NULL;
     2803        delete alternateWeights_;
     2804        alternateWeights_=NULL;
     2805        delete [] savedWeights_;
     2806        savedWeights_=NULL;
     2807        delete [] reference_;
     2808        reference_=NULL;
     2809        state_=-1;
     2810        pivotSequence_=-1;
     2811      }
     2812    }
    27922813  } else if (mode==2||mode==4||mode==5) {
    27932814    // restore
  • trunk/ClpSimplex.cpp

    r480 r483  
    26062606  }
    26072607
    2608   if ((what&16)!=0&&!rowArray_[2]) {
    2609     // get some arrays
    2610     int iRow,iColumn;
    2611     // these are "indexed" arrays so we always know where nonzeros are
    2612     /**********************************************************
     2608  if (what==63) {
     2609    if (newArrays) {
     2610      // get some arrays
     2611      int iRow,iColumn;
     2612      // these are "indexed" arrays so we always know where nonzeros are
     2613      /**********************************************************
    26132614      rowArray_[3] is long enough for rows+columns
    2614     *********************************************************/
    2615     for (iRow=0;iRow<4;iRow++) {
    2616       if (!rowArray_[iRow]) {
     2615      *********************************************************/
     2616      for (iRow=0;iRow<4;iRow++) {
     2617        delete rowArray_[iRow];
    26172618        rowArray_[iRow]=new CoinIndexedVector();
    26182619        int length =numberRows2+factorization_->maximumPivots();
     
    26212622        rowArray_[iRow]->reserve(length);
    26222623      }
    2623     }
    2624    
    2625     for (iColumn=0;iColumn<2;iColumn++) {
    2626       if (!columnArray_[iColumn]) {
     2624     
     2625      for (iColumn=0;iColumn<2;iColumn++) {
     2626        delete columnArray_[iColumn];
    26272627        columnArray_[iColumn]=new CoinIndexedVector();
    26282628        if (!iColumn)
     
    28902890  // scaling may have been turned off
    28912891  scalingFlag_ = abs(scalingFlag_);
    2892   if(getRidOfFactorizationData>0)
     2892  if(getRidOfFactorizationData>0) {
    28932893    gutsOfDelete(getRidOfFactorizationData+1);
     2894  } else {
     2895    // at least get rid of nonLinearCost_
     2896    delete nonLinearCost_;
     2897    nonLinearCost_=NULL;
     2898  }
    28942899  // get rid of data
    28952900  matrix_->generalExpanded(this,13,scalingFlag_);
     
    55185523    if (nonLinearCost_==NULL&&algorithm_>0) {
    55195524      // get a valid nonlinear cost function
    5520       delete nonLinearCost_;
    55215525      nonLinearCost_= new ClpNonLinearCost(this);
    55225526    }
Note: See TracChangeset for help on using the changeset viewer.