Changeset 112


Ignore:
Timestamp:
Apr 28, 2009 4:57:37 PM (13 years ago)
Author:
pbelotti
Message:

isolate restoreUnused to when there is at least one unused -- takes care of reformulated stockcycle problem (thanks to C. D'Ambrosio for the bug report). Check linear terms before adding a full exprGroup -- need a constructor pilot. Quicker solution feasibility check (with initial integrality check).

Location:
trunk/Couenne/src
Files:
19 edited

Legend:

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

    r39 r112  
    3232  installCutOff ();
    3333
     34  // check if bt cuts the optimal solution -- now and after bound tightening
     35  bool contains_optimum = false;
     36
     37  if (optimum_ != NULL) {
     38    contains_optimum = true;
     39    for (int i=0; i<nOrigVars_; i++)
     40      if ((optimum_ [i] < Lb (i) * (1 - COUENNE_EPS) - COUENNE_EPS) ||
     41          (optimum_ [i] > Ub (i) * (1 + COUENNE_EPS) + COUENNE_EPS)) {
     42        /*printf ("won't check BT: %d [%g,%g] (%g) -- %g\n",
     43                i, Lb (i), Ub (i), optimum_ [i],
     44                CoinMax (- optimum_ [i] + (Lb (i) * (1 - COUENNE_EPS) - COUENNE_EPS),
     45                optimum_ [i] - (Ub (i) * (1 + COUENNE_EPS) + COUENNE_EPS)));*/
     46        contains_optimum = false;
     47        break;
     48      }
     49  }
     50
    3451  do {
    3552
     
    5976    // continue if EITHER procedures gave (positive) results, as
    6077    // expression structure is not a tree.
     78
     79    if (contains_optimum) {
     80      for (int i=0; i<nOrigVars_; i++)
     81        if ((optimum_ [i] < Lb (i) * (1 - COUENNE_EPS) - COUENNE_EPS) ||
     82            (optimum_ [i] > Ub (i) * (1 + COUENNE_EPS) + COUENNE_EPS)) {
     83          printf ("bound tightening FAIL: %d [%e,%e] (%e) -- %e\n",
     84                  i, Lb (i), Ub (i), optimum_ [i],
     85                  CoinMax (- optimum_ [i] + Lb (i),
     86                           optimum_ [i] - Ub (i)));
     87          contains_optimum = false;
     88        }
     89    }
    6190
    6291  } while (((ntightened > 0) || (nbwtightened > 0)) &&
     
    177206          (Var (i) -> Multiplicity () > 0)) {
    178207
    179         bool isInt = Var (i) -> isInteger ();
    180 
    181208        CouNumber
    182209          x  = X  [i],
     
    185212          rc = RC [i];
    186213
    187         if (rc < COUENNE_EPS)
     214        if ((rc < COUENNE_EPS) || (l==u)) // no need to check
    188215          continue;
     216
     217        bool isInt = Var (i) -> isInteger ();
    189218
    190219        if (x == l) {
     
    210239        }
    211240      }
     241
     242    /*printf ("AFTER reduced cost bt:\n");
     243      for (int i=0; i < nVars (); i++)
     244        printf ("%3d [%10e %10e]\n", i, Lb (i), Ub (i));
     245        printf ("-----------\n");*/
    212246  }
    213247
  • trunk/Couenne/src/bound_tightening/impliedBounds.cpp

    r39 r112  
    7474          (variables_ [i] -> Index (), Lb (), Ub (), chg_bds)) {
    7575
     76        // conservative check for integer variables.
     77        /*if (Var (i) -> isInteger ()) {
     78          Lb (i) = ceil  (Lb (i) - COUENNE_EPS);
     79          Ub (i) = floor (Ub (i) + COUENNE_EPS);
     80          }*/
     81
    7682        if (Jnlst()->ProduceOutput(Ipopt::J_VECTOR, J_BOUNDTIGHTENING)) {
    7783          // todo: send all output through journalist
  • trunk/Couenne/src/bound_tightening/operators/impliedBounds-exprSum.cpp

    r1 r112  
    44 * Purpose: implied bound enforcing for exprSum and exprGroup
    55 *
    6  * (C) Carnegie-Mellon University, 2006.
     6 * (C) Carnegie-Mellon University, 2006-09.
    77 * This file is licensed under the Common Public License (CPL)
    88 */
     
    113113    exprGroup::lincoeff &lcoe = eg -> lcoeff ();
    114114
    115     for (exprGroup::lincoeff::iterator el = lcoe.begin ();
     115    for (register exprGroup::lincoeff::iterator el = lcoe.begin ();
    116116         el != lcoe.end (); ++el) {
    117117
     
    239239
    240240  for (register int i = maxind; i--;) {
    241     lc [i] = l [i];
    242     uc [i] = u [i];
    243   }
     241    *lc++ = *l++;
     242    *uc++ = *u++;
     243    //lc [i] = l [i];
     244    //uc [i] = u [i];
     245  }
     246
     247  lc -= maxind; uc -= maxind;
     248  l  -= maxind; u  -= maxind;
    244249
    245250  // Update lowers in I1 and uppers in I2
  • trunk/Couenne/src/bound_tightening/tightenBounds.cpp

    r39 r112  
    7373    }
    7474
     75    /*if ((Var (i) -> Type () == VAR) &&
     76        (Var (i) -> isInteger ())) {
     77      Lb (i) = ceil  (Lb (i) - COUENNE_EPS);
     78      Ub (i) = floor (Ub (i) + COUENNE_EPS);
     79      }*/
     80
    7581    if (Var (i) -> Type         () == AUX) {
    7682        // TODO: also test if any indep variable of this expression
  • trunk/Couenne/src/branch/CouenneChooseVariable.cpp

    r39 r112  
    117117                                              int numberObjects,
    118118                                              const OsiObject ** objects) {
     119
    119120  double obj = solution [problem_ -> Obj (0) -> Body () -> Index ()];
    120121  return problem_ -> checkNLP (solution, obj);
  • trunk/Couenne/src/convex/generateCuts.cpp

    r39 r112  
    318318    // Bound tightening ////////////////////////////////////
    319319
     320    /*printf ("== BT ================\n");
     321    for (int i = 0; i < problem_ -> nVars (); i++)
     322      if (problem_ -> Var (i) -> Multiplicity () > 0)
     323        printf ("%4d %+20.8g [%+20.8g,%+20.8g]\n", i,
     324                problem_ -> X  (i), problem_ -> Lb (i), problem_ -> Ub (i));
     325                printf("=============================\n");*/
     326
    320327    // Reduced Cost BT -- to be done first to use rcost correctly
    321328    if (!firstcall_  &&                         // have a linearization already
  • trunk/Couenne/src/disjunctive/disjCut.cpp

    r39 r112  
    238238
    239239    if (first) {cglp.initialSolve (); first = false;}
    240     else        cglp.resolve ();
     240    else        cglp.resolve (); // segfault in ex1244
    241241
    242242    if (cglp. isProvenOptimal () && (cglp.getObjValue () > COUENNE_EPS)) {
  • trunk/Couenne/src/expression/operators/exprGroup.cpp

    r75 r112  
    1111#include "exprVar.hpp"
    1212#include "exprGroup.hpp"
     13#include "exprClone.hpp"
     14#include "exprMul.hpp"
    1315#include "depGraph.hpp"
    1416#include "CouenneProblem.hpp"
     
    1618class Domain;
    1719
     20/// Generalized (static) constructor: check parameters and return a
     21/// constant, a single variable, or a real exprGroup
     22expression *exprGroup::genExprGroup (CouNumber c0,
     23                                     std::vector <std::pair <exprVar *, CouNumber> > &lcoeff,
     24                                     expression **al,
     25                                     int n) {
     26  int nl = lcoeff.size ();
     27  expression *ret = NULL;
     28
     29  // a constant
     30  if ((n==0) && (nl==0))
     31    ret = new exprConst (c0); // a constant auxiliary? FIX!
     32
     33  else if ((n==0) && (fabs (c0) < COUENNE_EPS) && (nl==1)) { // a linear monomial, cx
     34
     35    if (fabs (lcoeff[0]. second - 1) < COUENNE_EPS)
     36      ret    = new exprClone (lcoeff[0]. first);
     37    else ret = new exprMul (new exprConst (lcoeff[0]. second), new exprClone (lcoeff[0]. first));
     38   
     39  } else ret = new exprGroup (c0, lcoeff, al, n);
     40
     41  return ret;
     42}
     43
     44
    1845/// Constructor
    19 exprGroup::exprGroup  (CouNumber c0,
    20                        std::vector <std::pair <exprVar *, CouNumber> > &lcoeff,
    21                        expression **al,
    22                        int n):
     46exprGroup::exprGroup (CouNumber c0,
     47                      std::vector <std::pair <exprVar *, CouNumber> > &lcoeff,
     48                      expression **al,
     49                      int n):
    2350  exprSum  (al, n),
    2451  lcoeff_  (lcoeff),
  • trunk/Couenne/src/expression/operators/exprGroup.hpp

    r75 r112  
    3232
    3333public:
     34
     35  /// Generalized (static) constructor: check parameters and return a
     36  /// constant, a single variable, or a real exprGroup
     37  static expression *genExprGroup (CouNumber,
     38                                   lincoeff &,
     39                                   expression ** = NULL,
     40                                   int = 0);
    3441
    3542  /// Constructor
  • trunk/Couenne/src/main/BonInitHeuristic.cpp

    r1 r112  
    1313namespace Bonmin{
    1414 
    15   InitHeuristic::InitHeuristic(double objValue, const double* sol,
    16                                CouenneProblem& cp):
     15  InitHeuristic::InitHeuristic (double objValue, const double* sol,
     16                                CouenneProblem& cp):
    1717    CbcHeuristic(),
    1818    objValue_(COIN_DBL_MAX),
     
    2828      objValue_ = objValue;
    2929
    30       sol_ = new double[nVars_];
     30      sol_ = new double [nVars_];
    3131
    32       CoinCopyN(sol, cp.nOrigVars(), sol_);
     32      CoinCopyN (sol, cp.nOrigVars (), sol_);
    3333      cp.getAuxs(sol_);
    3434    }
  • trunk/Couenne/src/problem/CouenneSolverInterface.cpp

    r103 r112  
    6161  // some originals may be unused due to their zero multiplicity (that
    6262  // happens when they are duplicates), restore their value
    63   CouNumber *x = new CouNumber [getNumCols ()];
    64   CoinCopyN (getColSolution (), getNumCols (), x);
    65   cutgen_ -> Problem () -> restoreUnusedOriginals (x);
    66   setColSolution (x);
    67   delete [] x;
     63  if (cutgen_ -> Problem () -> nUnusedOriginals () > 0) {
     64    CouNumber *x = new CouNumber [getNumCols ()];
     65    CoinCopyN (getColSolution (), getNumCols (), x);
     66    cutgen_ -> Problem () -> restoreUnusedOriginals (x);
     67    setColSolution (x);
     68    delete [] x;
     69  }
    6870
    6971  /*
     
    147149  OsiClpSolverInterface::resolve ();
    148150
     151  CouNumber objval = getObjValue (),
     152    curCutoff = cutgen_ -> Problem () -> getCutOff ();
     153  // check if resolve found new integer solution
     154  if ((objval < curCutoff - COUENNE_EPS) &&
     155      (cutgen_ -> Problem () -> checkNLP (getColSolution (), objval, true)) &&
     156      (objval < curCutoff - COUENNE_EPS)) { // may have changed
     157
     158    // also save the solution so that cbcModel::setBestSolution saves it too
     159
     160    //printf ("new cutoff from CSI: %g\n", objval);
     161    cutgen_ -> Problem () -> setCutOff (objval);
     162  }
     163
    149164  // some originals may be unused due to their zero multiplicity (that
    150165  // happens when they are duplicates), restore their value
    151   CouNumber *x = new CouNumber [getNumCols ()];
    152   CoinCopyN (getColSolution (), getNumCols (), x);
    153   cutgen_ -> Problem () -> restoreUnusedOriginals (x);
    154   setColSolution (x);
    155   delete [] x;
     166  if (cutgen_ -> Problem () -> nUnusedOriginals () > 0) {
     167    CouNumber *x = new CouNumber [getNumCols ()];
     168    CoinCopyN (getColSolution (), getNumCols (), x);
     169    cutgen_ -> Problem () -> restoreUnusedOriginals (x);
     170    setColSolution (x);
     171    delete [] x;
     172  }
    156173
    157174  //cutgen_ -> Problem () -> restoreUnusedOriginals (this);
     
    323340  // some originals may be unused due to their zero multiplicity (that
    324341  // happens when they are duplicates), restore their value
    325   CouNumber *x = new CouNumber [getNumCols ()];
    326   CoinCopyN (getColSolution (), getNumCols (), x);
    327   cutgen_ -> Problem () -> restoreUnusedOriginals (x);
    328   setColSolution (x);
    329   delete [] x;
     342  if (cutgen_ -> Problem () -> nUnusedOriginals () > 0) {
     343    CouNumber *x = new CouNumber [getNumCols ()];
     344    CoinCopyN (getColSolution (), getNumCols (), x);
     345    cutgen_ -> Problem () -> restoreUnusedOriginals (x);
     346    setColSolution (x);
     347    delete [] x;
     348  }
    330349
    331350  if (isProvenPrimalInfeasible ()) knowInfeasible_ = true;
  • trunk/Couenne/src/problem/checkNLP.cpp

    r39 r112  
    44 * Purpose: check NLP feasibility of incumbent integer solution
    55 *
    6  * (C) Carnegie-Mellon University, 2006-08.
     6 * (C) Carnegie-Mellon University, 2006-09.
    77 * This file is licensed under the Common Public License (CPL)
    88 */
     
    1515
    1616  const int infeasible = 1;
     17  const int wrong_obj  = 2;
    1718
    1819  /*printf ("checking solution: [%g] ", obj);
    1920  for (int i=0; i<nOrigVars_; i++)
    20     printf ("%.5f ", solution [i]);
     21    printf ("%g ", solution [i]);
    2122    printf ("\n");*/
     23
     24  // pre-check on original variables
     25  for (int i=0; i < nOrigVars_; i++) {
     26
     27    CouNumber val = solution [i];
     28
     29    // check (original and auxiliary) variables' integrality
     30
     31    if ((variables_ [i] -> isInteger ()) &&
     32        (variables_ [i] -> Type () == VAR) &&
     33        (variables_ [i] -> Multiplicity () > 0) &&
     34        (fabs (val - COUENNE_round (val)) > feas_tolerance_)) {
     35
     36      Jnlst()->Printf(Ipopt::J_ITERSUMMARY, J_PROBLEM,
     37                      "checkNLP: integrality %d violated: %.6f [%g,%g]\n",
     38                      i, val, domain_.lb (i), domain_.ub (i));
     39
     40      return false;
     41    }
     42  }
    2243
    2344  CouNumber *sol = new CouNumber [nVars ()];
     
    5374                      realobj, obj, realobj - obj);
    5475
    55       throw infeasible;
     76      if (recompute)
     77        obj = realobj;
     78      else
     79        throw wrong_obj;
    5680    }
    5781
    58     if (recompute)
    59       obj = realobj;
     82    //printf ("recomputed: %g\n", obj);
    6083
    6184    for (int i=0; i < nOrigVars_; i++) {
     85
     86      if (variables_ [i] -> Multiplicity () <= 0)
     87        continue;
    6288
    6389      CouNumber val = domain_.x (i);
     
    149175
    150176  catch (int exception) {
    151     if (exception == infeasible)
     177
     178    switch (exception) {
     179
     180    case wrong_obj:
     181      retval = true;
     182      break;
     183
     184    case infeasible:
     185    default:
    152186      retval = false;
     187      break;
     188    }
    153189  }
    154190
  • trunk/Couenne/src/problem/getIntegerCandidate.cpp

    r103 r112  
    104104    int rank = 1;
    105105
    106     if (jnlst_ -> ProduceOutput (Ipopt::J_MOREVECTOR, J_PROBLEM)) {
     106    if (jnlst_ -> ProduceOutput (Ipopt::J_MOREVECTOR, J_NLPHEURISTIC)) {
    107107      printf ("=       ===========================================\n");
    108108      printf ("= BEGIN ===========================================\n");
     
    150150        initAuxs ();
    151151
    152         if (jnlst_ -> ProduceOutput (Ipopt::J_MOREVECTOR, J_PROBLEM)) {
     152        if (jnlst_ -> ProduceOutput (Ipopt::J_MOREVECTOR, J_NLPHEURISTIC)) {
    153153          printf ("= RANK LEVEL = %d [%d] ==================================\n", rank, *rNum);
    154154          for (int i=0; i<nOrigVars_; i++)
     
    205205                                       dualL, dualR, olb, oub, ntrials < maxtrials);
    206206
    207               jnlst_ -> Printf (J_MOREVECTOR, J_PROBLEM,
     207              jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
    208208                                "testing %d [%g -> %g], res = %d\n", i, xFrac [i], xInt [i], result);
    209209
     
    230230            assert (index < nOrigVars_);
    231231
    232             jnlst_ -> Printf (J_MOREVECTOR, J_PROBLEM,
     232            jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
    233233                              "none fixed, fix %d from %g [%g,%g] [L=%g, R=%g]",
    234234                              index, xFrac [index], Lb (index), Ub (index),
     
    241241                floor (xFrac [index]) : ceil (xFrac [index])));
    242242
    243             jnlst_ -> Printf (J_MOREVECTOR, J_PROBLEM, " to %g\n", xInt [index]);
     243            jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC, " to %g\n", xInt [index]);
    244244
    245245            fixed [index] = FIXED;
     
    250250          ntrials++;
    251251
    252           if (jnlst_ -> ProduceOutput (Ipopt::J_MOREVECTOR, J_PROBLEM)) {
     252          if (jnlst_ -> ProduceOutput (Ipopt::J_MOREVECTOR, J_NLPHEURISTIC)) {
    253253            printf ("--- remaining = %d --------------------------- \n", remaining);
    254254            for (int i=0; i<nOrigVars_; i++)
     
    298298      CouNumber xp = x [objind];
    299299
    300       if (checkNLP (x, xp, true)) // true for recomputing xp
     300      if (checkNLP (x, xp, true)) { // true for recomputing xp
    301301        setCutOff (xp);
     302        jnlst_ -> Printf (J_DETAILED, J_NLPHEURISTIC,
     303                          "new cutoff from getIntCand: %g\n", xp);
     304      }
    302305    }
    303306  } // try
     
    311314  ////////////////////////////////////////////////////////////////////////////////
    312315
    313   if (jnlst_->ProduceOutput(Ipopt::J_MOREVECTOR, J_PROBLEM)) {
     316  if (jnlst_->ProduceOutput(Ipopt::J_MOREVECTOR, J_NLPHEURISTIC)) {
    314317    if (retval >= 0) {
    315318      printf ("- Done: retval %d ----------------------------------------------------------------\n",
     
    330333  domain_.pop ();
    331334
    332   jnlst_ -> Printf (J_MOREVECTOR, J_PROBLEM, "Done with GetIntegerCandidate\n");
     335  jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC, "Done with GetIntegerCandidate\n");
    333336
    334337  optimum_ = store_optimum; // restore
  • trunk/Couenne/src/problem/problem.cpp

    r98 r112  
    7272  // defined in such a way that w_i does NOT depend on w_j if i<j.
    7373
     74  Jnlst () -> Printf (Ipopt::J_MOREMATRIX, J_PROBLEM, "InitAux -- assigning bounds\n");
     75
    7476  for (int j=0, i=nVars (); i--; j++) {
    7577
     
    363365    ("log_num_obbt_per_level",
    364366     "Specify the frequency (in terms of nodes) for optimality-based bound tightening.",
    365      -1,0,
     367     -1,1,
    366368     "\
    367369If -1, apply at every node (expensive!). \
     
    379381    ("log_num_abt_per_level",
    380382     "Specify the frequency (in terms of nodes) for aggressive bound tightening.",
    381      -1,1,
     383     -1,2,
    382384     "\
    383385If -1, apply at every node (expensive!). \
  • trunk/Couenne/src/problem/testIntFix.cpp

    r39 r112  
    9898    if (!feasRight) {
    9999
    100       jnlst_ -> Printf (J_MOREDETAILED, J_PROBLEM,
    101                         "test on %d -> Infeasible. ", index);
     100      jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
     101                        "test on %d -> Infeasible.\n ", index);
    102102      retval = -1; // case 2
    103103
     
    105105
    106106      // ceil is feasible, floor is not.
    107       jnlst_ -> Printf (J_MOREDETAILED, J_PROBLEM,
    108                         "test on %d -> Right feasible, fix to %g. ", index, ceil (xFrac));
     107      jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
     108                        "test on %d -> Right feasible, fix to %g.\n", index, ceil (xFrac));
    109109
    110110      fixed [index] = FIXED;
     
    127127
    128128    // floor is feasible, ceil is not.
    129     jnlst_ -> Printf (J_MOREDETAILED, J_PROBLEM,
    130                       "test on %d -> Left feasible, fix to %g. ", index, floor (xFrac));
     129    jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
     130                      "test on %d -> Left feasible, fix to %g.\n", index, floor (xFrac));
    131131
    132132    fixed [index] = FIXED;
     
    170170         ((CoinDrand48 () < 0.5) ? floor (xFrac) : ceil (xFrac)));
    171171     
    172       jnlst_ -> Printf (J_MOREVECTOR, J_PROBLEM,
    173                         "test on %d -> Both feasible, lost patience, fixed to %g. ",
     172      jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
     173                        "test on %d -> Both feasible, lost patience, fixed to %g.\n",
    174174                        index, xInt [index]);
    175175
     
    177177      retval++;
    178178      //printf ("+++ 2 %d\n", i);
    179     } else if (retval >= 0) jnlst_ -> Printf (J_MOREVECTOR, J_PROBLEM,
    180                                               "test on %d -> Both feasible, skip this turn. ", index);
     179    } else if (retval >= 0) jnlst_ -> Printf (J_MOREVECTOR, J_NLPHEURISTIC,
     180                                              "test on %d -> Both feasible, skip this turn.\n", index);
    181181  }
    182182
  • trunk/Couenne/src/readnl/readnl.cpp

    r98 r112  
    129129      indcoe2vector (indexL, coeff, lcoeff);
    130130
    131       exprGroup *eg = new exprGroup (0, lcoeff, al, 1);
     131      expression *eg = exprGroup::genExprGroup (0, lcoeff, al, 1);
    132132      commonexprs_ . push_back (eg);
    133133    }
     
    176176      indcoe2vector (indexL, coeff, lcoeff);
    177177
    178       exprGroup *eg = new exprGroup (0, lcoeff, al, 1);
     178      expression *eg = exprGroup::genExprGroup (0, lcoeff, al, 1);
    179179      commonexprs_ . push_back (eg);
    180180    }
     
    226226
    227227      if (nl -> code () == COU_EXPRSUM) {
    228         body = new exprGroup (0., lcoeff, nl -> ArgList (), nl -> nArgs ());
     228        body = exprGroup::genExprGroup (0., lcoeff, nl -> ArgList (), nl -> nArgs ());
    229229        // delete node without deleting children (they are now in body)
    230230        nl -> ArgList (NULL);
     
    238238
    239239        // apparently, objconst (i) is included in the obj expression
    240         body = new exprGroup (0., lcoeff, nll, 1);
     240        body = exprGroup::genExprGroup (0., lcoeff, nll, 1);
    241241        //body = new exprGroup (objconst (i), indexL, coeff, nll, 1);
    242242      }
     
    395395          (code == COU_EXPRGROUP)) {
    396396
    397         body    = new exprGroup (0., lcoeff, (*nll) -> ArgList (), (*nll) -> nArgs ());
     397        body    = exprGroup::genExprGroup (0., lcoeff, (*nll) -> ArgList (), (*nll) -> nArgs ());
    398398        // delete node without deleting children (they are now in body)
    399399        (*nll) -> ArgList (NULL);
     
    401401        delete [] nll;
    402402      }
    403       else body = new exprGroup (0., lcoeff, nll, 1);
     403      else body = exprGroup::genExprGroup (0., lcoeff, nll, 1);
    404404    }
    405405    else {
  • trunk/Couenne/src/standardize/linStandardize.cpp

    r91 r112  
    7979  else if ((nq==0) && (fabs (c0) < COUENNE_EPS) && (nl==1)) { // a linear monomial, cx
    8080
    81     if (fabs (*lc - 1) < COUENNE_EPS) 
     81    if (fabs (*lc - 1) < COUENNE_EPS)
    8282      ret    = new exprClone (Var (*li));
    8383    else ret = new exprMul (new exprConst (*lc), new exprClone (Var (*li)));
  • trunk/Couenne/src/standardize/splitAux.cpp

    r98 r112  
    129129        //lincoe [i] = lcoe [i]. second;
    130130
    131         if ((j > maxindex) &&
     131        // prefer non-integer. If integer, only take it if none chosen yet
     132        if ((!(lcoe [i].first -> isInteger ()) || (which==1)) && 
     133            (j > maxindex) &&
    132134            !(wentAux [j]) &&
    133135            (fabs (lcoe [i]. second) > COUENNE_EPS)) {
  • trunk/Couenne/src/standardize/standardize.cpp

    r103 r112  
    159159      (*i) -> Body (new exprClone (aux));
    160160      //      con2.push_back (*i);
    161 
    162161    }
    163162    else {
    164163      CouNumber lb, ub;
    165164      (*i) -> Body () -> getBounds (lb, ub);
    166       if ((((*((*i) -> Lb   ())) ()) > ub) ||
    167           (((*((*i) -> Ub   ())) ()) < lb))
     165      if ((((*((*i) -> Lb ())) ()) > ub) ||
     166          (((*((*i) -> Ub ())) ()) < lb)) {
     167        printf ("found infeasible constraint [%g,%g]\n", lb, ub);
     168        (*i) -> print ();
    168169        retval = false;
     170      }
    169171      iters2erase.push_back (i);
    170172    }
Note: See TracChangeset for help on using the changeset viewer.