Changeset 432


Ignore:
Timestamp:
Sep 10, 2004 5:07:56 PM (15 years ago)
Author:
forrest
Message:

change to allSlackBasis

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpSimplex.cpp

    r423 r432  
    44824482  for (i=0;i<numberRows_;i++) {
    44834483    setRowStatus(i,basic);
     4484  }
     4485}
     4486/* Sets up all slack basis and resets solution to
     4487   as it was after initial load or readMps */
     4488void ClpSimplex::allSlackBasis(bool resetSolution)
     4489{
     4490  createStatus();
     4491  if (resetSolution) {
     4492    // put back to as it was originally
     4493    int i;
     4494    // set column status to one nearest zero
     4495    // But set value to zero if lb <0.0 and ub>0.0
     4496    for (i=0;i<numberColumns_;i++) {
     4497      if (columnLower_[i]>=0.0) {
     4498        columnActivity_[i]=columnLower_[i];
     4499        setColumnStatus(i,atLowerBound);
     4500      } else if (columnUpper_[i]<=0.0) {
     4501        columnActivity_[i]=columnUpper_[i];
     4502        setColumnStatus(i,atUpperBound);
     4503      } else if (columnLower_[i]<-1.0e20&&columnUpper_[i]>1.0e20) {
     4504        // free
     4505        columnActivity_[i]=0.0;
     4506        setColumnStatus(i,isFree);
     4507      } else if (fabs(columnLower_[i])<fabs(columnUpper_[i])) {
     4508        columnActivity_[i]=0.0;
     4509        setColumnStatus(i,atLowerBound);
     4510      } else {
     4511        columnActivity_[i]=0.0;
     4512        setColumnStatus(i,atUpperBound);
     4513      }
     4514    }
    44844515  }
    44854516}
  • trunk/include/ClpSimplex.hpp

    r427 r432  
    771771      Also can be used to set up all slack basis */
    772772  void createStatus() ;
    773   inline void allSlackBasis()
    774   { createStatus();};
     773  /** Sets up all slack basis and resets solution to
     774      as it was after initial load or readMps */
     775  void allSlackBasis(bool resetSolution=false);
    775776   
    776777  /// So we know when to be cautious
Note: See TracChangeset for help on using the changeset viewer.