Changeset 1223 for trunk/Clp


Ignore:
Timestamp:
Jul 7, 2008 4:51:38 PM (12 years ago)
Author:
forrest
Message:

add code to compute integer infeasibility every iteration

File:
1 edited

Legend:

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

    r1212 r1223  
    15921592ClpSimplex::housekeeping(double objectiveChange)
    15931593{
     1594  //#define COMPUTE_INT_INFEAS
     1595#ifdef COMPUTE_INT_INFEAS
     1596  if (algorithm_>0&&integerType_) {
     1597    if (fabs(theta_)>1.0e-6||!numberIterations_) {
     1598      int numberFixed=0;
     1599      int numberUnsat=0;
     1600      int numberSat=0;
     1601      double sumUnsat=0.0;
     1602      for (int i=0;i<numberColumns_;i++) {
     1603        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);
     1610          } else {
     1611            numberSat++;
     1612          }
     1613        } else {
     1614          numberFixed++;
     1615        }
     1616      }
     1617      printf("iteration %d, %d unsatisfied (%g), %d fixed, %d satisfied\n",
     1618             numberIterations_,numberUnsat,sumUnsat,numberFixed,numberSat);
     1619    }
     1620  }
     1621#endif
    15941622  // save value of incoming and outgoing
    15951623  double oldIn = solution_[sequenceIn_];
Note: See TracChangeset for help on using the changeset viewer.