ruby-cbc 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,300 @@
|
|
|
1
|
+
/* $Id: ClpSimplexDual.hpp 1761 2011-07-06 16:06:24Z forrest $ */
|
|
2
|
+
// Copyright (C) 2002, 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
|
+
Authors
|
|
7
|
+
|
|
8
|
+
John Forrest
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
#ifndef ClpSimplexDual_H
|
|
12
|
+
#define ClpSimplexDual_H
|
|
13
|
+
|
|
14
|
+
#include "ClpSimplex.hpp"
|
|
15
|
+
|
|
16
|
+
/** This solves LPs using the dual simplex method
|
|
17
|
+
|
|
18
|
+
It inherits from ClpSimplex. It has no data of its own and
|
|
19
|
+
is never created - only cast from a ClpSimplex object at algorithm time.
|
|
20
|
+
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
class ClpSimplexDual : public ClpSimplex {
|
|
24
|
+
|
|
25
|
+
public:
|
|
26
|
+
|
|
27
|
+
/**@name Description of algorithm */
|
|
28
|
+
//@{
|
|
29
|
+
/** Dual algorithm
|
|
30
|
+
|
|
31
|
+
Method
|
|
32
|
+
|
|
33
|
+
It tries to be a single phase approach with a weight of 1.0 being
|
|
34
|
+
given to getting optimal and a weight of updatedDualBound_ being
|
|
35
|
+
given to getting dual feasible. In this version I have used the
|
|
36
|
+
idea that this weight can be thought of as a fake bound. If the
|
|
37
|
+
distance between the lower and upper bounds on a variable is less
|
|
38
|
+
than the feasibility weight then we are always better off flipping
|
|
39
|
+
to other bound to make dual feasible. If the distance is greater
|
|
40
|
+
then we make up a fake bound updatedDualBound_ away from one bound.
|
|
41
|
+
If we end up optimal or primal infeasible, we check to see if
|
|
42
|
+
bounds okay. If so we have finished, if not we increase updatedDualBound_
|
|
43
|
+
and continue (after checking if unbounded). I am undecided about
|
|
44
|
+
free variables - there is coding but I am not sure about it. At
|
|
45
|
+
present I put them in basis anyway.
|
|
46
|
+
|
|
47
|
+
The code is designed to take advantage of sparsity so arrays are
|
|
48
|
+
seldom zeroed out from scratch or gone over in their entirety.
|
|
49
|
+
The only exception is a full scan to find outgoing variable for
|
|
50
|
+
Dantzig row choice. For steepest edge we keep an updated list
|
|
51
|
+
of infeasibilities (actually squares).
|
|
52
|
+
On easy problems we don't need full scan - just
|
|
53
|
+
pick first reasonable.
|
|
54
|
+
|
|
55
|
+
One problem is how to tackle degeneracy and accuracy. At present
|
|
56
|
+
I am using the modification of costs which I put in OSL and some
|
|
57
|
+
of what I think is the dual analog of Gill et al.
|
|
58
|
+
I am still not sure of the exact details.
|
|
59
|
+
|
|
60
|
+
The flow of dual is three while loops as follows:
|
|
61
|
+
|
|
62
|
+
while (not finished) {
|
|
63
|
+
|
|
64
|
+
while (not clean solution) {
|
|
65
|
+
|
|
66
|
+
Factorize and/or clean up solution by flipping variables so
|
|
67
|
+
dual feasible. If looks finished check fake dual bounds.
|
|
68
|
+
Repeat until status is iterating (-1) or finished (0,1,2)
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
while (status==-1) {
|
|
73
|
+
|
|
74
|
+
Iterate until no pivot in or out or time to re-factorize.
|
|
75
|
+
|
|
76
|
+
Flow is:
|
|
77
|
+
|
|
78
|
+
choose pivot row (outgoing variable). if none then
|
|
79
|
+
we are primal feasible so looks as if done but we need to
|
|
80
|
+
break and check bounds etc.
|
|
81
|
+
|
|
82
|
+
Get pivot row in tableau
|
|
83
|
+
|
|
84
|
+
Choose incoming column. If we don't find one then we look
|
|
85
|
+
primal infeasible so break and check bounds etc. (Also the
|
|
86
|
+
pivot tolerance is larger after any iterations so that may be
|
|
87
|
+
reason)
|
|
88
|
+
|
|
89
|
+
If we do find incoming column, we may have to adjust costs to
|
|
90
|
+
keep going forwards (anti-degeneracy). Check pivot will be stable
|
|
91
|
+
and if unstable throw away iteration and break to re-factorize.
|
|
92
|
+
If minor error re-factorize after iteration.
|
|
93
|
+
|
|
94
|
+
Update everything (this may involve flipping variables to stay
|
|
95
|
+
dual feasible.
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
TODO's (or maybe not)
|
|
102
|
+
|
|
103
|
+
At present we never check we are going forwards. I overdid that in
|
|
104
|
+
OSL so will try and make a last resort.
|
|
105
|
+
|
|
106
|
+
Needs partial scan pivot out option.
|
|
107
|
+
|
|
108
|
+
May need other anti-degeneracy measures, especially if we try and use
|
|
109
|
+
loose tolerances as a way to solve in fewer iterations.
|
|
110
|
+
|
|
111
|
+
I like idea of dynamic scaling. This gives opportunity to decouple
|
|
112
|
+
different implications of scaling for accuracy, iteration count and
|
|
113
|
+
feasibility tolerance.
|
|
114
|
+
|
|
115
|
+
for use of exotic parameter startFinishoptions see Clpsimplex.hpp
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
int dual(int ifValuesPass, int startFinishOptions = 0);
|
|
119
|
+
/** For strong branching. On input lower and upper are new bounds
|
|
120
|
+
while on output they are change in objective function values
|
|
121
|
+
(>1.0e50 infeasible).
|
|
122
|
+
Return code is 0 if nothing interesting, -1 if infeasible both
|
|
123
|
+
ways and +1 if infeasible one way (check values to see which one(s))
|
|
124
|
+
Solutions are filled in as well - even down, odd up - also
|
|
125
|
+
status and number of iterations
|
|
126
|
+
*/
|
|
127
|
+
int strongBranching(int numberVariables, const int * variables,
|
|
128
|
+
double * newLower, double * newUpper,
|
|
129
|
+
double ** outputSolution,
|
|
130
|
+
int * outputStatus, int * outputIterations,
|
|
131
|
+
bool stopOnFirstInfeasible = true,
|
|
132
|
+
bool alwaysFinish = false,
|
|
133
|
+
int startFinishOptions = 0);
|
|
134
|
+
/// This does first part of StrongBranching
|
|
135
|
+
ClpFactorization * setupForStrongBranching(char * arrays, int numberRows,
|
|
136
|
+
int numberColumns, bool solveLp = false);
|
|
137
|
+
/// This cleans up after strong branching
|
|
138
|
+
void cleanupAfterStrongBranching(ClpFactorization * factorization);
|
|
139
|
+
//@}
|
|
140
|
+
|
|
141
|
+
/**@name Functions used in dual */
|
|
142
|
+
//@{
|
|
143
|
+
/** This has the flow between re-factorizations
|
|
144
|
+
Broken out for clarity and will be used by strong branching
|
|
145
|
+
|
|
146
|
+
Reasons to come out:
|
|
147
|
+
-1 iterations etc
|
|
148
|
+
-2 inaccuracy
|
|
149
|
+
-3 slight inaccuracy (and done iterations)
|
|
150
|
+
+0 looks optimal (might be unbounded - but we will investigate)
|
|
151
|
+
+1 looks infeasible
|
|
152
|
+
+3 max iterations
|
|
153
|
+
|
|
154
|
+
If givenPi not NULL then in values pass
|
|
155
|
+
*/
|
|
156
|
+
int whileIterating(double * & givenPi, int ifValuesPass);
|
|
157
|
+
/** The duals are updated by the given arrays.
|
|
158
|
+
Returns number of infeasibilities.
|
|
159
|
+
After rowArray and columnArray will just have those which
|
|
160
|
+
have been flipped.
|
|
161
|
+
Variables may be flipped between bounds to stay dual feasible.
|
|
162
|
+
The output vector has movement of primal
|
|
163
|
+
solution (row length array) */
|
|
164
|
+
int updateDualsInDual(CoinIndexedVector * rowArray,
|
|
165
|
+
CoinIndexedVector * columnArray,
|
|
166
|
+
CoinIndexedVector * outputArray,
|
|
167
|
+
double theta,
|
|
168
|
+
double & objectiveChange,
|
|
169
|
+
bool fullRecompute);
|
|
170
|
+
/** The duals are updated by the given arrays.
|
|
171
|
+
This is in values pass - so no changes to primal is made
|
|
172
|
+
*/
|
|
173
|
+
void updateDualsInValuesPass(CoinIndexedVector * rowArray,
|
|
174
|
+
CoinIndexedVector * columnArray,
|
|
175
|
+
double theta);
|
|
176
|
+
/** While updateDualsInDual sees what effect is of flip
|
|
177
|
+
this does actual flipping.
|
|
178
|
+
*/
|
|
179
|
+
void flipBounds(CoinIndexedVector * rowArray,
|
|
180
|
+
CoinIndexedVector * columnArray);
|
|
181
|
+
/**
|
|
182
|
+
Row array has row part of pivot row
|
|
183
|
+
Column array has column part.
|
|
184
|
+
This chooses pivot column.
|
|
185
|
+
Spare arrays are used to save pivots which will go infeasible
|
|
186
|
+
We will check for basic so spare array will never overflow.
|
|
187
|
+
If necessary will modify costs
|
|
188
|
+
For speed, we may need to go to a bucket approach when many
|
|
189
|
+
variables are being flipped.
|
|
190
|
+
Returns best possible pivot value
|
|
191
|
+
*/
|
|
192
|
+
double dualColumn(CoinIndexedVector * rowArray,
|
|
193
|
+
CoinIndexedVector * columnArray,
|
|
194
|
+
CoinIndexedVector * spareArray,
|
|
195
|
+
CoinIndexedVector * spareArray2,
|
|
196
|
+
double accpetablePivot,
|
|
197
|
+
CoinBigIndex * dubiousWeights);
|
|
198
|
+
/// Does first bit of dualColumn
|
|
199
|
+
int dualColumn0(const CoinIndexedVector * rowArray,
|
|
200
|
+
const CoinIndexedVector * columnArray,
|
|
201
|
+
CoinIndexedVector * spareArray,
|
|
202
|
+
double acceptablePivot,
|
|
203
|
+
double & upperReturn, double &bestReturn, double & badFree);
|
|
204
|
+
/**
|
|
205
|
+
Row array has row part of pivot row
|
|
206
|
+
Column array has column part.
|
|
207
|
+
This sees what is best thing to do in dual values pass
|
|
208
|
+
if sequenceIn==sequenceOut can change dual on chosen row and leave variable in basis
|
|
209
|
+
*/
|
|
210
|
+
void checkPossibleValuesMove(CoinIndexedVector * rowArray,
|
|
211
|
+
CoinIndexedVector * columnArray,
|
|
212
|
+
double acceptablePivot);
|
|
213
|
+
/**
|
|
214
|
+
Row array has row part of pivot row
|
|
215
|
+
Column array has column part.
|
|
216
|
+
This sees what is best thing to do in branch and bound cleanup
|
|
217
|
+
If sequenceIn_ < 0 then can't do anything
|
|
218
|
+
*/
|
|
219
|
+
void checkPossibleCleanup(CoinIndexedVector * rowArray,
|
|
220
|
+
CoinIndexedVector * columnArray,
|
|
221
|
+
double acceptablePivot);
|
|
222
|
+
/**
|
|
223
|
+
This sees if we can move duals in dual values pass.
|
|
224
|
+
This is done before any pivoting
|
|
225
|
+
*/
|
|
226
|
+
void doEasyOnesInValuesPass(double * givenReducedCosts);
|
|
227
|
+
/**
|
|
228
|
+
Chooses dual pivot row
|
|
229
|
+
Would be faster with separate region to scan
|
|
230
|
+
and will have this (with square of infeasibility) when steepest
|
|
231
|
+
For easy problems we can just choose one of the first rows we look at
|
|
232
|
+
|
|
233
|
+
If alreadyChosen >=0 then in values pass and that row has been
|
|
234
|
+
selected
|
|
235
|
+
*/
|
|
236
|
+
void dualRow(int alreadyChosen);
|
|
237
|
+
/** Checks if any fake bounds active - if so returns number and modifies
|
|
238
|
+
updatedDualBound_ and everything.
|
|
239
|
+
Free variables will be left as free
|
|
240
|
+
Returns number of bounds changed if >=0
|
|
241
|
+
Returns -1 if not initialize and no effect
|
|
242
|
+
Fills in changeVector which can be used to see if unbounded
|
|
243
|
+
and cost of change vector
|
|
244
|
+
If 2 sets to original (just changed)
|
|
245
|
+
*/
|
|
246
|
+
int changeBounds(int initialize, CoinIndexedVector * outputArray,
|
|
247
|
+
double & changeCost);
|
|
248
|
+
/** As changeBounds but just changes new bounds for a single variable.
|
|
249
|
+
Returns true if change */
|
|
250
|
+
bool changeBound( int iSequence);
|
|
251
|
+
/// Restores bound to original bound
|
|
252
|
+
void originalBound(int iSequence);
|
|
253
|
+
/** Checks if tentative optimal actually means unbounded in dual
|
|
254
|
+
Returns -3 if not, 2 if is unbounded */
|
|
255
|
+
int checkUnbounded(CoinIndexedVector * ray, CoinIndexedVector * spare,
|
|
256
|
+
double changeCost);
|
|
257
|
+
/** Refactorizes if necessary
|
|
258
|
+
Checks if finished. Updates status.
|
|
259
|
+
lastCleaned refers to iteration at which some objective/feasibility
|
|
260
|
+
cleaning too place.
|
|
261
|
+
|
|
262
|
+
type - 0 initial so set up save arrays etc
|
|
263
|
+
- 1 normal -if good update save
|
|
264
|
+
- 2 restoring from saved
|
|
265
|
+
*/
|
|
266
|
+
void statusOfProblemInDual(int & lastCleaned, int type,
|
|
267
|
+
double * givenDjs, ClpDataSave & saveData,
|
|
268
|
+
int ifValuesPass);
|
|
269
|
+
/** Perturbs problem (method depends on perturbation())
|
|
270
|
+
returns nonzero if should go to dual */
|
|
271
|
+
int perturb();
|
|
272
|
+
/** Fast iterations. Misses out a lot of initialization.
|
|
273
|
+
Normally stops on maximum iterations, first re-factorization
|
|
274
|
+
or tentative optimum. If looks interesting then continues as
|
|
275
|
+
normal. Returns 0 if finished properly, 1 otherwise.
|
|
276
|
+
*/
|
|
277
|
+
int fastDual(bool alwaysFinish = false);
|
|
278
|
+
/** Checks number of variables at fake bounds. This is used by fastDual
|
|
279
|
+
so can exit gracefully before end */
|
|
280
|
+
int numberAtFakeBound();
|
|
281
|
+
|
|
282
|
+
/** Pivot in a variable and choose an outgoing one. Assumes dual
|
|
283
|
+
feasible - will not go through a reduced cost. Returns step length in theta
|
|
284
|
+
Return codes as before but -1 means no acceptable pivot
|
|
285
|
+
*/
|
|
286
|
+
int pivotResultPart1();
|
|
287
|
+
/** Get next free , -1 if none */
|
|
288
|
+
int nextSuperBasic();
|
|
289
|
+
/** Startup part of dual (may be extended to other algorithms)
|
|
290
|
+
returns 0 if good, 1 if bad */
|
|
291
|
+
int startupSolve(int ifValuesPass, double * saveDuals, int startFinishOptions);
|
|
292
|
+
void finishSolve(int startFinishOptions);
|
|
293
|
+
void gutsOfDual(int ifValuesPass, double * & saveDuals, int initialStatus,
|
|
294
|
+
ClpDataSave & saveData);
|
|
295
|
+
//int dual2(int ifValuesPass,int startFinishOptions=0);
|
|
296
|
+
void resetFakeBounds(int type);
|
|
297
|
+
|
|
298
|
+
//@}
|
|
299
|
+
};
|
|
300
|
+
#endif
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* $Id: ClpSimplexNonlinear.hpp 2025 2014-03-19 12:49:55Z forrest $ */
|
|
2
|
+
// Copyright (C) 2004, 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
|
+
Authors
|
|
7
|
+
|
|
8
|
+
John Forrest
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
#ifndef ClpSimplexNonlinear_H
|
|
12
|
+
#define ClpSimplexNonlinear_H
|
|
13
|
+
|
|
14
|
+
class ClpNonlinearInfo;
|
|
15
|
+
class ClpQuadraticObjective;
|
|
16
|
+
class ClpConstraint;
|
|
17
|
+
|
|
18
|
+
#include "ClpSimplexPrimal.hpp"
|
|
19
|
+
|
|
20
|
+
/** This solves non-linear LPs using the primal simplex method
|
|
21
|
+
|
|
22
|
+
It inherits from ClpSimplexPrimal. It has no data of its own and
|
|
23
|
+
is never created - only cast from a ClpSimplexPrimal object at algorithm time.
|
|
24
|
+
If needed create new class and pass around
|
|
25
|
+
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
class ClpSimplexNonlinear : public ClpSimplexPrimal {
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
|
|
32
|
+
/**@name Description of algorithm */
|
|
33
|
+
//@{
|
|
34
|
+
/** Primal algorithms for reduced gradient
|
|
35
|
+
At present we have two algorithms:
|
|
36
|
+
|
|
37
|
+
*/
|
|
38
|
+
/// A reduced gradient method.
|
|
39
|
+
int primal();
|
|
40
|
+
/** Primal algorithm for quadratic
|
|
41
|
+
Using a semi-trust region approach as for pooling problem
|
|
42
|
+
This is in because I have it lying around
|
|
43
|
+
*/
|
|
44
|
+
int primalSLP(int numberPasses, double deltaTolerance,
|
|
45
|
+
int otherOptions=0);
|
|
46
|
+
/// May use a cut approach for solving any LP
|
|
47
|
+
int primalDualCuts(char * rowsIn, int startUp, int algorithm);
|
|
48
|
+
/** Primal algorithm for nonlinear constraints
|
|
49
|
+
Using a semi-trust region approach as for pooling problem
|
|
50
|
+
This is in because I have it lying around
|
|
51
|
+
|
|
52
|
+
*/
|
|
53
|
+
int primalSLP(int numberConstraints, ClpConstraint ** constraints,
|
|
54
|
+
int numberPasses, double deltaTolerance);
|
|
55
|
+
|
|
56
|
+
/** Creates direction vector. note longArray is long enough
|
|
57
|
+
for rows and columns. If numberNonBasic 0 then is updated
|
|
58
|
+
otherwise mode is ignored and those are used.
|
|
59
|
+
Norms are only for those > 1.0e3*dualTolerance
|
|
60
|
+
If mode is nonzero then just largest dj */
|
|
61
|
+
void directionVector (CoinIndexedVector * longArray,
|
|
62
|
+
CoinIndexedVector * spare1, CoinIndexedVector * spare2,
|
|
63
|
+
int mode,
|
|
64
|
+
double & normFlagged, double & normUnflagged,
|
|
65
|
+
int & numberNonBasic);
|
|
66
|
+
/// Main part.
|
|
67
|
+
int whileIterating (int & pivotMode);
|
|
68
|
+
/**
|
|
69
|
+
longArray has direction
|
|
70
|
+
pivotMode -
|
|
71
|
+
0 - use all dual infeasible variables
|
|
72
|
+
1 - largest dj
|
|
73
|
+
while >= 10 trying startup phase
|
|
74
|
+
Returns 0 - can do normal iteration (basis change)
|
|
75
|
+
1 - no basis change
|
|
76
|
+
2 - if wants singleton
|
|
77
|
+
3 - if time to re-factorize
|
|
78
|
+
If sequenceIn_ >=0 then that will be incoming variable
|
|
79
|
+
*/
|
|
80
|
+
int pivotColumn(CoinIndexedVector * longArray,
|
|
81
|
+
CoinIndexedVector * rowArray,
|
|
82
|
+
CoinIndexedVector * columnArray,
|
|
83
|
+
CoinIndexedVector * spare,
|
|
84
|
+
int & pivotMode,
|
|
85
|
+
double & solutionError,
|
|
86
|
+
double * array1);
|
|
87
|
+
/** Refactorizes if necessary
|
|
88
|
+
Checks if finished. Updates status.
|
|
89
|
+
lastCleaned refers to iteration at which some objective/feasibility
|
|
90
|
+
cleaning too place.
|
|
91
|
+
|
|
92
|
+
type - 0 initial so set up save arrays etc
|
|
93
|
+
- 1 normal -if good update save
|
|
94
|
+
- 2 restoring from saved
|
|
95
|
+
*/
|
|
96
|
+
void statusOfProblemInPrimal(int & lastCleaned, int type,
|
|
97
|
+
ClpSimplexProgress * progress,
|
|
98
|
+
bool doFactorization,
|
|
99
|
+
double & bestObjectiveWhenFlagged);
|
|
100
|
+
/** Do last half of an iteration.
|
|
101
|
+
Return codes
|
|
102
|
+
Reasons to come out normal mode
|
|
103
|
+
-1 normal
|
|
104
|
+
-2 factorize now - good iteration
|
|
105
|
+
-3 slight inaccuracy - refactorize - iteration done
|
|
106
|
+
-4 inaccuracy - refactorize - no iteration
|
|
107
|
+
-5 something flagged - go round again
|
|
108
|
+
+2 looks unbounded
|
|
109
|
+
+3 max iterations (iteration done)
|
|
110
|
+
|
|
111
|
+
*/
|
|
112
|
+
int pivotNonlinearResult();
|
|
113
|
+
//@}
|
|
114
|
+
|
|
115
|
+
};
|
|
116
|
+
#endif
|
|
117
|
+
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/* $Id: ClpSimplexOther.hpp 2070 2014-11-18 11:12:54Z forrest $ */
|
|
2
|
+
// Copyright (C) 2004, 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
|
+
Authors
|
|
7
|
+
|
|
8
|
+
John Forrest
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
#ifndef ClpSimplexOther_H
|
|
12
|
+
#define ClpSimplexOther_H
|
|
13
|
+
|
|
14
|
+
#include "ClpSimplex.hpp"
|
|
15
|
+
|
|
16
|
+
/** This is for Simplex stuff which is neither dual nor primal
|
|
17
|
+
|
|
18
|
+
It inherits from ClpSimplex. It has no data of its own and
|
|
19
|
+
is never created - only cast from a ClpSimplex object at algorithm time.
|
|
20
|
+
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
class ClpSimplexOther : public ClpSimplex {
|
|
24
|
+
|
|
25
|
+
public:
|
|
26
|
+
|
|
27
|
+
/**@name Methods */
|
|
28
|
+
//@{
|
|
29
|
+
/** Dual ranging.
|
|
30
|
+
This computes increase/decrease in cost for each given variable and corresponding
|
|
31
|
+
sequence numbers which would change basis. Sequence numbers are 0..numberColumns
|
|
32
|
+
and numberColumns.. for artificials/slacks.
|
|
33
|
+
For non-basic variables the information is trivial to compute and the change in cost is just minus the
|
|
34
|
+
reduced cost and the sequence number will be that of the non-basic variables.
|
|
35
|
+
For basic variables a ratio test is between the reduced costs for non-basic variables
|
|
36
|
+
and the row of the tableau corresponding to the basic variable.
|
|
37
|
+
The increase/decrease value is always >= 0.0
|
|
38
|
+
|
|
39
|
+
Up to user to provide correct length arrays where each array is of length numberCheck.
|
|
40
|
+
which contains list of variables for which information is desired. All other
|
|
41
|
+
arrays will be filled in by function. If fifth entry in which is variable 7 then fifth entry in output arrays
|
|
42
|
+
will be information for variable 7.
|
|
43
|
+
|
|
44
|
+
If valueIncrease/Decrease not NULL (both must be NULL or both non NULL) then these are filled with
|
|
45
|
+
the value of variable if such a change in cost were made (the existing bounds are ignored)
|
|
46
|
+
|
|
47
|
+
When here - guaranteed optimal
|
|
48
|
+
*/
|
|
49
|
+
void dualRanging(int numberCheck, const int * which,
|
|
50
|
+
double * costIncrease, int * sequenceIncrease,
|
|
51
|
+
double * costDecrease, int * sequenceDecrease,
|
|
52
|
+
double * valueIncrease = NULL, double * valueDecrease = NULL);
|
|
53
|
+
/** Primal ranging.
|
|
54
|
+
This computes increase/decrease in value for each given variable and corresponding
|
|
55
|
+
sequence numbers which would change basis. Sequence numbers are 0..numberColumns
|
|
56
|
+
and numberColumns.. for artificials/slacks.
|
|
57
|
+
This should only be used for non-basic variabls as otherwise information is pretty useless
|
|
58
|
+
For basic variables the sequence number will be that of the basic variables.
|
|
59
|
+
|
|
60
|
+
Up to user to provide correct length arrays where each array is of length numberCheck.
|
|
61
|
+
which contains list of variables for which information is desired. All other
|
|
62
|
+
arrays will be filled in by function. If fifth entry in which is variable 7 then fifth entry in output arrays
|
|
63
|
+
will be information for variable 7.
|
|
64
|
+
|
|
65
|
+
When here - guaranteed optimal
|
|
66
|
+
*/
|
|
67
|
+
void primalRanging(int numberCheck, const int * which,
|
|
68
|
+
double * valueIncrease, int * sequenceIncrease,
|
|
69
|
+
double * valueDecrease, int * sequenceDecrease);
|
|
70
|
+
/** Parametrics
|
|
71
|
+
This is an initial slow version.
|
|
72
|
+
The code uses current bounds + theta * change (if change array not NULL)
|
|
73
|
+
and similarly for objective.
|
|
74
|
+
It starts at startingTheta and returns ending theta in endingTheta.
|
|
75
|
+
If reportIncrement 0.0 it will report on any movement
|
|
76
|
+
If reportIncrement >0.0 it will report at startingTheta+k*reportIncrement.
|
|
77
|
+
If it can not reach input endingTheta return code will be 1 for infeasible,
|
|
78
|
+
2 for unbounded, if error on ranges -1, otherwise 0.
|
|
79
|
+
Normal report is just theta and objective but
|
|
80
|
+
if event handler exists it may do more
|
|
81
|
+
On exit endingTheta is maximum reached (can be used for next startingTheta)
|
|
82
|
+
*/
|
|
83
|
+
int parametrics(double startingTheta, double & endingTheta, double reportIncrement,
|
|
84
|
+
const double * changeLowerBound, const double * changeUpperBound,
|
|
85
|
+
const double * changeLowerRhs, const double * changeUpperRhs,
|
|
86
|
+
const double * changeObjective);
|
|
87
|
+
/** Version of parametrics which reads from file
|
|
88
|
+
See CbcClpParam.cpp for details of format
|
|
89
|
+
Returns -2 if unable to open file */
|
|
90
|
+
int parametrics(const char * dataFile);
|
|
91
|
+
/** Parametrics
|
|
92
|
+
This is an initial slow version.
|
|
93
|
+
The code uses current bounds + theta * change (if change array not NULL)
|
|
94
|
+
It starts at startingTheta and returns ending theta in endingTheta.
|
|
95
|
+
If it can not reach input endingTheta return code will be 1 for infeasible,
|
|
96
|
+
2 for unbounded, if error on ranges -1, otherwise 0.
|
|
97
|
+
Event handler may do more
|
|
98
|
+
On exit endingTheta is maximum reached (can be used for next startingTheta)
|
|
99
|
+
*/
|
|
100
|
+
int parametrics(double startingTheta, double & endingTheta,
|
|
101
|
+
const double * changeLowerBound, const double * changeUpperBound,
|
|
102
|
+
const double * changeLowerRhs, const double * changeUpperRhs);
|
|
103
|
+
int parametricsObj(double startingTheta, double & endingTheta,
|
|
104
|
+
const double * changeObjective);
|
|
105
|
+
/// Finds best possible pivot
|
|
106
|
+
double bestPivot(bool justColumns=false);
|
|
107
|
+
typedef struct {
|
|
108
|
+
double startingTheta;
|
|
109
|
+
double endingTheta;
|
|
110
|
+
double maxTheta;
|
|
111
|
+
double acceptableMaxTheta; // if this far then within tolerances
|
|
112
|
+
double * lowerChange; // full array of lower bound changes
|
|
113
|
+
int * lowerList; // list of lower bound changes
|
|
114
|
+
double * upperChange; // full array of upper bound changes
|
|
115
|
+
int * upperList; // list of upper bound changes
|
|
116
|
+
char * markDone; // mark which ones looked at
|
|
117
|
+
int * backwardBasic; // from sequence to pivot row
|
|
118
|
+
int * lowerActive;
|
|
119
|
+
double * lowerGap;
|
|
120
|
+
double * lowerCoefficient;
|
|
121
|
+
int * upperActive;
|
|
122
|
+
double * upperGap;
|
|
123
|
+
double * upperCoefficient;
|
|
124
|
+
int unscaledChangesOffset;
|
|
125
|
+
bool firstIteration; // so can update rhs for accuracy
|
|
126
|
+
} parametricsData;
|
|
127
|
+
|
|
128
|
+
private:
|
|
129
|
+
/** Parametrics - inner loop
|
|
130
|
+
This first attempt is when reportIncrement non zero and may
|
|
131
|
+
not report endingTheta correctly
|
|
132
|
+
If it can not reach input endingTheta return code will be 1 for infeasible,
|
|
133
|
+
2 for unbounded, otherwise 0.
|
|
134
|
+
Normal report is just theta and objective but
|
|
135
|
+
if event handler exists it may do more
|
|
136
|
+
*/
|
|
137
|
+
int parametricsLoop(parametricsData & paramData, double reportIncrement,
|
|
138
|
+
const double * changeLower, const double * changeUpper,
|
|
139
|
+
const double * changeObjective, ClpDataSave & data,
|
|
140
|
+
bool canTryQuick);
|
|
141
|
+
int parametricsLoop(parametricsData & paramData,
|
|
142
|
+
ClpDataSave & data,bool canSkipFactorization=false);
|
|
143
|
+
int parametricsObjLoop(parametricsData & paramData,
|
|
144
|
+
ClpDataSave & data,bool canSkipFactorization=false);
|
|
145
|
+
/** Refactorizes if necessary
|
|
146
|
+
Checks if finished. Updates status.
|
|
147
|
+
|
|
148
|
+
type - 0 initial so set up save arrays etc
|
|
149
|
+
- 1 normal -if good update save
|
|
150
|
+
- 2 restoring from saved
|
|
151
|
+
*/
|
|
152
|
+
void statusOfProblemInParametrics(int type, ClpDataSave & saveData);
|
|
153
|
+
void statusOfProblemInParametricsObj(int type, ClpDataSave & saveData);
|
|
154
|
+
/** This has the flow between re-factorizations
|
|
155
|
+
|
|
156
|
+
Reasons to come out:
|
|
157
|
+
-1 iterations etc
|
|
158
|
+
-2 inaccuracy
|
|
159
|
+
-3 slight inaccuracy (and done iterations)
|
|
160
|
+
+0 looks optimal (might be unbounded - but we will investigate)
|
|
161
|
+
+1 looks infeasible
|
|
162
|
+
+3 max iterations
|
|
163
|
+
*/
|
|
164
|
+
int whileIterating(parametricsData & paramData, double reportIncrement,
|
|
165
|
+
const double * changeObjective);
|
|
166
|
+
/** Computes next theta and says if objective or bounds (0= bounds, 1 objective, -1 none).
|
|
167
|
+
theta is in theta_.
|
|
168
|
+
type 1 bounds, 2 objective, 3 both.
|
|
169
|
+
*/
|
|
170
|
+
int nextTheta(int type, double maxTheta, parametricsData & paramData,
|
|
171
|
+
const double * changeObjective);
|
|
172
|
+
int whileIteratingObj(parametricsData & paramData);
|
|
173
|
+
int nextThetaObj(double maxTheta, parametricsData & paramData);
|
|
174
|
+
/// Restores bound to original bound
|
|
175
|
+
void originalBound(int iSequence, double theta, const double * changeLower,
|
|
176
|
+
const double * changeUpper);
|
|
177
|
+
/// Compute new rowLower_ etc (return negative if infeasible - otherwise largest change)
|
|
178
|
+
double computeRhsEtc(parametricsData & paramData);
|
|
179
|
+
/// Redo lower_ from rowLower_ etc
|
|
180
|
+
void redoInternalArrays();
|
|
181
|
+
/**
|
|
182
|
+
Row array has row part of pivot row
|
|
183
|
+
Column array has column part.
|
|
184
|
+
This is used in dual ranging
|
|
185
|
+
*/
|
|
186
|
+
void checkDualRatios(CoinIndexedVector * rowArray,
|
|
187
|
+
CoinIndexedVector * columnArray,
|
|
188
|
+
double & costIncrease, int & sequenceIncrease, double & alphaIncrease,
|
|
189
|
+
double & costDecrease, int & sequenceDecrease, double & alphaDecrease);
|
|
190
|
+
/**
|
|
191
|
+
Row array has pivot column
|
|
192
|
+
This is used in primal ranging
|
|
193
|
+
*/
|
|
194
|
+
void checkPrimalRatios(CoinIndexedVector * rowArray,
|
|
195
|
+
int direction);
|
|
196
|
+
/// Returns new value of whichOther when whichIn enters basis
|
|
197
|
+
double primalRanging1(int whichIn, int whichOther);
|
|
198
|
+
|
|
199
|
+
public:
|
|
200
|
+
/** Write the basis in MPS format to the specified file.
|
|
201
|
+
If writeValues true writes values of structurals
|
|
202
|
+
(and adds VALUES to end of NAME card)
|
|
203
|
+
|
|
204
|
+
Row and column names may be null.
|
|
205
|
+
formatType is
|
|
206
|
+
<ul>
|
|
207
|
+
<li> 0 - normal
|
|
208
|
+
<li> 1 - extra accuracy
|
|
209
|
+
<li> 2 - IEEE hex (later)
|
|
210
|
+
</ul>
|
|
211
|
+
|
|
212
|
+
Returns non-zero on I/O error
|
|
213
|
+
*/
|
|
214
|
+
int writeBasis(const char *filename,
|
|
215
|
+
bool writeValues = false,
|
|
216
|
+
int formatType = 0) const;
|
|
217
|
+
/// Read a basis from the given filename
|
|
218
|
+
int readBasis(const char *filename);
|
|
219
|
+
/** Creates dual of a problem if looks plausible
|
|
220
|
+
(defaults will always create model)
|
|
221
|
+
fractionRowRanges is fraction of rows allowed to have ranges
|
|
222
|
+
fractionColumnRanges is fraction of columns allowed to have ranges
|
|
223
|
+
*/
|
|
224
|
+
ClpSimplex * dualOfModel(double fractionRowRanges = 1.0, double fractionColumnRanges = 1.0) const;
|
|
225
|
+
/** Restores solution from dualized problem
|
|
226
|
+
non-zero return code indicates minor problems
|
|
227
|
+
*/
|
|
228
|
+
int restoreFromDual(const ClpSimplex * dualProblem,
|
|
229
|
+
bool checkAccuracy=false);
|
|
230
|
+
/** Sets solution in dualized problem
|
|
231
|
+
non-zero return code indicates minor problems
|
|
232
|
+
*/
|
|
233
|
+
int setInDual(ClpSimplex * dualProblem);
|
|
234
|
+
/** Does very cursory presolve.
|
|
235
|
+
rhs is numberRows, whichRows is 3*numberRows and whichColumns is 2*numberColumns.
|
|
236
|
+
*/
|
|
237
|
+
ClpSimplex * crunch(double * rhs, int * whichRows, int * whichColumns,
|
|
238
|
+
int & nBound, bool moreBounds = false, bool tightenBounds = false);
|
|
239
|
+
/** After very cursory presolve.
|
|
240
|
+
rhs is numberRows, whichRows is 3*numberRows and whichColumns is 2*numberColumns.
|
|
241
|
+
*/
|
|
242
|
+
void afterCrunch(const ClpSimplex & small,
|
|
243
|
+
const int * whichRows, const int * whichColumns,
|
|
244
|
+
int nBound);
|
|
245
|
+
/** Returns gub version of model or NULL
|
|
246
|
+
whichRows has to be numberRows
|
|
247
|
+
whichColumns has to be numberRows+numberColumns */
|
|
248
|
+
ClpSimplex * gubVersion(int * whichRows, int * whichColumns,
|
|
249
|
+
int neededGub,
|
|
250
|
+
int factorizationFrequency=50);
|
|
251
|
+
/// Sets basis from original
|
|
252
|
+
void setGubBasis(ClpSimplex &original,const int * whichRows,
|
|
253
|
+
const int * whichColumns);
|
|
254
|
+
/// Restores basis to original
|
|
255
|
+
void getGubBasis(ClpSimplex &original,const int * whichRows,
|
|
256
|
+
const int * whichColumns) const;
|
|
257
|
+
/// Quick try at cleaning up duals if postsolve gets wrong
|
|
258
|
+
void cleanupAfterPostsolve();
|
|
259
|
+
/** Tightens integer bounds - returns number tightened or -1 if infeasible
|
|
260
|
+
*/
|
|
261
|
+
int tightenIntegerBounds(double * rhsSpace);
|
|
262
|
+
/** Expands out all possible combinations for a knapsack
|
|
263
|
+
If buildObj NULL then just computes space needed - returns number elements
|
|
264
|
+
On entry numberOutput is maximum allowed, on exit it is number needed or
|
|
265
|
+
-1 (as will be number elements) if maximum exceeded. numberOutput will have at
|
|
266
|
+
least space to return values which reconstruct input.
|
|
267
|
+
Rows returned will be original rows but no entries will be returned for
|
|
268
|
+
any rows all of whose entries are in knapsack. So up to user to allow for this.
|
|
269
|
+
If reConstruct >=0 then returns number of entrie which make up item "reConstruct"
|
|
270
|
+
in expanded knapsack. Values in buildRow and buildElement;
|
|
271
|
+
*/
|
|
272
|
+
int expandKnapsack(int knapsackRow, int & numberOutput,
|
|
273
|
+
double * buildObj, CoinBigIndex * buildStart,
|
|
274
|
+
int * buildRow, double * buildElement, int reConstruct = -1) const;
|
|
275
|
+
//@}
|
|
276
|
+
};
|
|
277
|
+
#endif
|