Changeset 372 for trunk/ClpInterior.cpp


Ignore:
Timestamp:
May 21, 2004 5:52:34 PM (16 years ago)
Author:
forrest
Message:

Moving scaling to model plus robustness fixes in simplex
still messing with interior point

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpInterior.cpp

    r369 r372  
    530530    cost_[i] = direction*obj[i];
    531531  memset(cost_+numberColumns_,0,numberRows_*sizeof(double));
     532  // do scaling if needed
     533  if (scalingFlag_>0&&!rowScale_&&1) {
     534    if (matrix_->scale(this))
     535      scalingFlag_=-scalingFlag_; // not scaled after all
     536  }
    532537  delete [] lower_;
    533538  delete [] upper_;
     
    559564  if (!sanityCheck())
    560565    goodMatrix=false;
     566  if (rowScale_) {
     567    for (i=0;i<numberColumns_;i++)
     568      cost_[i] *= columnScale_[i];
     569    for (i=0;i<numberColumns_;i++) {
     570      double multiplier = 1.0/columnScale_[i];
     571      if (columnLowerWork_[i]>-1.0e50)
     572        columnLowerWork_[i] *= multiplier;
     573      if (columnUpperWork_[i]<1.0e50)
     574        columnUpperWork_[i] *= multiplier;
     575     
     576    }
     577    for (i=0;i<numberRows_;i++) {
     578      double multiplier = rowScale_[i];
     579      if (rowLowerWork_[i]>-1.0e50)
     580        rowLowerWork_[i] *= multiplier;
     581      if (rowUpperWork_[i]<1.0e50)
     582        rowUpperWork_[i] *= multiplier;
     583    }
     584  }
    561585  assert (!errorRegion_);
    562586  errorRegion_ = new double [numberRows_];
     
    632656      dual_[i] *= optimizationDirection_;
    633657  }
     658  if (rowScale_) {
     659    for (i=0;i<numberColumns_;i++) {
     660      double scaleFactor = columnScale_[i];
     661      columnActivity_[i] *= scaleFactor;
     662      reducedCost_[i] /= scaleFactor;
     663    }
     664    for (i=0;i<numberRows_;i++) {
     665      double scaleFactor = rowScale_[i];
     666      rowActivity_[i] /= scaleFactor;
     667      dual_[i] *= scaleFactor;
     668    }
     669  }
    634670  delete [] cost_;
    635671  cost_ = NULL;
Note: See TracChangeset for help on using the changeset viewer.