Changeset 1276 for trunk/Clp/examples


Ignore:
Timestamp:
Sep 16, 2008 5:31:36 PM (11 years ago)
Author:
ladanyi
Message:

changed max/min to CoinMax/CoinMin?

Location:
trunk/Clp/examples
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/examples/decompose.cpp

    r778 r1276  
    340340            if (fabs(value)>1.0e-15) {
    341341              dj -= dual[i]*value;
    342               smallest = min(smallest,fabs(value));
    343               largest = max(largest,fabs(value));
     342              smallest = CoinMin(smallest,fabs(value));
     343              largest = CoinMax(largest,fabs(value));
    344344              rowAdd[number]=i;
    345345              elementAdd[number++]=value;
     
    376376            if (fabs(value)>1.0e-15) {
    377377              dj -= dual[i]*value;
    378               smallest = min(smallest,fabs(value));
    379               largest = max(largest,fabs(value));
     378              smallest = CoinMin(smallest,fabs(value));
     379              largest = CoinMax(largest,fabs(value));
    380380              rowAdd[number]=i;
    381381              elementAdd[number++]=value;
  • trunk/Clp/examples/dualCuts.cpp

    r1265 r1276  
    8686  // Just add this number of rows each time in small problem
    8787  int smallNumberRows = 2*numberColumns;
    88   smallNumberRows=min(smallNumberRows,originalNumberRows/20);
     88  smallNumberRows=CoinMin(smallNumberRows,originalNumberRows/20);
    8989  // and pad out with random rows
    9090  double ratio = ((double)(smallNumberRows-numberSort))/((double) originalNumberRows);
     
    104104  double * columnUpper = model2->columnUpper();
    105105  for (iColumn=0;iColumn<numberColumns;iColumn++) {
    106     columnLower[iColumn]=max(-1.0e6,columnLower[iColumn]);
    107     columnUpper[iColumn]=min(1.0e6,columnUpper[iColumn]);
     106    columnLower[iColumn]=CoinMax(-1.0e6,columnLower[iColumn]);
     107    columnUpper[iColumn]=CoinMin(1.0e6,columnUpper[iColumn]);
    108108  }
    109109#endif
     
    183183          if (iPass<takeOutPass&&!dualInfeasible) {
    184184            // may have hit max iterations so check
    185             double infeasibility = max(fullSolution[iRow]-rowUpper[iRow],
     185            double infeasibility = CoinMax(fullSolution[iRow]-rowUpper[iRow],
    186186                                       rowLower[iRow]-fullSolution[iRow]);
    187187            weight[iRow]=-infeasibility;
     
    210210        if (weight[iRow]==1.123e50) {
    211211          // not looked at yet
    212           double infeasibility = max(fullSolution[iRow]-rowUpper[iRow],
     212          double infeasibility = CoinMax(fullSolution[iRow]-rowUpper[iRow],
    213213                                     rowLower[iRow]-fullSolution[iRow]);
    214214          weight[iRow]=-infeasibility;
     
    221221      // sort
    222222      CoinSort_2(weight,weight+originalNumberRows,sort);
    223       numberSort = min(originalNumberRows,smallNumberRows+numberKept);
     223      numberSort = CoinMin(originalNumberRows,smallNumberRows+numberKept);
    224224      memset(take,0,originalNumberRows);
    225225      for (iRow=0;iRow<numberSort;iRow++)
  • trunk/Clp/examples/myPdco.cpp

    r1171 r1276  
    232232    ir[nonzpt++] = *ifrom;
    233233    ir[nonzpt++] = *ito;
    234     imax = max(imax, *ifrom);
    235     imax = max(imax, *ito);
    236     imin = min(imin, *ifrom);
    237     imin = min(imin, *ito);
     234    imax = CoinMax(imax, *ifrom);
     235    imax = CoinMax(imax, *ito);
     236    imin = CoinMin(imin, *ifrom);
     237    imin = CoinMin(imin, *ito);
    238238  }
    239239  fclose(fpData);
     
    294294  model.dj_=dj;
    295295  model.xsize_ = 50/ncol;
    296   model.xsize_ = min(model.xsize_, 1.0);
     296  model.xsize_ = CoinMin(model.xsize_, 1.0);
    297297  model.zsize_ = 1;
    298298}
  • trunk/Clp/examples/pdco.cpp

    r1171 r1276  
    5656  // These are already set?
    5757  model.xsize_ = 50.0/(model.numberColumns());
    58   model.xsize_ = min( 1.0, model.xsize_);
     58  model.xsize_ = CoinMin( 1.0, model.xsize_);
    5959
    6060  /*
  • trunk/Clp/examples/sprint.cpp

    r230 r1276  
    117117
    118118  // Just take this number of columns in small problem
    119   int smallNumberColumns = min(3*numberRows,numberColumns);
    120   smallNumberColumns = max(smallNumberColumns,3000);
     119  int smallNumberColumns = CoinMin(3*numberRows,numberColumns);
     120  smallNumberColumns = CoinMax(smallNumberColumns,3000);
    121121  // We will be using all rows
    122122  int * whichRows = new int [numberRows];
  • trunk/Clp/examples/testGub.cpp

    r778 r1276  
    9090          break;
    9191        } else {
    92           last=max(last,iColumn);
    93           first = min(first,iColumn);
     92          last=CoinMax(last,iColumn);
     93          first = CoinMin(first,iColumn);
    9494        }
    9595      }
  • trunk/Clp/examples/testGub2.cpp

    r778 r1276  
    108108          break;
    109109        } else {
    110           last=max(last,iColumn);
    111           first = min(first,iColumn);
     110          last=CoinMax(last,iColumn);
     111          first = CoinMin(first,iColumn);
    112112        }
    113113      }
Note: See TracChangeset for help on using the changeset viewer.