Changeset 86
- Timestamp:
- Mar 23, 2005 4:51:39 PM (16 years ago)
- Location:
- trunk/Samples
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Samples/CbcCompareUser.cpp
r31 r86 95 95 return x->depth() < y->depth(); 96 96 } else { 97 // after solution or very beginning97 // after solution 98 98 double weight = CoinMax(weight_,0.0); 99 99 return x->objectiveValue()+ weight*x->numberUnsatisfied() > -
trunk/Samples/Makefile
r2 r86 1 OptLevel := -O1 1 2 OptLevel := -g 2 3 … … 72 73 ifeq ($(findstring Linux,${UNAME}),Linux) 73 74 CXXFLAGS += -DREADLINE 74 LDFLAGS += -lhistory -lreadline -ltermcap75 # LDFLAGS += -lhistory -lreadline -ltermcap 75 76 endif 76 77 CXXFLAGS += -I. … … 81 82 TESTSRC := $(DRIVER).cpp 82 83 TESTSRC += CbcCompareUser.cpp 84 TESTSRC += CbcSolver2.cpp 83 85 TESTSRC += CbcBranchUser.cpp 84 86 TESTSRC += CbcHeuristicUser.cpp 85 TESTSRC += Cbc TreeLocal.cpp87 TESTSRC += CbcHeuristicGreedy.cpp 86 88 TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o)) 87 89 TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d)) -
trunk/Samples/crew.cpp
r85 r86 14 14 #include "CbcModel.hpp" 15 15 #include "CbcBranchActual.hpp" 16 #include "CbcBranchUser.hpp"17 16 #include "CbcCompareUser.hpp" 18 17 … … 52 51 OsiClpSolverInterface * osiclp = dynamic_cast< OsiClpSolverInterface*> (solver3); 53 52 assert (osiclp); 54 55 // Redundant definition of default branching (as Default == User)56 CbcBranchUserDecision branch;57 model.setBranchingMethod(&branch);58 53 59 54 // Definition of node choice -
trunk/Samples/longthin.cpp
r83 r86 112 112 for (iColumn=0;iColumn<numberColumns;iColumn++) { 113 113 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])); 115 122 CbcSimpleIntegerPseudoCost * newObject = 116 123 new CbcSimpleIntegerPseudoCost(&model,numberIntegers,iColumn, 117 costPer,costPer);124 2.0*cost,cost); 118 125 newObject->setMethod(3); 119 126 objects[numberIntegers++]= newObject;
Note: See TracChangeset
for help on using the changeset viewer.