Ignore:
Timestamp:
Jun 24, 2009 10:54:00 AM (11 years ago)
Author:
pbelotti
Message:

created new stable branch 0.2 from trunk (rev. 157)

Location:
stable/0.2
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable/0.2

    • Property svn:externals
      •  

        old new  
        1 BuildTools https://projects.coin-or.org/svn/BuildTools/trunk
        2 ThirdParty/Blas https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/trunk
        3 ThirdParty/Lapack https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/trunk
        4 ThirdParty/HSL https://projects.coin-or.org/svn/BuildTools/ThirdParty/HSL/trunk
        5 ThirdParty/ASL https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/trunk
        6 ThirdParty/Mumps https://projects.coin-or.org/svn/BuildTools/ThirdParty/Mumps/trunk
        7 CoinUtils https://projects.coin-or.org/svn/CoinUtils/trunk/CoinUtils
        8 Cbc https://projects.coin-or.org/svn/Cbc/trunk/Cbc
        9 Cgl https://projects.coin-or.org/svn/Cgl/trunk/Cgl
        10 Clp https://projects.coin-or.org/svn/Clp/trunk/Clp
        11 Ipopt https://projects.coin-or.org/svn/Ipopt/trunk/Ipopt
        12 Osi https://projects.coin-or.org/svn/Osi/trunk/Osi
        13 Bonmin https://projects.coin-or.org/svn/Bonmin/trunk/Bonmin
         1BuildTools     https://projects.coin-or.org/svn/BuildTools/stable/0.5
         2CoinUtils      https://projects.coin-or.org/svn/CoinUtils/stable/2.6/CoinUtils
         3ThirdParty/ASL https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/stable/1.0
         4ThirdParty/Blas https://projects.coin-or.org/svn/BuildTools/ThirdParty/Blas/stable/1.0
         5ThirdParty/HSL https://projects.coin-or.org/svn/BuildTools/ThirdParty/HSL/stable/1.1
         6ThirdParty/Lapack https://projects.coin-or.org/svn/BuildTools/ThirdParty/Lapack/stable/1.0
         7ThirdParty/Mumps https://projects.coin-or.org/svn/BuildTools/ThirdParty/Mumps/stable/1.1
         8Cbc            https://projects.coin-or.org/svn/Cbc/stable/2.3/Cbc
         9Cgl            https://projects.coin-or.org/svn/Cgl/stable/0.54/Cgl
         10Clp            https://projects.coin-or.org/svn/Clp/stable/1.10/Clp
         11Osi            https://projects.coin-or.org/svn/Osi/stable/0.100/Osi
         12Ipopt          https://projects.coin-or.org/svn/Ipopt/stable/3.6/Ipopt
         13Bonmin         https://projects.coin-or.org/svn/Bonmin/stable/1.1/Bonmin
  • stable/0.2/Couenne/src/bound_tightening/aggressiveBT.cpp

    r39 r159  
     1/* $Id: aggressiveBT.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    aggressiveBT.cpp
     
    67 *          bounds/infeasibility
    78 *
    8  * (C) Carnegie-Mellon University, 2007-08.
     9 * (C) Carnegie-Mellon University, 2007-09.
    910 * This file is licensed under the Common Public License (CPL)
    1011 */
    1112
     13#include "BonTNLPSolver.hpp"
     14#include "BonNlpHeuristic.hpp"
    1215#include "CoinHelperFunctions.hpp"
    1316#include "BonCouenneInfo.hpp"
     
    115118    nlp -> setColSolution (Y);
    116119
    117     nlp -> initialSolve ();
    118 
     120    try {
     121      nlp -> initialSolve ();
     122    }
     123    catch (Bonmin::TNLPSolver::UnsolvedError *E) {
     124    }
     125   
    119126    delete [] Y;
    120127    delete [] lower;
     
    237244                                 "Couenne infeasible node from aggressive BT\n");
    238245
    239     int       objind = Obj (0) -> Body  () -> Index ();
     246    int objind = Obj (0) -> Body  () -> Index ();
    240247
    241248    Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,
     
    243250                    Lb (objind), getCutOff (), ncols);
    244251
    245     for (int i=0; i<nOrigVars_; i++)
    246       Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING,
    247                       "   x%02d [%+20g %+20g]  | %+20g\n",
    248                       i, Lb (i), Ub (i), X [i]);
    249 
    250     for (int i=nOrigVars_; i<ncols; i++)
    251       Jnlst()->Printf(J_MOREDETAILED, J_BOUNDTIGHTENING,
    252                       "   w%02d [%+20g %+20g]  | %+20g\n", i, Lb (i), Ub (i), X [i]);
     252    if (Jnlst()->ProduceOutput(J_DETAILED, J_BOUNDTIGHTENING))
     253      for (int i=0; i<nOrigVars_; i++)
     254        printf("   x%02d [%+20g %+20g]  | %+20g\n",
     255               i, Lb (i), Ub (i), X [i]);
     256
     257    if (Jnlst()->ProduceOutput(J_MOREDETAILED, J_BOUNDTIGHTENING))
     258      for (int i=nOrigVars_; i<ncols; i++)
     259        printf ("   w%02d [%+20g %+20g]  | %+20g\n", i, Lb (i), Ub (i), X [i]);
    253260  }
    254261
  • stable/0.2/Couenne/src/bound_tightening/boundTightening.cpp

    r112 r159  
    1 /*
     1/* $Id: boundTightening.cpp 151 2009-06-16 03:31:06Z pbelotti $
     2 *
    23 * Name:    boundTightening.cpp
    34 * Author:  Pietro Belotti
     
    3738  if (optimum_ != NULL) {
    3839    contains_optimum = true;
    39     for (int i=0; i<nOrigVars_; i++)
     40    for (int i=0; i < nVars (); i++)
    4041      if ((optimum_ [i] < Lb (i) * (1 - COUENNE_EPS) - COUENNE_EPS) ||
    4142          (optimum_ [i] > Ub (i) * (1 + COUENNE_EPS) + COUENNE_EPS)) {
     
    7071
    7172    if ((ntightened < 0) || (nbwtightened < 0)) {
    72       Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING, "infeasible BT\n");
     73      Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING, "infeasible BT\n");
    7374      return false;
    7475    }
     
    7879
    7980    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)) {
     81      for (int i=0; i<nVars (); i++)
     82        if ((optimum_[i] < Lb(i) - COUENNE_EPS * (1. + CoinMin (fabs(optimum_ [i]), fabs (Lb(i))))) ||
     83            (optimum_[i] > Ub(i) + COUENNE_EPS * (1. + CoinMin (fabs(optimum_ [i]), fabs (Ub(i)))))) {
    8384          printf ("bound tightening FAIL: %d [%e,%e] (%e) -- %e\n",
    8485                  i, Lb (i), Ub (i), optimum_ [i],
     
    108109
    109110      // final test
    110       if ((Lb (i) > Ub (i) + COUENNE_EPS) ||
     111      if ((Lb (i) > Ub (i) + COUENNE_EPS * (1 + CoinMin (fabs (Lb (i)), fabs (Ub (i))))) ||
    111112          (Ub (i) < - MAX_BOUND) ||
    112113          (Lb (i) >   MAX_BOUND)) {
    113114
    114         Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING, "final test: infeasible BT\n");
     115        Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING, "final test: infeasible BT\n");
    115116        return false;
    116117      }
  • stable/0.2/Couenne/src/bound_tightening/fake_tightening.cpp

    r39 r159  
     1/* $Id: fake_tightening.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    fake_tightening.cpp
     
    1314//#define DEBUG
    1415
    15 #define MAX_ITER  2 // max # fake tightening (inner) iterations
     16#define MAX_ITER  10 // max # fake tightening (inner) iterations
    1617#define AGGR_MUL  2 // the larger,  the more conservative. Must be > 0
    1718#define AGGR_DIV  2 // the smaller, the more conservative. Must be > 1
     
    8990#endif
    9091
     92  /*if (index == objind)
     93    printf ("  x_%d [%g,%g].  x = %10g, break at %g, cutoff = %g-----------------\n",
     94    index, Lb (index), Ub (index), xcur, fb, getCutOff());*/
     95
    9196  for (int iter = 0; iter < MAX_ITER; iter++) {
    9297
     
    137142      feasible  = btCore (f_chg),             // true if feasible with fake bound
    138143      betterbds = Lb (objind) > getCutOff (); // true if over cutoff
    139      
    140144
    141145#ifdef DEBUG
     
    227231
    228232    // TODO: compute golden section
    229     fb = (inner + outer) / 2;
     233    //fb = (inner + outer) / 2;
     234
     235    //fb = fictBounds (direction, fb, CoinMin (inner, outer), CoinMax (inner, outer));
     236
     237    CouNumber diff = fabs (inner-outer);
     238
     239    if (diff == 0.) break;
     240
     241    if (diff > 1) {
     242
     243      CouNumber L = log (diff) / log (10.);
     244
     245      if (direction) fb = inner + exp (log (10.) * L/2);
     246      else           fb = inner - exp (log (10.) * L/2);
     247
     248    } else fb = (inner+outer)/2;
    230249
    231250    //    if () fb = (          inner + (phi-1) * outer) / phi;
     
    236255    //       direction ? lb [index] : outer,
    237256    //       direction ? outer      : ub [index]);
    238     //    fb = fictBounds (direction, xcur, CoinMin (inner, outer), CoinMax (inner, outer));
    239257
    240258#ifdef DEBUG
     
    242260#endif
    243261  }
    244 
    245262
    246263  Jnlst()->Printf(Ipopt::J_MOREVECTOR, J_BOUNDTIGHTENING, "\n");
  • stable/0.2/Couenne/src/bound_tightening/impliedBounds.cpp

    r112 r159  
     1/* $Id: impliedBounds.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds.cpp
     
    3738        (variables_ [i] -> Multiplicity () > 0)) {
    3839
    39       if (Lb (i) > Ub (i) + COUENNE_EPS) {
    40         Jnlst()->Printf(Ipopt::J_DETAILED, J_BOUNDTIGHTENING,
    41                         "  implied bounds: w_%d has infeasible bounds [%g,%g]\n",
    42                         i, Lb (i), Ub (i));
     40      if (Lb (i) > Ub (i) + COUENNE_EPS * (1 + CoinMin (fabs (Lb (i)), fabs (Ub (i))))) {
     41        Jnlst () -> Printf (Ipopt::J_DETAILED, J_BOUNDTIGHTENING,
     42                            "  implied bounds: w_%d has infeasible bounds [%g,%g]\n",
     43                            i, Lb (i), Ub (i));
    4344        return -1;
    4445      }
     
    8687                          i, l0, u0, Lb (i), Ub (i));
    8788
    88           variables_ [i]             -> print (std::cout);
     89          variables_ [i] -> print (std::cout);
    8990
    9091          if (Jnlst()->ProduceOutput(Ipopt::J_MOREVECTOR, J_BOUNDTIGHTENING)) {
  • stable/0.2/Couenne/src/bound_tightening/obbt.cpp

    r39 r159  
     1/* $Id: obbt.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    obbt.cpp
     
    164165
    165166    csi -> setupForRepeatedUse ();
     167    csi -> doingResolve () = false;
     168
    166169    //csi -> setHintParam (OsiDoDualInResolve, false);
    167170
     
    172175    while (!notImproved &&
    173176           (nIter++ < MAX_OBBT_ITER) &&
    174            ((nImprov = obbtInner (csi, cs, chg_bds, babInfo)) > 0)) {
    175 
    176       if (CoinCpuTime () > maxCpuTime_)
    177         break;
     177           ((nImprov = obbtInner (csi, cs, chg_bds, babInfo)) > 0) &&
     178           (CoinCpuTime () < maxCpuTime_)) {
    178179
    179180      int nchanged, *changed = NULL;
     
    198199        free (changed);
    199200    }
     201
     202    csi -> doingResolve () = true;
    200203
    201204    delete csi;
  • stable/0.2/Couenne/src/bound_tightening/obbt_iter.cpp

    r39 r159  
     1/* $Id: obbt_iter.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    obbt.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-exprDiv.cpp

    r1 r159  
     1/* $Id: impliedBounds-exprDiv.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-exprDiv.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-exprMul.cpp

    r79 r159  
     1/* $Id: impliedBounds-exprMul.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-exprMul.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-exprPow.cpp

    r54 r159  
     1/* $Id: impliedBounds-exprPow.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-exprPow.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-exprQuad.cpp

    r1 r159  
     1/* $Id: impliedBounds-exprQuad.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-exprQuad.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-exprSum.cpp

    r116 r159  
     1/* $Id: impliedBounds-exprSum.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-exprSum.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-mul.cpp

    r1 r159  
     1/* $Id: impliedBounds-mul.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-mul.cpp
  • stable/0.2/Couenne/src/bound_tightening/operators/impliedBounds-sum.cpp

    r1 r159  
     1/* $Id: impliedBounds-sum.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    impliedBounds-sum.cpp
  • stable/0.2/Couenne/src/bound_tightening/tightenBounds.cpp

    r112 r159  
     1/* $Id: tightenBounds.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
    12/*
    23 * Name:    tightenBounds.cpp
     
    5253    // early test to avoid a loop
    5354
    54     if ((Lb (i) > Ub (i) + COUENNE_EPS) ||
     55    if ((Lb (i) > Ub (i) + COUENNE_EPS * (1 + CoinMin (fabs (Lb (i)), fabs (Ub (i))))) ||
    5556        (Ub (i) < - MAX_BOUND) ||
    5657        (Lb (i) >   MAX_BOUND)) {
    5758
    58       //if (Jnlst()->ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) {
    59 
    60       Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,
    61                       "pre-check: w_%d has infeasible bounds [%.10e,%.10e]. ", i, Lb (i), Ub (i));
    62 
    63       if (Jnlst()->ProduceOutput(J_DETAILED, J_BOUNDTIGHTENING)) {
    64         Var (i) -> Lb () -> print (std::cout);
    65         Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING," --- ");
    66         Var (i) -> Ub () -> print (std::cout);
    67       }
    68 
    69       Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,"\n");
    70         //}
     59      if (Jnlst()->ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) {
     60
     61        Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,
     62                        "pre-check: w_%d has infeasible bounds [%.10e,%.10e]. ", i, Lb (i), Ub (i));
     63
     64        if (Jnlst()->ProduceOutput(J_DETAILED, J_BOUNDTIGHTENING)) {
     65          Var (i) -> Lb () -> print (std::cout);
     66          Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING," --- ");
     67          Var (i) -> Ub () -> print (std::cout);
     68        }
     69
     70        Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,"\n");
     71      }
    7172
    7273      return -1; // declare this node infeasible
     
    7980      }*/
    8081
    81     if (Var (i) -> Type         () == AUX) {
     82    if (Var (i) -> Type () == AUX) {
    8283        // TODO: also test if any indep variable of this expression
    8384        // have changed. If not, skip
     
    9495      }
    9596
    96       if (ll > uu + COUENNE_EPS) {
     97      if (ll - uu > COUENNE_EPS * (1 + CoinMin (fabs (ll), fabs (uu)))) {
    9798
    9899        //if (Jnlst()->ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) {
     
    150151        Lb (i) = ll;
    151152
    152         if (ll > Ub (i) + COUENNE_EPS) {
     153        if (ll > Ub (i) + COUENNE_EPS * (1. + CoinMin (fabs (ll), fabs (Ub (i))))) {
    153154          Jnlst () -> Printf (J_ITERSUMMARY, J_BOUNDTIGHTENING,
    154155                              "just-check: w_%d has infeasible bounds [%g,%g]. ", i, Lb (i), Ub (i));
Note: See TracChangeset for help on using the changeset viewer.