Changeset 1067


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

changed max/min to CoinMax/CoinMin?

Location:
trunk/Cbc
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/examples/CbcBranchUser.cpp

    r705 r1067  
    147147      // could add in depth as well
    148148      for ( i = 0 ; i < numberObjects ; i++) {
    149         int thisNumber = min(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
     149        int thisNumber = CoinMin(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
    150150        if (thisNumber<=bestNumber) {
    151151          int betterWay=0;
     
    170170              better=true;
    171171            } else if (numberInfeasibilitiesUp[i]==bestNumber) {
    172               if (min(changeUp[i],changeDown[i])<bestCriterion)
     172              if (CoinMin(changeUp[i],changeDown[i])<bestCriterion)
    173173                better=true;;
    174174            }
     
    182182          }
    183183          if (betterWay) {
    184             bestCriterion = min(changeUp[i],changeDown[i]);
     184            bestCriterion = CoinMin(changeUp[i],changeDown[i]);
    185185            bestNumber = thisNumber;
    186186            whichObject = i;
     
    201201        }
    202202        if (betterWay) {
    203           bestCriterion = min(changeUp[i],changeDown[i]);
     203          bestCriterion = CoinMin(changeUp[i],changeDown[i]);
    204204          whichObject = i;
    205205          bestWay = betterWay;
     
    209209    case 2:
    210210      for ( i = 0 ; i < numberObjects ; i++) {
    211         double change = min(changeUp[i],changeDown[i]);
     211        double change = CoinMin(changeUp[i],changeDown[i]);
    212212        double sum = changeUp[i] + changeDown[i];
    213213        bool take=false;
     
    262262      // now choose smallest change up amongst equal number infeas
    263263      for ( i = 0 ; i < numberObjects ; i++) {
    264         int thisNumber = min(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
     264        int thisNumber = CoinMin(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
    265265        if (thisNumber<=bestNumber) {
    266266          int betterWay=0;
     
    285285              better=true;
    286286            } else if (numberInfeasibilitiesUp[i]==bestNumber) {
    287               if (min(changeUp[i],changeDown[i])<bestCriterion)
     287              if (CoinMin(changeUp[i],changeDown[i])<bestCriterion)
    288288                better=true;;
    289289            }
     
    297297          }
    298298          if (betterWay) {
    299             bestCriterion = min(changeUp[i],changeDown[i]);
     299            bestCriterion = CoinMin(changeUp[i],changeDown[i]);
    300300            bestNumber = thisNumber;
    301301            whichObject = i;
  • trunk/Cbc/examples/fast0507.cpp

    r333 r1067  
    255255
    256256  // Could tune more
    257   model.setMinimumDrop(min(1.0,
     257  model.setMinimumDrop(CoinMin(1.0,
    258258                             fabs(model.getMinimizationObjValue())*1.0e-3+1.0e-4));
    259259
  • trunk/Cbc/examples/fast0507b.cpp

    r333 r1067  
    242242
    243243  // Could tune more
    244   model.setMinimumDrop(min(1.0,
     244  model.setMinimumDrop(CoinMin(1.0,
    245245                             fabs(model.getMinimizationObjValue())*1.0e-3+1.0e-4));
    246246
  • trunk/Cbc/examples/qmip.cpp

    r270 r1067  
    126126
    127127  // Could tune more
    128   model.setMinimumDrop(min(1.0,
     128  model.setMinimumDrop(CoinMin(1.0,
    129129                             fabs(model.getMinimizationObjValue())*1.0e-3+1.0e-4));
    130130
  • trunk/Cbc/examples/sample3.cpp

    r333 r1067  
    161161
    162162  // Could tune more
    163   model.setMinimumDrop(min(1.0,
     163  model.setMinimumDrop(CoinMin(1.0,
    164164                             fabs(model.getMinimizationObjValue())*1.0e-3+1.0e-4));
    165165
  • trunk/Cbc/examples/sample5.cpp

    r333 r1067  
    244244
    245245  // Could tune more
    246   model.setMinimumDrop(min(1.0,
     246  model.setMinimumDrop(CoinMin(1.0,
    247247                             fabs(model.getMinimizationObjValue())*1.0e-3+1.0e-4));
    248248
  • trunk/Cbc/src/CbcBranchActual.cpp

    r1053 r1067  
    29832983        better=true;
    29842984      } else if (numInfUp==bestNumber) {
    2985         if (min(changeUp,changeDn)<bestCriterion_)
     2985        if (CoinMin(changeUp,changeDn)<bestCriterion_)
    29862986          better=true;;
    29872987      }
     
    31153115      // could add in depth as well
    31163116      for ( i = 0 ; i < numberObjects ; i++) {
    3117         int thisNumber = min(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
     3117        int thisNumber = CoinMin(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
    31183118        if (thisNumber<=bestNumber) {
    31193119          int betterWay=0;
     
    31383138              better=true;
    31393139            } else if (numberInfeasibilitiesUp[i]==bestNumber) {
    3140               if (min(changeUp[i],changeDown[i])<bestCriterion)
     3140              if (CoinMin(changeUp[i],changeDown[i])<bestCriterion)
    31413141                better=true;;
    31423142            }
     
    31503150          }
    31513151          if (betterWay) {
    3152             bestCriterion = min(changeUp[i],changeDown[i]);
     3152            bestCriterion = CoinMin(changeUp[i],changeDown[i]);
    31533153            bestNumber = thisNumber;
    31543154            whichObject = i;
     
    31693169        }
    31703170        if (betterWay) {
    3171           bestCriterion = min(changeUp[i],changeDown[i]);
     3171          bestCriterion = CoinMin(changeUp[i],changeDown[i]);
    31723172          whichObject = i;
    31733173          bestWay = betterWay;
     
    31773177    case 2:
    31783178      for ( i = 0 ; i < numberObjects ; i++) {
    3179         double change = min(changeUp[i],changeDown[i]);
     3179        double change = CoinMin(changeUp[i],changeDown[i]);
    31803180        double sum = changeUp[i] + changeDown[i];
    31813181        bool take=false;
     
    32303230      // now choose smallest change up amongst equal number infeas
    32313231      for ( i = 0 ; i < numberObjects ; i++) {
    3232         int thisNumber = min(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
     3232        int thisNumber = CoinMin(numberInfeasibilitiesUp[i],numberInfeasibilitiesDown[i]);
    32333233        if (thisNumber<=bestNumber) {
    32343234          int betterWay=0;
     
    32533253              better=true;
    32543254            } else if (numberInfeasibilitiesUp[i]==bestNumber) {
    3255               if (min(changeUp[i],changeDown[i])<bestCriterion)
     3255              if (CoinMin(changeUp[i],changeDown[i])<bestCriterion)
    32563256                better=true;;
    32573257            }
     
    32653265          }
    32663266          if (betterWay) {
    3267             bestCriterion = min(changeUp[i],changeDown[i]);
     3267            bestCriterion = CoinMin(changeUp[i],changeDown[i]);
    32683268            bestNumber = thisNumber;
    32693269            whichObject = i;
  • trunk/Cbc/src/CbcBranchActual.hpp

    r931 r1067  
    648648  /** Method -
    649649      0 - normal - return min (up,down)
    650       1 - if before any solution return max(up,down)
    651       2 - if before branched solution return max(up,down)
    652       3 - always return max(up,down)
     650      1 - if before any solution return CoinMax(up,down)
     651      2 - if before branched solution return CoinMax(up,down)
     652      3 - always return CoinMax(up,down)
    653653  */
    654654  int method_;
  • trunk/Cbc/src/CbcGenBaB.cpp

    r709 r1067  
    331331*/
    332332  { double objFrac = fabs(model->getMinimizationObjValue())*.001+.0001 ;
    333     double minDrop = min(.05,objFrac) ;
     333    double minDrop = CoinMin(.05,objFrac) ;
    334334    model->setMinimumDrop(minDrop) ; }
    335335/*
  • trunk/Cbc/src/CbcHeuristicFPump.cpp

    r1053 r1067  
    688688          double * randomX = new double [numberIntegers];
    689689          for (i=0;i<numberIntegers;i++)
    690             randomX[i] = max(0.0,randomNumberGenerator_.randomDouble()-0.3);
     690            randomX[i] = CoinMax(0.0,randomNumberGenerator_.randomDouble()-0.3);
    691691          for (int k=0;k<10;k++) {
    692692#ifdef COIN_DEVELOP_x
     
    18781878    double largestInfeasibility =0.0;
    18791879    for (i=0 ; i < numberRows ; i++) {
    1880       largestInfeasibility = max(largestInfeasibility,
     1880      largestInfeasibility = CoinMax(largestInfeasibility,
    18811881                                 rowLower[i]-rowActivity[i]);
    1882       largestInfeasibility = max(largestInfeasibility,
     1882      largestInfeasibility = CoinMax(largestInfeasibility,
    18831883                                 rowActivity[i]-rowUpper[i]);
    18841884    }
     
    19561956  double largestInfeasibility =0.0;
    19571957  for (i=0 ; i < numberRows ; i++) {
    1958     largestInfeasibility = max(largestInfeasibility,
     1958    largestInfeasibility = CoinMax(largestInfeasibility,
    19591959                               rowLower[i]-rowActivity[i]);
    1960     largestInfeasibility = max(largestInfeasibility,
     1960    largestInfeasibility = CoinMax(largestInfeasibility,
    19611961                               rowActivity[i]-rowUpper[i]);
    19621962  }
  • trunk/Cbc/src/CbcLinked.cpp

    r854 r1067  
    28782878    clpModel->dual();  // clean up
    28792879    // compute some things using problem size
    2880     cbcModel->setMinimumDrop(min(5.0e-2,
     2880    cbcModel->setMinimumDrop(CoinMin(5.0e-2,
    28812881                                 fabs(cbcModel->getMinimizationObjValue())*1.0e-3+1.0e-4));
    28822882    if (cbcModel->getNumCols()<500)
     
    35733573      clpModel->dual();  // clean up
    35743574      // compute some things using problem size
    3575       cbcModel->setMinimumDrop(min(5.0e-2,
     3575      cbcModel->setMinimumDrop(CoinMin(5.0e-2,
    35763576                                   fabs(cbcModel->getMinimizationObjValue())*1.0e-3+1.0e-4));
    35773577      if (cbcModel->getNumCols()<500)
  • trunk/Cbc/src/CbcMain.cpp

    r768 r1067  
    821821          for ( iParam=0; iParam<numberParameters; iParam+=4 ) {
    822822            int i;
    823             for (i=iParam;i<min(numberParameters,iParam+4);i++)
     823            for (i=iParam;i<CoinMin(numberParameters,iParam+4);i++)
    824824              std::cout<<parameters[i].matchName()<<"  ";
    825825            std::cout<<std::endl;
     
    12761276              }
    12771277              // Could tune more
    1278               model->setMinimumDrop(min(1.0,
     1278              model->setMinimumDrop(CoinMin(1.0,
    12791279                                        fabs(model->getMinimizationObjValue())*1.0e-3+1.0e-4));
    12801280             
  • trunk/Cbc/src/CbcSolver.cpp

    r1058 r1067  
    1034810348    // override some settings
    1034910349    strcpy(line[numberLines++],"5  // compute some things using problem size");
    10350     strcpy(line[numberLines++],"5  cbcModel->setMinimumDrop(min(5.0e-2,");
     10350    strcpy(line[numberLines++],"5  cbcModel->setMinimumDrop(CoinMin(5.0e-2,");
    1035110351    strcpy(line[numberLines++],"5       fabs(cbcModel->getMinimizationObjValue())*1.0e-3+1.0e-4));");
    1035210352    strcpy(line[numberLines++],"5  if (cbcModel->getNumCols()<500)");
  • trunk/Cbc/src/CbcTreeLocal.cpp

    r931 r1067  
    340340    int nn=nodes_[i]->nodeInfo()->nodeNumber();
    341341    double dd = nodes_[i]->objectiveValue();
    342     largest=max(largest,nn);
    343     smallest=min(smallest,nn);
    344     largestD=max(largestD,dd);
    345     smallestD=min(smallestD,dd);
     342    largest=CoinMax(largest,nn);
     343    smallest=CoinMin(smallest,nn);
     344    largestD=CoinMax(largestD,dd);
     345    smallestD=CoinMin(smallestD,dd);
    346346  }
    347347  if (model_->messageHandler()->logLevel()>0) {
     
    813813  CoinPackedVector row = cut_.row();
    814814  for (int k=0; k<row.getNumElements(); k++)
    815     smallest = min(smallest,fabs(row.getElements()[k]));
     815    smallest = CoinMin(smallest,fabs(row.getElements()[k]));
    816816  if (!typeCuts_&&!refine_) {
    817817    // Reverse cut very very weakly
  • trunk/Cbc/src/ClpAmplObjective.cpp

    r687 r1067  
    3434  numberColumns_ = numberColumns;
    3535  if (numberExtendedColumns>=0)
    36     numberExtendedColumns_= max(numberColumns_,numberExtendedColumns);
     36    numberExtendedColumns_= CoinMax(numberColumns_,numberExtendedColumns);
    3737  else
    3838    numberExtendedColumns_= numberColumns_;
  • trunk/Cbc/src/unitTestClp.cpp

    r1062 r1067  
    367367#endif
    368368    }
    369     model->setMinimumDrop(min(5.0e-2,
     369    model->setMinimumDrop(CoinMin(5.0e-2,
    370370                              fabs(model->getMinimizationObjValue())*1.0e-3+1.0e-4));
    371371    if (CoinAbs(model->getMaximumCutPassesAtRoot())<=100) {
Note: See TracChangeset for help on using the changeset viewer.