Changeset 723


Ignore:
Timestamp:
Aug 6, 2007 9:14:55 AM (12 years ago)
Author:
forrest
Message:

add glpk and fix ampl bug

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:externals
      •  

        old new  
        33ThirdParty/Blas https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/stable/1.0
        44ThirdParty/Lapack https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/stable/1.0
         5ThirdParty/Glpk https://projects.coin-or.org/svn/BuildTools/ThirdParty/Glpk/trunk
        56Data/Netlib   https://projects.coin-or.org/svn/Data/stable/1.0/Netlib
        67Data/Sample   https://projects.coin-or.org/svn/Data/stable/1.0/Sample
  • trunk/Cbc/src/CbcHeuristicFPump.cpp

    r715 r723  
    252252    allSlack=true;
    253253  }
     254  double time1 = CoinCpuTime();
    254255  if (when_>=11&&when_<=15) {
    255256    fixInternal = when_ >11&&when_<15;
     
    651652            <<CoinMessageEol;
    652653        pumpPrint[0]='\0';
    653         sprintf(pumpPrint+strlen(pumpPrint),"Pass %3d: obj. %10.5f --> ", numberPasses+totalNumberPasses,solver->getObjValue());
     654        if (solver->getNumRows()<3000)
     655          sprintf(pumpPrint+strlen(pumpPrint),"Pass %3d: obj. %10.5f --> ", numberPasses+totalNumberPasses,solver->getObjValue());
     656        else
     657          sprintf(pumpPrint+strlen(pumpPrint),"Pass %3d: (%.2f seconds) obj. %10.5f --> ", numberPasses+totalNumberPasses,
     658                  model_->getCurrentSeconds(),solver->getObjValue());
    654659        if (closestSolution&&solver->getObjValue()<closestObjectiveValue) {
    655660          int i;
     
    764769      }
    765770      if (returnCode) {
    766         sprintf(pumpPrint+strlen(pumpPrint),"Mini branch and bound improved solution from %g to %g",saveValue,newSolutionValue);
     771        sprintf(pumpPrint+strlen(pumpPrint),"Mini branch and bound improved solution from %g to %g (%.2f seconds)",
     772                saveValue,newSolutionValue,model_->getCurrentSeconds());
    767773        model_->messageHandler()->message(CBC_FPUMP1,model_->messages())
    768774          << pumpPrint
     
    804810        solutionValue=newSolutionValue;
    805811        solutionFound=true;
     812      } else {
     813        sprintf(pumpPrint+strlen(pumpPrint),"Mini branch and bound did not improve solution (%.2f seconds)",
     814                model_->getCurrentSeconds());
     815        model_->messageHandler()->message(CBC_FPUMP1,model_->messages())
     816          << pumpPrint
     817          <<CoinMessageEol;
     818        pumpPrint[0]='\0';
    806819      }
    807820      delete newSolver;
     
    872885  delete [] closestSolution;
    873886  delete [] integerVariable;
     887  sprintf(pumpPrint,"After %.2f seconds - Feasibility pump exiting - took %.2f seconds",
     888          model_->getCurrentSeconds(),CoinCpuTime()-time1);
     889  model_->messageHandler()->message(CBC_FPUMP1,model_->messages())
     890    << pumpPrint
     891    <<CoinMessageEol;
    874892  return finalReturnCode;
    875893}
  • trunk/Cbc/src/CbcSolver.cpp

    r720 r723  
    962962  delete si;
    963963  si=NULL;
    964   if (!badModel) {
     964  if (!badModel&&finalModel) {
    965965    finalModel->setDblParam(OsiObjOffset,coinModel.objectiveOffset());
    966966    return finalModel;
     
    30253025                  model.solver()->setHintParam(OsiDoPresolveInResolve,false,OsiHintTry);
    30263026                }
     3027                double time1a = CoinCpuTime();
    30273028                model.initialSolve();
    30283029                OsiSolverInterface * solver = model.solver();
     
    30313032                ClpSimplex * clpSolver = si->getModelPtr();
    30323033                clpSolver->setSpecialOptions(clpSolver->specialOptions()|0x01000000); // say is Cbc (and in branch and bound)
     3034                if (!noPrinting) {
     3035                  sprintf(generalPrint,"Continuous objective value is %g - %.2f seconds",
     3036                          solver->getObjValue(),CoinCpuTime()-time1a);
     3037                  generalMessageHandler->message(CLP_GENERAL,generalMessages)
     3038                    << generalPrint
     3039                    <<CoinMessageEol;
     3040                }
    30333041                if (!complicatedInteger&&clpSolver->tightenPrimalBounds()!=0) {
    30343042                  std::cout<<"Problem is infeasible - tightenPrimalBounds!"<<std::endl;
     
    34003408              {
    34013409                OsiSolverLink * solver3 = dynamic_cast<OsiSolverLink *> (babModel->solver());
    3402                 if (solver3) {
    3403                   int options = parameters[whichParam(MIPOPTIONS,numberParameters,parameters)].intValue()/10000;
     3410                int options = parameters[whichParam(MIPOPTIONS,numberParameters,parameters)].intValue()/10000;
     3411                if (solver3||(options&16)!=0) {
    34043412                  if (options) {
    34053413                    /*
  • trunk/Cbc/src/Cbc_ampl.cpp

    r696 r723  
    466466    info->numberElements=nzc;
    467467    info->numberBinary=nbv;
    468     info->numberIntegers=niv;
     468    info->numberIntegers=niv+nbv;
    469469    info->objective=obj;
    470470    info->rowLower=rowLower;
     
    524524    info->numberElements=nzc;
    525525    info->numberBinary=nbv;
    526     info->numberIntegers=niv+nlvci+nlvoi;
    527     // No idea if there are overlaps so compute
    528     int numberIntegers=0;
    529     for ( i=0; i<n_var;i++) {
    530       if (model->columnIsInteger(i))
     526    int numberIntegers=niv+nlvci+nlvoi+nbv;
     527    if (nlvci+nlvoi+nlvc+nlvo) {
     528      // Non linear
     529      // No idea if there are overlaps so compute
     530      int numberIntegers=0;
     531      for ( i=0; i<n_var;i++) {
     532        if (model->columnIsInteger(i))
    531533          numberIntegers++;
     534      }
    532535    }
    533536    info->numberIntegers=numberIntegers;
  • trunk/Externals

    r658 r723  
    33ThirdParty/Blas https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/stable/1.0
    44ThirdParty/Lapack https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/stable/1.0
     5ThirdParty/Glpk https://projects.coin-or.org/svn/BuildTools/ThirdParty/Glpk/trunk
    56Data/Netlib   https://projects.coin-or.org/svn/Data/stable/1.0/Netlib
    67Data/Sample   https://projects.coin-or.org/svn/Data/stable/1.0/Sample
Note: See TracChangeset for help on using the changeset viewer.