Changeset 1981


Ignore:
Timestamp:
May 27, 2012 6:47:33 AM (7 years ago)
Author:
pbonami
Message:

Fix bug in cleaning of small coefficients

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Interfaces/BonOsiTMINLPInterface.cpp

    r1962 r1981  
    18761876    double infty)
    18771877{
     1878  //return 1;
    18781879  if(fabs(value)>= tiny) return 1;
    18791880
     
    18861887  bool rowNotUpBounded = rowUpper >= infty;
    18871888  bool pos =  value > 0;
    1888 
    1889   if(colLoBounded && pos && rowNotUpBounded) {
    1890     lb += value * (colsol - colLower);
     1889  if(colUpBounded && pos && rowNotUpBounded) {
     1890    lb += value * (colsol - colUpper);
    18911891    return 0;
    18921892  }
    18931893  else
    1894     if(colLoBounded && !pos && rowNotLoBounded) {
    1895       ub += value * (colsol - colLower);
     1894    if(colUpBounded && !pos && rowNotLoBounded) {
     1895      ub += value * (colsol - colUpper);
    18961896      return 0;
    18971897    }
    18981898    else
    1899       if(colUpBounded && !pos && rowNotUpBounded) {
    1900         lb += value * (colsol - colUpper);
     1899      if(colLoBounded && !pos && rowNotUpBounded) {
     1900        lb += value * (colsol - colLower);
    19011901        return 0;
    19021902      }
    19031903      else
    1904         if(colUpBounded && pos && rowNotLoBounded) {
    1905           ub += value * (colsol - colUpper);
     1904        if(colLoBounded && pos && rowNotLoBounded) {
     1905          ub += value * (colsol - colLower);
    19061906          return 0;
    19071907        }
    1908   //can not remove coefficient increase it to smallest non zero
    1909   if(pos) value = tiny;
    1910   else
    1911     value = - tiny;
     1908  //can not remove coefficient
    19121909  return 1;
    19131910}
     
    20352032      newCut.setGloballyValidAsInteger(1);
    20362033    }
    2037     if(fabs(lb[cutIdx]) < tiny_) lb[cutIdx] = 0;
    2038     if(fabs(ub[cutIdx]) < tiny_) ub[cutIdx] = 0;
     2034    //if(fabs(lb[cutIdx]) < tiny_) lb[cutIdx] = 0;
     2035    //if(fabs(ub[cutIdx]) < tiny_) ub[cutIdx] = 0;
    20392036    newCut.setLb(lb[cutIdx]);
    20402037    newCut.setUb(ub[cutIdx]);
Note: See TracChangeset for help on using the changeset viewer.