Ignore:
Timestamp:
Oct 8, 2007 8:19:01 AM (13 years ago)
Author:
forrest
Message:

fixes for bonmin and other stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r814 r819  
    11001100        }
    11011101      }
    1102       // and add to solver if none
    1103       if (!solver_->numberObjects()) {
     1102      // and add to solver
     1103      //if (!solver_->numberObjects()) {
    11041104        solver_->addObjects(numberObjects_,object_);
    1105       } else {
    1106         if (solver_->numberObjects()!=numberOriginalObjects) {
    1107           printf("should have trapped that solver has objects before\n");
    1108           abort();
    1109         }
    1110       }
     1105        //} else {
     1106        //if (solver_->numberObjects()!=numberOriginalObjects) {
     1107        //printf("should have trapped that solver has objects before\n");
     1108        //abort();
     1109        //}
     1110        //}
    11111111    } else {
    11121112      // do from solver
     
    47814781        int iStatus = (feasible) ? 0 : 0;
    47824782        double value = obj->value();
     4783        double movement;
    47834784        if (branch)
    4784           value = ceil(value)-value;
     4785          movement = ceil(value)-value;
    47854786        else
    4786           value = value -floor(value);
    4787 #if 1
     4787          movement = value -floor(value);
     4788#if 0
     4789        // OUT as much too complicated - we are not at a natural hotstart place
    47884790        OsiBranchingInformation usefulInfo=usefulInformation();
     4791        // hotInfo is meant for BEFORE a branch so we need to fool
     4792        // was much simpler with alternate method
     4793        double save[3];
     4794        save[0]=usefulInfo.lower_[iColumn];
     4795        save[1]=usefulInfo.solution_[iColumn];
     4796        save[2]=usefulInfo.upper_[iColumn];
     4797        usefulInfo.lower_[iColumn]=floor(value);
     4798        usefulInfo.solution_[iColumn]=value;
     4799        usefulInfo.upper_[iColumn]=ceil(value);
    47894800        OsiHotInfo hotInfo(solver_,&usefulInfo,&object,0);
     4801        usefulInfo.lower_[iColumn]=save[0];
     4802        usefulInfo.solution_[iColumn]=save[1];
     4803        usefulInfo.upper_[iColumn]=save[2];
    47904804        if (branch) {
    47914805          hotInfo.setUpStatus(iStatus);
    47924806          hotInfo.setUpChange(changeInObjective);
    4793           //object->setUpEstimate(value);
     4807          //object->setUpEstimate(movement);
    47944808        } else {
    47954809          hotInfo.setDownStatus(iStatus);
    47964810          hotInfo.setDownChange(changeInObjective);
    4797           //object->setDownEstimate(value);
     4811          //object->setDownEstimate(movement);
    47984812        }
    47994813        branchingMethod_->chooseMethod()->updateInformation(&usefulInfo,branch,&hotInfo);
    48004814#else
    48014815        branchingMethod_->chooseMethod()->updateInformation(iObject,branch,changeInObjective,
    4802                                                             value,iStatus);
     4816                                                            movement,iStatus);
    48034817#endif
    48044818      }
     
    72677281        mark[iColumn]=i;
    72687282      }
     7283    } else {
     7284      // some other object - keep
     7285      newNumberObjects++;
    72697286    }
    72707287  }
Note: See TracChangeset for help on using the changeset viewer.