Changeset 1343 for trunk/Clp


Ignore:
Timestamp:
Mar 3, 2009 3:45:19 PM (11 years ago)
Author:
forrest
Message:

changes to make dual a nit more reliable

Location:
trunk/Clp/src
Files:
4 edited

Legend:

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

    r1321 r1343  
    381381    chosenRow=pivotRow();
    382382    model_->setLargestDualError(saveError);
     383  }
     384  if (chosenRow<0&&lastPivotRow<0){
     385    int nLeft=0;
     386    for (int i=0;i<number;i++) {
     387      int iRow = index[i];
     388      if (fabs(infeas[iRow])>1.0e-50) {
     389        index[nLeft++]=iRow;
     390      } else {
     391        infeas[iRow]=0.0;
     392      }
     393    }
     394    infeasible_->setNumElements(nLeft);
     395    model_->setNumberPrimalInfeasibilities(nLeft);
    383396  }
    384397  return chosenRow;
  • trunk/Clp/src/ClpSimplex.hpp

    r1326 r1343  
    950950  inline double theta() const
    951951  { return theta_;}
     952  /** Best possible improvement using djs (primal) or
     953      obj change by flipping bounds to make dual feasible (dual) */
     954  inline double bestPossibleImprovement() const
     955  { return bestPossibleImprovement_;}
    952956  /// Return pointer to details of costs
    953957  inline ClpNonLinearCost * nonLinearCost() const
  • trunk/Clp/src/ClpSimplexDual.cpp

    r1329 r1343  
    38603860  bool unflagVariables = true;
    38613861  bool weightsSaved=false;
     3862  bool weightsSaved2=numberIterations_&&!numberPrimalInfeasibilities_;
    38623863  int dontFactorizePivots = dontFactorizePivots_;
    38633864  if (type==3) {
     
    48674868        dualRowPivot_->saveWeights(this,6);
    48684869      }
     4870    } else if (weightsSaved2&&numberPrimalInfeasibilities_) {
     4871      dualRowPivot_->saveWeights(this,3);
    48694872    }
    48704873  }
  • trunk/Clp/src/ClpSolve.cpp

    r1326 r1343  
    27802780    return -1;
    27812781  double objective = model_->rawObjectiveValue();
     2782  if (model_->algorithm()<0)
     2783    objective -= model_->bestPossibleImprovement();
    27822784  double infeasibility;
    27832785  double realInfeasibility=0.0;
Note: See TracChangeset for help on using the changeset viewer.