Changeset 1406


Ignore:
Timestamp:
Apr 3, 2009 6:30:52 AM (11 years ago)
Author:
pbonami
Message:

Add a few std:: to make it compile with Cbc trunk

Location:
stable/1.0/Bonmin/src/Interfaces
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable/1.0/Bonmin/src/Interfaces/Ampl/BonAmplTMINLP.cpp

    r1269 r1406  
    453453    // The first ones are continuous
    454454    start = end;
    455     end = max(start,end + n_non_linear_c - n_non_linear_ci - n_non_linear_b);
     455    end = std::max(start,end + n_non_linear_c - n_non_linear_ci - n_non_linear_b);
    456456    for (int i=start; i<end; i++) {
    457457      var_types[i] = CONTINUOUS;
     
    469469    // The first ones are continuous
    470470    start = end;
    471     end = max(start,end + n_non_linear_o - max(n_non_linear_b, n_non_linear_c) - n_non_linear_oi);
     471    end = std::max(start,end + n_non_linear_o - std::max(n_non_linear_b, n_non_linear_c)
     472                         - n_non_linear_oi);
    472473    for (int i=start; i<end; i++) {
    473474      var_types[i] = CONTINUOUS;
  • stable/1.0/Bonmin/src/Interfaces/BonOsiTMINLPInterface.cpp

    r1329 r1406  
    15771577      randomGenerationType = uniform;
    15781578    if(randomGenerationType_ == uniform){
    1579       double lower = min(-maxRandomRadius_,colUpper[i] - maxRandomRadius_);
    1580       lower = max(colLower[i], lower);
    1581       double upper = max(maxRandomRadius_,colLower[i] + maxRandomRadius_);
    1582       upper = min(colUpper[i],upper);
    1583       lower = min(upper,lower);
    1584       upper = max(upper, lower);
     1579      double lower = std::min(-maxRandomRadius_,colUpper[i] - maxRandomRadius_);
     1580      lower = std::max(colLower[i], lower);
     1581      double upper = std::max(maxRandomRadius_,colLower[i] + maxRandomRadius_);
     1582      upper = std::min(colUpper[i],upper);
     1583      lower = std::min(upper,lower);
     1584      upper = std::max(upper, lower);
    15851585      double interval = upper - lower;
    15861586      sol[i] = CoinDrand48()*(interval) + lower;}
    15871587    else if (randomGenerationType_ == perturb){
    1588       const double lower = max(x_init[i] - max_perturbation_, colLower[i]);
    1589       const double upper = min(x_init[i] + max_perturbation_, colUpper[i]);
     1588      const double lower = std::max(x_init[i] - max_perturbation_, colLower[i]);
     1589      const double upper = std::min(x_init[i] + max_perturbation_, colUpper[i]);
    15901590      const double interval = upper - lower;
    15911591      sol[i]  = lower + CoinDrand48()*(interval);
     
    15931593    else if (randomGenerationType_ == perturb_suffix){
    15941594      const double radius = perturb_radius[i];
    1595       const double lower = max(x_init[i] - radius*max_perturbation_, colLower[i]);
    1596       const double upper = min(x_init[i] + radius*max_perturbation_, colUpper[i]);
     1595      const double lower = std::max(x_init[i] - radius*max_perturbation_, colLower[i]);
     1596      const double upper = std::min(x_init[i] + radius*max_perturbation_, colUpper[i]);
    15971597      const double interval = upper - lower;
    15981598      sol[i]  = lower + CoinDrand48()*(interval);
     
    16611661      double rowViolation = 0;
    16621662      if(rowLower[i] > -1e10)
    1663          rowViolation = max(0.,rowLower[i] - g[i]);
     1663         rowViolation = std::max(0.,rowLower[i] - g[i]);
    16641664
    16651665      if(rowUpper[i] < 1e10);
    1666         rowViolation = max(rowViolation, g[i] - rowUpper[i]);
     1666        rowViolation = std::max(rowViolation, g[i] - rowUpper[i]);
    16671667
    16681668      norm = rowViolation > norm ? rowViolation : norm;
     
    18331833      double rhs = cuts[cutIdx].dotProduct(x2);
    18341834      double violation = 0.;
    1835       violation = max(violation, rhs - ub[cutIdx]);
    1836       violation = max(violation, lb[cutIdx] - rhs);
     1835      violation = std::max(violation, rhs - ub[cutIdx]);
     1836      violation = std::max(violation, lb[cutIdx] - rhs);
    18371837      if(violation < theta) {
    18381838        if(oaHandler_->logLevel() > 0)
     
    18961896          lb[nNonLinear_],
    18971897          ub[nNonLinear_],tiny_, 1e-15)) {
    1898         //            minCoeff = min(fabs(obj[i]), minCoeff);
     1898        //            minCoeff = std::min(fabs(obj[i]), minCoeff);
    18991899        v.insert(i,obj[i]);
    19001900        lb[nNonLinear_] += obj[i] * x[i];
     
    19071907    if(x2 != NULL) {
    19081908      double rhs = v.dotProduct(x2);
    1909       double violation = max(0., rhs - ub[nNonLinear_]);
     1909      double violation = std::max(0., rhs - ub[nNonLinear_]);
    19101910      if(violation < theta) genCut = false;
    19111911    }
     
    26372637  else if(numRetryResolve_ ||
    26382638          (numRetryInfeasibles_ && isProvenPrimalInfeasible() ))
    2639     resolveForCost(max(numRetryResolve_, numRetryInfeasibles_), 0);
     2639    resolveForCost(std::max(numRetryResolve_, numRetryInfeasibles_), 0);
    26402640
    26412641  // if warmstart_ is not empty then had to use resolveFor... and that created
  • stable/1.0/Bonmin/src/Interfaces/Filter/BonBqpdSolver.cpp

    r1143 r1406  
    252252    else {
    253253      kmax = kmax_ipt;
    254       kmax = min(kmax,n);
     254      kmax = std::min(kmax,n);
    255255    }
    256256    mlp = mlp_ipt;
  • stable/1.0/Bonmin/src/Interfaces/Filter/BonFilterSolver.cpp

    r1239 r1406  
    490490    else {
    491491      kmax = kmax_ipt;
    492       kmax = min(kmax,n);
     492      kmax = std::min(kmax,n);
    493493    }
    494494    Ipopt::Index mlp_ipt;
Note: See TracChangeset for help on using the changeset viewer.