Changeset 587


Ignore:
Timestamp:
May 30, 2011 12:47:59 PM (9 years ago)
Author:
pbelotti
Message:

BonCouenne?.cpp: stabilizing pointers for PrintInfo?() added by Francois, removing warnings. Merging Recorded Best Sol data from art_cutoff option.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/configure

    r585 r587  
    10801080  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
    10811081  --enable-debug          compile all projects with debug options tests
    1082                           (implies --disable-shared)
    1083   --enable-debug-couenne compile this project (Couenne) with debug compiler
    1084                           flags
     1082  --enable-debug-couenne compile this project (Couenne) with debug options
    10851083  --enable-doscompile     Under Cygwin, compile so that executables run under
    10861084                          DOS. Set to mingw to use gcc/g++/ld with
     
    11211119  --with-coin-instdir     prefix of installation directory for precompiled
    11221120                          COIN packages
    1123 
    11241121  --with-bonmin-lib linker flags for using package Bonmin
    11251122  --with-bonmin-incdir directory with header files for using package Bonmin
     
    18511848  case "${enableval}" in
    18521849    yes) coin_debug_compile=true
     1850         enable_shared=no
    18531851         ;;
    18541852    no)  coin_debug_compile=false
     
    31103108esac
    31113109
    3112 # add -DPROJECT_BUILD to signal compiler preprocessor which config header file to include
    3113 if test x$COIN_PRJCT != x; then
    3114   CFLAGS="$CFLAGS -D${COIN_PRJCT}_BUILD"
    3115 fi
    3116 
    31173110# Try if CFLAGS works
    31183111save_CFLAGS="$CFLAGS"
     
    40534046    fi ;;
    40544047esac
    4055 
    4056 # add -DPROJECT_BUILD to signal compiler preprocessor which config header file to include
    4057 if test x$COIN_PRJCT != x; then
    4058   CXXFLAGS="$CXXFLAGS -D${COIN_PRJCT}_BUILD"
    4059 fi
    40604048
    40614049# Try if CXXFLAGS works
     
    51495137esac
    51505138
    5151 # add -DPROJECT_BUILD to signal compiler preprocessor which config header file to include
    5152 if test x$COIN_PRJCT != x; then
    5153   CFLAGS="$CFLAGS -D${COIN_PRJCT}_BUILD"
    5154 fi
    5155 
    51565139# Try if CFLAGS works
    51575140save_CFLAGS="$CFLAGS"
     
    70457028*-*-irix6*)
    70467029  # Find out which ABI we are using.
    7047   echo '#line 7047 "configure"' > conftest.$ac_ext
     7030  echo '#line 7030 "configure"' > conftest.$ac_ext
    70487031  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    70497032  (eval $ac_compile) 2>&5
     
    81798162
    81808163# Provide some information about the compiler.
    8181 echo "$as_me:8181:" \
     8164echo "$as_me:8164:" \
    81828165     "checking for Fortran 77 compiler version" >&5
    81838166ac_compiler=`set X $ac_compile; echo $2`
     
    92469229   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    92479230   -e 's:$: $lt_compiler_flag:'`
    9248    (eval echo "\"\$as_me:9248: $lt_compile\"" >&5)
     9231   (eval echo "\"\$as_me:9231: $lt_compile\"" >&5)
    92499232   (eval "$lt_compile" 2>conftest.err)
    92509233   ac_status=$?
    92519234   cat conftest.err >&5
    9252    echo "$as_me:9252: \$? = $ac_status" >&5
     9235   echo "$as_me:9235: \$? = $ac_status" >&5
    92539236   if (exit $ac_status) && test -s "$ac_outfile"; then
    92549237     # The compiler can only warn and ignore the option if not recognized
     
    95149497   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    95159498   -e 's:$: $lt_compiler_flag:'`
    9516    (eval echo "\"\$as_me:9516: $lt_compile\"" >&5)
     9499   (eval echo "\"\$as_me:9499: $lt_compile\"" >&5)
    95179500   (eval "$lt_compile" 2>conftest.err)
    95189501   ac_status=$?
    95199502   cat conftest.err >&5
    9520    echo "$as_me:9520: \$? = $ac_status" >&5
     9503   echo "$as_me:9503: \$? = $ac_status" >&5
    95219504   if (exit $ac_status) && test -s "$ac_outfile"; then
    95229505     # The compiler can only warn and ignore the option if not recognized
     
    96189601   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    96199602   -e 's:$: $lt_compiler_flag:'`
    9620    (eval echo "\"\$as_me:9620: $lt_compile\"" >&5)
     9603   (eval echo "\"\$as_me:9603: $lt_compile\"" >&5)
    96219604   (eval "$lt_compile" 2>out/conftest.err)
    96229605   ac_status=$?
    96239606   cat out/conftest.err >&5
    9624    echo "$as_me:9624: \$? = $ac_status" >&5
     9607   echo "$as_me:9607: \$? = $ac_status" >&5
    96259608   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    96269609   then
     
    1196311946  lt_status=$lt_dlunknown
    1196411947  cat > conftest.$ac_ext <<EOF
    11965 #line 11965 "configure"
     11948#line 11948 "configure"
    1196611949#include "confdefs.h"
    1196711950
     
    1206312046  lt_status=$lt_dlunknown
    1206412047  cat > conftest.$ac_ext <<EOF
    12065 #line 12065 "configure"
     12048#line 12048 "configure"
    1206612049#include "confdefs.h"
    1206712050
     
    1440714390   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1440814391   -e 's:$: $lt_compiler_flag:'`
    14409    (eval echo "\"\$as_me:14409: $lt_compile\"" >&5)
     14392   (eval echo "\"\$as_me:14392: $lt_compile\"" >&5)
    1441014393   (eval "$lt_compile" 2>conftest.err)
    1441114394   ac_status=$?
    1441214395   cat conftest.err >&5
    14413    echo "$as_me:14413: \$? = $ac_status" >&5
     14396   echo "$as_me:14396: \$? = $ac_status" >&5
    1441414397   if (exit $ac_status) && test -s "$ac_outfile"; then
    1441514398     # The compiler can only warn and ignore the option if not recognized
     
    1451114494   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1451214495   -e 's:$: $lt_compiler_flag:'`
    14513    (eval echo "\"\$as_me:14513: $lt_compile\"" >&5)
     14496   (eval echo "\"\$as_me:14496: $lt_compile\"" >&5)
    1451414497   (eval "$lt_compile" 2>out/conftest.err)
    1451514498   ac_status=$?
    1451614499   cat out/conftest.err >&5
    14517    echo "$as_me:14517: \$? = $ac_status" >&5
     14500   echo "$as_me:14500: \$? = $ac_status" >&5
    1451814501   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1451914502   then
     
    1608116064   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1608216065   -e 's:$: $lt_compiler_flag:'`
    16083    (eval echo "\"\$as_me:16083: $lt_compile\"" >&5)
     16066   (eval echo "\"\$as_me:16066: $lt_compile\"" >&5)
    1608416067   (eval "$lt_compile" 2>conftest.err)
    1608516068   ac_status=$?
    1608616069   cat conftest.err >&5
    16087    echo "$as_me:16087: \$? = $ac_status" >&5
     16070   echo "$as_me:16070: \$? = $ac_status" >&5
    1608816071   if (exit $ac_status) && test -s "$ac_outfile"; then
    1608916072     # The compiler can only warn and ignore the option if not recognized
     
    1618516168   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1618616169   -e 's:$: $lt_compiler_flag:'`
    16187    (eval echo "\"\$as_me:16187: $lt_compile\"" >&5)
     16170   (eval echo "\"\$as_me:16170: $lt_compile\"" >&5)
    1618816171   (eval "$lt_compile" 2>out/conftest.err)
    1618916172   ac_status=$?
    1619016173   cat out/conftest.err >&5
    16191    echo "$as_me:16191: \$? = $ac_status" >&5
     16174   echo "$as_me:16174: \$? = $ac_status" >&5
    1619216175   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1619316176   then
     
    1839218375   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1839318376   -e 's:$: $lt_compiler_flag:'`
    18394    (eval echo "\"\$as_me:18394: $lt_compile\"" >&5)
     18377   (eval echo "\"\$as_me:18377: $lt_compile\"" >&5)
    1839518378   (eval "$lt_compile" 2>conftest.err)
    1839618379   ac_status=$?
    1839718380   cat conftest.err >&5
    18398    echo "$as_me:18398: \$? = $ac_status" >&5
     18381   echo "$as_me:18381: \$? = $ac_status" >&5
    1839918382   if (exit $ac_status) && test -s "$ac_outfile"; then
    1840018383     # The compiler can only warn and ignore the option if not recognized
     
    1866018643   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1866118644   -e 's:$: $lt_compiler_flag:'`
    18662    (eval echo "\"\$as_me:18662: $lt_compile\"" >&5)
     18645   (eval echo "\"\$as_me:18645: $lt_compile\"" >&5)
    1866318646   (eval "$lt_compile" 2>conftest.err)
    1866418647   ac_status=$?
    1866518648   cat conftest.err >&5
    18666    echo "$as_me:18666: \$? = $ac_status" >&5
     18649   echo "$as_me:18649: \$? = $ac_status" >&5
    1866718650   if (exit $ac_status) && test -s "$ac_outfile"; then
    1866818651     # The compiler can only warn and ignore the option if not recognized
     
    1876418747   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1876518748   -e 's:$: $lt_compiler_flag:'`
    18766    (eval echo "\"\$as_me:18766: $lt_compile\"" >&5)
     18749   (eval echo "\"\$as_me:18749: $lt_compile\"" >&5)
    1876718750   (eval "$lt_compile" 2>out/conftest.err)
    1876818751   ac_status=$?
    1876918752   cat out/conftest.err >&5
    18770    echo "$as_me:18770: \$? = $ac_status" >&5
     18753   echo "$as_me:18753: \$? = $ac_status" >&5
    1877118754   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1877218755   then
     
    2221722200fi
    2221822201
    22219 if test "$coin_has_bonmin" != skipping; then
    22220 
    22221 # Check whether --with-m4_tolower(Bonmin) or --without-m4_tolower(Bonmin) was given.
    22222 if test "${with_bonmin+set}" = set; then
    22223   withval="$with_bonmin"
    22224   if test "$withval" = no ; then
    22225        coin_has_bonmin=skipping
    22226      fi
    22227 
    22228 fi;
    22229 fi
    22230 
    2223122202BONMIN_LIBS=
    2223222203BONMIN_CFLAGS=
     
    2271922690    fi
    2272022691  done
    22721 fi
    22722 
    22723 if test "$coin_has_asl" != skipping; then
    22724 
    22725 # Check whether --with-m4_tolower(ASL) or --without-m4_tolower(ASL) was given.
    22726 if test "${with_asl+set}" = set; then
    22727   withval="$with_asl"
    22728   if test "$withval" = no ; then
    22729        coin_has_asl=skipping
    22730      fi
    22731 
    22732 fi;
    2273322692fi
    2273422693
     
    2341623375fi
    2341723376
    23418 if test "$coin_has_cpx" != skipping; then
    23419 
    23420 # Check whether --with-m4_tolower(Cpx) or --without-m4_tolower(Cpx) was given.
    23421 if test "${with_cpx+set}" = set; then
    23422   withval="$with_cpx"
    23423   if test "$withval" = no ; then
    23424        coin_has_cpx=skipping
    23425      fi
    23426 
    23427 fi;
    23428 fi
    23429 
    2343023377CPX_LIBS=
    2343123378CPX_CFLAGS=
     
    2391723864fi
    2391823865
    23919 if test "$coin_has_grb" != skipping; then
    23920 
    23921 # Check whether --with-m4_tolower(Grb) or --without-m4_tolower(Grb) was given.
    23922 if test "${with_grb+set}" = set; then
    23923   withval="$with_grb"
    23924   if test "$withval" = no ; then
    23925        coin_has_grb=skipping
    23926      fi
    23927 
    23928 fi;
    23929 fi
    23930 
    2393123866GRB_LIBS=
    2393223867GRB_CFLAGS=
     
    2440924344fi
    2441024345
    24411 if test "$coin_has_msk" != skipping; then
    24412 
    24413 # Check whether --with-m4_tolower(Msk) or --without-m4_tolower(Msk) was given.
    24414 if test "${with_msk+set}" = set; then
    24415   withval="$with_msk"
    24416   if test "$withval" = no ; then
    24417        coin_has_msk=skipping
    24418      fi
    24419 
    24420 fi;
    24421 fi
    24422 
    2442324346MSK_LIBS=
    2442424347MSK_CFLAGS=
     
    2490124824fi
    2490224825
    24903 if test "$coin_has_spx" != skipping; then
    24904 
    24905 # Check whether --with-m4_tolower(Spx) or --without-m4_tolower(Spx) was given.
    24906 if test "${with_spx+set}" = set; then
    24907   withval="$with_spx"
    24908   if test "$withval" = no ; then
    24909        coin_has_spx=skipping
    24910      fi
    24911 
    24912 fi;
    24913 fi
    24914 
    2491524826SPX_LIBS=
    2491624827SPX_CFLAGS=
     
    2539125302    fi
    2539225303  done
    25393 fi
    25394 
    25395 if test "$coin_has_xpr" != skipping; then
    25396 
    25397 # Check whether --with-m4_tolower(Xpr) or --without-m4_tolower(Xpr) was given.
    25398 if test "${with_xpr+set}" = set; then
    25399   withval="$with_xpr"
    25400   if test "$withval" = no ; then
    25401        coin_has_xpr=skipping
    25402      fi
    25403 
    25404 fi;
    2540525304fi
    2540625305
  • trunk/Couenne/src/branch/CouenneBranchingObject.cpp

    r577 r587  
    2525
    2626namespace Couenne {
    27 class CouenneCutGenerator;
     27  class CouenneCutGenerator;
    2828}
    2929
     
    164164      ::isInteger (brpt)) {
    165165
    166     // Careful here. We should look at all possible cases (l,u are
    167     // bounds, b is the branching point. l,u,b all integer):
     166    // Look at all possible cases (l,u are bounds, b is the branching
     167    // point. l,u,b all integer):
    168168    //
    169169    // 1) l <  b <  u: first branch on b +/- 1 depending on branch
     
    223223  t_chg_bounds *chg_bds = NULL;
    224224
     225  // Apply core branching decision (usually new variable bound)
     226
    225227  branchCore (solver, index, way, integer, brpt, chg_bds);
    226228
  • trunk/Couenne/src/convex/generateCuts.cpp

    r574 r587  
    9292                                        const CglTreeInfo info) const {
    9393
     94  // check if out of time or if an infeasibility cut (iis of type 0)
     95  // was added as a result of, e.g., pruning on BT. If so, no need to
     96  // run this.
     97
    9498  if (isWiped (cs) ||
    9599     (CoinCpuTime () > problem_ -> getMaxCpuTime ()))
     
    104108  }
    105109  if(currCutOff > bestVal) {
    106     problem_->setCutOff(bestVal - 1e-6);
     110    //problem_ -> setCutOff (bestVal - 1e-6); // FIXME: don't add numerical constants
     111    problem_ -> setCutOff (bestVal);
    107112    OsiColCut *objCut = new OsiColCut;
    108113    int indObj = problem_->Obj(0)->Body()->Index();
  • trunk/Couenne/src/main/BonCouenne.cpp

    r586 r587  
    1111// Date : 12/19/2006
    1212
    13 
    1413#if defined(_MSC_VER)
    1514// Turn off compiler warning about long names
    1615#  pragma warning(disable:4786)
    1716#endif
     17
    1818#include <iomanip>
    1919#include <fstream>
     
    4949
    5050#ifdef COIN_HAS_NTY
    51 int nOrbBr = 0;
     51int nOrbBr = 0; // FIXME: horrible global variable. Brrr.
    5252#endif
    5353
     
    118118      throw infeasible;
    119119
    120 #ifdef FM_PRINT_INFO
     120    //////////////////////////////
     121    CouenneCutGenerator *cg = NULL;
     122
     123    // there is only one CouenneCutGenerator object; scan array until
     124    // dynamic_cast returns non-NULL
     125
     126    if (couenne. cutGenerators () . size () > 0) {
     127
     128      for (std::list <Bonmin::BabSetupBase::CuttingMethod>::iterator
     129                   i  = couenne.cutGenerators () . begin ();
     130           !cg && (i != couenne.cutGenerators () . end ());
     131           ++i)
     132
     133        cg = dynamic_cast <CouenneCutGenerator *> (i -> cgl);
     134    }
     135
    121136    // This assumes that first cut generator is CouenneCutGenerator
    122     CouenneCutGenerator *ccg = dynamic_cast<CouenneCutGenerator *>
    123       (couenne.cutGenerators().begin()->cgl);
    124     if(ccg) {
    125       ccg->setBabPtr(&bb);
    126     }
     137    // CouenneCutGenerator *cg = dynamic_cast<CouenneCutGenerator *>
     138    //   (couenne.cutGenerators().begin()->cgl);
     139
     140    if (cg)
     141
     142      cg -> setBabPtr (&bb);
     143
    127144    else {
    128       printf("main(): ### ERROR: Can not get CouenneCutGenerator\n");
    129       exit(1);
    130     }
    131 #endif
     145      printf ("main(): ### ERROR: Can not get CouenneCutGenerator\n");
     146      exit (1);
     147    }
    132148
    133149    // initial printout
     
    177193    std::cout.precision (10);
    178194
    179     //////////////////////////////
    180     CouenneCutGenerator *cg = NULL;
    181 
    182     // there is only one cut generator, so scan array until
    183     // dynamic_cast returns non-NULL
    184 
    185     if (bb.model (). cutGenerators ()) {
    186 
    187       int nGen = bb.model (). numberCutGenerators ();
    188      
    189       for (int i=0; !cg && i < nGen; i++)
    190         cg = dynamic_cast <CouenneCutGenerator *>
    191           (bb.model (). cutGenerators () [i] -> generator ());
    192     }
    193 
    194195    ////////////////////////////////
    195196    int nr=-1, nt=-1;
     
    201202    CouenneProblem *cp = cg ? cg -> Problem () : NULL;
    202203
     204#if defined (FM_TRACE_OPTSOL) || defined (FM_FRES)
    203205    double cbcLb = bb.model ().getBestPossibleObjValue();
    204206    double printObj = 0;
    205207    bool foundSol = false;
     208#endif
    206209
    207210#ifdef FM_TRACE_OPTSOL
    208211
    209     FILE *fSol = fopen("bidon.sol", "w");
     212    FILE *fSol = fopen ("bidon.sol", "w");
     213
    210214    if(fSol == NULL) {
    211215      printf("### ERROR: can not open bidon.sol\n");
     
    369373
    370374    if (couenne.displayStats ()) { // print statistics
    371 
    372       // CAUTION: assuming first cut generator is our CouenneCutGenerator
    373375
    374376      if (cg && !cp) printf ("Warning, could not get pointer to problem\n");
  • trunk/Couenne/src/main/BonCouenneSetup.cpp

    r577 r587  
    466466    cg.cgl = couenneCg;
    467467    cg.id = "Couenne convexifier cuts";
    468     cutGenerators().push_back(cg);
     468    cutGenerators().push_back (cg);
    469469
    470470    // set cut gen pointer
     
    885885                            givenAllowFGap2, "bonmin.");
    886886  double upval = 1e50;
    887   printf("CutOff value:\n");
    888   scanf("%lf", &upval);
     887  //printf("CutOff value:\n");
     888  //scanf("%lf", &upval);
     889
     890  options_->GetNumericValue(std::string("art_cutoff"),
     891                            upval, "bonmin.");
     892
    889893  double newCO = (1-givenAllowFGap2) * upval;
    890894  couenneProb_->setCutOff(newCO);
  • trunk/configure

    r563 r587  
    36543654        coin_add_cxxflags="-pipe"
    36553655        coin_dbg_cxxflags="-g"
    3656         coin_warn_cxxflags="-Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long"
     3656        coin_warn_cxxflags="-Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long"
    36573657        case $build in
    36583658          *-darwin*)
Note: See TracChangeset for help on using the changeset viewer.