Changeset 138


Ignore:
Timestamp:
May 31, 2009 8:48:27 PM (12 years ago)
Author:
pbelotti
Message:

fix infeasibility detected from ::inf=1e40 (from BonChooseVariable?.cpp)

Location:
trunk/Couenne/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/branch/CouenneObject.cpp

    r126 r138  
    55 * Purpose: Base object for variables (to be used in branching)
    66 *
    7  * (C) Carnegie-Mellon University, 2006-08.
     7 * (C) Carnegie-Mellon University, 2006-09.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    371371  }
    372372
     373  // Need to allow infeasibility for a variable without making the
     374  // whole problem infeasible with an infeasibility = 1e+50. Check
     375  // BonChooseVariable.cpp:382
     376
     377  if (retval > 1.e40)
     378    retval = 1.e20;
     379
    373380  return (reference_ -> isInteger ()) ?
    374381    CoinMax (retval, intInfeasibility (info -> solution_ [reference_ -> Index ()])) :
  • trunk/Couenne/src/branch/CouenneSOSObject.hpp

    r64 r138  
    1616class CouenneSOSObject;
    1717
     18// TODO: SOS of the form sum x_i \le k with k small. Instead of
     19// branching on a single variable do a SOS-like branching
    1820
    1921class CouenneSOSBranchingObject: public OsiSOSBranchingObject {
  • trunk/Couenne/src/branch/infeasibility.cpp

    r126 r138  
    44 * Purpose: Compute infeasibility of a variable, looking at all expressions it appears in
    55 *
    6  * (C) Carnegie-Mellon University, 2008.
     6 * (C) Carnegie-Mellon University, 2008-09.
    77 * This file is licensed under the Common Public License (CPL)
    88 */
     
    148148
    149149    double retval =
    150       // neglect it if variable has small bound interval (chech
     150      // neglect it if variable has small bound interval (check
    151151      // x84=x83/x5 in csched1.nl)
    152152      (1. - 1. / (1. + info -> upper_ [index] - info -> lower_ [index])) *
  • trunk/Couenne/src/problem/getIntegerCandidate.cpp

    r112 r138  
    3434
    3535  int
    36     ncols    = nVars (),
    37     retval   = 0;
     36    ncols  = nVars (),
     37    retval = 0;
    3838
    3939  double
     
    127127    }
    128128
     129
     130    const int
     131      N_VARS_HUGE   = 10000,
     132      N_VARS_LARGE  = 1000,
     133      N_VARS_MEDIUM = 100,
     134      N_VARS_SMALL  = 10,
     135      N_VARS_TINY   = 5;
     136
     137    int
     138      ntrials   = 0,
     139      nvars = nVars (),
     140      maxtrials =
     141      (nvars >= N_VARS_HUGE)   ? 0 :
     142      (nvars >= N_VARS_LARGE)  ? 1 :
     143      (nvars >= N_VARS_MEDIUM) ? 2 :
     144      (nvars >= N_VARS_SMALL)  ? 4 :
     145      (nvars >= N_VARS_TINY)   ? 8 : 16;
     146
    129147    for (std::vector <int>::iterator rNum = numberInRank_.begin();
    130148         ++rNum != numberInRank_.end(); rank++)
     
    171189        //CoinCopyN (xFrac, nOrigVars_, xInt);// TODO: re-copy first nOrigVars_ variables into xInt?
    172190
    173         int
    174           remaining = *rNum,
    175           ntrials   = 0,
    176           maxtrials = 3;// rNum / divider;
     191        int remaining = *rNum;
    177192
    178193        do {
  • trunk/Couenne/src/problem/problem.cpp

    r130 r138  
    101101
    102102      Jnlst () -> Printf (Ipopt::J_MOREMATRIX, J_PROBLEM,
    103                           " [ --> w_%04d [%10g,%10g] ] vs [%10g %10g]",
     103                          " ( --> w_%04d [%10g,%10g] ) vs [%10g %10g]",
    104104                          ord, l, u, Lb (ord), Ub (ord));
    105105
Note: See TracChangeset for help on using the changeset viewer.