Changeset 308


Ignore:
Timestamp:
Mar 8, 2010 3:25:18 PM (10 years ago)
Author:
pbelotti
Message:

minor fixes

Location:
trunk/Couenne
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/Makefile.am

    r305 r308  
    1616          src/util \
    1717          src/expression
    18          
     18
    1919if COIN_HAS_ASL
    2020SUBDIRS += src/readnl
  • trunk/Couenne/Makefile.in

    r288 r308  
    5252build_triplet = @build@
    5353host_triplet = @host@
     54@COIN_HAS_ASL_TRUE@am__append_1 = src/readnl
    5455
    5556# We don't want to compile the test subdirectory, unless the test target is
    5657# specified.  But we need to list it as subdirectory to make sure that it is
    5758# included in the tarball
    58 @ALWAYS_FALSE@am__append_1 = test
     59@ALWAYS_FALSE@am__append_2 = test
    5960DIST_COMMON = README $(am__configure_deps) \
    6061        $(srcdir)/../BuildTools/Makemain.inc $(srcdir)/../config.guess \
     
    6465        $(srcdir)/couenne_addlibs.txt.in $(top_srcdir)/configure \
    6566        $(top_srcdir)/inc/config_couenne.h.in AUTHORS
    66 @HAVE_EXTERNALS_TRUE@am__append_2 = Externals
    67 @HAVE_EXTERNALS_TRUE@am__append_3 = .Externals-stamp
     67@HAVE_EXTERNALS_TRUE@am__append_3 = Externals
     68@HAVE_EXTERNALS_TRUE@am__append_4 = .Externals-stamp
    6869subdir = .
    6970ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    295296#                          Subdirectories                              #
    296297########################################################################
    297 SUBDIRS = src/util src/expression src/readnl src/standardize \
     298SUBDIRS = src/util src/expression $(am__append_1) src/standardize \
    298299        src/problem src/bound_tightening src/convex src/branch \
    299         src/disjunctive src src/main $(am__append_1)
     300        src/disjunctive src src/main $(am__append_2)
    300301
    301302########################################################################
     
    304305
    305306# Here we need include all files that are not mentioned in other Makefiles
    306 EXTRA_DIST = test/grandTest.sh.in $(am__append_2)
     307EXTRA_DIST = test/grandTest.sh.in $(am__append_3)
    307308
    308309########################################################################
     
    317318
    318319# Files that are generated and should be cleaned with make distclean
    319 DISTCLEANFILES = $(am__append_3) $(VPATH_DISTCLEANFILES)
     320DISTCLEANFILES = $(am__append_4) $(VPATH_DISTCLEANFILES)
    320321DocFiles = README AUTHORS LICENSE
    321322DocInstallDir = $(prefix)/share/doc/coin/$(PACKAGE_NAME)
  • trunk/Couenne/src/bound_tightening/boundTightening.cpp

    r151 r308  
    195195
    196196    if (jnlst_ -> ProduceOutput (J_MATRIX, J_BOUNDTIGHTENING)) {
    197       printf ("REDUCED COST BT:\n");
     197      printf ("REDUCED COST BT (LB=%g, UB=%g):\n", LB, UB);
    198198      for (int i=0; i < nVars (); i++)
    199199        printf ("%3d %10e [%10e %10e] rc %10e\n", i, X [i], L [i], U [i], RC [i]);
  • trunk/Couenne/src/bound_tightening/fake_tightening.cpp

    r203 r308  
    1 /* $Id$ */
    2 /*
     1/* $Id$
     2 *
    33 * Name:    fake_tightening.cpp
    44 * Author:  Pietro Belotti
    55 * Purpose: fake single bounds in variables to exclude parts of the solution space
    66 *
    7  * (C) Carnegie-Mellon University, 2007. 
     7 * (C) Carnegie-Mellon University, 2007.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
  • trunk/Couenne/src/convex/createCuts.cpp

    r141 r308  
    4545  if (fabs (c2) <= 1.e-21) {                  c2 = c3; i2 = i3; i3 = -1;} // keep consistency
    4646  if (fabs (c1) <= 1.e-21) {c1 = c2; i1 = i2; c2 = c3; i2 = i3; i3 = -1;}
    47   // why 1.0e-21? Look at CoinPackedMatrix.cpp:2188
     47  // why 1.e-21? Look at CoinPackedMatrix.cpp:2273
    4848
    4949#if 0
  • trunk/Couenne/src/convex/operators/alphaConvexify.cpp

    r217 r308  
    55 * Purpose: create alpha-convexification of a quadratic expression
    66 *
    7  * (C) Carnegie-Mellon University, 2007.
     7 * (C) Carnegie-Mellon University, 2007-09.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
  • trunk/Couenne/src/convex/operators/exprMul-upperHull.cpp

    r303 r308  
    3131
    3232  register double tmp = l;
    33   l  = -u;
    34   u  = -tmp;
    35 
    36   x  = -x;
     33  l = -u;
     34  u = -tmp;
     35
     36  x = -x;
    3737}
    3838
     
    336336  CouNumber
    337337    a = (x1-x0) * (y1-y0),
    338     b = x0*y1 + y0*x1 - 2*x0*y0, // x0 * (y1-y0) + y0 * (x1-x0)
    339     c = x0 * y0;
     338    c = x0 * y0,
     339    b = x0*y1 + y0*x1 - 2*c; // x0 * (y1-y0) + y0 * (x1-x0)
    340340
    341341  if (fabs (a) < COUENNE_EPS)
     
    350350    tL2 = (- b + sqrt (b*b - 4*a*(c-*wl))) / (2*a);
    351351    //printf ("solutions L: %g %g (b2-4ac=%g)\n", tL1, tL2, b*b - 4*a*(c-*wl));
    352     tL = (tL1 < -COUENNE_EPS) ? tL2 : tL1;
     352    tL = (tL1 < 0) ? tL2 : tL1;
    353353  }
    354354
     
    357357    tU2 = (- b + sqrt (b*b - 4*a*(c-*wu))) / (2*a);
    358358    //printf ("solutions U: %g %g (b2-4ac=%g)\n", tU1, tU2, b*b - 4*a*(c-*wu));
    359     tU = (tU1 < -COUENNE_EPS) ? tU2 : tU1;
     359    tU = (tU1 < 0) ? tU2 : tU1;
    360360  }
    361361
  • trunk/Couenne/src/convex/operators/unifiedProdCuts.cpp

    r290 r308  
    138138
    139139
    140   if (cg -> Problem () -> MultilinSep () == CouenneProblem::MulSepSimple) {
     140  if (cg -> Problem () -> MultilinSep () == CouenneProblem::MulSepSimple ||
     141      fabs (wu - wl) < COUENNE_EPS) {
    141142
    142143    if ((x0 > xl + COUENNE_EPS) && (y0 > yl + COUENNE_EPS) &&
  • trunk/Couenne/src/expression/exprCopy.hpp

    r217 r308  
    55 * Purpose: definition of the class exprCopy
    66 *
    7  * (C) Carnegie-Mellon University, 2006-09.
     7 * (C) Carnegie-Mellon University, 2006-10.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    143143  inline bool isInteger ()
    144144  {return copy_ -> isInteger ();}
     145
     146  /// is this expression DEFINED as integer?
     147  virtual inline bool isDefinedInteger ()
     148  {return copy_ -> isDefinedInteger ();}
    145149
    146150  /// Get lower and upper bound of an expression (if any)
  • trunk/Couenne/src/expression/operators/exprPow.cpp

    r217 r308  
    55 * Purpose: definition of powers
    66 *
    7  * (C) Carnegie-Mellon University, 2006-08.
     7 * (C) Carnegie-Mellon University, 2006-10.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    2020#include "exprDiv.hpp"
    2121#include "exprLog.hpp"
     22//#include "exprOpp.hpp"
    2223#include "exprConst.hpp"
    2324#include "CouenneProblem.hpp"
     
    7374        return ret;
    7475      }
     76
     77      //
     78      // x^k = x for x binary. Too bad we don't know bounds yet, so the code below will give segfault
     79
     80      //       // is it an integer variable with bounds [-1,0] or [0,1]
     81      //       else if ((arglist_ [0] -> Type () == VAR) && (arglist_ [0] -> isDefinedInteger ())) {
     82
     83      //        CouNumber lb, ub;
     84      //        arglist_ [0] -> getBounds (lb, ub);
     85
     86      //        if ((fabs (lb)      < COUENNE_EPS) &&
     87      //            (fabs (ub - 1.) < COUENNE_EPS)) {  // {0,1}
     88
     89      //          delete arglist_ [1];
     90      //          expression *ret = arglist_ [0];
     91      //          arglist_ [0] = arglist_ [1] = NULL;
     92      //          return ret;
     93
     94      //        } else if ((fabs (lb + 1.) < COUENNE_EPS) &&
     95      //                   (fabs (ub)      < COUENNE_EPS)) { // {-1,0}
     96
     97      //          delete arglist_ [1];
     98      //          expression *ret = new exprOpp (arglist_ [0]);
     99      //          arglist_ [0] = arglist_ [1] = NULL;
     100      //          return ret;
     101      //        }
     102      //       }
     103
    75104    }
    76105
  • trunk/Couenne/src/expression/simplify/simplify.cpp

    r268 r308  
    55 * Purpose: symbolic expression simplifier
    66 *
    7  * (C) Carnegie-Mellon University, 2006.
     7 * (C) Carnegie-Mellon University, 2006-10.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    2424    expression *subst;
    2525
    26     if ((subst = (arglist_ [i]) -> simplify ())) {
     26    if ((subst = arglist_ [i] -> simplify ())) {
    2727
    2828      delete arglist_ [i];
     
    5555
    5656      return ret;
    57     } else return NULL;
    58   } else return NULL;
     57    }
     58  }
     59
     60  return NULL;
    5961}
  • trunk/Couenne/src/main/Makefile.in

    r290 r308  
    4747@COIN_HAS_CPX_TRUE@am__append_1 = $(OSIOBJDIR)/src/OsiCpx/libOsiCpx.la
    4848@COIN_HAS_NTY_TRUE@am__append_2 = $(NTYLIB)
    49 @COIN_HAS_CPX_TRUE@am__append_3 = \
     49@COIN_HAS_ASL_TRUE@am__append_3 = ../readnl/libCouenneReadnl.la
     50@COIN_HAS_ASL_TRUE@am__append_4 = ../readnl/libCouenneReadnl.la
     51@COIN_HAS_ASL_TRUE@am__append_5 = ../readnl/libCouenneReadnl.la
     52@COIN_HAS_ASL_TRUE@am__append_6 = ../readnl/libCouenneReadnl.la
     53@COIN_HAS_CPX_TRUE@am__append_7 = \
    5054@COIN_HAS_CPX_TRUE@     -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiCpx` \
    5155@COIN_HAS_CPX_TRUE@     -I`$(CYGPATH_W) $(CPXINCDIR)`
     
    7882am_couenne_OBJECTS = BonCouenne.$(OBJEXT)
    7983couenne_OBJECTS = $(am_couenne_OBJECTS)
    80 @COIN_HAS_CPX_TRUE@am__DEPENDENCIES_1 =  \
     84@COIN_HAS_ASL_TRUE@am__DEPENDENCIES_1 = ../readnl/libCouenneReadnl.la
     85@COIN_HAS_CPX_TRUE@am__DEPENDENCIES_2 =  \
    8186@COIN_HAS_CPX_TRUE@     $(OSIOBJDIR)/src/OsiCpx/libOsiCpx.la
    82 am__DEPENDENCIES_2 =
    83 @COIN_HAS_NTY_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2)
    84 am__DEPENDENCIES_4 = $(CBCOBJDIR)/src/libCbc.la \
     87am__DEPENDENCIES_3 =
     88@COIN_HAS_NTY_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3)
     89am__DEPENDENCIES_5 = $(CBCOBJDIR)/src/libCbc.la \
    8590        $(CGLOBJDIR)/src/libCgl.la \
    8691        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
     
    8994        $(BONMINOBJDIR)/src/Interfaces/libbonmininterfaces.la \
    9095        $(IPOPTOBJDIR)/src/Interfaces/libipopt.la \
    91         $(IPOPTOBJDIR)/src/LinAlg/liblinalg.la $(am__DEPENDENCIES_1) \
    92         $(am__DEPENDENCIES_3) $(OSIOBJDIR)/src/libOsi.la \
     96        $(IPOPTOBJDIR)/src/LinAlg/liblinalg.la $(am__DEPENDENCIES_2) \
     97        $(am__DEPENDENCIES_4) $(OSIOBJDIR)/src/libOsi.la \
    9398        $(CLPOBJDIR)/src/libClp.la \
    9499        $(COINUTILSOBJDIR)/src/libCoinUtils.la
     
    325330
    326331#       ../readnl/readnl.cpp
    327 couenne_LDADD = libBonCouenne.la ../readnl/libCouenneReadnl.la \
    328         ../libCouenne.la $(LIBCBCCOPY) $(COINLIBS) $(ADDLIBS) \
    329         $(ASLLIB) `cat \
     332couenne_LDADD = libBonCouenne.la $(am__append_3) ../libCouenne.la \
     333        $(LIBCBCCOPY) $(COINLIBS) $(ADDLIBS) $(ASLLIB) `cat \
    330334        $(IPOPTOBJDIR)/src/Interfaces/ipopt_addlibs_cpp.txt` `cat \
    331335        $(COINUTILSOBJDIR)/coinutils_addlibs.txt`
    332 couenne_DEPENDENCIES = \
    333         libBonCouenne.la \
    334         ../readnl/libCouenneReadnl.la \
     336couenne_DEPENDENCIES = libBonCouenne.la $(am__append_4) \
    335337        ../libCouenne.la
    336 
    337338couenne_SOURCES = \
    338339        BonCouenne.cpp
    339340
    340 couenne2_LDADD = libBonCouenne.la ../readnl/libCouenneReadnl.la \
    341         ../libCouenne.la $(LIBCBCCOPY) $(COINLIBS) $(ADDLIBS) \
    342         $(ASLLIB) `cat \
     341couenne2_LDADD = libBonCouenne.la $(am__append_5) ../libCouenne.la \
     342        $(LIBCBCCOPY) $(COINLIBS) $(ADDLIBS) $(ASLLIB) `cat \
    343343        $(IPOPTOBJDIR)/src/Interfaces/ipopt_addlibs_cpp.txt` `cat \
    344344        $(COINUTILSOBJDIR)/coinutils_addlibs.txt`
    345 couenne2_DEPENDENCIES = \
    346         libBonCouenne.la \
    347         ../readnl/libCouenneReadnl.la \
     345couenne2_DEPENDENCIES = libBonCouenne.la $(am__append_6) \
    348346        ../libCouenne.la
    349 
    350347couenne2_SOURCES = \
    351348        Couenne.cpp \
     
    397394        $(CGLSRCDIR)/src/CglKnapsackCover` -I`$(CYGPATH_W) \
    398395        $(CGLSRCDIR)/src/CglPreProcess` -I`$(CYGPATH_W) \
    399         $(CGLOBJDIR)/inc` $(am__append_3) $(ASL_CPPFLAGS) \
     396        $(CGLOBJDIR)/inc` $(am__append_7) $(ASL_CPPFLAGS) \
    400397        -I`$(CYGPATH_W) $(COUENNESRCDIR)/src` -I`$(CYGPATH_W) \
    401398        $(COUENNESRCDIR)/src/convex` -I`$(CYGPATH_W) \
  • trunk/Couenne/src/problem/CouenneProblemConstructors.cpp

    r290 r308  
    235235                  s == "simple" ? CouenneProblem::MulSepSimple :
    236236                                  CouenneProblem::MulSepTight);
    237 
    238 }
     237}
  • trunk/Couenne/src/readnl/nl2e.cpp

    r230 r308  
    127127    if (j >= nOrigVars_) // common expression
    128128      // use base pointer otherwise the .a field returns an awkward, out-of-bound index
     129      // TODO: fix! In itointqor.nl should return v51=y44 but returns v52=y44
     130      //                                          v??=y39 but returns v79=y39
    129131      j = ((expr_v *) e) - ((const ASL_fg *) asl) -> I.var_e_;
    130132
Note: See TracChangeset for help on using the changeset viewer.