Changeset 123


Ignore:
Timestamp:
Feb 10, 2003 1:13:37 PM (17 years ago)
Author:
forrest
Message:

What a mess

Files:
10 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpModel.cpp

    r119 r123  
    7878  intParam_[ClpMaxNumIterationHotStart] = 9999999;
    7979
    80   dblParam_[ClpDualObjectiveLimit] = DBL_MAX;
    81   dblParam_[ClpPrimalObjectiveLimit] = DBL_MAX;
     80  dblParam_[ClpDualObjectiveLimit] = COIN_DBL_MAX;
     81  dblParam_[ClpPrimalObjectiveLimit] = COIN_DBL_MAX;
    8282  dblParam_[ClpDualTolerance] = 1e-7;
    8383  dblParam_[ClpPrimalTolerance] = 1e-7;
     
    168168  int iRow,iColumn;
    169169
    170   rowLower_=ClpCopyOfArray(rowlb,numberRows_,-DBL_MAX);
    171   rowUpper_=ClpCopyOfArray(rowub,numberRows_,DBL_MAX);
     170  rowLower_=ClpCopyOfArray(rowlb,numberRows_,-COIN_DBL_MAX);
     171  rowUpper_=ClpCopyOfArray(rowub,numberRows_,COIN_DBL_MAX);
    172172  double * objective=ClpCopyOfArray(obj,numberColumns_,0.0);
    173173  objective_ = new ClpLinearObjective(objective,numberColumns_);
     
    175175  rowObjective_=ClpCopyOfArray(rowObjective,numberRows_);
    176176  columnLower_=ClpCopyOfArray(collb,numberColumns_,0.0);
    177   columnUpper_=ClpCopyOfArray(colub,numberColumns_,DBL_MAX);
     177  columnUpper_=ClpCopyOfArray(colub,numberColumns_,COIN_DBL_MAX);
    178178  // set default solution
    179179  for (iRow=0;iRow<numberRows_;iRow++) {
     
    272272ClpModel::getRowBound(int iRow, double& lower, double& upper) const
    273273{
    274   lower=-DBL_MAX;
    275   upper=DBL_MAX;
     274  lower=-COIN_DBL_MAX;
     275  upper=COIN_DBL_MAX;
    276276  if (rowUpper_)
    277277    upper=rowUpper_[iRow];
     
    626626                               newNumberRows,0.0,false);
    627627  rowLower_ = resizeDouble(rowLower_,numberRows_,
    628                            newNumberRows,-DBL_MAX,true);
     628                           newNumberRows,-COIN_DBL_MAX,true);
    629629  rowUpper_ = resizeDouble(rowUpper_,numberRows_,
    630                            newNumberRows,DBL_MAX,true);
     630                           newNumberRows,COIN_DBL_MAX,true);
    631631  columnActivity_ = resizeDouble(columnActivity_,numberColumns_,
    632632                                 newNumberColumns,0.0,true);
    633633  reducedCost_ = resizeDouble(reducedCost_,numberColumns_,
    634634                              newNumberColumns,0.0,true);
    635   objective_->resize(newNumberColumns);
     635  if (objective_)
     636    objective_->resize(newNumberColumns);
     637  else
     638    objective_ = new ClpLinearObjective(NULL,newNumberColumns);
    636639  columnLower_ = resizeDouble(columnLower_,numberColumns_,
    637640                              newNumberColumns,0.0,true);
    638641  columnUpper_ = resizeDouble(columnUpper_,numberColumns_,
    639                               newNumberColumns,DBL_MAX,true);
     642                              newNumberColumns,COIN_DBL_MAX,true);
    640643  if (newNumberRows<numberRows_) {
    641644    int * which = new int[numberRows_-newNumberRows];
  • trunk/ClpNonLinearCost.cpp

    r114 r123  
    8282  for (iSequence=0;iSequence<numberTotal;iSequence++) {
    8383
    84     lower_[put] = -DBL_MAX;
     84    lower_[put] = -COIN_DBL_MAX;
    8585    setInfeasible(put,true);
    8686
     
    9292    cost_[put++] = cost[iSequence]+infeasibilityCost;
    9393    if (upper[iSequence]<1.0e20) {
    94       lower_[put] = DBL_MAX;
     94      lower_[put] = COIN_DBL_MAX;
    9595      setInfeasible(put-1,true);
    9696      cost_[put++] = 1.0e50;
     
    150150
    151151  for (iSequence=0;iSequence<numberTotal;iSequence++) {
    152     lower_[put] = -DBL_MAX;
     152    lower_[put] = -COIN_DBL_MAX;
    153153    setInfeasible(put,true);
    154154    cost_[put++] = cost[iSequence]-infeasibilityCost;
     
    165165      int end = starts[iSequence+1];
    166166      assert (fabs(lower[iSequence]-lowerNon[iIndex])<1.0e-8);
    167       thisCost = -DBL_MAX;
     167      thisCost = -COIN_DBL_MAX;
    168168      for (;iIndex<end;iIndex++) {
    169169        if (lowerNon[iIndex]<upper[iSequence]-1.0e-8) {
     
    182182    cost_[put++] = thisCost+infeasibilityCost;
    183183    if (upper[iSequence]<1.0e20) {
    184       lower_[put] = DBL_MAX;
     184      lower_[put] = COIN_DBL_MAX;
    185185      setInfeasible(put-1,true);
    186186      cost_[put++] = 1.0e50;
     
    655655  int end = start_[sequence+1];
    656656  int jRange=-1;
    657   double nearest=DBL_MAX;
     657  double nearest=COIN_DBL_MAX;
    658658  for (iRange=start; iRange<end;iRange++) {
    659659    if (fabs(solutionValue-lower_[iRange])<nearest) {
  • trunk/ClpSimplex.cpp

    r119 r123  
    135135void ClpSimplex::setLargeValue( double value)
    136136{
    137   if (value>0.0&&value<DBL_MAX)
     137  if (value>0.0&&value<COIN_DBL_MAX)
    138138    largeValue_=value;
    139139}
     
    270270
    271271  // Ftran adjusted RHS and iterate to improve accuracy
    272   double lastError=DBL_MAX;
     272  double lastError=COIN_DBL_MAX;
    273273  int iRefine;
    274274  double * work = workSpace->denseVector();
     
    359359
    360360  // Btran basic costs and get as accurate as possible
    361   double lastError=DBL_MAX;
     361  double lastError=COIN_DBL_MAX;
    362362  int iRefine;
    363363  double * work = workSpace->denseVector();
     
    17491749    for (i=0;i<numberColumns_;i++) {
    17501750      if (columnLowerWork_[i]<-1.0e30)
    1751         columnLowerWork_[i] = -DBL_MAX;
     1751        columnLowerWork_[i] = -COIN_DBL_MAX;
    17521752      if (columnUpperWork_[i]>1.0e30)
    1753         columnUpperWork_[i] = DBL_MAX;
     1753        columnUpperWork_[i] = COIN_DBL_MAX;
    17541754    }
    17551755    // clean up any mismatches on infinity
    17561756    for (i=0;i<numberRows_;i++) {
    17571757      if (rowLowerWork_[i]<-1.0e30)
    1758         rowLowerWork_[i] = -DBL_MAX;
     1758        rowLowerWork_[i] = -COIN_DBL_MAX;
    17591759      if (rowUpperWork_[i]>1.0e30)
    1760         rowUpperWork_[i] = DBL_MAX;
     1760        rowUpperWork_[i] = COIN_DBL_MAX;
    17611761    }
    17621762  }
     
    21242124
    21252125          // Row is redundant - make totally free
    2126           rowLower_[iRow]=-DBL_MAX;
    2127           rowUpper_[iRow]=DBL_MAX;
     2126          rowLower_[iRow]=-COIN_DBL_MAX;
     2127          rowUpper_[iRow]=COIN_DBL_MAX;
    21282128
    21292129        } else {
     
    33713371              int j;
    33723372              // down is amount pi can go down
    3373               double maximumDown = DBL_MAX;
    3374               double maximumUp = DBL_MAX;
     3373              double maximumDown = COIN_DBL_MAX;
     3374              double maximumUp = COIN_DBL_MAX;
    33753375              double minimumDown =0.0;
    33763376              double minimumUp =0.0;
  • trunk/Makefile.Clp

    r119 r123  
    66# between then specify the exact level you want, e.g., -O1 or -O2
    77OptLevel := -g
    8 OptLevel := -O2
     8OptLevel := -O3
    99
    1010
  • trunk/Test/ClpMain.cpp

    r113 r123  
    13061306                ClpSimplex& m = models[iModel];
    13071307                CoinMpsIO writer;
    1308                 writer.setMpsData(*m.matrix(), CLP_INFINITY,
     1308                writer.setMpsData(*m.matrix(), COIN_DBL_MAX,
    13091309                                  m.getColLower(), m.getColUpper(),
    13101310                                  m.getObjCoefficients(),
  • trunk/include/ClpModel.hpp

    r119 r123  
    1515#include "ClpObjective.hpp"
    1616
    17 #define CLP_INFINITY 1e30
     17// Plus infinity
     18// Plus infinity
     19#ifndef COIN_DBL_MAX
     20#define COIN_DBL_MAX DBL_MAX
     21#endif
    1822
    1923/** This is the base class for Linear Models
     
    207211   /// Objective
    208212   inline double * objective() const           
    209   { double offset; return objective_->gradient(NULL,offset); }
     213  {
     214    if (objective_) {
     215      double offset;
     216      return objective_->gradient(NULL,offset);
     217    } else {
     218      return NULL;
     219    }
     220  }
    210221   inline const double * getObjCoefficients() const
    211   { double offset; return objective_->gradient(NULL,offset); }
     222  {
     223    if (objective_) {
     224      double offset;
     225      return objective_->gradient(NULL,offset);
     226    } else {
     227      return NULL;
     228    }
     229  }
    212230   /// Row Objective
    213231   inline double * rowObjective() const         { return rowObjective_; }
  • trunk/include/PresolveMatrix.hpp

    r63 r123  
    234234//  static const int    NO_LINK = -66666666;
    235235#define NO_LINK -66666666
    236 #define PRESOLVE_INF DBL_MAX
     236// Plus infinity
     237#ifndef COIN_DBL_MAX
     238#define COIN_DBL_MAX DBL_MAX
     239#endif
     240#define PRESOLVE_INF COIN_DBL_MAX
    237241
    238242class presolvehlink {
Note: See TracChangeset for help on using the changeset viewer.