ruby-cbc 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +203 -0
- data/Rakefile +40 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/ext/ruby-cbc/cbc.i +15 -0
- data/ext/ruby-cbc/cbc_wrap.c +4618 -0
- data/ext/ruby-cbc/extconf.rb +60 -0
- data/ext/ruby-cbc/install/bin/cbc +0 -0
- data/ext/ruby-cbc/install/bin/clp +0 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchActual.hpp +24 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchAllDifferent.hpp +62 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchBase.hpp +78 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchCut.hpp +183 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchDecision.hpp +129 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchDefaultDecision.hpp +100 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchDynamic.hpp +206 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchLotsize.hpp +242 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchToFixLots.hpp +94 -0
- data/ext/ruby-cbc/install/include/coin/CbcBranchingObject.hpp +236 -0
- data/ext/ruby-cbc/install/include/coin/CbcClique.hpp +303 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompare.hpp +39 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareActual.hpp +14 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareBase.hpp +142 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareDefault.hpp +120 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareDepth.hpp +47 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareEstimate.hpp +48 -0
- data/ext/ruby-cbc/install/include/coin/CbcCompareObjective.hpp +49 -0
- data/ext/ruby-cbc/install/include/coin/CbcConfig.h +14 -0
- data/ext/ruby-cbc/install/include/coin/CbcConsequence.hpp +49 -0
- data/ext/ruby-cbc/install/include/coin/CbcCountRowCut.hpp +168 -0
- data/ext/ruby-cbc/install/include/coin/CbcCutGenerator.hpp +482 -0
- data/ext/ruby-cbc/install/include/coin/CbcCutModifier.hpp +57 -0
- data/ext/ruby-cbc/install/include/coin/CbcCutSubsetModifier.hpp +66 -0
- data/ext/ruby-cbc/install/include/coin/CbcDummyBranchingObject.hpp +83 -0
- data/ext/ruby-cbc/install/include/coin/CbcEventHandler.hpp +245 -0
- data/ext/ruby-cbc/install/include/coin/CbcFathom.hpp +137 -0
- data/ext/ruby-cbc/install/include/coin/CbcFathomDynamicProgramming.hpp +169 -0
- data/ext/ruby-cbc/install/include/coin/CbcFeasibilityBase.hpp +56 -0
- data/ext/ruby-cbc/install/include/coin/CbcFixVariable.hpp +67 -0
- data/ext/ruby-cbc/install/include/coin/CbcFollowOn.hpp +207 -0
- data/ext/ruby-cbc/install/include/coin/CbcFullNodeInfo.hpp +161 -0
- data/ext/ruby-cbc/install/include/coin/CbcGeneral.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CbcGeneralDepth.hpp +279 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristic.hpp +682 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDINS.hpp +96 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDW.hpp +309 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDive.hpp +192 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveCoefficient.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveFractional.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveGuided.hpp +55 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveLineSearch.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDivePseudoCost.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveVectorLength.hpp +52 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicFPump.hpp +340 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicGreedy.hpp +280 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicLocal.hpp +271 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicPivotAndFix.hpp +58 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRENS.hpp +77 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRINS.hpp +102 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRandRound.hpp +58 -0
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicVND.hpp +94 -0
- data/ext/ruby-cbc/install/include/coin/CbcLinked.hpp +1406 -0
- data/ext/ruby-cbc/install/include/coin/CbcMessage.hpp +94 -0
- data/ext/ruby-cbc/install/include/coin/CbcMipStartIO.hpp +26 -0
- data/ext/ruby-cbc/install/include/coin/CbcModel.hpp +2952 -0
- data/ext/ruby-cbc/install/include/coin/CbcNWay.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CbcNode.hpp +351 -0
- data/ext/ruby-cbc/install/include/coin/CbcNodeInfo.hpp +349 -0
- data/ext/ruby-cbc/install/include/coin/CbcObject.hpp +272 -0
- data/ext/ruby-cbc/install/include/coin/CbcObjectUpdateData.hpp +64 -0
- data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.cpp +4134 -0
- data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.hpp +532 -0
- data/ext/ruby-cbc/install/include/coin/CbcParam.hpp +324 -0
- data/ext/ruby-cbc/install/include/coin/CbcPartialNodeInfo.hpp +110 -0
- data/ext/ruby-cbc/install/include/coin/CbcSOS.hpp +279 -0
- data/ext/ruby-cbc/install/include/coin/CbcSimpleInteger.hpp +286 -0
- data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerDynamicPseudoCost.hpp +564 -0
- data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerPseudoCost.hpp +114 -0
- data/ext/ruby-cbc/install/include/coin/CbcSolver.hpp +447 -0
- data/ext/ruby-cbc/install/include/coin/CbcStrategy.hpp +258 -0
- data/ext/ruby-cbc/install/include/coin/CbcSubProblem.hpp +83 -0
- data/ext/ruby-cbc/install/include/coin/CbcTree.hpp +490 -0
- data/ext/ruby-cbc/install/include/coin/CbcTreeLocal.hpp +372 -0
- data/ext/ruby-cbc/install/include/coin/Cbc_C_Interface.h +381 -0
- data/ext/ruby-cbc/install/include/coin/Cgl012cut.hpp +464 -0
- data/ext/ruby-cbc/install/include/coin/CglAllDifferent.hpp +115 -0
- data/ext/ruby-cbc/install/include/coin/CglClique.hpp +308 -0
- data/ext/ruby-cbc/install/include/coin/CglConfig.h +19 -0
- data/ext/ruby-cbc/install/include/coin/CglCutGenerator.hpp +121 -0
- data/ext/ruby-cbc/install/include/coin/CglDuplicateRow.hpp +189 -0
- data/ext/ruby-cbc/install/include/coin/CglFlowCover.hpp +371 -0
- data/ext/ruby-cbc/install/include/coin/CglGMI.hpp +364 -0
- data/ext/ruby-cbc/install/include/coin/CglGMIParam.hpp +313 -0
- data/ext/ruby-cbc/install/include/coin/CglGomory.hpp +204 -0
- data/ext/ruby-cbc/install/include/coin/CglKnapsackCover.hpp +310 -0
- data/ext/ruby-cbc/install/include/coin/CglLandP.hpp +306 -0
- data/ext/ruby-cbc/install/include/coin/CglLandPValidator.hpp +130 -0
- data/ext/ruby-cbc/install/include/coin/CglLiftAndProject.hpp +104 -0
- data/ext/ruby-cbc/install/include/coin/CglMessage.hpp +50 -0
- data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding.hpp +429 -0
- data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding2.hpp +427 -0
- data/ext/ruby-cbc/install/include/coin/CglOddHole.hpp +160 -0
- data/ext/ruby-cbc/install/include/coin/CglParam.hpp +93 -0
- data/ext/ruby-cbc/install/include/coin/CglPreProcess.hpp +492 -0
- data/ext/ruby-cbc/install/include/coin/CglProbing.hpp +543 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplit.hpp +448 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplit2.hpp +494 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplit2Param.hpp +495 -0
- data/ext/ruby-cbc/install/include/coin/CglRedSplitParam.hpp +272 -0
- data/ext/ruby-cbc/install/include/coin/CglResidualCapacity.hpp +240 -0
- data/ext/ruby-cbc/install/include/coin/CglSimpleRounding.hpp +174 -0
- data/ext/ruby-cbc/install/include/coin/CglStored.hpp +125 -0
- data/ext/ruby-cbc/install/include/coin/CglTreeInfo.hpp +180 -0
- data/ext/ruby-cbc/install/include/coin/CglTwomir.hpp +565 -0
- data/ext/ruby-cbc/install/include/coin/CglZeroHalf.hpp +133 -0
- data/ext/ruby-cbc/install/include/coin/ClpAmplObjective.hpp +113 -0
- data/ext/ruby-cbc/install/include/coin/ClpCholeskyBase.hpp +294 -0
- data/ext/ruby-cbc/install/include/coin/ClpCholeskyDense.hpp +162 -0
- data/ext/ruby-cbc/install/include/coin/ClpConfig.h +17 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraint.hpp +125 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraintAmpl.hpp +108 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraintLinear.hpp +110 -0
- data/ext/ruby-cbc/install/include/coin/ClpConstraintQuadratic.hpp +119 -0
- data/ext/ruby-cbc/install/include/coin/ClpDualRowDantzig.hpp +71 -0
- data/ext/ruby-cbc/install/include/coin/ClpDualRowPivot.hpp +129 -0
- data/ext/ruby-cbc/install/include/coin/ClpDualRowSteepest.hpp +153 -0
- data/ext/ruby-cbc/install/include/coin/ClpDummyMatrix.hpp +183 -0
- data/ext/ruby-cbc/install/include/coin/ClpDynamicExampleMatrix.hpp +186 -0
- data/ext/ruby-cbc/install/include/coin/ClpDynamicMatrix.hpp +381 -0
- data/ext/ruby-cbc/install/include/coin/ClpEventHandler.hpp +187 -0
- data/ext/ruby-cbc/install/include/coin/ClpFactorization.hpp +432 -0
- data/ext/ruby-cbc/install/include/coin/ClpGubDynamicMatrix.hpp +247 -0
- data/ext/ruby-cbc/install/include/coin/ClpGubMatrix.hpp +358 -0
- data/ext/ruby-cbc/install/include/coin/ClpInterior.hpp +570 -0
- data/ext/ruby-cbc/install/include/coin/ClpLinearObjective.hpp +103 -0
- data/ext/ruby-cbc/install/include/coin/ClpMatrixBase.hpp +524 -0
- data/ext/ruby-cbc/install/include/coin/ClpMessage.hpp +131 -0
- data/ext/ruby-cbc/install/include/coin/ClpModel.hpp +1307 -0
- data/ext/ruby-cbc/install/include/coin/ClpNetworkMatrix.hpp +229 -0
- data/ext/ruby-cbc/install/include/coin/ClpNode.hpp +349 -0
- data/ext/ruby-cbc/install/include/coin/ClpNonLinearCost.hpp +401 -0
- data/ext/ruby-cbc/install/include/coin/ClpObjective.hpp +134 -0
- data/ext/ruby-cbc/install/include/coin/ClpPackedMatrix.hpp +638 -0
- data/ext/ruby-cbc/install/include/coin/ClpParameters.hpp +126 -0
- data/ext/ruby-cbc/install/include/coin/ClpPdcoBase.hpp +103 -0
- data/ext/ruby-cbc/install/include/coin/ClpPlusMinusOneMatrix.hpp +290 -0
- data/ext/ruby-cbc/install/include/coin/ClpPresolve.hpp +299 -0
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnDantzig.hpp +72 -0
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnPivot.hpp +155 -0
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnSteepest.hpp +247 -0
- data/ext/ruby-cbc/install/include/coin/ClpQuadraticObjective.hpp +155 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplex.hpp +1797 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexDual.hpp +300 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexNonlinear.hpp +117 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexOther.hpp +277 -0
- data/ext/ruby-cbc/install/include/coin/ClpSimplexPrimal.hpp +244 -0
- data/ext/ruby-cbc/install/include/coin/ClpSolve.hpp +446 -0
- data/ext/ruby-cbc/install/include/coin/Clp_C_Interface.h +525 -0
- data/ext/ruby-cbc/install/include/coin/CoinAlloc.hpp +176 -0
- data/ext/ruby-cbc/install/include/coin/CoinBuild.hpp +149 -0
- data/ext/ruby-cbc/install/include/coin/CoinDenseFactorization.hpp +419 -0
- data/ext/ruby-cbc/install/include/coin/CoinDenseVector.hpp +383 -0
- data/ext/ruby-cbc/install/include/coin/CoinDistance.hpp +48 -0
- data/ext/ruby-cbc/install/include/coin/CoinError.hpp +257 -0
- data/ext/ruby-cbc/install/include/coin/CoinFactorization.hpp +2044 -0
- data/ext/ruby-cbc/install/include/coin/CoinFileIO.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CoinFinite.hpp +34 -0
- data/ext/ruby-cbc/install/include/coin/CoinFloatEqual.hpp +177 -0
- data/ext/ruby-cbc/install/include/coin/CoinHelperFunctions.hpp +1111 -0
- data/ext/ruby-cbc/install/include/coin/CoinIndexedVector.hpp +1164 -0
- data/ext/ruby-cbc/install/include/coin/CoinLpIO.hpp +805 -0
- data/ext/ruby-cbc/install/include/coin/CoinMessage.hpp +96 -0
- data/ext/ruby-cbc/install/include/coin/CoinMessageHandler.hpp +666 -0
- data/ext/ruby-cbc/install/include/coin/CoinModel.hpp +1054 -0
- data/ext/ruby-cbc/install/include/coin/CoinModelUseful.hpp +441 -0
- data/ext/ruby-cbc/install/include/coin/CoinMpsIO.hpp +1056 -0
- data/ext/ruby-cbc/install/include/coin/CoinOslFactorization.hpp +280 -0
- data/ext/ruby-cbc/install/include/coin/CoinPackedMatrix.hpp +947 -0
- data/ext/ruby-cbc/install/include/coin/CoinPackedVector.hpp +657 -0
- data/ext/ruby-cbc/install/include/coin/CoinPackedVectorBase.hpp +269 -0
- data/ext/ruby-cbc/install/include/coin/CoinParam.hpp +644 -0
- data/ext/ruby-cbc/install/include/coin/CoinPragma.hpp +26 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDoubleton.hpp +73 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDual.hpp +85 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDupcol.hpp +226 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveEmpty.hpp +116 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveFixed.hpp +181 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveForcing.hpp +61 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveImpliedFree.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveIsolated.hpp +51 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveMatrix.hpp +1842 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveMonitor.hpp +105 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolvePsdebug.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveSingleton.hpp +112 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveSubst.hpp +101 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveTighten.hpp +55 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveTripleton.hpp +66 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveUseless.hpp +63 -0
- data/ext/ruby-cbc/install/include/coin/CoinPresolveZeros.hpp +60 -0
- data/ext/ruby-cbc/install/include/coin/CoinRational.hpp +44 -0
- data/ext/ruby-cbc/install/include/coin/CoinSearchTree.hpp +465 -0
- data/ext/ruby-cbc/install/include/coin/CoinShallowPackedVector.hpp +148 -0
- data/ext/ruby-cbc/install/include/coin/CoinSignal.hpp +117 -0
- data/ext/ruby-cbc/install/include/coin/CoinSimpFactorization.hpp +431 -0
- data/ext/ruby-cbc/install/include/coin/CoinSmartPtr.hpp +528 -0
- data/ext/ruby-cbc/install/include/coin/CoinSnapshot.hpp +476 -0
- data/ext/ruby-cbc/install/include/coin/CoinSort.hpp +678 -0
- data/ext/ruby-cbc/install/include/coin/CoinStructuredModel.hpp +247 -0
- data/ext/ruby-cbc/install/include/coin/CoinTime.hpp +310 -0
- data/ext/ruby-cbc/install/include/coin/CoinTypes.hpp +64 -0
- data/ext/ruby-cbc/install/include/coin/CoinUtility.hpp +19 -0
- data/ext/ruby-cbc/install/include/coin/CoinUtilsConfig.h +34 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStart.hpp +58 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartBasis.hpp +456 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartDual.hpp +166 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartPrimalDual.hpp +211 -0
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartVector.hpp +488 -0
- data/ext/ruby-cbc/install/include/coin/Coin_C_defines.h +115 -0
- data/ext/ruby-cbc/install/include/coin/Idiot.hpp +298 -0
- data/ext/ruby-cbc/install/include/coin/OsiAuxInfo.hpp +206 -0
- data/ext/ruby-cbc/install/include/coin/OsiBranchingObject.hpp +1005 -0
- data/ext/ruby-cbc/install/include/coin/OsiCbcSolverInterface.hpp +764 -0
- data/ext/ruby-cbc/install/include/coin/OsiChooseVariable.hpp +534 -0
- data/ext/ruby-cbc/install/include/coin/OsiClpSolverInterface.hpp +1509 -0
- data/ext/ruby-cbc/install/include/coin/OsiColCut.hpp +324 -0
- data/ext/ruby-cbc/install/include/coin/OsiCollections.hpp +35 -0
- data/ext/ruby-cbc/install/include/coin/OsiConfig.h +19 -0
- data/ext/ruby-cbc/install/include/coin/OsiCut.hpp +245 -0
- data/ext/ruby-cbc/install/include/coin/OsiCuts.hpp +474 -0
- data/ext/ruby-cbc/install/include/coin/OsiPresolve.hpp +252 -0
- data/ext/ruby-cbc/install/include/coin/OsiRowCut.hpp +331 -0
- data/ext/ruby-cbc/install/include/coin/OsiRowCutDebugger.hpp +187 -0
- data/ext/ruby-cbc/install/include/coin/OsiSolverBranch.hpp +152 -0
- data/ext/ruby-cbc/install/include/coin/OsiSolverInterface.hpp +2143 -0
- data/ext/ruby-cbc/install/include/coin/OsiSolverParameters.hpp +142 -0
- data/ext/ruby-cbc/install/include/coin/OsiUnitTests.hpp +374 -0
- data/ext/ruby-cbc/install/lib/libCbc.la +35 -0
- data/ext/ruby-cbc/install/lib/libCbc.so +0 -0
- data/ext/ruby-cbc/install/lib/libCbc.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libCbc.so.3.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.la +35 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.so +0 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libCbcSolver.so.3.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libCgl.la +35 -0
- data/ext/ruby-cbc/install/lib/libCgl.so +0 -0
- data/ext/ruby-cbc/install/lib/libCgl.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libCgl.so.1.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libClp.la +35 -0
- data/ext/ruby-cbc/install/lib/libClp.so +0 -0
- data/ext/ruby-cbc/install/lib/libClp.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libClp.so.1.13.9 +0 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.la +35 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.so +0 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libClpSolver.so.1.13.9 +0 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.la +35 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.so +0 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libCoinUtils.so.3.10.11 +0 -0
- data/ext/ruby-cbc/install/lib/libOsi.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsi.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsi.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libOsi.so.1.12.6 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.so.3 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCbc.so.3.9.7 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiClp.so.1.13.9 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.la +35 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.so +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.so.1 +0 -0
- data/ext/ruby-cbc/install/lib/libOsiCommonTests.so.1.12.6 +0 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/cbc.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/cgl.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/clp.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/coindatamiplib3.pc +9 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/coindatasample.pc +9 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/coinutils.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-cbc.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-clp.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-unittests.pc +12 -0
- data/ext/ruby-cbc/install/lib/pkgconfig/osi.pc +12 -0
- data/lib/ruby-cbc/ilp/constant.rb +44 -0
- data/lib/ruby-cbc/ilp/constraint.rb +32 -0
- data/lib/ruby-cbc/ilp/objective.rb +26 -0
- data/lib/ruby-cbc/ilp/term.rb +47 -0
- data/lib/ruby-cbc/ilp/term_array.rb +80 -0
- data/lib/ruby-cbc/ilp/var.rb +62 -0
- data/lib/ruby-cbc/model.rb +125 -0
- data/lib/ruby-cbc/problem.rb +170 -0
- data/lib/ruby-cbc/version.rb +3 -0
- data/lib/ruby-cbc.rb +21 -0
- data/ruby-cbc.gemspec +36 -0
- metadata +431 -0
@@ -0,0 +1,1509 @@
|
|
1
|
+
// $Id$
|
2
|
+
// Copyright (C) 2000, International Business Machines
|
3
|
+
// Corporation and others. All Rights Reserved.
|
4
|
+
// This code is licensed under the terms of the Eclipse Public License (EPL).
|
5
|
+
|
6
|
+
|
7
|
+
#ifndef OsiClpSolverInterface_H
|
8
|
+
#define OsiClpSolverInterface_H
|
9
|
+
|
10
|
+
#include <string>
|
11
|
+
#include <cfloat>
|
12
|
+
#include <map>
|
13
|
+
|
14
|
+
#include "ClpSimplex.hpp"
|
15
|
+
#include "ClpLinearObjective.hpp"
|
16
|
+
#include "CoinPackedMatrix.hpp"
|
17
|
+
#include "OsiSolverInterface.hpp"
|
18
|
+
#include "CoinWarmStartBasis.hpp"
|
19
|
+
#include "ClpEventHandler.hpp"
|
20
|
+
#include "ClpNode.hpp"
|
21
|
+
#include "CoinIndexedVector.hpp"
|
22
|
+
#include "CoinFinite.hpp"
|
23
|
+
|
24
|
+
class OsiRowCut;
|
25
|
+
class OsiClpUserSolver;
|
26
|
+
class OsiClpDisasterHandler;
|
27
|
+
class CoinSet;
|
28
|
+
static const double OsiClpInfinity = COIN_DBL_MAX;
|
29
|
+
|
30
|
+
//#############################################################################
|
31
|
+
|
32
|
+
/** Clp Solver Interface
|
33
|
+
|
34
|
+
Instantiation of OsiClpSolverInterface for the Model Algorithm.
|
35
|
+
|
36
|
+
*/
|
37
|
+
|
38
|
+
class OsiClpSolverInterface :
|
39
|
+
virtual public OsiSolverInterface {
|
40
|
+
friend void OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
|
41
|
+
|
42
|
+
public:
|
43
|
+
//---------------------------------------------------------------------------
|
44
|
+
/**@name Solve methods */
|
45
|
+
//@{
|
46
|
+
/// Solve initial LP relaxation
|
47
|
+
virtual void initialSolve();
|
48
|
+
|
49
|
+
/// Resolve an LP relaxation after problem modification
|
50
|
+
virtual void resolve();
|
51
|
+
|
52
|
+
/// Resolve an LP relaxation after problem modification (try GUB)
|
53
|
+
virtual void resolveGub(int needed);
|
54
|
+
|
55
|
+
/// Invoke solver's built-in enumeration algorithm
|
56
|
+
virtual void branchAndBound();
|
57
|
+
|
58
|
+
/** Solve when primal column and dual row solutions are near-optimal
|
59
|
+
options - 0 no presolve (use primal and dual)
|
60
|
+
1 presolve (just use primal)
|
61
|
+
2 no presolve (just use primal)
|
62
|
+
basis - 0 use all slack basis
|
63
|
+
1 try and put some in basis
|
64
|
+
*/
|
65
|
+
void crossover(int options,int basis);
|
66
|
+
//@}
|
67
|
+
|
68
|
+
/*! @name OsiSimplexInterface methods
|
69
|
+
\brief Methods for the Osi Simplex API.
|
70
|
+
|
71
|
+
The current implementation should work for both minimisation and
|
72
|
+
maximisation in mode 1 (tableau access). In mode 2 (single pivot), only
|
73
|
+
minimisation is supported as of 100907.
|
74
|
+
*/
|
75
|
+
//@{
|
76
|
+
/** \brief Simplex API capability.
|
77
|
+
|
78
|
+
Returns
|
79
|
+
- 0 if no simplex API
|
80
|
+
- 1 if can just do getBInv etc
|
81
|
+
- 2 if has all OsiSimplex methods
|
82
|
+
*/
|
83
|
+
virtual int canDoSimplexInterface() const;
|
84
|
+
|
85
|
+
/*! \brief Enables simplex mode 1 (tableau access)
|
86
|
+
|
87
|
+
Tells solver that calls to getBInv etc are about to take place.
|
88
|
+
Underlying code may need mutable as this may be called from
|
89
|
+
CglCut::generateCuts which is const. If that is too horrific then
|
90
|
+
each solver e.g. BCP or CBC will have to do something outside
|
91
|
+
main loop.
|
92
|
+
*/
|
93
|
+
virtual void enableFactorization() const;
|
94
|
+
|
95
|
+
/*! \brief Undo any setting changes made by #enableFactorization */
|
96
|
+
virtual void disableFactorization() const;
|
97
|
+
|
98
|
+
/** Returns true if a basis is available
|
99
|
+
AND problem is optimal. This should be used to see if
|
100
|
+
the BInvARow type operations are possible and meaningful.
|
101
|
+
*/
|
102
|
+
virtual bool basisIsAvailable() const;
|
103
|
+
|
104
|
+
/** The following two methods may be replaced by the
|
105
|
+
methods of OsiSolverInterface using OsiWarmStartBasis if:
|
106
|
+
1. OsiWarmStartBasis resize operation is implemented
|
107
|
+
more efficiently and
|
108
|
+
2. It is ensured that effects on the solver are the same
|
109
|
+
|
110
|
+
Returns a basis status of the structural/artificial variables
|
111
|
+
At present as warm start i.e 0 free, 1 basic, 2 upper, 3 lower
|
112
|
+
|
113
|
+
NOTE artificials are treated as +1 elements so for <= rhs
|
114
|
+
artificial will be at lower bound if constraint is tight
|
115
|
+
|
116
|
+
This means that Clpsimplex flips artificials as it works
|
117
|
+
in terms of row activities
|
118
|
+
*/
|
119
|
+
virtual void getBasisStatus(int* cstat, int* rstat) const;
|
120
|
+
|
121
|
+
/** Set the status of structural/artificial variables and
|
122
|
+
factorize, update solution etc
|
123
|
+
|
124
|
+
NOTE artificials are treated as +1 elements so for <= rhs
|
125
|
+
artificial will be at lower bound if constraint is tight
|
126
|
+
|
127
|
+
This means that Clpsimplex flips artificials as it works
|
128
|
+
in terms of row activities
|
129
|
+
Returns 0 if OK, 1 if problem is bad e.g. duplicate elements, too large ...
|
130
|
+
*/
|
131
|
+
virtual int setBasisStatus(const int* cstat, const int* rstat);
|
132
|
+
|
133
|
+
///Get the reduced gradient for the cost vector c
|
134
|
+
virtual void getReducedGradient(double* columnReducedCosts,
|
135
|
+
double * duals,
|
136
|
+
const double * c) const ;
|
137
|
+
|
138
|
+
///Get a row of the tableau (slack part in slack if not NULL)
|
139
|
+
virtual void getBInvARow(int row, double* z, double * slack=NULL) const;
|
140
|
+
|
141
|
+
/** Get a row of the tableau (slack part in slack if not NULL)
|
142
|
+
If keepScaled is true then scale factors not applied after so
|
143
|
+
user has to use coding similar to what is in this method
|
144
|
+
*/
|
145
|
+
virtual void getBInvARow(int row, CoinIndexedVector * z, CoinIndexedVector * slack=NULL,
|
146
|
+
bool keepScaled=false) const;
|
147
|
+
|
148
|
+
///Get a row of the basis inverse
|
149
|
+
virtual void getBInvRow(int row, double* z) const;
|
150
|
+
|
151
|
+
///Get a column of the tableau
|
152
|
+
virtual void getBInvACol(int col, double* vec) const ;
|
153
|
+
|
154
|
+
///Get a column of the tableau
|
155
|
+
virtual void getBInvACol(int col, CoinIndexedVector * vec) const ;
|
156
|
+
|
157
|
+
/** Update (i.e. ftran) the vector passed in.
|
158
|
+
Unscaling is applied after - can't be applied before
|
159
|
+
*/
|
160
|
+
|
161
|
+
virtual void getBInvACol(CoinIndexedVector * vec) const ;
|
162
|
+
|
163
|
+
///Get a column of the basis inverse
|
164
|
+
virtual void getBInvCol(int col, double* vec) const ;
|
165
|
+
|
166
|
+
/** Get basic indices (order of indices corresponds to the
|
167
|
+
order of elements in a vector retured by getBInvACol() and
|
168
|
+
getBInvCol()).
|
169
|
+
*/
|
170
|
+
virtual void getBasics(int* index) const;
|
171
|
+
|
172
|
+
/*! \brief Enables simplex mode 2 (individual pivot control)
|
173
|
+
|
174
|
+
This method is supposed to ensure that all typical things (like
|
175
|
+
reduced costs, etc.) are updated when individual pivots are executed
|
176
|
+
and can be queried by other methods.
|
177
|
+
*/
|
178
|
+
virtual void enableSimplexInterface(bool doingPrimal);
|
179
|
+
/// Copy across enabled stuff from one solver to another
|
180
|
+
void copyEnabledSuff(OsiClpSolverInterface & rhs);
|
181
|
+
|
182
|
+
/*! \brief Undo setting changes made by #enableSimplexInterface */
|
183
|
+
virtual void disableSimplexInterface();
|
184
|
+
/// Copy across enabled stuff from one solver to another
|
185
|
+
void copyEnabledStuff(ClpSimplex & rhs);
|
186
|
+
|
187
|
+
/** Perform a pivot by substituting a colIn for colOut in the basis.
|
188
|
+
The status of the leaving variable is given in statOut. Where
|
189
|
+
1 is to upper bound, -1 to lower bound
|
190
|
+
Return code is 0 for okay,
|
191
|
+
1 if inaccuracy forced re-factorization (should be okay) and
|
192
|
+
-1 for singular factorization
|
193
|
+
*/
|
194
|
+
virtual int pivot(int colIn, int colOut, int outStatus);
|
195
|
+
|
196
|
+
/** Obtain a result of the primal pivot
|
197
|
+
Outputs: colOut -- leaving column, outStatus -- its status,
|
198
|
+
t -- step size, and, if dx!=NULL, *dx -- primal ray direction.
|
199
|
+
Inputs: colIn -- entering column, sign -- direction of its change (+/-1).
|
200
|
+
Both for colIn and colOut, artificial variables are index by
|
201
|
+
the negative of the row index minus 1.
|
202
|
+
Return code (for now): 0 -- leaving variable found,
|
203
|
+
-1 -- everything else?
|
204
|
+
Clearly, more informative set of return values is required
|
205
|
+
Primal and dual solutions are updated
|
206
|
+
*/
|
207
|
+
virtual int primalPivotResult(int colIn, int sign,
|
208
|
+
int& colOut, int& outStatus,
|
209
|
+
double& t, CoinPackedVector* dx);
|
210
|
+
|
211
|
+
/** Obtain a result of the dual pivot (similar to the previous method)
|
212
|
+
Differences: entering variable and a sign of its change are now
|
213
|
+
the outputs, the leaving variable and its statuts -- the inputs
|
214
|
+
If dx!=NULL, then *dx contains dual ray
|
215
|
+
Return code: same
|
216
|
+
*/
|
217
|
+
virtual int dualPivotResult(int& colIn, int& sign,
|
218
|
+
int colOut, int outStatus,
|
219
|
+
double& t, CoinPackedVector* dx);
|
220
|
+
|
221
|
+
|
222
|
+
//@}
|
223
|
+
//---------------------------------------------------------------------------
|
224
|
+
/**@name Parameter set/get methods
|
225
|
+
|
226
|
+
The set methods return true if the parameter was set to the given value,
|
227
|
+
false otherwise. There can be various reasons for failure: the given
|
228
|
+
parameter is not applicable for the solver (e.g., refactorization
|
229
|
+
frequency for the clp algorithm), the parameter is not yet implemented
|
230
|
+
for the solver or simply the value of the parameter is out of the range
|
231
|
+
the solver accepts. If a parameter setting call returns false check the
|
232
|
+
details of your solver.
|
233
|
+
|
234
|
+
The get methods return true if the given parameter is applicable for the
|
235
|
+
solver and is implemented. In this case the value of the parameter is
|
236
|
+
returned in the second argument. Otherwise they return false.
|
237
|
+
*/
|
238
|
+
//@{
|
239
|
+
// Set an integer parameter
|
240
|
+
bool setIntParam(OsiIntParam key, int value);
|
241
|
+
// Set an double parameter
|
242
|
+
bool setDblParam(OsiDblParam key, double value);
|
243
|
+
// Set a string parameter
|
244
|
+
bool setStrParam(OsiStrParam key, const std::string & value);
|
245
|
+
// Get an integer parameter
|
246
|
+
bool getIntParam(OsiIntParam key, int& value) const;
|
247
|
+
// Get an double parameter
|
248
|
+
bool getDblParam(OsiDblParam key, double& value) const;
|
249
|
+
// Get a string parameter
|
250
|
+
bool getStrParam(OsiStrParam key, std::string& value) const;
|
251
|
+
// Set a hint parameter - overrides OsiSolverInterface
|
252
|
+
virtual bool setHintParam(OsiHintParam key, bool yesNo=true,
|
253
|
+
OsiHintStrength strength=OsiHintTry,
|
254
|
+
void * otherInformation=NULL);
|
255
|
+
//@}
|
256
|
+
|
257
|
+
//---------------------------------------------------------------------------
|
258
|
+
///@name Methods returning info on how the solution process terminated
|
259
|
+
//@{
|
260
|
+
/// Are there a numerical difficulties?
|
261
|
+
virtual bool isAbandoned() const;
|
262
|
+
/// Is optimality proven?
|
263
|
+
virtual bool isProvenOptimal() const;
|
264
|
+
/// Is primal infeasiblity proven?
|
265
|
+
virtual bool isProvenPrimalInfeasible() const;
|
266
|
+
/// Is dual infeasiblity proven?
|
267
|
+
virtual bool isProvenDualInfeasible() const;
|
268
|
+
/// Is the given primal objective limit reached?
|
269
|
+
virtual bool isPrimalObjectiveLimitReached() const;
|
270
|
+
/// Is the given dual objective limit reached?
|
271
|
+
virtual bool isDualObjectiveLimitReached() const;
|
272
|
+
/// Iteration limit reached?
|
273
|
+
virtual bool isIterationLimitReached() const;
|
274
|
+
//@}
|
275
|
+
|
276
|
+
//---------------------------------------------------------------------------
|
277
|
+
/**@name WarmStart related methods */
|
278
|
+
//@{
|
279
|
+
|
280
|
+
/*! \brief Get an empty warm start object
|
281
|
+
|
282
|
+
This routine returns an empty CoinWarmStartBasis object. Its purpose is
|
283
|
+
to provide a way to give a client a warm start basis object of the
|
284
|
+
appropriate type, which can resized and modified as desired.
|
285
|
+
*/
|
286
|
+
|
287
|
+
virtual CoinWarmStart *getEmptyWarmStart () const;
|
288
|
+
|
289
|
+
/// Get warmstarting information
|
290
|
+
virtual CoinWarmStart* getWarmStart() const;
|
291
|
+
/// Get warmstarting information
|
292
|
+
inline CoinWarmStartBasis* getPointerToWarmStart()
|
293
|
+
{ return &basis_;}
|
294
|
+
/// Get warmstarting information
|
295
|
+
inline const CoinWarmStartBasis* getConstPointerToWarmStart() const
|
296
|
+
{ return &basis_;}
|
297
|
+
/** Set warmstarting information. Return true/false depending on whether
|
298
|
+
the warmstart information was accepted or not. */
|
299
|
+
virtual bool setWarmStart(const CoinWarmStart* warmstart);
|
300
|
+
/** \brief Get warm start information.
|
301
|
+
|
302
|
+
Return warm start information for the current state of the solver
|
303
|
+
interface. If there is no valid warm start information, an empty warm
|
304
|
+
start object wil be returned. This does not necessarily create an
|
305
|
+
object - may just point to one. must Delete set true if user
|
306
|
+
should delete returned object.
|
307
|
+
OsiClp version always returns pointer and false.
|
308
|
+
*/
|
309
|
+
virtual CoinWarmStart* getPointerToWarmStart(bool & mustDelete) ;
|
310
|
+
|
311
|
+
/// Set column status in ClpSimplex and warmStart
|
312
|
+
void setColumnStatus(int iColumn, ClpSimplex::Status status);
|
313
|
+
|
314
|
+
//@}
|
315
|
+
|
316
|
+
//---------------------------------------------------------------------------
|
317
|
+
/**@name Hotstart related methods (primarily used in strong branching).
|
318
|
+
The user can create a hotstart (a snapshot) of the optimization process
|
319
|
+
then reoptimize over and over again always starting from there.<br>
|
320
|
+
<strong>NOTE</strong>: between hotstarted optimizations only
|
321
|
+
bound changes are allowed. */
|
322
|
+
//@{
|
323
|
+
/// Create a hotstart point of the optimization process
|
324
|
+
virtual void markHotStart();
|
325
|
+
/// Optimize starting from the hotstart
|
326
|
+
virtual void solveFromHotStart();
|
327
|
+
/// Delete the snapshot
|
328
|
+
virtual void unmarkHotStart();
|
329
|
+
/** Start faster dual - returns negative if problems 1 if infeasible,
|
330
|
+
Options to pass to solver
|
331
|
+
1 - create external reduced costs for columns
|
332
|
+
2 - create external reduced costs for rows
|
333
|
+
4 - create external row activity (columns always done)
|
334
|
+
Above only done if feasible
|
335
|
+
When set resolve does less work
|
336
|
+
*/
|
337
|
+
int startFastDual(int options);
|
338
|
+
/// Stop fast dual
|
339
|
+
void stopFastDual();
|
340
|
+
/// Sets integer tolerance and increment
|
341
|
+
void setStuff(double tolerance,double increment);
|
342
|
+
/// Return a conflict analysis cut from small model
|
343
|
+
OsiRowCut * smallModelCut(const double * originalLower, const double * originalUpper,
|
344
|
+
int numberRowsAtContinuous,const int * whichGenerator,
|
345
|
+
int typeCut=0);
|
346
|
+
/** Return a conflict analysis cut from model
|
347
|
+
If type is 0 then genuine cut, if 1 then only partially processed
|
348
|
+
*/
|
349
|
+
OsiRowCut * modelCut(const double * originalLower, const double * originalUpper,
|
350
|
+
int numberRowsAtContinuous,const int * whichGenerator,
|
351
|
+
int typeCut=0);
|
352
|
+
//@}
|
353
|
+
|
354
|
+
//---------------------------------------------------------------------------
|
355
|
+
/**@name Problem information methods
|
356
|
+
|
357
|
+
These methods call the solver's query routines to return
|
358
|
+
information about the problem referred to by the current object.
|
359
|
+
Querying a problem that has no data associated with it result in
|
360
|
+
zeros for the number of rows and columns, and NULL pointers from
|
361
|
+
the methods that return vectors.
|
362
|
+
|
363
|
+
Const pointers returned from any data-query method are valid as
|
364
|
+
long as the data is unchanged and the solver is not called.
|
365
|
+
*/
|
366
|
+
//@{
|
367
|
+
/**@name Methods related to querying the input data */
|
368
|
+
//@{
|
369
|
+
/// Get number of columns
|
370
|
+
virtual int getNumCols() const {
|
371
|
+
return modelPtr_->numberColumns(); }
|
372
|
+
|
373
|
+
/// Get number of rows
|
374
|
+
virtual int getNumRows() const {
|
375
|
+
return modelPtr_->numberRows(); }
|
376
|
+
|
377
|
+
/// Get number of nonzero elements
|
378
|
+
virtual int getNumElements() const {
|
379
|
+
int retVal = 0;
|
380
|
+
const CoinPackedMatrix * matrix =modelPtr_->matrix();
|
381
|
+
if ( matrix != NULL ) retVal=matrix->getNumElements();
|
382
|
+
return retVal; }
|
383
|
+
|
384
|
+
/// Return name of row if one exists or Rnnnnnnn
|
385
|
+
/// maxLen is currently ignored and only there to match the signature from the base class!
|
386
|
+
virtual std::string getRowName(int rowIndex,
|
387
|
+
unsigned maxLen = static_cast<unsigned>(std::string::npos)) const;
|
388
|
+
|
389
|
+
/// Return name of column if one exists or Cnnnnnnn
|
390
|
+
/// maxLen is currently ignored and only there to match the signature from the base class!
|
391
|
+
virtual std::string getColName(int colIndex,
|
392
|
+
unsigned maxLen = static_cast<unsigned>(std::string::npos)) const;
|
393
|
+
|
394
|
+
|
395
|
+
/// Get pointer to array[getNumCols()] of column lower bounds
|
396
|
+
virtual const double * getColLower() const { return modelPtr_->columnLower(); }
|
397
|
+
|
398
|
+
/// Get pointer to array[getNumCols()] of column upper bounds
|
399
|
+
virtual const double * getColUpper() const { return modelPtr_->columnUpper(); }
|
400
|
+
|
401
|
+
/** Get pointer to array[getNumRows()] of row constraint senses.
|
402
|
+
<ul>
|
403
|
+
<li>'L' <= constraint
|
404
|
+
<li>'E' = constraint
|
405
|
+
<li>'G' >= constraint
|
406
|
+
<li>'R' ranged constraint
|
407
|
+
<li>'N' free constraint
|
408
|
+
</ul>
|
409
|
+
*/
|
410
|
+
virtual const char * getRowSense() const;
|
411
|
+
|
412
|
+
/** Get pointer to array[getNumRows()] of rows right-hand sides
|
413
|
+
<ul>
|
414
|
+
<li> if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
|
415
|
+
<li> if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
|
416
|
+
<li> if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
|
417
|
+
<li> if rowsense()[i] == 'N' then rhs()[i] == 0.0
|
418
|
+
</ul>
|
419
|
+
*/
|
420
|
+
virtual const double * getRightHandSide() const ;
|
421
|
+
|
422
|
+
/** Get pointer to array[getNumRows()] of row ranges.
|
423
|
+
<ul>
|
424
|
+
<li> if rowsense()[i] == 'R' then
|
425
|
+
rowrange()[i] == rowupper()[i] - rowlower()[i]
|
426
|
+
<li> if rowsense()[i] != 'R' then
|
427
|
+
rowrange()[i] is undefined
|
428
|
+
</ul>
|
429
|
+
*/
|
430
|
+
virtual const double * getRowRange() const ;
|
431
|
+
|
432
|
+
/// Get pointer to array[getNumRows()] of row lower bounds
|
433
|
+
virtual const double * getRowLower() const { return modelPtr_->rowLower(); }
|
434
|
+
|
435
|
+
/// Get pointer to array[getNumRows()] of row upper bounds
|
436
|
+
virtual const double * getRowUpper() const { return modelPtr_->rowUpper(); }
|
437
|
+
|
438
|
+
/// Get pointer to array[getNumCols()] of objective function coefficients
|
439
|
+
virtual const double * getObjCoefficients() const
|
440
|
+
{ if (fakeMinInSimplex_)
|
441
|
+
return linearObjective_ ;
|
442
|
+
else
|
443
|
+
return modelPtr_->objective(); }
|
444
|
+
|
445
|
+
/// Get objective function sense (1 for min (default), -1 for max)
|
446
|
+
virtual double getObjSense() const
|
447
|
+
{ return ((fakeMinInSimplex_)?-modelPtr_->optimizationDirection():
|
448
|
+
modelPtr_->optimizationDirection()); }
|
449
|
+
|
450
|
+
/// Return true if column is continuous
|
451
|
+
virtual bool isContinuous(int colNumber) const;
|
452
|
+
/// Return true if variable is binary
|
453
|
+
virtual bool isBinary(int colIndex) const;
|
454
|
+
|
455
|
+
/** Return true if column is integer.
|
456
|
+
Note: This function returns true if the the column
|
457
|
+
is binary or a general integer.
|
458
|
+
*/
|
459
|
+
virtual bool isInteger(int colIndex) const;
|
460
|
+
|
461
|
+
/// Return true if variable is general integer
|
462
|
+
virtual bool isIntegerNonBinary(int colIndex) const;
|
463
|
+
|
464
|
+
/// Return true if variable is binary and not fixed at either bound
|
465
|
+
virtual bool isFreeBinary(int colIndex) const;
|
466
|
+
/** Return array of column length
|
467
|
+
0 - continuous
|
468
|
+
1 - binary (may get fixed later)
|
469
|
+
2 - general integer (may get fixed later)
|
470
|
+
*/
|
471
|
+
virtual const char * getColType(bool refresh=false) const;
|
472
|
+
|
473
|
+
/** Return true if column is integer but does not have to
|
474
|
+
be declared as such.
|
475
|
+
Note: This function returns true if the the column
|
476
|
+
is binary or a general integer.
|
477
|
+
*/
|
478
|
+
bool isOptionalInteger(int colIndex) const;
|
479
|
+
/** Set the index-th variable to be an optional integer variable */
|
480
|
+
void setOptionalInteger(int index);
|
481
|
+
|
482
|
+
/// Get pointer to row-wise copy of matrix
|
483
|
+
virtual const CoinPackedMatrix * getMatrixByRow() const;
|
484
|
+
|
485
|
+
/// Get pointer to column-wise copy of matrix
|
486
|
+
virtual const CoinPackedMatrix * getMatrixByCol() const;
|
487
|
+
|
488
|
+
/// Get pointer to mutable column-wise copy of matrix
|
489
|
+
virtual CoinPackedMatrix * getMutableMatrixByCol() const;
|
490
|
+
|
491
|
+
/// Get solver's value for infinity
|
492
|
+
virtual double getInfinity() const { return OsiClpInfinity; }
|
493
|
+
//@}
|
494
|
+
|
495
|
+
/**@name Methods related to querying the solution */
|
496
|
+
//@{
|
497
|
+
/// Get pointer to array[getNumCols()] of primal solution vector
|
498
|
+
virtual const double * getColSolution() const;
|
499
|
+
|
500
|
+
/// Get pointer to array[getNumRows()] of dual prices
|
501
|
+
virtual const double * getRowPrice() const;
|
502
|
+
|
503
|
+
/// Get a pointer to array[getNumCols()] of reduced costs
|
504
|
+
virtual const double * getReducedCost() const;
|
505
|
+
|
506
|
+
/** Get pointer to array[getNumRows()] of row activity levels (constraint
|
507
|
+
matrix times the solution vector */
|
508
|
+
virtual const double * getRowActivity() const;
|
509
|
+
|
510
|
+
/// Get objective function value
|
511
|
+
virtual double getObjValue() const;
|
512
|
+
|
513
|
+
/** Get how many iterations it took to solve the problem (whatever
|
514
|
+
"iteration" mean to the solver. */
|
515
|
+
virtual int getIterationCount() const
|
516
|
+
{ return modelPtr_->numberIterations(); }
|
517
|
+
|
518
|
+
/** Get as many dual rays as the solver can provide. (In case of proven
|
519
|
+
primal infeasibility there should be at least one.)
|
520
|
+
|
521
|
+
The first getNumRows() ray components will always be associated with
|
522
|
+
the row duals (as returned by getRowPrice()). If \c fullRay is true,
|
523
|
+
the final getNumCols() entries will correspond to the ray components
|
524
|
+
associated with the nonbasic variables. If the full ray is requested
|
525
|
+
and the method cannot provide it, it will throw an exception.
|
526
|
+
|
527
|
+
<strong>NOTE for implementers of solver interfaces:</strong> <br>
|
528
|
+
The double pointers in the vector should point to arrays of length
|
529
|
+
getNumRows() and they should be allocated via new[]. <br>
|
530
|
+
|
531
|
+
<strong>NOTE for users of solver interfaces:</strong> <br>
|
532
|
+
It is the user's responsibility to free the double pointers in the
|
533
|
+
vector using delete[].
|
534
|
+
*/
|
535
|
+
virtual std::vector<double*> getDualRays(int maxNumRays,
|
536
|
+
bool fullRay = false) const;
|
537
|
+
/** Get as many primal rays as the solver can provide. (In case of proven
|
538
|
+
dual infeasibility there should be at least one.)
|
539
|
+
|
540
|
+
<strong>NOTE for implementers of solver interfaces:</strong> <br>
|
541
|
+
The double pointers in the vector should point to arrays of length
|
542
|
+
getNumCols() and they should be allocated via new[]. <br>
|
543
|
+
|
544
|
+
<strong>NOTE for users of solver interfaces:</strong> <br>
|
545
|
+
It is the user's responsibility to free the double pointers in the
|
546
|
+
vector using delete[].
|
547
|
+
*/
|
548
|
+
virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
|
549
|
+
|
550
|
+
//@}
|
551
|
+
//@}
|
552
|
+
|
553
|
+
//---------------------------------------------------------------------------
|
554
|
+
|
555
|
+
/**@name Problem modifying methods */
|
556
|
+
//@{
|
557
|
+
//-------------------------------------------------------------------------
|
558
|
+
/**@name Changing bounds on variables and constraints */
|
559
|
+
//@{
|
560
|
+
/** Set an objective function coefficient */
|
561
|
+
virtual void setObjCoeff( int elementIndex, double elementValue );
|
562
|
+
|
563
|
+
/** Set a single column lower bound<br>
|
564
|
+
Use -DBL_MAX for -infinity. */
|
565
|
+
virtual void setColLower( int elementIndex, double elementValue );
|
566
|
+
|
567
|
+
/** Set a single column upper bound<br>
|
568
|
+
Use DBL_MAX for infinity. */
|
569
|
+
virtual void setColUpper( int elementIndex, double elementValue );
|
570
|
+
|
571
|
+
/** Set a single column lower and upper bound */
|
572
|
+
virtual void setColBounds( int elementIndex,
|
573
|
+
double lower, double upper );
|
574
|
+
|
575
|
+
/** Set the bounds on a number of columns simultaneously<br>
|
576
|
+
The default implementation just invokes setColLower() and
|
577
|
+
setColUpper() over and over again.
|
578
|
+
@param indexFirst,indexLast pointers to the beginning and after the
|
579
|
+
end of the array of the indices of the variables whose
|
580
|
+
<em>either</em> bound changes
|
581
|
+
@param boundList the new lower/upper bound pairs for the variables
|
582
|
+
*/
|
583
|
+
virtual void setColSetBounds(const int* indexFirst,
|
584
|
+
const int* indexLast,
|
585
|
+
const double* boundList);
|
586
|
+
|
587
|
+
/** Set a single row lower bound<br>
|
588
|
+
Use -DBL_MAX for -infinity. */
|
589
|
+
virtual void setRowLower( int elementIndex, double elementValue );
|
590
|
+
|
591
|
+
/** Set a single row upper bound<br>
|
592
|
+
Use DBL_MAX for infinity. */
|
593
|
+
virtual void setRowUpper( int elementIndex, double elementValue ) ;
|
594
|
+
|
595
|
+
/** Set a single row lower and upper bound */
|
596
|
+
virtual void setRowBounds( int elementIndex,
|
597
|
+
double lower, double upper ) ;
|
598
|
+
|
599
|
+
/** Set the type of a single row<br> */
|
600
|
+
virtual void setRowType(int index, char sense, double rightHandSide,
|
601
|
+
double range);
|
602
|
+
|
603
|
+
/** Set the bounds on a number of rows simultaneously<br>
|
604
|
+
The default implementation just invokes setRowLower() and
|
605
|
+
setRowUpper() over and over again.
|
606
|
+
@param indexFirst,indexLast pointers to the beginning and after the
|
607
|
+
end of the array of the indices of the constraints whose
|
608
|
+
<em>either</em> bound changes
|
609
|
+
@param boundList the new lower/upper bound pairs for the constraints
|
610
|
+
*/
|
611
|
+
virtual void setRowSetBounds(const int* indexFirst,
|
612
|
+
const int* indexLast,
|
613
|
+
const double* boundList);
|
614
|
+
|
615
|
+
/** Set the type of a number of rows simultaneously<br>
|
616
|
+
The default implementation just invokes setRowType()
|
617
|
+
over and over again.
|
618
|
+
@param indexFirst,indexLast pointers to the beginning and after the
|
619
|
+
end of the array of the indices of the constraints whose
|
620
|
+
<em>any</em> characteristics changes
|
621
|
+
@param senseList the new senses
|
622
|
+
@param rhsList the new right hand sides
|
623
|
+
@param rangeList the new ranges
|
624
|
+
*/
|
625
|
+
virtual void setRowSetTypes(const int* indexFirst,
|
626
|
+
const int* indexLast,
|
627
|
+
const char* senseList,
|
628
|
+
const double* rhsList,
|
629
|
+
const double* rangeList);
|
630
|
+
/** Set the objective coefficients for all columns
|
631
|
+
array [getNumCols()] is an array of values for the objective.
|
632
|
+
This defaults to a series of set operations and is here for speed.
|
633
|
+
*/
|
634
|
+
virtual void setObjective(const double * array);
|
635
|
+
|
636
|
+
/** Set the lower bounds for all columns
|
637
|
+
array [getNumCols()] is an array of values for the objective.
|
638
|
+
This defaults to a series of set operations and is here for speed.
|
639
|
+
*/
|
640
|
+
virtual void setColLower(const double * array);
|
641
|
+
|
642
|
+
/** Set the upper bounds for all columns
|
643
|
+
array [getNumCols()] is an array of values for the objective.
|
644
|
+
This defaults to a series of set operations and is here for speed.
|
645
|
+
*/
|
646
|
+
virtual void setColUpper(const double * array);
|
647
|
+
|
648
|
+
// using OsiSolverInterface::setRowName ;
|
649
|
+
/// Set name of row
|
650
|
+
// virtual void setRowName(int rowIndex, std::string & name) ;
|
651
|
+
virtual void setRowName(int rowIndex, std::string name) ;
|
652
|
+
|
653
|
+
// using OsiSolverInterface::setColName ;
|
654
|
+
/// Set name of column
|
655
|
+
// virtual void setColName(int colIndex, std::string & name) ;
|
656
|
+
virtual void setColName(int colIndex, std::string name) ;
|
657
|
+
|
658
|
+
//@}
|
659
|
+
|
660
|
+
//-------------------------------------------------------------------------
|
661
|
+
/**@name Integrality related changing methods */
|
662
|
+
//@{
|
663
|
+
/** Set the index-th variable to be a continuous variable */
|
664
|
+
virtual void setContinuous(int index);
|
665
|
+
/** Set the index-th variable to be an integer variable */
|
666
|
+
virtual void setInteger(int index);
|
667
|
+
/** Set the variables listed in indices (which is of length len) to be
|
668
|
+
continuous variables */
|
669
|
+
virtual void setContinuous(const int* indices, int len);
|
670
|
+
/** Set the variables listed in indices (which is of length len) to be
|
671
|
+
integer variables */
|
672
|
+
virtual void setInteger(const int* indices, int len);
|
673
|
+
/// Number of SOS sets
|
674
|
+
inline int numberSOS() const
|
675
|
+
{ return numberSOS_;}
|
676
|
+
/// SOS set info
|
677
|
+
inline const CoinSet * setInfo() const
|
678
|
+
{ return setInfo_;}
|
679
|
+
/** \brief Identify integer variables and SOS and create corresponding objects.
|
680
|
+
|
681
|
+
Record integer variables and create an OsiSimpleInteger object for each
|
682
|
+
one. All existing OsiSimpleInteger objects will be destroyed.
|
683
|
+
If the solver supports SOS then do the same for SOS.
|
684
|
+
If justCount then no objects created and we just store numberIntegers_
|
685
|
+
Returns number of SOS
|
686
|
+
*/
|
687
|
+
|
688
|
+
virtual int findIntegersAndSOS(bool justCount);
|
689
|
+
//@}
|
690
|
+
|
691
|
+
//-------------------------------------------------------------------------
|
692
|
+
/// Set objective function sense (1 for min (default), -1 for max,)
|
693
|
+
virtual void setObjSense(double s )
|
694
|
+
{ modelPtr_->setOptimizationDirection( s < 0 ? -1 : 1); }
|
695
|
+
|
696
|
+
/** Set the primal solution column values
|
697
|
+
|
698
|
+
colsol[numcols()] is an array of values of the problem column
|
699
|
+
variables. These values are copied to memory owned by the
|
700
|
+
solver object or the solver. They will be returned as the
|
701
|
+
result of colsol() until changed by another call to
|
702
|
+
setColsol() or by a call to any solver routine. Whether the
|
703
|
+
solver makes use of the solution in any way is
|
704
|
+
solver-dependent.
|
705
|
+
*/
|
706
|
+
virtual void setColSolution(const double * colsol);
|
707
|
+
|
708
|
+
/** Set dual solution vector
|
709
|
+
|
710
|
+
rowprice[numrows()] is an array of values of the problem row
|
711
|
+
dual variables. These values are copied to memory owned by the
|
712
|
+
solver object or the solver. They will be returned as the
|
713
|
+
result of rowprice() until changed by another call to
|
714
|
+
setRowprice() or by a call to any solver routine. Whether the
|
715
|
+
solver makes use of the solution in any way is
|
716
|
+
solver-dependent.
|
717
|
+
*/
|
718
|
+
virtual void setRowPrice(const double * rowprice);
|
719
|
+
|
720
|
+
//-------------------------------------------------------------------------
|
721
|
+
/**@name Methods to expand a problem.<br>
|
722
|
+
Note that if a column is added then by default it will correspond to a
|
723
|
+
continuous variable. */
|
724
|
+
//@{
|
725
|
+
|
726
|
+
//using OsiSolverInterface::addCol ;
|
727
|
+
/** */
|
728
|
+
virtual void addCol(const CoinPackedVectorBase& vec,
|
729
|
+
const double collb, const double colub,
|
730
|
+
const double obj);
|
731
|
+
/*! \brief Add a named column (primal variable) to the problem.
|
732
|
+
*/
|
733
|
+
virtual void addCol(const CoinPackedVectorBase& vec,
|
734
|
+
const double collb, const double colub,
|
735
|
+
const double obj, std::string name) ;
|
736
|
+
/** Add a column (primal variable) to the problem. */
|
737
|
+
virtual void addCol(int numberElements, const int * rows, const double * elements,
|
738
|
+
const double collb, const double colub,
|
739
|
+
const double obj) ;
|
740
|
+
/*! \brief Add a named column (primal variable) to the problem.
|
741
|
+
*/
|
742
|
+
virtual void addCol(int numberElements,
|
743
|
+
const int* rows, const double* elements,
|
744
|
+
const double collb, const double colub,
|
745
|
+
const double obj, std::string name) ;
|
746
|
+
/** */
|
747
|
+
virtual void addCols(const int numcols,
|
748
|
+
const CoinPackedVectorBase * const * cols,
|
749
|
+
const double* collb, const double* colub,
|
750
|
+
const double* obj);
|
751
|
+
/** */
|
752
|
+
virtual void addCols(const int numcols,
|
753
|
+
const int * columnStarts, const int * rows, const double * elements,
|
754
|
+
const double* collb, const double* colub,
|
755
|
+
const double* obj);
|
756
|
+
/** */
|
757
|
+
virtual void deleteCols(const int num, const int * colIndices);
|
758
|
+
|
759
|
+
/** */
|
760
|
+
virtual void addRow(const CoinPackedVectorBase& vec,
|
761
|
+
const double rowlb, const double rowub);
|
762
|
+
/** */
|
763
|
+
/*! \brief Add a named row (constraint) to the problem.
|
764
|
+
|
765
|
+
The default implementation adds the row, then changes the name. This
|
766
|
+
can surely be made more efficient within an OsiXXX class.
|
767
|
+
*/
|
768
|
+
virtual void addRow(const CoinPackedVectorBase& vec,
|
769
|
+
const double rowlb, const double rowub,
|
770
|
+
std::string name) ;
|
771
|
+
virtual void addRow(const CoinPackedVectorBase& vec,
|
772
|
+
const char rowsen, const double rowrhs,
|
773
|
+
const double rowrng);
|
774
|
+
/** Add a row (constraint) to the problem. */
|
775
|
+
virtual void addRow(int numberElements, const int * columns, const double * element,
|
776
|
+
const double rowlb, const double rowub) ;
|
777
|
+
/*! \brief Add a named row (constraint) to the problem.
|
778
|
+
*/
|
779
|
+
virtual void addRow(const CoinPackedVectorBase& vec,
|
780
|
+
const char rowsen, const double rowrhs,
|
781
|
+
const double rowrng, std::string name) ;
|
782
|
+
/** */
|
783
|
+
virtual void addRows(const int numrows,
|
784
|
+
const CoinPackedVectorBase * const * rows,
|
785
|
+
const double* rowlb, const double* rowub);
|
786
|
+
/** */
|
787
|
+
virtual void addRows(const int numrows,
|
788
|
+
const CoinPackedVectorBase * const * rows,
|
789
|
+
const char* rowsen, const double* rowrhs,
|
790
|
+
const double* rowrng);
|
791
|
+
|
792
|
+
/** */
|
793
|
+
virtual void addRows(const int numrows,
|
794
|
+
const int * rowStarts, const int * columns, const double * element,
|
795
|
+
const double* rowlb, const double* rowub);
|
796
|
+
///
|
797
|
+
void modifyCoefficient(int row, int column, double newElement,
|
798
|
+
bool keepZero=false)
|
799
|
+
{modelPtr_->modifyCoefficient(row,column,newElement, keepZero);}
|
800
|
+
|
801
|
+
/** */
|
802
|
+
virtual void deleteRows(const int num, const int * rowIndices);
|
803
|
+
/** If solver wants it can save a copy of "base" (continuous) model here
|
804
|
+
*/
|
805
|
+
virtual void saveBaseModel() ;
|
806
|
+
/** Strip off rows to get to this number of rows.
|
807
|
+
If solver wants it can restore a copy of "base" (continuous) model here
|
808
|
+
*/
|
809
|
+
virtual void restoreBaseModel(int numberRows);
|
810
|
+
|
811
|
+
//-----------------------------------------------------------------------
|
812
|
+
/** Apply a collection of row cuts which are all effective.
|
813
|
+
applyCuts seems to do one at a time which seems inefficient.
|
814
|
+
*/
|
815
|
+
virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts);
|
816
|
+
/** Apply a collection of row cuts which are all effective.
|
817
|
+
applyCuts seems to do one at a time which seems inefficient.
|
818
|
+
This uses array of pointers
|
819
|
+
*/
|
820
|
+
virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts);
|
821
|
+
/** Apply a collection of cuts.
|
822
|
+
|
823
|
+
Only cuts which have an <code>effectiveness >= effectivenessLb</code>
|
824
|
+
are applied.
|
825
|
+
<ul>
|
826
|
+
<li> ReturnCode.getNumineffective() -- number of cuts which were
|
827
|
+
not applied because they had an
|
828
|
+
<code>effectiveness < effectivenessLb</code>
|
829
|
+
<li> ReturnCode.getNuminconsistent() -- number of invalid cuts
|
830
|
+
<li> ReturnCode.getNuminconsistentWrtIntegerModel() -- number of
|
831
|
+
cuts that are invalid with respect to this integer model
|
832
|
+
<li> ReturnCode.getNuminfeasible() -- number of cuts that would
|
833
|
+
make this integer model infeasible
|
834
|
+
<li> ReturnCode.getNumApplied() -- number of integer cuts which
|
835
|
+
were applied to the integer model
|
836
|
+
<li> cs.size() == getNumineffective() +
|
837
|
+
getNuminconsistent() +
|
838
|
+
getNuminconsistentWrtIntegerModel() +
|
839
|
+
getNuminfeasible() +
|
840
|
+
getNumApplied()
|
841
|
+
</ul>
|
842
|
+
*/
|
843
|
+
virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
|
844
|
+
double effectivenessLb = 0.0);
|
845
|
+
|
846
|
+
//@}
|
847
|
+
//@}
|
848
|
+
|
849
|
+
//---------------------------------------------------------------------------
|
850
|
+
|
851
|
+
public:
|
852
|
+
|
853
|
+
/**@name Methods to input a problem */
|
854
|
+
//@{
|
855
|
+
/** Load in an problem by copying the arguments (the constraints on the
|
856
|
+
rows are given by lower and upper bounds). If a pointer is NULL then the
|
857
|
+
following values are the default:
|
858
|
+
<ul>
|
859
|
+
<li> <code>colub</code>: all columns have upper bound infinity
|
860
|
+
<li> <code>collb</code>: all columns have lower bound 0
|
861
|
+
<li> <code>rowub</code>: all rows have upper bound infinity
|
862
|
+
<li> <code>rowlb</code>: all rows have lower bound -infinity
|
863
|
+
<li> <code>obj</code>: all variables have 0 objective coefficient
|
864
|
+
</ul>
|
865
|
+
*/
|
866
|
+
virtual void loadProblem(const CoinPackedMatrix& matrix,
|
867
|
+
const double* collb, const double* colub,
|
868
|
+
const double* obj,
|
869
|
+
const double* rowlb, const double* rowub);
|
870
|
+
|
871
|
+
/** Load in an problem by assuming ownership of the arguments (the
|
872
|
+
constraints on the rows are given by lower and upper bounds). For
|
873
|
+
default values see the previous method. <br>
|
874
|
+
<strong>WARNING</strong>: The arguments passed to this method will be
|
875
|
+
freed using the C++ <code>delete</code> and <code>delete[]</code>
|
876
|
+
functions.
|
877
|
+
*/
|
878
|
+
virtual void assignProblem(CoinPackedMatrix*& matrix,
|
879
|
+
double*& collb, double*& colub, double*& obj,
|
880
|
+
double*& rowlb, double*& rowub);
|
881
|
+
|
882
|
+
/** Load in an problem by copying the arguments (the constraints on the
|
883
|
+
rows are given by sense/rhs/range triplets). If a pointer is NULL then the
|
884
|
+
following values are the default:
|
885
|
+
<ul>
|
886
|
+
<li> <code>colub</code>: all columns have upper bound infinity
|
887
|
+
<li> <code>collb</code>: all columns have lower bound 0
|
888
|
+
<li> <code>obj</code>: all variables have 0 objective coefficient
|
889
|
+
<li> <code>rowsen</code>: all rows are >=
|
890
|
+
<li> <code>rowrhs</code>: all right hand sides are 0
|
891
|
+
<li> <code>rowrng</code>: 0 for the ranged rows
|
892
|
+
</ul>
|
893
|
+
*/
|
894
|
+
virtual void loadProblem(const CoinPackedMatrix& matrix,
|
895
|
+
const double* collb, const double* colub,
|
896
|
+
const double* obj,
|
897
|
+
const char* rowsen, const double* rowrhs,
|
898
|
+
const double* rowrng);
|
899
|
+
|
900
|
+
/** Load in an problem by assuming ownership of the arguments (the
|
901
|
+
constraints on the rows are given by sense/rhs/range triplets). For
|
902
|
+
default values see the previous method. <br>
|
903
|
+
<strong>WARNING</strong>: The arguments passed to this method will be
|
904
|
+
freed using the C++ <code>delete</code> and <code>delete[]</code>
|
905
|
+
functions.
|
906
|
+
*/
|
907
|
+
virtual void assignProblem(CoinPackedMatrix*& matrix,
|
908
|
+
double*& collb, double*& colub, double*& obj,
|
909
|
+
char*& rowsen, double*& rowrhs,
|
910
|
+
double*& rowrng);
|
911
|
+
|
912
|
+
/** Just like the other loadProblem() methods except that the matrix is
|
913
|
+
given as a ClpMatrixBase. */
|
914
|
+
virtual void loadProblem(const ClpMatrixBase& matrix,
|
915
|
+
const double* collb, const double* colub,
|
916
|
+
const double* obj,
|
917
|
+
const double* rowlb, const double* rowub) ;
|
918
|
+
|
919
|
+
/** Just like the other loadProblem() methods except that the matrix is
|
920
|
+
given in a standard column major ordered format (without gaps). */
|
921
|
+
virtual void loadProblem(const int numcols, const int numrows,
|
922
|
+
const CoinBigIndex * start, const int* index,
|
923
|
+
const double* value,
|
924
|
+
const double* collb, const double* colub,
|
925
|
+
const double* obj,
|
926
|
+
const double* rowlb, const double* rowub);
|
927
|
+
|
928
|
+
/** Just like the other loadProblem() methods except that the matrix is
|
929
|
+
given in a standard column major ordered format (without gaps). */
|
930
|
+
virtual void loadProblem(const int numcols, const int numrows,
|
931
|
+
const CoinBigIndex * start, const int* index,
|
932
|
+
const double* value,
|
933
|
+
const double* collb, const double* colub,
|
934
|
+
const double* obj,
|
935
|
+
const char* rowsen, const double* rowrhs,
|
936
|
+
const double* rowrng);
|
937
|
+
/// This loads a model from a coinModel object - returns number of errors
|
938
|
+
virtual int loadFromCoinModel ( CoinModel & modelObject, bool keepSolution=false);
|
939
|
+
|
940
|
+
using OsiSolverInterface::readMps ;
|
941
|
+
/** Read an mps file from the given filename (defaults to Osi reader) - returns
|
942
|
+
number of errors (see OsiMpsReader class) */
|
943
|
+
virtual int readMps(const char *filename,
|
944
|
+
const char *extension = "mps") ;
|
945
|
+
/** Read an mps file from the given filename returns
|
946
|
+
number of errors (see OsiMpsReader class) */
|
947
|
+
int readMps(const char *filename,bool keepNames,bool allowErrors);
|
948
|
+
/// Read an mps file
|
949
|
+
virtual int readMps (const char *filename, const char*extension,
|
950
|
+
int & numberSets, CoinSet ** & sets);
|
951
|
+
|
952
|
+
/** Write the problem into an mps file of the given filename.
|
953
|
+
If objSense is non zero then -1.0 forces the code to write a
|
954
|
+
maximization objective and +1.0 to write a minimization one.
|
955
|
+
If 0.0 then solver can do what it wants */
|
956
|
+
virtual void writeMps(const char *filename,
|
957
|
+
const char *extension = "mps",
|
958
|
+
double objSense=0.0) const;
|
959
|
+
/** Write the problem into an mps file of the given filename,
|
960
|
+
names may be null. formatType is
|
961
|
+
0 - normal
|
962
|
+
1 - extra accuracy
|
963
|
+
2 - IEEE hex (later)
|
964
|
+
|
965
|
+
Returns non-zero on I/O error
|
966
|
+
*/
|
967
|
+
virtual int writeMpsNative(const char *filename,
|
968
|
+
const char ** rowNames, const char ** columnNames,
|
969
|
+
int formatType=0,int numberAcross=2,
|
970
|
+
double objSense=0.0) const ;
|
971
|
+
/// Read file in LP format (with names)
|
972
|
+
virtual int readLp(const char *filename, const double epsilon = 1e-5);
|
973
|
+
/** Write the problem into an Lp file of the given filename.
|
974
|
+
If objSense is non zero then -1.0 forces the code to write a
|
975
|
+
maximization objective and +1.0 to write a minimization one.
|
976
|
+
If 0.0 then solver can do what it wants.
|
977
|
+
This version calls writeLpNative with names */
|
978
|
+
virtual void writeLp(const char *filename,
|
979
|
+
const char *extension = "lp",
|
980
|
+
double epsilon = 1e-5,
|
981
|
+
int numberAcross = 10,
|
982
|
+
int decimals = 5,
|
983
|
+
double objSense = 0.0,
|
984
|
+
bool useRowNames = true) const;
|
985
|
+
/** Write the problem into the file pointed to by the parameter fp.
|
986
|
+
Other parameters are similar to
|
987
|
+
those of writeLp() with first parameter filename.
|
988
|
+
*/
|
989
|
+
virtual void writeLp(FILE *fp,
|
990
|
+
double epsilon = 1e-5,
|
991
|
+
int numberAcross = 10,
|
992
|
+
int decimals = 5,
|
993
|
+
double objSense = 0.0,
|
994
|
+
bool useRowNames = true) const;
|
995
|
+
/**
|
996
|
+
I (JJF) am getting annoyed because I can't just replace a matrix.
|
997
|
+
The default behavior of this is do nothing so only use where that would not matter
|
998
|
+
e.g. strengthening a matrix for MIP
|
999
|
+
*/
|
1000
|
+
virtual void replaceMatrixOptional(const CoinPackedMatrix & matrix);
|
1001
|
+
/// And if it does matter (not used at present)
|
1002
|
+
virtual void replaceMatrix(const CoinPackedMatrix & matrix) ;
|
1003
|
+
//@}
|
1004
|
+
|
1005
|
+
/**@name Message handling (extra for Clp messages).
|
1006
|
+
Normally I presume you would want the same language.
|
1007
|
+
If not then you could use underlying model pointer */
|
1008
|
+
//@{
|
1009
|
+
/** Pass in a message handler
|
1010
|
+
|
1011
|
+
It is the client's responsibility to destroy a message handler installed
|
1012
|
+
by this routine; it will not be destroyed when the solver interface is
|
1013
|
+
destroyed.
|
1014
|
+
*/
|
1015
|
+
virtual void passInMessageHandler(CoinMessageHandler * handler);
|
1016
|
+
/// Set language
|
1017
|
+
void newLanguage(CoinMessages::Language language);
|
1018
|
+
void setLanguage(CoinMessages::Language language)
|
1019
|
+
{newLanguage(language);}
|
1020
|
+
/// Set log level (will also set underlying solver's log level)
|
1021
|
+
void setLogLevel(int value);
|
1022
|
+
/// Create C++ lines to get to current state
|
1023
|
+
void generateCpp( FILE * fp);
|
1024
|
+
//@}
|
1025
|
+
//---------------------------------------------------------------------------
|
1026
|
+
|
1027
|
+
/**@name Clp specific public interfaces */
|
1028
|
+
//@{
|
1029
|
+
/// Get pointer to Clp model
|
1030
|
+
ClpSimplex * getModelPtr() const ;
|
1031
|
+
/// Set pointer to Clp model and return old
|
1032
|
+
inline ClpSimplex * swapModelPtr(ClpSimplex * newModel)
|
1033
|
+
{ ClpSimplex * model = modelPtr_; modelPtr_=newModel;return model;}
|
1034
|
+
/// Get special options
|
1035
|
+
inline unsigned int specialOptions() const
|
1036
|
+
{ return specialOptions_;}
|
1037
|
+
void setSpecialOptions(unsigned int value);
|
1038
|
+
/// Last algorithm used , 1 = primal, 2 = dual other unknown
|
1039
|
+
inline int lastAlgorithm() const
|
1040
|
+
{ return lastAlgorithm_;}
|
1041
|
+
/// Set last algorithm used , 1 = primal, 2 = dual other unknown
|
1042
|
+
inline void setLastAlgorithm(int value)
|
1043
|
+
{ lastAlgorithm_ = value;}
|
1044
|
+
/// Get scaling action option
|
1045
|
+
inline int cleanupScaling() const
|
1046
|
+
{ return cleanupScaling_;}
|
1047
|
+
/** Set Scaling option
|
1048
|
+
When scaling is on it is possible that the scaled problem
|
1049
|
+
is feasible but the unscaled is not. Clp returns a secondary
|
1050
|
+
status code to that effect. This option allows for a cleanup.
|
1051
|
+
If you use it I would suggest 1.
|
1052
|
+
This only affects actions when scaled optimal
|
1053
|
+
0 - no action
|
1054
|
+
1 - clean up using dual if primal infeasibility
|
1055
|
+
2 - clean up using dual if dual infeasibility
|
1056
|
+
3 - clean up using dual if primal or dual infeasibility
|
1057
|
+
11,12,13 - as 1,2,3 but use primal
|
1058
|
+
*/
|
1059
|
+
inline void setCleanupScaling(int value)
|
1060
|
+
{ cleanupScaling_=value;}
|
1061
|
+
/** Get smallest allowed element in cut.
|
1062
|
+
If smaller than this then ignored */
|
1063
|
+
inline double smallestElementInCut() const
|
1064
|
+
{ return smallestElementInCut_;}
|
1065
|
+
/** Set smallest allowed element in cut.
|
1066
|
+
If smaller than this then ignored */
|
1067
|
+
inline void setSmallestElementInCut(double value)
|
1068
|
+
{ smallestElementInCut_=value;}
|
1069
|
+
/** Get smallest change in cut.
|
1070
|
+
If (upper-lower)*element < this then element is
|
1071
|
+
taken out and cut relaxed.
|
1072
|
+
(upper-lower) is taken to be at least 1.0 and
|
1073
|
+
this is assumed >= smallestElementInCut_
|
1074
|
+
*/
|
1075
|
+
inline double smallestChangeInCut() const
|
1076
|
+
{ return smallestChangeInCut_;}
|
1077
|
+
/** Set smallest change in cut.
|
1078
|
+
If (upper-lower)*element < this then element is
|
1079
|
+
taken out and cut relaxed.
|
1080
|
+
(upper-lower) is taken to be at least 1.0 and
|
1081
|
+
this is assumed >= smallestElementInCut_
|
1082
|
+
*/
|
1083
|
+
inline void setSmallestChangeInCut(double value)
|
1084
|
+
{ smallestChangeInCut_=value;}
|
1085
|
+
/// Pass in initial solve options
|
1086
|
+
inline void setSolveOptions(const ClpSolve & options)
|
1087
|
+
{ solveOptions_ = options;}
|
1088
|
+
/** Tighten bounds - lightweight or very lightweight
|
1089
|
+
0 - normal, 1 lightweight but just integers, 2 lightweight and all
|
1090
|
+
*/
|
1091
|
+
virtual int tightenBounds(int lightweight=0);
|
1092
|
+
/// See if any integer variables make infeasible other way
|
1093
|
+
int infeasibleOtherWay(char * whichWay);
|
1094
|
+
/// Return number of entries in L part of current factorization
|
1095
|
+
virtual CoinBigIndex getSizeL() const;
|
1096
|
+
/// Return number of entries in U part of current factorization
|
1097
|
+
virtual CoinBigIndex getSizeU() const;
|
1098
|
+
/// Get disaster handler
|
1099
|
+
const OsiClpDisasterHandler * disasterHandler() const
|
1100
|
+
{ return disasterHandler_;}
|
1101
|
+
/// Pass in disaster handler
|
1102
|
+
void passInDisasterHandler(OsiClpDisasterHandler * handler);
|
1103
|
+
/// Get fake objective
|
1104
|
+
ClpLinearObjective * fakeObjective() const
|
1105
|
+
{ return fakeObjective_;}
|
1106
|
+
/// Set fake objective (and take ownership)
|
1107
|
+
void setFakeObjective(ClpLinearObjective * fakeObjective);
|
1108
|
+
/// Set fake objective
|
1109
|
+
void setFakeObjective(double * fakeObjective);
|
1110
|
+
/*! \brief Set up solver for repeated use by Osi interface.
|
1111
|
+
|
1112
|
+
The normal usage does things like keeping factorization around so can be
|
1113
|
+
used. Will also do things like keep scaling and row copy of matrix if
|
1114
|
+
matrix does not change.
|
1115
|
+
|
1116
|
+
\p senseOfAdventure:
|
1117
|
+
- 0 - safe stuff as above
|
1118
|
+
- 1 - will take more risks - if it does not work then bug which will be
|
1119
|
+
fixed
|
1120
|
+
- 2 - don't bother doing most extreme termination checks e.g. don't bother
|
1121
|
+
re-factorizing if less than 20 iterations.
|
1122
|
+
- 3 - Actually safer than 1 (mainly just keeps factorization)
|
1123
|
+
|
1124
|
+
\p printOut
|
1125
|
+
- -1 always skip round common messages instead of doing some work
|
1126
|
+
- 0 skip if normal defaults
|
1127
|
+
- 1 leaves
|
1128
|
+
*/
|
1129
|
+
void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0);
|
1130
|
+
/// Synchronize model (really if no cuts in tree)
|
1131
|
+
virtual void synchronizeModel();
|
1132
|
+
/*! \brief Set special options in underlying clp solver.
|
1133
|
+
|
1134
|
+
Safe as const because #modelPtr_ is mutable.
|
1135
|
+
*/
|
1136
|
+
void setSpecialOptionsMutable(unsigned int value) const;
|
1137
|
+
|
1138
|
+
//@}
|
1139
|
+
|
1140
|
+
//---------------------------------------------------------------------------
|
1141
|
+
|
1142
|
+
/**@name Constructors and destructors */
|
1143
|
+
//@{
|
1144
|
+
/// Default Constructor
|
1145
|
+
OsiClpSolverInterface ();
|
1146
|
+
|
1147
|
+
/// Clone
|
1148
|
+
virtual OsiSolverInterface * clone(bool copyData = true) const;
|
1149
|
+
|
1150
|
+
/// Copy constructor
|
1151
|
+
OsiClpSolverInterface (const OsiClpSolverInterface &);
|
1152
|
+
|
1153
|
+
/// Borrow constructor - only delete one copy
|
1154
|
+
OsiClpSolverInterface (ClpSimplex * rhs, bool reallyOwn=false);
|
1155
|
+
|
1156
|
+
/// Releases so won't error
|
1157
|
+
void releaseClp();
|
1158
|
+
|
1159
|
+
/// Assignment operator
|
1160
|
+
OsiClpSolverInterface & operator=(const OsiClpSolverInterface& rhs);
|
1161
|
+
|
1162
|
+
/// Destructor
|
1163
|
+
virtual ~OsiClpSolverInterface ();
|
1164
|
+
|
1165
|
+
/// Resets as if default constructor
|
1166
|
+
virtual void reset();
|
1167
|
+
//@}
|
1168
|
+
|
1169
|
+
//---------------------------------------------------------------------------
|
1170
|
+
|
1171
|
+
protected:
|
1172
|
+
///@name Protected methods
|
1173
|
+
//@{
|
1174
|
+
/** Apply a row cut (append to constraint matrix). */
|
1175
|
+
virtual void applyRowCut(const OsiRowCut& rc);
|
1176
|
+
|
1177
|
+
/** Apply a column cut (adjust one or more bounds). */
|
1178
|
+
virtual void applyColCut(const OsiColCut& cc);
|
1179
|
+
//@}
|
1180
|
+
|
1181
|
+
//---------------------------------------------------------------------------
|
1182
|
+
|
1183
|
+
protected:
|
1184
|
+
/**@name Protected methods */
|
1185
|
+
//@{
|
1186
|
+
/// The real work of a copy constructor (used by copy and assignment)
|
1187
|
+
void gutsOfDestructor();
|
1188
|
+
|
1189
|
+
/// Deletes all mutable stuff
|
1190
|
+
void freeCachedResults() const;
|
1191
|
+
|
1192
|
+
/// Deletes all mutable stuff for row ranges etc
|
1193
|
+
void freeCachedResults0() const;
|
1194
|
+
|
1195
|
+
/// Deletes all mutable stuff for matrix etc
|
1196
|
+
void freeCachedResults1() const;
|
1197
|
+
|
1198
|
+
/// A method that fills up the rowsense_, rhs_ and rowrange_ arrays
|
1199
|
+
void extractSenseRhsRange() const;
|
1200
|
+
|
1201
|
+
///
|
1202
|
+
void fillParamMaps();
|
1203
|
+
/** Warm start
|
1204
|
+
|
1205
|
+
NOTE artificials are treated as +1 elements so for <= rhs
|
1206
|
+
artificial will be at lower bound if constraint is tight
|
1207
|
+
|
1208
|
+
This means that Clpsimplex flips artificials as it works
|
1209
|
+
in terms of row activities
|
1210
|
+
*/
|
1211
|
+
CoinWarmStartBasis getBasis(ClpSimplex * model) const;
|
1212
|
+
/** Sets up working basis as a copy of input
|
1213
|
+
|
1214
|
+
NOTE artificials are treated as +1 elements so for <= rhs
|
1215
|
+
artificial will be at lower bound if constraint is tight
|
1216
|
+
|
1217
|
+
This means that Clpsimplex flips artificials as it works
|
1218
|
+
in terms of row activities
|
1219
|
+
*/
|
1220
|
+
void setBasis( const CoinWarmStartBasis & basis, ClpSimplex * model);
|
1221
|
+
/// Crunch down problem a bit
|
1222
|
+
void crunch();
|
1223
|
+
/// Extend scale factors
|
1224
|
+
void redoScaleFactors(int numberRows,const CoinBigIndex * starts,
|
1225
|
+
const int * indices, const double * elements);
|
1226
|
+
public:
|
1227
|
+
/** Sets up working basis as a copy of input and puts in as basis
|
1228
|
+
*/
|
1229
|
+
void setBasis( const CoinWarmStartBasis & basis);
|
1230
|
+
/// Just puts current basis_ into ClpSimplex model
|
1231
|
+
inline void setBasis( )
|
1232
|
+
{ setBasis(basis_,modelPtr_);}
|
1233
|
+
/// Warm start difference from basis_ to statusArray
|
1234
|
+
CoinWarmStartDiff * getBasisDiff(const unsigned char * statusArray) const ;
|
1235
|
+
/// Warm start from statusArray
|
1236
|
+
CoinWarmStartBasis * getBasis(const unsigned char * statusArray) const ;
|
1237
|
+
/// Delete all scale factor stuff and reset option
|
1238
|
+
void deleteScaleFactors();
|
1239
|
+
/// If doing fast hot start then ranges are computed
|
1240
|
+
inline const double * upRange() const
|
1241
|
+
{ return rowActivity_;}
|
1242
|
+
inline const double * downRange() const
|
1243
|
+
{ return columnActivity_;}
|
1244
|
+
/// Pass in range array
|
1245
|
+
inline void passInRanges(int * array)
|
1246
|
+
{ whichRange_=array;}
|
1247
|
+
/// Pass in sos stuff from AMPl
|
1248
|
+
void setSOSData(int numberSOS,const char * type,
|
1249
|
+
const int * start,const int * indices, const double * weights=NULL);
|
1250
|
+
/// Compute largest amount any at continuous away from bound
|
1251
|
+
void computeLargestAway();
|
1252
|
+
/// Get largest amount continuous away from bound
|
1253
|
+
inline double largestAway() const
|
1254
|
+
{ return largestAway_;}
|
1255
|
+
/// Set largest amount continuous away from bound
|
1256
|
+
inline void setLargestAway(double value)
|
1257
|
+
{ largestAway_ = value;}
|
1258
|
+
/// Sort of lexicographic resolve
|
1259
|
+
void lexSolve();
|
1260
|
+
//@}
|
1261
|
+
|
1262
|
+
protected:
|
1263
|
+
/**@name Protected member data */
|
1264
|
+
//@{
|
1265
|
+
/// Clp model represented by this class instance
|
1266
|
+
mutable ClpSimplex * modelPtr_;
|
1267
|
+
//@}
|
1268
|
+
/**@name Cached information derived from the OSL model */
|
1269
|
+
//@{
|
1270
|
+
/// Pointer to dense vector of row sense indicators
|
1271
|
+
mutable char *rowsense_;
|
1272
|
+
|
1273
|
+
/// Pointer to dense vector of row right-hand side values
|
1274
|
+
mutable double *rhs_;
|
1275
|
+
|
1276
|
+
/** Pointer to dense vector of slack upper bounds for range
|
1277
|
+
constraints (undefined for non-range rows)
|
1278
|
+
*/
|
1279
|
+
mutable double *rowrange_;
|
1280
|
+
|
1281
|
+
/** A pointer to the warmstart information to be used in the hotstarts.
|
1282
|
+
This is NOT efficient and more thought should be given to it... */
|
1283
|
+
mutable CoinWarmStartBasis* ws_;
|
1284
|
+
/** also save row and column information for hot starts
|
1285
|
+
only used in hotstarts so can be casual */
|
1286
|
+
mutable double * rowActivity_;
|
1287
|
+
mutable double * columnActivity_;
|
1288
|
+
/// Stuff for fast dual
|
1289
|
+
ClpNodeStuff stuff_;
|
1290
|
+
/// Number of SOS sets
|
1291
|
+
int numberSOS_;
|
1292
|
+
/// SOS set info
|
1293
|
+
CoinSet * setInfo_;
|
1294
|
+
/// Alternate model (hot starts) - but also could be permanent and used for crunch
|
1295
|
+
ClpSimplex * smallModel_;
|
1296
|
+
/// factorization for hot starts
|
1297
|
+
ClpFactorization * factorization_;
|
1298
|
+
/** Smallest allowed element in cut.
|
1299
|
+
If smaller than this then ignored */
|
1300
|
+
double smallestElementInCut_;
|
1301
|
+
/** Smallest change in cut.
|
1302
|
+
If (upper-lower)*element < this then element is
|
1303
|
+
taken out and cut relaxed. */
|
1304
|
+
double smallestChangeInCut_;
|
1305
|
+
/// Largest amount continuous away from bound
|
1306
|
+
double largestAway_;
|
1307
|
+
/// Arrays for hot starts
|
1308
|
+
char * spareArrays_;
|
1309
|
+
/** Warmstart information to be used in resolves. */
|
1310
|
+
CoinWarmStartBasis basis_;
|
1311
|
+
/** The original iteration limit before hotstarts started. */
|
1312
|
+
int itlimOrig_;
|
1313
|
+
|
1314
|
+
/*! \brief Last algorithm used
|
1315
|
+
|
1316
|
+
Coded as
|
1317
|
+
- 0 invalid
|
1318
|
+
- 1 primal
|
1319
|
+
- 2 dual
|
1320
|
+
- -911 disaster in the algorithm that was attempted
|
1321
|
+
- 999 current solution no longer optimal due to change in problem or
|
1322
|
+
basis
|
1323
|
+
*/
|
1324
|
+
mutable int lastAlgorithm_;
|
1325
|
+
|
1326
|
+
/// To say if destructor should delete underlying model
|
1327
|
+
bool notOwned_;
|
1328
|
+
|
1329
|
+
/// Pointer to row-wise copy of problem matrix coefficients.
|
1330
|
+
mutable CoinPackedMatrix *matrixByRow_;
|
1331
|
+
|
1332
|
+
/// Pointer to row-wise copy of continuous problem matrix coefficients.
|
1333
|
+
CoinPackedMatrix *matrixByRowAtContinuous_;
|
1334
|
+
|
1335
|
+
/// Pointer to integer information
|
1336
|
+
char * integerInformation_;
|
1337
|
+
|
1338
|
+
/** Pointer to variables for which we want range information
|
1339
|
+
The number is in [0]
|
1340
|
+
memory is not owned by OsiClp
|
1341
|
+
*/
|
1342
|
+
int * whichRange_;
|
1343
|
+
|
1344
|
+
//std::map<OsiIntParam, ClpIntParam> intParamMap_;
|
1345
|
+
//std::map<OsiDblParam, ClpDblParam> dblParamMap_;
|
1346
|
+
//std::map<OsiStrParam, ClpStrParam> strParamMap_;
|
1347
|
+
|
1348
|
+
/*! \brief Faking min to get proper dual solution signs in simplex API */
|
1349
|
+
mutable bool fakeMinInSimplex_ ;
|
1350
|
+
/*! \brief Linear objective
|
1351
|
+
|
1352
|
+
Normally a pointer to the linear coefficient array in the clp objective.
|
1353
|
+
An independent copy when #fakeMinInSimplex_ is true, because we need
|
1354
|
+
something permanent to point to when #getObjCoefficients is called.
|
1355
|
+
*/
|
1356
|
+
mutable double *linearObjective_;
|
1357
|
+
|
1358
|
+
/// To save data in OsiSimplex stuff
|
1359
|
+
mutable ClpDataSave saveData_;
|
1360
|
+
/// Options for initialSolve
|
1361
|
+
ClpSolve solveOptions_;
|
1362
|
+
/** Scaling option
|
1363
|
+
When scaling is on it is possible that the scaled problem
|
1364
|
+
is feasible but the unscaled is not. Clp returns a secondary
|
1365
|
+
status code to that effect. This option allows for a cleanup.
|
1366
|
+
If you use it I would suggest 1.
|
1367
|
+
This only affects actions when scaled optimal
|
1368
|
+
0 - no action
|
1369
|
+
1 - clean up using dual if primal infeasibility
|
1370
|
+
2 - clean up using dual if dual infeasibility
|
1371
|
+
3 - clean up using dual if primal or dual infeasibility
|
1372
|
+
11,12,13 - as 1,2,3 but use primal
|
1373
|
+
*/
|
1374
|
+
int cleanupScaling_;
|
1375
|
+
/** Special options
|
1376
|
+
0x80000000 off
|
1377
|
+
0 simple stuff for branch and bound
|
1378
|
+
1 try and keep work regions as much as possible
|
1379
|
+
2 do not use any perturbation
|
1380
|
+
4 allow exit before re-factorization
|
1381
|
+
8 try and re-use factorization if no cuts
|
1382
|
+
16 use standard strong branching rather than clp's
|
1383
|
+
32 Just go to first factorization in fast dual
|
1384
|
+
64 try and tighten bounds in crunch
|
1385
|
+
128 Model will only change in column bounds
|
1386
|
+
256 Clean up model before hot start
|
1387
|
+
512 Give user direct access to Clp regions in getBInvARow etc (i.e.,
|
1388
|
+
do not unscale, and do not return result in getBInv parameters;
|
1389
|
+
you have to know where to look for the answer)
|
1390
|
+
1024 Don't "borrow" model in initialSolve
|
1391
|
+
2048 Don't crunch
|
1392
|
+
4096 quick check for optimality
|
1393
|
+
Bits above 8192 give where called from in Cbc
|
1394
|
+
At present 0 is normal, 1 doing fast hotstarts, 2 is can do quick check
|
1395
|
+
65536 Keep simple i.e. no crunch etc
|
1396
|
+
131072 Try and keep scaling factors around
|
1397
|
+
262144 Don't try and tighten bounds (funny global cuts)
|
1398
|
+
524288 Fake objective and 0-1
|
1399
|
+
1048576 Don't recompute ray after crunch
|
1400
|
+
2097152
|
1401
|
+
*/
|
1402
|
+
mutable unsigned int specialOptions_;
|
1403
|
+
/// Copy of model when option 131072 set
|
1404
|
+
ClpSimplex * baseModel_;
|
1405
|
+
/// Number of rows when last "scaled"
|
1406
|
+
int lastNumberRows_;
|
1407
|
+
/// Continuous model
|
1408
|
+
ClpSimplex * continuousModel_;
|
1409
|
+
/// Possible disaster handler
|
1410
|
+
OsiClpDisasterHandler * disasterHandler_ ;
|
1411
|
+
/// Fake objective
|
1412
|
+
ClpLinearObjective * fakeObjective_;
|
1413
|
+
/// Row scale factors (has inverse at end)
|
1414
|
+
CoinDoubleArrayWithLength rowScale_;
|
1415
|
+
/// Column scale factors (has inverse at end)
|
1416
|
+
CoinDoubleArrayWithLength columnScale_;
|
1417
|
+
//@}
|
1418
|
+
};
|
1419
|
+
|
1420
|
+
class OsiClpDisasterHandler : public ClpDisasterHandler {
|
1421
|
+
public:
|
1422
|
+
/**@name Virtual methods that the derived classe should provide.
|
1423
|
+
*/
|
1424
|
+
//@{
|
1425
|
+
/// Into simplex
|
1426
|
+
virtual void intoSimplex();
|
1427
|
+
/// Checks if disaster
|
1428
|
+
virtual bool check() const ;
|
1429
|
+
/// saves information for next attempt
|
1430
|
+
virtual void saveInfo();
|
1431
|
+
/// Type of disaster 0 can fix, 1 abort
|
1432
|
+
virtual int typeOfDisaster();
|
1433
|
+
//@}
|
1434
|
+
|
1435
|
+
|
1436
|
+
/**@name Constructors, destructor */
|
1437
|
+
|
1438
|
+
//@{
|
1439
|
+
/** Default constructor. */
|
1440
|
+
OsiClpDisasterHandler(OsiClpSolverInterface * model = NULL);
|
1441
|
+
/** Destructor */
|
1442
|
+
virtual ~OsiClpDisasterHandler();
|
1443
|
+
// Copy
|
1444
|
+
OsiClpDisasterHandler(const OsiClpDisasterHandler&);
|
1445
|
+
// Assignment
|
1446
|
+
OsiClpDisasterHandler& operator=(const OsiClpDisasterHandler&);
|
1447
|
+
/// Clone
|
1448
|
+
virtual ClpDisasterHandler * clone() const;
|
1449
|
+
|
1450
|
+
//@}
|
1451
|
+
|
1452
|
+
/**@name Sets/gets */
|
1453
|
+
|
1454
|
+
//@{
|
1455
|
+
/** set model. */
|
1456
|
+
void setOsiModel(OsiClpSolverInterface * model);
|
1457
|
+
/// Get model
|
1458
|
+
inline OsiClpSolverInterface * osiModel() const
|
1459
|
+
{ return osiModel_;}
|
1460
|
+
/// Set where from
|
1461
|
+
inline void setWhereFrom(int value)
|
1462
|
+
{ whereFrom_=value;}
|
1463
|
+
/// Get where from
|
1464
|
+
inline int whereFrom() const
|
1465
|
+
{ return whereFrom_;}
|
1466
|
+
/// Set phase
|
1467
|
+
inline void setPhase(int value)
|
1468
|
+
{ phase_=value;}
|
1469
|
+
/// Get phase
|
1470
|
+
inline int phase() const
|
1471
|
+
{ return phase_;}
|
1472
|
+
/// are we in trouble
|
1473
|
+
bool inTrouble() const;
|
1474
|
+
|
1475
|
+
//@}
|
1476
|
+
|
1477
|
+
|
1478
|
+
protected:
|
1479
|
+
/**@name Data members
|
1480
|
+
The data members are protected to allow access for derived classes. */
|
1481
|
+
//@{
|
1482
|
+
/// Pointer to model
|
1483
|
+
OsiClpSolverInterface * osiModel_;
|
1484
|
+
/** Where from
|
1485
|
+
0 dual (resolve)
|
1486
|
+
1 crunch
|
1487
|
+
2 primal (resolve)
|
1488
|
+
4 dual (initialSolve)
|
1489
|
+
6 primal (initialSolve)
|
1490
|
+
*/
|
1491
|
+
int whereFrom_;
|
1492
|
+
/** phase
|
1493
|
+
0 initial
|
1494
|
+
1 trying continuing with back in and maybe different perturb
|
1495
|
+
2 trying continuing with back in and different scaling
|
1496
|
+
3 trying dual from all slack
|
1497
|
+
4 trying primal from previous stored basis
|
1498
|
+
*/
|
1499
|
+
int phase_;
|
1500
|
+
/// Are we in trouble
|
1501
|
+
bool inTrouble_;
|
1502
|
+
//@}
|
1503
|
+
};
|
1504
|
+
// So unit test can find out if NDEBUG set
|
1505
|
+
bool OsiClpHasNDEBUG();
|
1506
|
+
//#############################################################################
|
1507
|
+
/** A function that tests the methods in the OsiClpSolverInterface class. */
|
1508
|
+
void OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
|
1509
|
+
#endif
|