Changeset 1226 for trunk


Ignore:
Timestamp:
Jul 9, 2008 10:16:39 AM (12 years ago)
Author:
forrest
Message:

correct solution investigation

File:
1 edited

Legend:

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

    r1224 r1226  
    15941594  //#define COMPUTE_INT_INFEAS
    15951595#ifdef COMPUTE_INT_INFEAS
    1596   if (algorithm_>0&&integerType_&&!sumPrimalInfeasibilities_) {
     1596  if (algorithm_>0&&integerType_&&!nonLinearCost_->numberInfeasibilities()) {
    15971597    if (fabs(theta_)>1.0e-6||!numberIterations_) {
    15981598      int numberFixed=0;
     
    16001600      int numberSat=0;
    16011601      double sumUnsat=0.0;
     1602      double tolerance = 10.0*primalTolerance_;
     1603      double mostAway=0.0;
     1604      int iAway=-1;
    16021605      for (int i=0;i<numberColumns_;i++) {
    16031606        if (upper_[i]>lower_[i]) {
    1604           double value = columnScale_ ? solution_[i]*columnScale_[i] : solution_[i];
    1605           double closest = floor(value+0.5);
    1606           // problem may be perturbed so relax test
    1607           if (fabs(value-closest)>1.0e-4) {
    1608             numberUnsat++;
    1609             sumUnsat += fabs(value-closest);
     1607          double value = solution_[i];
     1608          if (value>lower_[i]+tolerance&&
     1609              value<upper_[i]-tolerance) {
     1610            if (columnScale_)
     1611              value *= columnScale_[i];
     1612            double closest = floor(value+0.5);
     1613            // problem may be perturbed so relax test
     1614            if (fabs(value-closest)>1.0e-4) {
     1615              numberUnsat++;
     1616              sumUnsat += fabs(value-closest);
     1617              if (mostAway<fabs(value-closest)) {
     1618                mostAway=fabs(value-closest);
     1619                iAway=i;
     1620              }
     1621            } else {
     1622              numberSat++;
     1623            }
    16101624          } else {
    16111625            numberSat++;
     
    16151629        }
    16161630      }
    1617       printf("iteration %d, %d unsatisfied (%g), %d fixed, %d satisfied\n",
    1618              numberIterations_,numberUnsat,sumUnsat,numberFixed,numberSat);
     1631      printf("iteration %d, %d unsatisfied (%g,%g), %d fixed, %d satisfied\n",
     1632             numberIterations_,numberUnsat,sumUnsat,mostAway,numberFixed,numberSat);
    16191633    }
    16201634  }
Note: See TracChangeset for help on using the changeset viewer.