Changeset 416 for branches


Ignore:
Timestamp:
Jul 15, 2006 4:14:39 PM (13 years ago)
Author:
forrest
Message:

for allCuts

Location:
branches/devel/Cbc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/Makefile.in

    r406 r416  
    6262        $(srcdir)/../ltmain.sh $(srcdir)/../missing \
    6363        $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
    64         $(srcdir)/cbc_addlibs.txt.in \
    65         $(top_srcdir)/../Clp/src/CbcOrClpParam.cpp \
    66         $(top_srcdir)/../Clp/src/CbcOrClpParam.hpp \
    67         $(top_srcdir)/configure $(top_srcdir)/examples/Makefile.in \
     64        $(srcdir)/cbc_addlibs.txt.in $(top_srcdir)/configure \
     65        $(top_srcdir)/examples/Makefile.in \
    6866        $(top_srcdir)/inc/config_cbc.h.in AUTHORS
    6967@HAVE_EXTERNALS_TRUE@am__append_2 = Externals
     
    544542        $(am__remove_distdir)
    545543        mkdir $(distdir)
    546         $(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../BuildTools $(distdir)/../Clp/src $(distdir)/doc $(distdir)/examples $(distdir)/inc
     544        $(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../BuildTools $(distdir)/doc $(distdir)/examples $(distdir)/inc
    547545        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    548546        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  • branches/devel/Cbc/configure

    r406 r416  
    2054820548esac
    2054920549
    20550 # Steal some files from Clp - they are going to be deleted by a
    20551 # distclean in src (see the Makefile.am there)
    20552 if test x"$coin_has_clp" != xunavailable; then
    20553   { echo "$as_me:$LINENO: Stealing CbcOrClpParam's files from Clp" >&5
    20554 echo "$as_me: Stealing CbcOrClpParam's files from Clp" >&6;}
    20555                       ac_config_links="$ac_config_links src/CbcOrClpParam.cpp:../Clp/src/CbcOrClpParam.cpp src/CbcOrClpParam.hpp:../Clp/src/CbcOrClpParam.hpp"
    20556 
    20557 fi
    20558 
    2055920550#############################################################################
    2056020551#                            Third party solvers                            #
     
    2239422385$config_headers
    2239522386
    22396 Configuration links:
    22397 $config_links
    22398 
    2239922387Configuration commands:
    2240022388$config_commands
     
    2252022508  "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
    2252122509  "cbc_addlibs.txt" ) CONFIG_FILES="$CONFIG_FILES cbc_addlibs.txt" ;;
    22522   "src/CbcOrClpParam.cpp" ) CONFIG_LINKS="$CONFIG_LINKS src/CbcOrClpParam.cpp:../Clp/src/CbcOrClpParam.cpp" ;;
    22523   "src/CbcOrClpParam.hpp" ) CONFIG_LINKS="$CONFIG_LINKS src/CbcOrClpParam.hpp:../Clp/src/CbcOrClpParam.hpp" ;;
    2252422510  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    2252522511  "inc/config_cbc.h" ) CONFIG_HEADERS="$CONFIG_HEADERS inc/config_cbc.h" ;;
     
    2253722523  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
    2253822524  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
    22539   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
    2254022525  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
    2254122526fi
     
    2326023245
    2326123246#
    23262 # CONFIG_LINKS section.
    23263 #
    23264 
    23265 for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
    23266   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
    23267   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
    23268 
    23269   { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5
    23270 echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;}
    23271 
    23272   if test ! -r $srcdir/$ac_source; then
    23273     { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5
    23274 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;}
    23275    { (exit 1); exit 1; }; }
    23276   fi
    23277   rm -f $ac_dest
    23278 
    23279   # Make relative symlinks.
    23280   ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null ||
    23281 $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    23282          X"$ac_dest" : 'X\(//\)[^/]' \| \
    23283          X"$ac_dest" : 'X\(//\)$' \| \
    23284          X"$ac_dest" : 'X\(/\)' \| \
    23285          .     : '\(.\)' 2>/dev/null ||
    23286 echo X"$ac_dest" |
    23287     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
    23288           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
    23289           /^X\(\/\/\)$/{ s//\1/; q; }
    23290           /^X\(\/\).*/{ s//\1/; q; }
    23291           s/.*/./; q'`
    23292   { if $as_mkdir_p; then
    23293     mkdir -p "$ac_dest_dir"
    23294   else
    23295     as_dir="$ac_dest_dir"
    23296     as_dirs=
    23297     while test ! -d "$as_dir"; do
    23298       as_dirs="$as_dir $as_dirs"
    23299       as_dir=`(dirname "$as_dir") 2>/dev/null ||
    23300 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    23301          X"$as_dir" : 'X\(//\)[^/]' \| \
    23302          X"$as_dir" : 'X\(//\)$' \| \
    23303          X"$as_dir" : 'X\(/\)' \| \
    23304          .     : '\(.\)' 2>/dev/null ||
    23305 echo X"$as_dir" |
    23306     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
    23307           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
    23308           /^X\(\/\/\)$/{ s//\1/; q; }
    23309           /^X\(\/\).*/{ s//\1/; q; }
    23310           s/.*/./; q'`
    23311     done
    23312     test ! -n "$as_dirs" || mkdir $as_dirs
    23313   fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5
    23314 echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;}
    23315    { (exit 1); exit 1; }; }; }
    23316 
    23317   ac_builddir=.
    23318 
    23319 if test "$ac_dest_dir" != .; then
    23320   ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'`
    23321   # A "../" for each directory in $ac_dir_suffix.
    23322   ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
    23323 else
    23324   ac_dir_suffix= ac_top_builddir=
    23325 fi
    23326 
    23327 case $srcdir in
    23328   .)  # No --srcdir option.  We are building in place.
    23329     ac_srcdir=.
    23330     if test -z "$ac_top_builddir"; then
    23331        ac_top_srcdir=.
    23332     else
    23333        ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    23334     fi ;;
    23335   [\\/]* | ?:[\\/]* )  # Absolute path.
    23336     ac_srcdir=$srcdir$ac_dir_suffix;
    23337     ac_top_srcdir=$srcdir ;;
    23338   *) # Relative path.
    23339     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    23340     ac_top_srcdir=$ac_top_builddir$srcdir ;;
    23341 esac
    23342 
    23343 # Do not use `cd foo && pwd` to compute absolute paths, because
    23344 # the directories may not exist.
    23345 case `pwd` in
    23346 .) ac_abs_builddir="$ac_dest_dir";;
    23347 *)
    23348   case "$ac_dest_dir" in
    23349   .) ac_abs_builddir=`pwd`;;
    23350   [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";;
    23351   *) ac_abs_builddir=`pwd`/"$ac_dest_dir";;
    23352   esac;;
    23353 esac
    23354 case $ac_abs_builddir in
    23355 .) ac_abs_top_builddir=${ac_top_builddir}.;;
    23356 *)
    23357   case ${ac_top_builddir}. in
    23358   .) ac_abs_top_builddir=$ac_abs_builddir;;
    23359   [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
    23360   *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
    23361   esac;;
    23362 esac
    23363 case $ac_abs_builddir in
    23364 .) ac_abs_srcdir=$ac_srcdir;;
    23365 *)
    23366   case $ac_srcdir in
    23367   .) ac_abs_srcdir=$ac_abs_builddir;;
    23368   [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
    23369   *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
    23370   esac;;
    23371 esac
    23372 case $ac_abs_builddir in
    23373 .) ac_abs_top_srcdir=$ac_top_srcdir;;
    23374 *)
    23375   case $ac_top_srcdir in
    23376   .) ac_abs_top_srcdir=$ac_abs_builddir;;
    23377   [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
    23378   *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
    23379   esac;;
    23380 esac
    23381 
    23382 
    23383   case $srcdir in
    23384   [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;;
    23385       *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
    23386   esac
    23387 
    23388   # Try a symlink, then a hard link, then a copy.
    23389   ln -s $ac_rel_source $ac_dest 2>/dev/null ||
    23390     ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
    23391     cp -p $srcdir/$ac_source $ac_dest ||
    23392     { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5
    23393 echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;}
    23394    { (exit 1); exit 1; }; }
    23395 done
    23396 _ACEOF
    23397 cat >>$CONFIG_STATUS <<\_ACEOF
    23398 
    23399 #
    2340023247# CONFIG_COMMANDS section.
    2340123248#
  • branches/devel/Cbc/src/CbcBranchActual.cpp

    r310 r416  
    33253325  }
    33263326}
     3327
     3328// Default Constructor
     3329CbcDummyBranchingObject::CbcDummyBranchingObject(CbcModel * model)
     3330  :CbcBranchingObject(model,0,0,0.5)
     3331{
     3332  numberBranchesLeft_=1;
     3333}
     3334
     3335
     3336// Copy constructor
     3337CbcDummyBranchingObject::CbcDummyBranchingObject ( const CbcDummyBranchingObject & rhs) :CbcBranchingObject(rhs)
     3338{
     3339}
     3340
     3341// Assignment operator
     3342CbcDummyBranchingObject &
     3343CbcDummyBranchingObject::operator=( const CbcDummyBranchingObject& rhs)
     3344{
     3345  if (this != &rhs) {
     3346    CbcBranchingObject::operator=(rhs);
     3347  }
     3348  return *this;
     3349}
     3350CbcBranchingObject *
     3351CbcDummyBranchingObject::clone() const
     3352{
     3353  return (new CbcDummyBranchingObject(*this));
     3354}
     3355
     3356
     3357// Destructor
     3358CbcDummyBranchingObject::~CbcDummyBranchingObject ()
     3359{
     3360}
     3361
     3362/*
     3363  Perform a dummy branch
     3364*/
     3365double
     3366CbcDummyBranchingObject::branch(bool normalBranch)
     3367{
     3368  if (model_->messageHandler()->logLevel()>2&&normalBranch)
     3369    print(normalBranch);
     3370  numberBranchesLeft_=0;
     3371  return 0.0;
     3372}
     3373// Print what would happen 
     3374void
     3375CbcDummyBranchingObject::print(bool normalBranch)
     3376{
     3377  printf("Dummy branch\n");
     3378}
  • branches/devel/Cbc/src/CbcBranchActual.hpp

    r295 r416  
    10111011  int * variable_;
    10121012};
     1013/** Dummy branching object
     1014
     1015  This object specifies a one-way dummy branch.
     1016  This is so one can carry on branching even when it looks feasible
     1017*/
     1018
     1019class CbcDummyBranchingObject : public CbcBranchingObject {
     1020
     1021public:
     1022
     1023  /// Default constructor
     1024  CbcDummyBranchingObject (CbcModel * model=NULL);
     1025
     1026  /// Copy constructor
     1027  CbcDummyBranchingObject ( const CbcDummyBranchingObject &);
     1028   
     1029  /// Assignment operator
     1030  CbcDummyBranchingObject & operator= (const CbcDummyBranchingObject& rhs);
     1031
     1032  /// Clone
     1033  virtual CbcBranchingObject * clone() const;
     1034
     1035  /// Destructor
     1036  virtual ~CbcDummyBranchingObject ();
     1037 
     1038  /** \brief Dummy branch
     1039  */
     1040  virtual double branch(bool normalBranch=false);
     1041
     1042  /** \brief Print something about branch - only if log level high
     1043  */
     1044  virtual void print(bool normalBranch);
     1045
     1046};
     1047
    10131048
    10141049#endif
  • branches/devel/Cbc/src/CbcModel.cpp

    r414 r416  
    15521552            statistics_[numberNodes2_-1]->sayInfeasible();
    15531553        }
    1554         if (newNode)
    1555         { if (newNode->variable() >= 0)
     1554        if (newNode) {
     1555          if (newNode->variable() < 0&&solverCharacteristics_->solverType()==4) {
     1556            // need to check if any cuts would do anything
     1557            OsiCuts theseCuts;
     1558            for (int i = 0;i<numberCutGenerators_;i++) {
     1559              bool generate = generator_[i]->normal();
     1560              // skip if not optimal and should be (maybe a cut generator has fixed variables)
     1561              if (generator_[i]->needsOptimalBasis()&&!solver_->basisIsAvailable())
     1562                generate=false;
     1563              if (!generator_[i]->mustCallAgain())
     1564                generate=false; // only special cuts
     1565              if (generate) {
     1566                generator_[i]->generateCuts(theseCuts,true,NULL) ;
     1567                int numberRowCutsAfter = theseCuts.sizeRowCuts() ;
     1568                if (numberRowCutsAfter) {
     1569                  // need dummy branch
     1570                  newNode->setBranchingObject(new CbcDummyBranchingObject(this));
     1571                  newNode->nodeInfo()->initializeInfo(1);
     1572                  break;
     1573                }
     1574              }
     1575            }
     1576          }
     1577          if (newNode->variable() >= 0)
    15561578          { handler_->message(CBC_BRANCH,messages_)
    15571579               << numberNodes_<< newNode->objectiveValue()
  • branches/devel/Cbc/src/CbcNode.hpp

    r303 r416  
    545545  {guessedObjectiveValue_=value;};
    546546  /// Branching object for this node
    547   const CbcBranchingObject * branchingObject() const
     547  inline const CbcBranchingObject * branchingObject() const
    548548  { return branch_;};
    549549  /// Modifiable branching object for this node
    550   CbcBranchingObject * modifiableBranchingObject() const
     550  inline CbcBranchingObject * modifiableBranchingObject() const
    551551  { return branch_;};
     552  /// Set branching object for this node (takes ownership)
     553  inline void setBranchingObject(CbcBranchingObject * branchingObject)
     554  { branch_ = branchingObject;};
    552555
    553556private:
  • branches/devel/Cbc/src/Makefile.in

    r415 r416  
    128128mkinstalldirs = $(install_sh) -d
    129129CONFIG_HEADER = $(top_builddir)/inc/config_cbc.h
    130 CONFIG_CLEAN_FILES = CbcOrClpParam.cpp CbcOrClpParam.hpp
     130CONFIG_CLEAN_FILES =
    131131am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    132132am__vpath_adj = case $$p in \
Note: See TracChangeset for help on using the changeset viewer.