Changeset 58


Ignore:
Timestamp:
Feb 14, 2005 9:39:11 AM (17 years ago)
Author:
forrest
Message:

add debug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Samples/sample2.cpp

    r57 r58  
    4040#include  "CoinTime.hpp"
    4141
     42//#############################################################################
    4243
    4344
     
    7475  //solver1.messageHandler()->setLogLevel(0);
    7576  CbcModel model(solver1);
    76   solver1.getModelPtr()->setDualBound(1.0e10);
    7777#elif COIN_USE_OSL
    7878  OsiOslSolverInterface solver1;
     
    9898  generator1.setMaxLook(50);
    9999  generator1.setRowCuts(3);
     100  //  generator1.snapshot(*model.solver());
     101  //generator1.createCliques(*model.solver(),2,1000,true);
     102  //generator1.setMode(0);
    100103
    101104  CglGomory generator2;
     
    127130  model.addCutGenerator(&mixedGen,-1,"MixedIntegerRounding");
    128131
     132#ifdef COIN_USE_CLP
     133  OsiClpSolverInterface * osiclp = dynamic_cast< OsiClpSolverInterface*> (model.solver());
     134  // go faster stripes
     135  if (osiclp->getNumRows()<300&&osiclp->getNumCols()<500) {
     136    osiclp->setupForRepeatedUse(2,0);
     137    printf("trying slightly less reliable but faster version (? Gomory cuts okay?)\n");
     138    printf("may not be safe if doing cuts in tree which need accuracy (level 2 anyway)\n");
     139  }
     140#endif
     141
    129142  // Allow rounding heuristic
    130143
     
    186199  //model.solver()->messageHandler()->setLogLevel(2);
    187200  //model.setPrintFrequency(50);
    188  
    189   double time1 = CoinCpuTime();
    190   // For debugging we can check if we cut off known solution
    191201  //#define DEBUG_CUTS 2
    192202#if DEBUG_CUTS==1
     
    205215  }
    206216#elif DEBUG_CUTS==2
    207   // Set up debugger by name if already in OsiRowCutDebugger list
     217  // Set up debugger by name
    208218  {
    209219    std::string problemName ;
    210     // Get name from NAME card - we could also use a known name
    211220    model.solver()->getStrParam(OsiProbName,problemName) ;
    212221    model.solver()->activateRowCutDebugger(problemName.c_str()) ;
    213222  }
    214223#endif
     224  double time1 = CoinCpuTime();
    215225
    216226  if (0) {
     
    239249           <<std::endl;
    240250
     251  printf("Exact obj %18.18g\n",model.getObjValue());
    241252  // Print more statistics
    242253  std::cout<<"Cuts at root node changed objective from "<<model.getContinuousObjective()
     
    252263             <<std::endl;
    253264  }
    254   // Print solution if there is one - we can't get names from Osi!
     265  // Print solution if finished - we can't get names from Osi!
    255266
    256267  if (model.getMinimizationObjValue()<1.0e50) {
Note: See TracChangeset for help on using the changeset viewer.