Changeset 86


Ignore:
Timestamp:
Mar 23, 2005 4:51:39 PM (16 years ago)
Author:
forrest
Message:

inline with doc

Location:
trunk/Samples
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Samples/CbcCompareUser.cpp

    r31 r86  
    9595      return x->depth() < y->depth();
    9696  } else {
    97     // after solution or very beginning
     97    // after solution
    9898    double weight = CoinMax(weight_,0.0);
    9999    return x->objectiveValue()+ weight*x->numberUnsatisfied() >
  • trunk/Samples/Makefile

    r2 r86  
     1OptLevel := -O1
    12OptLevel := -g
    23
     
    7273ifeq ($(findstring Linux,${UNAME}),Linux)
    7374        CXXFLAGS +=     -DREADLINE
    74         LDFLAGS += -lhistory -lreadline -ltermcap
     75#       LDFLAGS += -lhistory -lreadline -ltermcap
    7576endif
    7677CXXFLAGS  += -I.
     
    8182TESTSRC := $(DRIVER).cpp
    8283TESTSRC += CbcCompareUser.cpp
     84TESTSRC += CbcSolver2.cpp
    8385TESTSRC += CbcBranchUser.cpp
    8486TESTSRC += CbcHeuristicUser.cpp
    85 TESTSRC += CbcTreeLocal.cpp
     87TESTSRC += CbcHeuristicGreedy.cpp
    8688TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
    8789TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
  • trunk/Samples/crew.cpp

    r85 r86  
    1414#include "CbcModel.hpp"
    1515#include "CbcBranchActual.hpp"
    16 #include "CbcBranchUser.hpp"
    1716#include "CbcCompareUser.hpp"
    1817
     
    5251  OsiClpSolverInterface * osiclp = dynamic_cast< OsiClpSolverInterface*> (solver3);
    5352  assert (osiclp);
    54 
    55   // Redundant definition of default branching (as Default == User)
    56   CbcBranchUserDecision branch;
    57   model.setBranchingMethod(&branch);
    5853
    5954  // Definition of node choice
  • trunk/Samples/longthin.cpp

    r83 r86  
    112112  for (iColumn=0;iColumn<numberColumns;iColumn++) {
    113113    if (solver3->isInteger(iColumn)) {
    114       double costPer = objective[iColumn]/ ((double) columnLength[iColumn]);
     114      /*  Branching up gets us much closer to an integer solution so we want
     115          to encourage up - so we will branch up if variable value > 0.333333.
     116          The expected cost of going up obviously depends on the cost of the
     117          variable so we just choose pseudo costs to reflect that.  We could also
     118          decide to try and use the pseudo costs to make it more likely to branch
     119          on a variable with many coefficients.  This leads to the computation below.
     120      */
     121      double cost = objective[iColumn]*(1.0 + 0.2*((double) columnLength[iColumn]));
    115122      CbcSimpleIntegerPseudoCost * newObject =
    116123        new CbcSimpleIntegerPseudoCost(&model,numberIntegers,iColumn,
    117                                        costPer,costPer);
     124                                       2.0*cost,cost);
    118125      newObject->setMethod(3);
    119126      objects[numberIntegers++]= newObject;
Note: See TracChangeset for help on using the changeset viewer.