Changeset 1244 for trunk


Ignore:
Timestamp:
Mar 10, 2018 12:39:11 PM (21 months ago)
Author:
pbelotti
Message:

clean up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/bound_tightening/FixPointGenCuts.cpp

    r1241 r1244  
    246246
    247247    if (extendedModel_ || cut -> ub () <  COUENNE_INFINITY)
    248       for (int i=0; i<nEl; i++) 
     248      for (int i=0; i<nEl; i++)
    249249        createRow (+1, ind [i], n, fplp, ind, coe, cut -> ub (), nEl, extendedModel_, m + j, m + nCuts); // downward constraints -- on x_i
    250250
     
    284284  /// (possibly) better bounds
    285285
    286   fplp -> setObjSense (-1.); // we want to maximize
    287 
    288   //printf ("(writing lp) "); fflush (stdout);
    289   //fplp -> writeLp ("fplp");
    290 
    291   // sometimes Clp gets stuck on these fplps...
    292   fplp -> setIntParam (OsiMaxNumIteration, CoinMax (100, fplp -> getNumRows ()));
    293 
    294   // we are maximizing the size of the box. If the initial box [l0,u0]
    295   // is bounded, since the final one is contained in [l0,u0] we can
    296   // set as a primal limit (Clp will stop after reaching it) a value
    297   // close to it, since we won't need tightening if the one norm is
    298   // very close to the old one.
    299 
    300   double one_norm = 0;
    301   bool one_inf_bd = false;
    302 
    303   for (int i=0; i<n; ++i) {
    304 
    305     if ((oldLB [i] < -COUENNE_INFINITY) ||
    306         (oldUB [i] >  COUENNE_INFINITY)) {
    307       one_inf_bd = true;
    308       break;
    309     }
    310 
    311     one_norm += (oldUB [i] - oldLB [i]);
    312   }
    313 
    314 #define APPROX_USELESS .99
    315 
    316   //csi -> setDblParam (OsiDualObjectiveLimit, COIN_DBL_MAX);
    317   if (!one_inf_bd)
    318     fplp -> setDblParam (OsiPrimalObjectiveLimit, APPROX_USELESS * one_norm);
     286  fplp -> setObjSense (-1.); // we want to maximize
    319287
    320288  fplp -> initialSolve ();
    321 
    322   //fplp -> writeLp ("beforefplp"); // TODO: remove
    323289
    324290  // Extra pre-solve: if the initial LP is unbounded (that is,
     
    326292  // call to BT. This is a cheap way not to throw
    327293
    328   if (fplp   -> isProvenDualInfeasible   () &&
    329       !(fplp -> isProvenPrimalInfeasible ())) {
     294  if (fplp -> isProvenDualInfeasible ())
    330295
    331296    problem_ -> Jnlst () -> Printf (J_WARNING, J_BOUNDTIGHTENING, "FPLP unbounded: extra BT\n");
     
    336301
    337302    // Otherwise, reset bounds on auxiliaries based on new bounds in problem_ -> domain ();
    338    
     303
    339304    for (int i=0; i<n; i++) {
    340305      fplp -> setColLower (  i, problem_ -> Lb (i)); // set lower bound for xL [i]
     
    344309    }
    345310
    346     //fplp -> writeLp ("fplp+bt"); // TODO: remove
    347 
    348311    fplp -> resolve ();
    349312  }
     
    354317
    355318  double infeasBounds [] = {1,-1};
    356 
    357   //problem_ -> Jnlst () -> Printf (J_WARNING, J_BOUNDTIGHTENING, "FBBTFP point:\n");
    358319
    359320  if (fplp -> isProvenOptimal ()) {
     
    445406  //  problem_ -> Jnlst () -> Printf (J_ERROR, J_BOUNDTIGHTENING, "END\n");
    446407
    447   delete fplp;
    448 
    449408  perfIndicator_. update (newLB, newUB, treeInfo.level);
    450409  perfIndicator_. addToTimer (CoinCpuTime () - startTime);
     410
     411  delete fplp;
    451412
    452413  problem_ -> domain () -> pop ();
Note: See TracChangeset for help on using the changeset viewer.