Changeset 594 for branches


Ignore:
Timestamp:
Mar 31, 2007 6:29:02 AM (12 years ago)
Author:
forrest
Message:

cuts or special

Location:
branches/devel/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcHeuristicFPump.cpp

    r574 r594  
    190190  double direction = model_->solver()->getObjSense();
    191191  cutoff *= direction;
     192  double firstCutoff = fabs(cutoff);
    192193  cutoff = CoinMin(cutoff,solutionValue);
    193194  // check plausible and space for rounded solution
     
    271272    // Clone solver - otherwise annoys root node computations
    272273    OsiSolverInterface * solver = model_->solver()->clone();
    273     // if cutoff exists then add constraint
    274     if (fabs(cutoff)<1.0e20&&(fakeCutoff_!=COIN_DBL_MAX||numberTries>1)) {
     274    // if cutoff exists then add constraint
     275    bool useCutoff = (fabs(cutoff)<1.0e20&&(fakeCutoff_!=COIN_DBL_MAX||numberTries>1));
     276    // but there may be a close one
     277    if (firstCutoff<2.0*solutionValue&&numberTries==1)
     278      useCutoff=true;
     279    if (useCutoff) {
    275280      cutoff = CoinMin(cutoff,fakeCutoff_);
    276281      const double * objective = solver->getObjCoefficients();
  • branches/devel/Cbc/src/Cbc_ampl.cpp

    r587 r594  
    147147        { "sosref", 0, ASL_Sufkind_var | ASL_Sufkind_real },
    148148        { "special", 0, ASL_Sufkind_var },
     149        { "special", 0, ASL_Sufkind_con },
    149150        /*{ "special", 0, ASL_Sufkind_con },*/
    150151        { strdup("sstatus"), 0, ASL_Sufkind_var, 0 },
     
    178179  dpri = suf_get("priority", ASL_Sufkind_var);
    179180  priority = dpri->u.i;
    180   dcut = suf_get("special", ASL_Sufkind_con);
     181  dspecial = suf_get("special", ASL_Sufkind_con);
    181182  dcut = suf_get("cut", ASL_Sufkind_con);
    182183  cut = dcut->u.i;
     184  if (!cut) {
     185    // try special
     186    dcut = suf_get("special", ASL_Sufkind_con);
     187    cut = dcut->u.i;
     188  }
    183189  dspecial = suf_get("special", ASL_Sufkind_var);
    184190  special = dspecial->u.i;
Note: See TracChangeset for help on using the changeset viewer.