ruby-cbc 0.1.9 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/Rakefile +0 -2
- data/lib/ruby-cbc.rb +1 -1
- data/lib/ruby-cbc/problem.rb +6 -8
- data/lib/ruby-cbc/version.rb +1 -1
- data/ruby-cbc.gemspec +3 -2
- metadata +17 -287
- data/ext/ruby-cbc/cbc.i +0 -15
- data/ext/ruby-cbc/cbc_wrap.c +0 -4618
- data/ext/ruby-cbc/extconf.rb +0 -60
- 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 +0 -24
- data/ext/ruby-cbc/install/include/coin/CbcBranchAllDifferent.hpp +0 -62
- data/ext/ruby-cbc/install/include/coin/CbcBranchBase.hpp +0 -78
- data/ext/ruby-cbc/install/include/coin/CbcBranchCut.hpp +0 -183
- data/ext/ruby-cbc/install/include/coin/CbcBranchDecision.hpp +0 -129
- data/ext/ruby-cbc/install/include/coin/CbcBranchDefaultDecision.hpp +0 -100
- data/ext/ruby-cbc/install/include/coin/CbcBranchDynamic.hpp +0 -206
- data/ext/ruby-cbc/install/include/coin/CbcBranchLotsize.hpp +0 -242
- data/ext/ruby-cbc/install/include/coin/CbcBranchToFixLots.hpp +0 -94
- data/ext/ruby-cbc/install/include/coin/CbcBranchingObject.hpp +0 -236
- data/ext/ruby-cbc/install/include/coin/CbcClique.hpp +0 -303
- data/ext/ruby-cbc/install/include/coin/CbcCompare.hpp +0 -39
- data/ext/ruby-cbc/install/include/coin/CbcCompareActual.hpp +0 -14
- data/ext/ruby-cbc/install/include/coin/CbcCompareBase.hpp +0 -142
- data/ext/ruby-cbc/install/include/coin/CbcCompareDefault.hpp +0 -120
- data/ext/ruby-cbc/install/include/coin/CbcCompareDepth.hpp +0 -47
- data/ext/ruby-cbc/install/include/coin/CbcCompareEstimate.hpp +0 -48
- data/ext/ruby-cbc/install/include/coin/CbcCompareObjective.hpp +0 -49
- data/ext/ruby-cbc/install/include/coin/CbcConfig.h +0 -14
- data/ext/ruby-cbc/install/include/coin/CbcConsequence.hpp +0 -49
- data/ext/ruby-cbc/install/include/coin/CbcCountRowCut.hpp +0 -168
- data/ext/ruby-cbc/install/include/coin/CbcCutGenerator.hpp +0 -482
- data/ext/ruby-cbc/install/include/coin/CbcCutModifier.hpp +0 -57
- data/ext/ruby-cbc/install/include/coin/CbcCutSubsetModifier.hpp +0 -66
- data/ext/ruby-cbc/install/include/coin/CbcDummyBranchingObject.hpp +0 -83
- data/ext/ruby-cbc/install/include/coin/CbcEventHandler.hpp +0 -245
- data/ext/ruby-cbc/install/include/coin/CbcFathom.hpp +0 -137
- data/ext/ruby-cbc/install/include/coin/CbcFathomDynamicProgramming.hpp +0 -169
- data/ext/ruby-cbc/install/include/coin/CbcFeasibilityBase.hpp +0 -56
- data/ext/ruby-cbc/install/include/coin/CbcFixVariable.hpp +0 -67
- data/ext/ruby-cbc/install/include/coin/CbcFollowOn.hpp +0 -207
- data/ext/ruby-cbc/install/include/coin/CbcFullNodeInfo.hpp +0 -161
- data/ext/ruby-cbc/install/include/coin/CbcGeneral.hpp +0 -60
- data/ext/ruby-cbc/install/include/coin/CbcGeneralDepth.hpp +0 -279
- data/ext/ruby-cbc/install/include/coin/CbcHeuristic.hpp +0 -682
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDINS.hpp +0 -96
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDW.hpp +0 -309
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDive.hpp +0 -192
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveCoefficient.hpp +0 -52
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveFractional.hpp +0 -52
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveGuided.hpp +0 -55
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveLineSearch.hpp +0 -52
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDivePseudoCost.hpp +0 -60
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicDiveVectorLength.hpp +0 -52
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicFPump.hpp +0 -340
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicGreedy.hpp +0 -280
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicLocal.hpp +0 -271
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicPivotAndFix.hpp +0 -58
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRENS.hpp +0 -77
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRINS.hpp +0 -102
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicRandRound.hpp +0 -58
- data/ext/ruby-cbc/install/include/coin/CbcHeuristicVND.hpp +0 -94
- data/ext/ruby-cbc/install/include/coin/CbcLinked.hpp +0 -1406
- data/ext/ruby-cbc/install/include/coin/CbcMessage.hpp +0 -94
- data/ext/ruby-cbc/install/include/coin/CbcMipStartIO.hpp +0 -26
- data/ext/ruby-cbc/install/include/coin/CbcModel.hpp +0 -2952
- data/ext/ruby-cbc/install/include/coin/CbcNWay.hpp +0 -166
- data/ext/ruby-cbc/install/include/coin/CbcNode.hpp +0 -351
- data/ext/ruby-cbc/install/include/coin/CbcNodeInfo.hpp +0 -349
- data/ext/ruby-cbc/install/include/coin/CbcObject.hpp +0 -272
- data/ext/ruby-cbc/install/include/coin/CbcObjectUpdateData.hpp +0 -64
- data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.cpp +0 -4134
- data/ext/ruby-cbc/install/include/coin/CbcOrClpParam.hpp +0 -532
- data/ext/ruby-cbc/install/include/coin/CbcParam.hpp +0 -324
- data/ext/ruby-cbc/install/include/coin/CbcPartialNodeInfo.hpp +0 -110
- data/ext/ruby-cbc/install/include/coin/CbcSOS.hpp +0 -279
- data/ext/ruby-cbc/install/include/coin/CbcSimpleInteger.hpp +0 -286
- data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerDynamicPseudoCost.hpp +0 -564
- data/ext/ruby-cbc/install/include/coin/CbcSimpleIntegerPseudoCost.hpp +0 -114
- data/ext/ruby-cbc/install/include/coin/CbcSolver.hpp +0 -447
- data/ext/ruby-cbc/install/include/coin/CbcStrategy.hpp +0 -258
- data/ext/ruby-cbc/install/include/coin/CbcSubProblem.hpp +0 -83
- data/ext/ruby-cbc/install/include/coin/CbcTree.hpp +0 -490
- data/ext/ruby-cbc/install/include/coin/CbcTreeLocal.hpp +0 -372
- data/ext/ruby-cbc/install/include/coin/Cbc_C_Interface.h +0 -381
- data/ext/ruby-cbc/install/include/coin/Cgl012cut.hpp +0 -464
- data/ext/ruby-cbc/install/include/coin/CglAllDifferent.hpp +0 -115
- data/ext/ruby-cbc/install/include/coin/CglClique.hpp +0 -308
- data/ext/ruby-cbc/install/include/coin/CglConfig.h +0 -19
- data/ext/ruby-cbc/install/include/coin/CglCutGenerator.hpp +0 -121
- data/ext/ruby-cbc/install/include/coin/CglDuplicateRow.hpp +0 -189
- data/ext/ruby-cbc/install/include/coin/CglFlowCover.hpp +0 -371
- data/ext/ruby-cbc/install/include/coin/CglGMI.hpp +0 -364
- data/ext/ruby-cbc/install/include/coin/CglGMIParam.hpp +0 -313
- data/ext/ruby-cbc/install/include/coin/CglGomory.hpp +0 -204
- data/ext/ruby-cbc/install/include/coin/CglKnapsackCover.hpp +0 -310
- data/ext/ruby-cbc/install/include/coin/CglLandP.hpp +0 -306
- data/ext/ruby-cbc/install/include/coin/CglLandPValidator.hpp +0 -130
- data/ext/ruby-cbc/install/include/coin/CglLiftAndProject.hpp +0 -104
- data/ext/ruby-cbc/install/include/coin/CglMessage.hpp +0 -50
- data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding.hpp +0 -429
- data/ext/ruby-cbc/install/include/coin/CglMixedIntegerRounding2.hpp +0 -427
- data/ext/ruby-cbc/install/include/coin/CglOddHole.hpp +0 -160
- data/ext/ruby-cbc/install/include/coin/CglParam.hpp +0 -93
- data/ext/ruby-cbc/install/include/coin/CglPreProcess.hpp +0 -492
- data/ext/ruby-cbc/install/include/coin/CglProbing.hpp +0 -543
- data/ext/ruby-cbc/install/include/coin/CglRedSplit.hpp +0 -448
- data/ext/ruby-cbc/install/include/coin/CglRedSplit2.hpp +0 -494
- data/ext/ruby-cbc/install/include/coin/CglRedSplit2Param.hpp +0 -495
- data/ext/ruby-cbc/install/include/coin/CglRedSplitParam.hpp +0 -272
- data/ext/ruby-cbc/install/include/coin/CglResidualCapacity.hpp +0 -240
- data/ext/ruby-cbc/install/include/coin/CglSimpleRounding.hpp +0 -174
- data/ext/ruby-cbc/install/include/coin/CglStored.hpp +0 -125
- data/ext/ruby-cbc/install/include/coin/CglTreeInfo.hpp +0 -180
- data/ext/ruby-cbc/install/include/coin/CglTwomir.hpp +0 -565
- data/ext/ruby-cbc/install/include/coin/CglZeroHalf.hpp +0 -133
- data/ext/ruby-cbc/install/include/coin/ClpAmplObjective.hpp +0 -113
- data/ext/ruby-cbc/install/include/coin/ClpCholeskyBase.hpp +0 -294
- data/ext/ruby-cbc/install/include/coin/ClpCholeskyDense.hpp +0 -162
- data/ext/ruby-cbc/install/include/coin/ClpConfig.h +0 -17
- data/ext/ruby-cbc/install/include/coin/ClpConstraint.hpp +0 -125
- data/ext/ruby-cbc/install/include/coin/ClpConstraintAmpl.hpp +0 -108
- data/ext/ruby-cbc/install/include/coin/ClpConstraintLinear.hpp +0 -110
- data/ext/ruby-cbc/install/include/coin/ClpConstraintQuadratic.hpp +0 -119
- data/ext/ruby-cbc/install/include/coin/ClpDualRowDantzig.hpp +0 -71
- data/ext/ruby-cbc/install/include/coin/ClpDualRowPivot.hpp +0 -129
- data/ext/ruby-cbc/install/include/coin/ClpDualRowSteepest.hpp +0 -153
- data/ext/ruby-cbc/install/include/coin/ClpDummyMatrix.hpp +0 -183
- data/ext/ruby-cbc/install/include/coin/ClpDynamicExampleMatrix.hpp +0 -186
- data/ext/ruby-cbc/install/include/coin/ClpDynamicMatrix.hpp +0 -381
- data/ext/ruby-cbc/install/include/coin/ClpEventHandler.hpp +0 -187
- data/ext/ruby-cbc/install/include/coin/ClpFactorization.hpp +0 -432
- data/ext/ruby-cbc/install/include/coin/ClpGubDynamicMatrix.hpp +0 -247
- data/ext/ruby-cbc/install/include/coin/ClpGubMatrix.hpp +0 -358
- data/ext/ruby-cbc/install/include/coin/ClpInterior.hpp +0 -570
- data/ext/ruby-cbc/install/include/coin/ClpLinearObjective.hpp +0 -103
- data/ext/ruby-cbc/install/include/coin/ClpMatrixBase.hpp +0 -524
- data/ext/ruby-cbc/install/include/coin/ClpMessage.hpp +0 -131
- data/ext/ruby-cbc/install/include/coin/ClpModel.hpp +0 -1307
- data/ext/ruby-cbc/install/include/coin/ClpNetworkMatrix.hpp +0 -229
- data/ext/ruby-cbc/install/include/coin/ClpNode.hpp +0 -349
- data/ext/ruby-cbc/install/include/coin/ClpNonLinearCost.hpp +0 -401
- data/ext/ruby-cbc/install/include/coin/ClpObjective.hpp +0 -134
- data/ext/ruby-cbc/install/include/coin/ClpPackedMatrix.hpp +0 -638
- data/ext/ruby-cbc/install/include/coin/ClpParameters.hpp +0 -126
- data/ext/ruby-cbc/install/include/coin/ClpPdcoBase.hpp +0 -103
- data/ext/ruby-cbc/install/include/coin/ClpPlusMinusOneMatrix.hpp +0 -290
- data/ext/ruby-cbc/install/include/coin/ClpPresolve.hpp +0 -299
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnDantzig.hpp +0 -72
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnPivot.hpp +0 -155
- data/ext/ruby-cbc/install/include/coin/ClpPrimalColumnSteepest.hpp +0 -247
- data/ext/ruby-cbc/install/include/coin/ClpQuadraticObjective.hpp +0 -155
- data/ext/ruby-cbc/install/include/coin/ClpSimplex.hpp +0 -1797
- data/ext/ruby-cbc/install/include/coin/ClpSimplexDual.hpp +0 -300
- data/ext/ruby-cbc/install/include/coin/ClpSimplexNonlinear.hpp +0 -117
- data/ext/ruby-cbc/install/include/coin/ClpSimplexOther.hpp +0 -277
- data/ext/ruby-cbc/install/include/coin/ClpSimplexPrimal.hpp +0 -244
- data/ext/ruby-cbc/install/include/coin/ClpSolve.hpp +0 -446
- data/ext/ruby-cbc/install/include/coin/Clp_C_Interface.h +0 -525
- data/ext/ruby-cbc/install/include/coin/CoinAlloc.hpp +0 -176
- data/ext/ruby-cbc/install/include/coin/CoinBuild.hpp +0 -149
- data/ext/ruby-cbc/install/include/coin/CoinDenseFactorization.hpp +0 -419
- data/ext/ruby-cbc/install/include/coin/CoinDenseVector.hpp +0 -383
- data/ext/ruby-cbc/install/include/coin/CoinDistance.hpp +0 -48
- data/ext/ruby-cbc/install/include/coin/CoinError.hpp +0 -257
- data/ext/ruby-cbc/install/include/coin/CoinFactorization.hpp +0 -2044
- data/ext/ruby-cbc/install/include/coin/CoinFileIO.hpp +0 -166
- data/ext/ruby-cbc/install/include/coin/CoinFinite.hpp +0 -34
- data/ext/ruby-cbc/install/include/coin/CoinFloatEqual.hpp +0 -177
- data/ext/ruby-cbc/install/include/coin/CoinHelperFunctions.hpp +0 -1111
- data/ext/ruby-cbc/install/include/coin/CoinIndexedVector.hpp +0 -1164
- data/ext/ruby-cbc/install/include/coin/CoinLpIO.hpp +0 -805
- data/ext/ruby-cbc/install/include/coin/CoinMessage.hpp +0 -96
- data/ext/ruby-cbc/install/include/coin/CoinMessageHandler.hpp +0 -666
- data/ext/ruby-cbc/install/include/coin/CoinModel.hpp +0 -1054
- data/ext/ruby-cbc/install/include/coin/CoinModelUseful.hpp +0 -441
- data/ext/ruby-cbc/install/include/coin/CoinMpsIO.hpp +0 -1056
- data/ext/ruby-cbc/install/include/coin/CoinOslFactorization.hpp +0 -280
- data/ext/ruby-cbc/install/include/coin/CoinPackedMatrix.hpp +0 -947
- data/ext/ruby-cbc/install/include/coin/CoinPackedVector.hpp +0 -657
- data/ext/ruby-cbc/install/include/coin/CoinPackedVectorBase.hpp +0 -269
- data/ext/ruby-cbc/install/include/coin/CoinParam.hpp +0 -644
- data/ext/ruby-cbc/install/include/coin/CoinPragma.hpp +0 -26
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDoubleton.hpp +0 -73
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDual.hpp +0 -85
- data/ext/ruby-cbc/install/include/coin/CoinPresolveDupcol.hpp +0 -226
- data/ext/ruby-cbc/install/include/coin/CoinPresolveEmpty.hpp +0 -116
- data/ext/ruby-cbc/install/include/coin/CoinPresolveFixed.hpp +0 -181
- data/ext/ruby-cbc/install/include/coin/CoinPresolveForcing.hpp +0 -61
- data/ext/ruby-cbc/install/include/coin/CoinPresolveImpliedFree.hpp +0 -60
- data/ext/ruby-cbc/install/include/coin/CoinPresolveIsolated.hpp +0 -51
- data/ext/ruby-cbc/install/include/coin/CoinPresolveMatrix.hpp +0 -1842
- data/ext/ruby-cbc/install/include/coin/CoinPresolveMonitor.hpp +0 -105
- data/ext/ruby-cbc/install/include/coin/CoinPresolvePsdebug.hpp +0 -166
- data/ext/ruby-cbc/install/include/coin/CoinPresolveSingleton.hpp +0 -112
- data/ext/ruby-cbc/install/include/coin/CoinPresolveSubst.hpp +0 -101
- data/ext/ruby-cbc/install/include/coin/CoinPresolveTighten.hpp +0 -55
- data/ext/ruby-cbc/install/include/coin/CoinPresolveTripleton.hpp +0 -66
- data/ext/ruby-cbc/install/include/coin/CoinPresolveUseless.hpp +0 -63
- data/ext/ruby-cbc/install/include/coin/CoinPresolveZeros.hpp +0 -60
- data/ext/ruby-cbc/install/include/coin/CoinRational.hpp +0 -44
- data/ext/ruby-cbc/install/include/coin/CoinSearchTree.hpp +0 -465
- data/ext/ruby-cbc/install/include/coin/CoinShallowPackedVector.hpp +0 -148
- data/ext/ruby-cbc/install/include/coin/CoinSignal.hpp +0 -117
- data/ext/ruby-cbc/install/include/coin/CoinSimpFactorization.hpp +0 -431
- data/ext/ruby-cbc/install/include/coin/CoinSmartPtr.hpp +0 -528
- data/ext/ruby-cbc/install/include/coin/CoinSnapshot.hpp +0 -476
- data/ext/ruby-cbc/install/include/coin/CoinSort.hpp +0 -678
- data/ext/ruby-cbc/install/include/coin/CoinStructuredModel.hpp +0 -247
- data/ext/ruby-cbc/install/include/coin/CoinTime.hpp +0 -310
- data/ext/ruby-cbc/install/include/coin/CoinTypes.hpp +0 -64
- data/ext/ruby-cbc/install/include/coin/CoinUtility.hpp +0 -19
- data/ext/ruby-cbc/install/include/coin/CoinUtilsConfig.h +0 -34
- data/ext/ruby-cbc/install/include/coin/CoinWarmStart.hpp +0 -58
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartBasis.hpp +0 -456
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartDual.hpp +0 -166
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartPrimalDual.hpp +0 -211
- data/ext/ruby-cbc/install/include/coin/CoinWarmStartVector.hpp +0 -488
- data/ext/ruby-cbc/install/include/coin/Coin_C_defines.h +0 -115
- data/ext/ruby-cbc/install/include/coin/Idiot.hpp +0 -298
- data/ext/ruby-cbc/install/include/coin/OsiAuxInfo.hpp +0 -206
- data/ext/ruby-cbc/install/include/coin/OsiBranchingObject.hpp +0 -1005
- data/ext/ruby-cbc/install/include/coin/OsiCbcSolverInterface.hpp +0 -764
- data/ext/ruby-cbc/install/include/coin/OsiChooseVariable.hpp +0 -534
- data/ext/ruby-cbc/install/include/coin/OsiClpSolverInterface.hpp +0 -1509
- data/ext/ruby-cbc/install/include/coin/OsiColCut.hpp +0 -324
- data/ext/ruby-cbc/install/include/coin/OsiCollections.hpp +0 -35
- data/ext/ruby-cbc/install/include/coin/OsiConfig.h +0 -19
- data/ext/ruby-cbc/install/include/coin/OsiCut.hpp +0 -245
- data/ext/ruby-cbc/install/include/coin/OsiCuts.hpp +0 -474
- data/ext/ruby-cbc/install/include/coin/OsiPresolve.hpp +0 -252
- data/ext/ruby-cbc/install/include/coin/OsiRowCut.hpp +0 -331
- data/ext/ruby-cbc/install/include/coin/OsiRowCutDebugger.hpp +0 -187
- data/ext/ruby-cbc/install/include/coin/OsiSolverBranch.hpp +0 -152
- data/ext/ruby-cbc/install/include/coin/OsiSolverInterface.hpp +0 -2143
- data/ext/ruby-cbc/install/include/coin/OsiSolverParameters.hpp +0 -142
- data/ext/ruby-cbc/install/include/coin/OsiUnitTests.hpp +0 -374
- data/ext/ruby-cbc/install/lib/libCbc.la +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -35
- 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 +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/cgl.pc +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/clp.pc +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/coindatamiplib3.pc +0 -9
- data/ext/ruby-cbc/install/lib/pkgconfig/coindatasample.pc +0 -9
- data/ext/ruby-cbc/install/lib/pkgconfig/coinutils.pc +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-cbc.pc +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-clp.pc +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/osi-unittests.pc +0 -12
- data/ext/ruby-cbc/install/lib/pkgconfig/osi.pc +0 -12
@@ -1,441 +0,0 @@
|
|
1
|
-
/* $Id: CoinModelUseful.hpp 1416 2011-04-17 09:57:29Z stefan $ */
|
2
|
-
// Copyright (C) 2005, 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
|
-
#ifndef CoinModelUseful_H
|
7
|
-
#define CoinModelUseful_H
|
8
|
-
|
9
|
-
|
10
|
-
#include <cstdlib>
|
11
|
-
#include <cmath>
|
12
|
-
#include <cassert>
|
13
|
-
#include <cfloat>
|
14
|
-
#include <cstring>
|
15
|
-
#include <cstdio>
|
16
|
-
#include <iostream>
|
17
|
-
|
18
|
-
|
19
|
-
#include "CoinPragma.hpp"
|
20
|
-
|
21
|
-
/**
|
22
|
-
This is for various structures/classes needed by CoinModel.
|
23
|
-
|
24
|
-
CoinModelLink
|
25
|
-
CoinModelLinkedList
|
26
|
-
CoinModelHash
|
27
|
-
*/
|
28
|
-
/// for going through row or column
|
29
|
-
|
30
|
-
class CoinModelLink {
|
31
|
-
|
32
|
-
public:
|
33
|
-
/**@name Constructors, destructor */
|
34
|
-
//@{
|
35
|
-
/** Default constructor. */
|
36
|
-
CoinModelLink();
|
37
|
-
/** Destructor */
|
38
|
-
~CoinModelLink();
|
39
|
-
//@}
|
40
|
-
|
41
|
-
/**@name Copy method */
|
42
|
-
//@{
|
43
|
-
/** The copy constructor. */
|
44
|
-
CoinModelLink(const CoinModelLink&);
|
45
|
-
/// =
|
46
|
-
CoinModelLink& operator=(const CoinModelLink&);
|
47
|
-
//@}
|
48
|
-
|
49
|
-
/**@name Sets and gets method */
|
50
|
-
//@{
|
51
|
-
/// Get row
|
52
|
-
inline int row() const
|
53
|
-
{ return row_;}
|
54
|
-
/// Get column
|
55
|
-
inline int column() const
|
56
|
-
{ return column_;}
|
57
|
-
/// Get value
|
58
|
-
inline double value() const
|
59
|
-
{ return value_;}
|
60
|
-
/// Get value
|
61
|
-
inline double element() const
|
62
|
-
{ return value_;}
|
63
|
-
/// Get position
|
64
|
-
inline int position() const
|
65
|
-
{ return position_;}
|
66
|
-
/// Get onRow
|
67
|
-
inline bool onRow() const
|
68
|
-
{ return onRow_;}
|
69
|
-
/// Set row
|
70
|
-
inline void setRow(int row)
|
71
|
-
{ row_=row;}
|
72
|
-
/// Set column
|
73
|
-
inline void setColumn(int column)
|
74
|
-
{ column_=column;}
|
75
|
-
/// Set value
|
76
|
-
inline void setValue(double value)
|
77
|
-
{ value_=value;}
|
78
|
-
/// Set value
|
79
|
-
inline void setElement(double value)
|
80
|
-
{ value_=value;}
|
81
|
-
/// Set position
|
82
|
-
inline void setPosition(int position)
|
83
|
-
{ position_=position;}
|
84
|
-
/// Set onRow
|
85
|
-
inline void setOnRow(bool onRow)
|
86
|
-
{ onRow_=onRow;}
|
87
|
-
//@}
|
88
|
-
|
89
|
-
private:
|
90
|
-
/**@name Data members */
|
91
|
-
//@{
|
92
|
-
/// Row
|
93
|
-
int row_;
|
94
|
-
/// Column
|
95
|
-
int column_;
|
96
|
-
/// Value as double
|
97
|
-
double value_;
|
98
|
-
/// Position in data
|
99
|
-
int position_;
|
100
|
-
/// If on row chain
|
101
|
-
bool onRow_;
|
102
|
-
//@}
|
103
|
-
};
|
104
|
-
|
105
|
-
/// for linked lists
|
106
|
-
// for specifying triple
|
107
|
-
typedef struct {
|
108
|
-
// top bit is nonzero if string
|
109
|
-
// rest is row
|
110
|
-
unsigned int row;
|
111
|
-
//CoinModelRowIndex row;
|
112
|
-
int column;
|
113
|
-
double value; // If string then index into strings
|
114
|
-
} CoinModelTriple;
|
115
|
-
inline int rowInTriple(const CoinModelTriple & triple)
|
116
|
-
{ return triple.row&0x7fffffff;}
|
117
|
-
inline void setRowInTriple(CoinModelTriple & triple,int iRow)
|
118
|
-
{ triple.row = iRow|(triple.row&0x80000000);}
|
119
|
-
inline bool stringInTriple(const CoinModelTriple & triple)
|
120
|
-
{ return (triple.row&0x80000000)!=0;}
|
121
|
-
inline void setStringInTriple(CoinModelTriple & triple,bool string)
|
122
|
-
{ triple.row = (string ? 0x80000000 : 0)|(triple.row&0x7fffffff);}
|
123
|
-
inline void setRowAndStringInTriple(CoinModelTriple & triple,
|
124
|
-
int iRow,bool string)
|
125
|
-
{ triple.row = (string ? 0x80000000 : 0)|iRow;}
|
126
|
-
/// for names and hashing
|
127
|
-
// for hashing
|
128
|
-
typedef struct {
|
129
|
-
int index, next;
|
130
|
-
} CoinModelHashLink;
|
131
|
-
|
132
|
-
/* Function type. */
|
133
|
-
typedef double (*func_t) (double);
|
134
|
-
|
135
|
-
/// For string evaluation
|
136
|
-
/* Data type for links in the chain of symbols. */
|
137
|
-
struct symrec
|
138
|
-
{
|
139
|
-
char *name; /* name of symbol */
|
140
|
-
int type; /* type of symbol: either VAR or FNCT */
|
141
|
-
union
|
142
|
-
{
|
143
|
-
double var; /* value of a VAR */
|
144
|
-
func_t fnctptr; /* value of a FNCT */
|
145
|
-
} value;
|
146
|
-
struct symrec *next; /* link field */
|
147
|
-
};
|
148
|
-
|
149
|
-
typedef struct symrec symrec;
|
150
|
-
|
151
|
-
class CoinYacc {
|
152
|
-
private:
|
153
|
-
CoinYacc(const CoinYacc& rhs);
|
154
|
-
CoinYacc& operator=(const CoinYacc& rhs);
|
155
|
-
|
156
|
-
public:
|
157
|
-
CoinYacc() : symtable(NULL), symbuf(NULL), length(0), unsetValue(0) {}
|
158
|
-
~CoinYacc()
|
159
|
-
{
|
160
|
-
if (length) {
|
161
|
-
free(symbuf);
|
162
|
-
symbuf = NULL;
|
163
|
-
}
|
164
|
-
symrec* s = symtable;
|
165
|
-
while (s) {
|
166
|
-
free(s->name);
|
167
|
-
symtable = s;
|
168
|
-
s = s->next;
|
169
|
-
free(symtable);
|
170
|
-
}
|
171
|
-
}
|
172
|
-
|
173
|
-
public:
|
174
|
-
symrec * symtable;
|
175
|
-
char * symbuf;
|
176
|
-
int length;
|
177
|
-
double unsetValue;
|
178
|
-
};
|
179
|
-
|
180
|
-
class CoinModelHash {
|
181
|
-
|
182
|
-
public:
|
183
|
-
/**@name Constructors, destructor */
|
184
|
-
//@{
|
185
|
-
/** Default constructor. */
|
186
|
-
CoinModelHash();
|
187
|
-
/** Destructor */
|
188
|
-
~CoinModelHash();
|
189
|
-
//@}
|
190
|
-
|
191
|
-
/**@name Copy method */
|
192
|
-
//@{
|
193
|
-
/** The copy constructor. */
|
194
|
-
CoinModelHash(const CoinModelHash&);
|
195
|
-
/// =
|
196
|
-
CoinModelHash& operator=(const CoinModelHash&);
|
197
|
-
//@}
|
198
|
-
|
199
|
-
/**@name sizing (just increases) */
|
200
|
-
//@{
|
201
|
-
/// Resize hash (also re-hashs)
|
202
|
-
void resize(int maxItems,bool forceReHash=false);
|
203
|
-
/// Number of items i.e. rows if just row names
|
204
|
-
inline int numberItems() const
|
205
|
-
{ return numberItems_;}
|
206
|
-
/// Set number of items
|
207
|
-
void setNumberItems(int number);
|
208
|
-
/// Maximum number of items
|
209
|
-
inline int maximumItems() const
|
210
|
-
{ return maximumItems_;}
|
211
|
-
/// Names
|
212
|
-
inline const char *const * names() const
|
213
|
-
{ return names_;}
|
214
|
-
//@}
|
215
|
-
|
216
|
-
/**@name hashing */
|
217
|
-
//@{
|
218
|
-
/// Returns index or -1
|
219
|
-
int hash(const char * name) const;
|
220
|
-
/// Adds to hash
|
221
|
-
void addHash(int index, const char * name);
|
222
|
-
/// Deletes from hash
|
223
|
-
void deleteHash(int index);
|
224
|
-
/// Returns name at position (or NULL)
|
225
|
-
const char * name(int which) const;
|
226
|
-
/// Returns non const name at position (or NULL)
|
227
|
-
char * getName(int which) const;
|
228
|
-
/// Sets name at position (does not create)
|
229
|
-
void setName(int which,char * name ) ;
|
230
|
-
/// Validates
|
231
|
-
void validateHash() const;
|
232
|
-
private:
|
233
|
-
/// Returns a hash value
|
234
|
-
int hashValue(const char * name) const;
|
235
|
-
public:
|
236
|
-
//@}
|
237
|
-
private:
|
238
|
-
/**@name Data members */
|
239
|
-
//@{
|
240
|
-
/// Names
|
241
|
-
char ** names_;
|
242
|
-
/// hash
|
243
|
-
CoinModelHashLink * hash_;
|
244
|
-
/// Number of items
|
245
|
-
int numberItems_;
|
246
|
-
/// Maximum number of items
|
247
|
-
int maximumItems_;
|
248
|
-
/// Last slot looked at
|
249
|
-
int lastSlot_;
|
250
|
-
//@}
|
251
|
-
};
|
252
|
-
/// For int,int hashing
|
253
|
-
class CoinModelHash2 {
|
254
|
-
|
255
|
-
public:
|
256
|
-
/**@name Constructors, destructor */
|
257
|
-
//@{
|
258
|
-
/** Default constructor. */
|
259
|
-
CoinModelHash2();
|
260
|
-
/** Destructor */
|
261
|
-
~CoinModelHash2();
|
262
|
-
//@}
|
263
|
-
|
264
|
-
/**@name Copy method */
|
265
|
-
//@{
|
266
|
-
/** The copy constructor. */
|
267
|
-
CoinModelHash2(const CoinModelHash2&);
|
268
|
-
/// =
|
269
|
-
CoinModelHash2& operator=(const CoinModelHash2&);
|
270
|
-
//@}
|
271
|
-
|
272
|
-
/**@name sizing (just increases) */
|
273
|
-
//@{
|
274
|
-
/// Resize hash (also re-hashs)
|
275
|
-
void resize(int maxItems, const CoinModelTriple * triples,bool forceReHash=false);
|
276
|
-
/// Number of items
|
277
|
-
inline int numberItems() const
|
278
|
-
{ return numberItems_;}
|
279
|
-
/// Set number of items
|
280
|
-
void setNumberItems(int number);
|
281
|
-
/// Maximum number of items
|
282
|
-
inline int maximumItems() const
|
283
|
-
{ return maximumItems_;}
|
284
|
-
//@}
|
285
|
-
|
286
|
-
/**@name hashing */
|
287
|
-
//@{
|
288
|
-
/// Returns index or -1
|
289
|
-
int hash(int row, int column, const CoinModelTriple * triples) const;
|
290
|
-
/// Adds to hash
|
291
|
-
void addHash(int index, int row, int column, const CoinModelTriple * triples);
|
292
|
-
/// Deletes from hash
|
293
|
-
void deleteHash(int index, int row, int column);
|
294
|
-
private:
|
295
|
-
/// Returns a hash value
|
296
|
-
int hashValue(int row, int column) const;
|
297
|
-
public:
|
298
|
-
//@}
|
299
|
-
private:
|
300
|
-
/**@name Data members */
|
301
|
-
//@{
|
302
|
-
/// hash
|
303
|
-
CoinModelHashLink * hash_;
|
304
|
-
/// Number of items
|
305
|
-
int numberItems_;
|
306
|
-
/// Maximum number of items
|
307
|
-
int maximumItems_;
|
308
|
-
/// Last slot looked at
|
309
|
-
int lastSlot_;
|
310
|
-
//@}
|
311
|
-
};
|
312
|
-
class CoinModelLinkedList {
|
313
|
-
|
314
|
-
public:
|
315
|
-
/**@name Constructors, destructor */
|
316
|
-
//@{
|
317
|
-
/** Default constructor. */
|
318
|
-
CoinModelLinkedList();
|
319
|
-
/** Destructor */
|
320
|
-
~CoinModelLinkedList();
|
321
|
-
//@}
|
322
|
-
|
323
|
-
/**@name Copy method */
|
324
|
-
//@{
|
325
|
-
/** The copy constructor. */
|
326
|
-
CoinModelLinkedList(const CoinModelLinkedList&);
|
327
|
-
/// =
|
328
|
-
CoinModelLinkedList& operator=(const CoinModelLinkedList&);
|
329
|
-
//@}
|
330
|
-
|
331
|
-
/**@name sizing (just increases) */
|
332
|
-
//@{
|
333
|
-
/** Resize list - for row list maxMajor is maximum rows.
|
334
|
-
*/
|
335
|
-
void resize(int maxMajor,int maxElements);
|
336
|
-
/** Create list - for row list maxMajor is maximum rows.
|
337
|
-
type 0 row list, 1 column list
|
338
|
-
*/
|
339
|
-
void create(int maxMajor,int maxElements,
|
340
|
-
int numberMajor, int numberMinor,
|
341
|
-
int type,
|
342
|
-
int numberElements, const CoinModelTriple * triples);
|
343
|
-
/// Number of major items i.e. rows if just row links
|
344
|
-
inline int numberMajor() const
|
345
|
-
{ return numberMajor_;}
|
346
|
-
/// Maximum number of major items i.e. rows if just row links
|
347
|
-
inline int maximumMajor() const
|
348
|
-
{ return maximumMajor_;}
|
349
|
-
/// Number of elements
|
350
|
-
inline int numberElements() const
|
351
|
-
{ return numberElements_;}
|
352
|
-
/// Maximum number of elements
|
353
|
-
inline int maximumElements() const
|
354
|
-
{ return maximumElements_;}
|
355
|
-
/// First on free chain
|
356
|
-
inline int firstFree() const
|
357
|
-
{ return first_[maximumMajor_];}
|
358
|
-
/// Last on free chain
|
359
|
-
inline int lastFree() const
|
360
|
-
{ return last_[maximumMajor_];}
|
361
|
-
/// First on chain
|
362
|
-
inline int first(int which) const
|
363
|
-
{ return first_[which];}
|
364
|
-
/// Last on chain
|
365
|
-
inline int last(int which) const
|
366
|
-
{ return last_[which];}
|
367
|
-
/// Next array
|
368
|
-
inline const int * next() const
|
369
|
-
{ return next_;}
|
370
|
-
/// Previous array
|
371
|
-
inline const int * previous() const
|
372
|
-
{ return previous_;}
|
373
|
-
//@}
|
374
|
-
|
375
|
-
/**@name does work */
|
376
|
-
//@{
|
377
|
-
/** Adds to list - easy case i.e. add row to row list
|
378
|
-
Returns where chain starts
|
379
|
-
*/
|
380
|
-
int addEasy(int majorIndex, int numberOfElements, const int * indices,
|
381
|
-
const double * elements, CoinModelTriple * triples,
|
382
|
-
CoinModelHash2 & hash);
|
383
|
-
/** Adds to list - hard case i.e. add row to column list
|
384
|
-
*/
|
385
|
-
void addHard(int minorIndex, int numberOfElements, const int * indices,
|
386
|
-
const double * elements, CoinModelTriple * triples,
|
387
|
-
CoinModelHash2 & hash);
|
388
|
-
/** Adds to list - hard case i.e. add row to column list
|
389
|
-
This is when elements have been added to other copy
|
390
|
-
*/
|
391
|
-
void addHard(int first, const CoinModelTriple * triples,
|
392
|
-
int firstFree, int lastFree,const int * nextOther);
|
393
|
-
/** Deletes from list - same case i.e. delete row from row list
|
394
|
-
*/
|
395
|
-
void deleteSame(int which, CoinModelTriple * triples,
|
396
|
-
CoinModelHash2 & hash, bool zapTriples);
|
397
|
-
/** Deletes from list - other case i.e. delete row from column list
|
398
|
-
This is when elements have been deleted from other copy
|
399
|
-
*/
|
400
|
-
void updateDeleted(int which, CoinModelTriple * triples,
|
401
|
-
CoinModelLinkedList & otherList);
|
402
|
-
/** Deletes one element from Row list
|
403
|
-
*/
|
404
|
-
void deleteRowOne(int position, CoinModelTriple * triples,
|
405
|
-
CoinModelHash2 & hash);
|
406
|
-
/** Update column list for one element when
|
407
|
-
one element deleted from row copy
|
408
|
-
*/
|
409
|
-
void updateDeletedOne(int position, const CoinModelTriple * triples);
|
410
|
-
/// Fills first,last with -1
|
411
|
-
void fill(int first,int last);
|
412
|
-
/** Puts in free list from other list */
|
413
|
-
void synchronize(CoinModelLinkedList & other);
|
414
|
-
/// Checks that links are consistent
|
415
|
-
void validateLinks(const CoinModelTriple * triples) const;
|
416
|
-
//@}
|
417
|
-
private:
|
418
|
-
/**@name Data members */
|
419
|
-
//@{
|
420
|
-
/// Previous - maximumElements long
|
421
|
-
int * previous_;
|
422
|
-
/// Next - maximumElements long
|
423
|
-
int * next_;
|
424
|
-
/// First - maximumMajor+1 long (last free element chain)
|
425
|
-
int * first_;
|
426
|
-
/// Last - maximumMajor+1 long (last free element chain)
|
427
|
-
int * last_;
|
428
|
-
/// Number of major items i.e. rows if just row links
|
429
|
-
int numberMajor_;
|
430
|
-
/// Maximum number of major items i.e. rows if just row links
|
431
|
-
int maximumMajor_;
|
432
|
-
/// Number of elements
|
433
|
-
int numberElements_;
|
434
|
-
/// Maximum number of elements
|
435
|
-
int maximumElements_;
|
436
|
-
/// 0 row list, 1 column list
|
437
|
-
int type_;
|
438
|
-
//@}
|
439
|
-
};
|
440
|
-
|
441
|
-
#endif
|
@@ -1,1056 +0,0 @@
|
|
1
|
-
/* $Id: CoinMpsIO.hpp 1642 2013-10-16 00:43:14Z tkr $ */
|
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
|
-
#ifndef CoinMpsIO_H
|
7
|
-
#define CoinMpsIO_H
|
8
|
-
|
9
|
-
#if defined(_MSC_VER)
|
10
|
-
// Turn off compiler warning about long names
|
11
|
-
# pragma warning(disable:4786)
|
12
|
-
#endif
|
13
|
-
|
14
|
-
#include <vector>
|
15
|
-
#include <string>
|
16
|
-
|
17
|
-
#include "CoinUtilsConfig.h"
|
18
|
-
#include "CoinPackedMatrix.hpp"
|
19
|
-
#include "CoinMessageHandler.hpp"
|
20
|
-
#include "CoinFileIO.hpp"
|
21
|
-
class CoinModel;
|
22
|
-
|
23
|
-
/// The following lengths are in decreasing order (for 64 bit etc)
|
24
|
-
/// Large enough to contain element index
|
25
|
-
/// This is already defined as CoinBigIndex
|
26
|
-
/// Large enough to contain column index
|
27
|
-
typedef int COINColumnIndex;
|
28
|
-
|
29
|
-
/// Large enough to contain row index (or basis)
|
30
|
-
typedef int COINRowIndex;
|
31
|
-
|
32
|
-
// We are allowing free format - but there is a limit!
|
33
|
-
// User can override by using CXXFLAGS += -DCOIN_MAX_FIELD_LENGTH=nnn
|
34
|
-
#ifndef COIN_MAX_FIELD_LENGTH
|
35
|
-
#define COIN_MAX_FIELD_LENGTH 160
|
36
|
-
#endif
|
37
|
-
#define MAX_CARD_LENGTH 5*COIN_MAX_FIELD_LENGTH+80
|
38
|
-
|
39
|
-
enum COINSectionType { COIN_NO_SECTION, COIN_NAME_SECTION, COIN_ROW_SECTION,
|
40
|
-
COIN_COLUMN_SECTION,
|
41
|
-
COIN_RHS_SECTION, COIN_RANGES_SECTION, COIN_BOUNDS_SECTION,
|
42
|
-
COIN_ENDATA_SECTION, COIN_EOF_SECTION, COIN_QUADRATIC_SECTION,
|
43
|
-
COIN_CONIC_SECTION,COIN_QUAD_SECTION,COIN_SOS_SECTION,
|
44
|
-
COIN_BASIS_SECTION,COIN_UNKNOWN_SECTION
|
45
|
-
};
|
46
|
-
|
47
|
-
enum COINMpsType { COIN_N_ROW, COIN_E_ROW, COIN_L_ROW, COIN_G_ROW,
|
48
|
-
COIN_BLANK_COLUMN, COIN_S1_COLUMN, COIN_S2_COLUMN, COIN_S3_COLUMN,
|
49
|
-
COIN_INTORG, COIN_INTEND, COIN_SOSEND, COIN_UNSET_BOUND,
|
50
|
-
COIN_UP_BOUND, COIN_FX_BOUND, COIN_LO_BOUND, COIN_FR_BOUND,
|
51
|
-
COIN_MI_BOUND, COIN_PL_BOUND, COIN_BV_BOUND,
|
52
|
-
COIN_UI_BOUND, COIN_LI_BOUND, COIN_BOTH_BOUNDS_SET,
|
53
|
-
COIN_SC_BOUND, COIN_S1_BOUND, COIN_S2_BOUND,
|
54
|
-
COIN_BS_BASIS, COIN_XL_BASIS, COIN_XU_BASIS,
|
55
|
-
COIN_LL_BASIS, COIN_UL_BASIS, COIN_UNKNOWN_MPS_TYPE
|
56
|
-
};
|
57
|
-
class CoinMpsIO;
|
58
|
-
/// Very simple code for reading MPS data
|
59
|
-
class CoinMpsCardReader {
|
60
|
-
|
61
|
-
public:
|
62
|
-
|
63
|
-
/**@name Constructor and destructor */
|
64
|
-
//@{
|
65
|
-
/// Constructor expects file to be open
|
66
|
-
/// This one takes gzFile if fp null
|
67
|
-
CoinMpsCardReader ( CoinFileInput *input, CoinMpsIO * reader );
|
68
|
-
|
69
|
-
/// Destructor
|
70
|
-
~CoinMpsCardReader ( );
|
71
|
-
//@}
|
72
|
-
|
73
|
-
|
74
|
-
/**@name card stuff */
|
75
|
-
//@{
|
76
|
-
/// Read to next section
|
77
|
-
COINSectionType readToNextSection ( );
|
78
|
-
/// Gets next field and returns section type e.g. COIN_COLUMN_SECTION
|
79
|
-
COINSectionType nextField ( );
|
80
|
-
/** Gets next field for .gms file and returns type.
|
81
|
-
-1 - EOF
|
82
|
-
0 - what we expected (and processed so pointer moves past)
|
83
|
-
1 - not what we expected
|
84
|
-
leading blanks always ignored
|
85
|
-
input types
|
86
|
-
0 - anything - stops on non blank card
|
87
|
-
1 - name (in columnname)
|
88
|
-
2 - value
|
89
|
-
3 - value name pair
|
90
|
-
4 - equation type
|
91
|
-
5 - ;
|
92
|
-
*/
|
93
|
-
int nextGmsField ( int expectedType );
|
94
|
-
/// Returns current section type
|
95
|
-
inline COINSectionType whichSection ( ) const {
|
96
|
-
return section_;
|
97
|
-
}
|
98
|
-
/// Sets current section type
|
99
|
-
inline void setWhichSection(COINSectionType section ) {
|
100
|
-
section_=section;
|
101
|
-
}
|
102
|
-
/// Sees if free format.
|
103
|
-
inline bool freeFormat() const
|
104
|
-
{ return freeFormat_;}
|
105
|
-
/// Sets whether free format. Mainly for blank RHS etc
|
106
|
-
inline void setFreeFormat(bool yesNo)
|
107
|
-
{ freeFormat_=yesNo;}
|
108
|
-
/// Only for first field on card otherwise BLANK_COLUMN
|
109
|
-
/// e.g. COIN_E_ROW
|
110
|
-
inline COINMpsType mpsType ( ) const {
|
111
|
-
return mpsType_;
|
112
|
-
}
|
113
|
-
/// Reads and cleans card - taking out trailing blanks - return 1 if EOF
|
114
|
-
int cleanCard();
|
115
|
-
/// Returns row name of current field
|
116
|
-
inline const char *rowName ( ) const {
|
117
|
-
return rowName_;
|
118
|
-
}
|
119
|
-
/// Returns column name of current field
|
120
|
-
inline const char *columnName ( ) const {
|
121
|
-
return columnName_;
|
122
|
-
}
|
123
|
-
/// Returns value in current field
|
124
|
-
inline double value ( ) const {
|
125
|
-
return value_;
|
126
|
-
}
|
127
|
-
/// Returns value as string in current field
|
128
|
-
inline const char *valueString ( ) const {
|
129
|
-
return valueString_;
|
130
|
-
}
|
131
|
-
/// Whole card (for printing)
|
132
|
-
inline const char *card ( ) const {
|
133
|
-
return card_;
|
134
|
-
}
|
135
|
-
/// Whole card - so we look at it (not const so nextBlankOr will work for gms reader)
|
136
|
-
inline char *mutableCard ( ) {
|
137
|
-
return card_;
|
138
|
-
}
|
139
|
-
/// set position (again so gms reader will work)
|
140
|
-
inline void setPosition(char * position)
|
141
|
-
{ position_=position;}
|
142
|
-
/// get position (again so gms reader will work)
|
143
|
-
inline char * getPosition() const
|
144
|
-
{ return position_;}
|
145
|
-
/// Returns card number
|
146
|
-
inline CoinBigIndex cardNumber ( ) const {
|
147
|
-
return cardNumber_;
|
148
|
-
}
|
149
|
-
/// Returns file input
|
150
|
-
inline CoinFileInput * fileInput ( ) const {
|
151
|
-
return input_;
|
152
|
-
}
|
153
|
-
/// Sets whether strings allowed
|
154
|
-
inline void setStringsAllowed()
|
155
|
-
{ stringsAllowed_=true;}
|
156
|
-
//@}
|
157
|
-
|
158
|
-
////////////////// data //////////////////
|
159
|
-
protected:
|
160
|
-
|
161
|
-
/**@name data */
|
162
|
-
//@{
|
163
|
-
/// Current value
|
164
|
-
double value_;
|
165
|
-
/// Current card image
|
166
|
-
char card_[MAX_CARD_LENGTH];
|
167
|
-
/// Current position within card image
|
168
|
-
char *position_;
|
169
|
-
/// End of card
|
170
|
-
char *eol_;
|
171
|
-
/// Current COINMpsType
|
172
|
-
COINMpsType mpsType_;
|
173
|
-
/// Current row name
|
174
|
-
char rowName_[COIN_MAX_FIELD_LENGTH];
|
175
|
-
/// Current column name
|
176
|
-
char columnName_[COIN_MAX_FIELD_LENGTH];
|
177
|
-
/// File input
|
178
|
-
CoinFileInput *input_;
|
179
|
-
/// Which section we think we are in
|
180
|
-
COINSectionType section_;
|
181
|
-
/// Card number
|
182
|
-
CoinBigIndex cardNumber_;
|
183
|
-
/// Whether free format. Just for blank RHS etc
|
184
|
-
bool freeFormat_;
|
185
|
-
/// Whether IEEE - 0 no, 1 INTEL, 2 not INTEL
|
186
|
-
int ieeeFormat_;
|
187
|
-
/// If all names <= 8 characters then allow embedded blanks
|
188
|
-
bool eightChar_;
|
189
|
-
/// MpsIO
|
190
|
-
CoinMpsIO * reader_;
|
191
|
-
/// Message handler
|
192
|
-
CoinMessageHandler * handler_;
|
193
|
-
/// Messages
|
194
|
-
CoinMessages messages_;
|
195
|
-
/// Current element as characters (only if strings allowed)
|
196
|
-
char valueString_[COIN_MAX_FIELD_LENGTH];
|
197
|
-
/// Whether strings allowed
|
198
|
-
bool stringsAllowed_;
|
199
|
-
//@}
|
200
|
-
public:
|
201
|
-
/**@name methods */
|
202
|
-
//@{
|
203
|
-
/// type - 0 normal, 1 INTEL IEEE, 2 other IEEE
|
204
|
-
double osi_strtod(char * ptr, char ** output, int type);
|
205
|
-
/// remove blanks
|
206
|
-
static void strcpyAndCompress ( char *to, const char *from );
|
207
|
-
///
|
208
|
-
static char * nextBlankOr ( char *image );
|
209
|
-
/// For strings
|
210
|
-
double osi_strtod(char * ptr, char ** output);
|
211
|
-
//@}
|
212
|
-
|
213
|
-
};
|
214
|
-
|
215
|
-
//#############################################################################
|
216
|
-
#ifdef USE_SBB
|
217
|
-
class SbbObject;
|
218
|
-
class SbbModel;
|
219
|
-
#endif
|
220
|
-
/// Very simple class for containing data on set
|
221
|
-
class CoinSet {
|
222
|
-
|
223
|
-
public:
|
224
|
-
|
225
|
-
/**@name Constructor and destructor */
|
226
|
-
//@{
|
227
|
-
/// Default constructor
|
228
|
-
CoinSet ( );
|
229
|
-
/// Constructor
|
230
|
-
CoinSet ( int numberEntries, const int * which);
|
231
|
-
|
232
|
-
/// Copy constructor
|
233
|
-
CoinSet (const CoinSet &);
|
234
|
-
|
235
|
-
/// Assignment operator
|
236
|
-
CoinSet & operator=(const CoinSet& rhs);
|
237
|
-
|
238
|
-
/// Destructor
|
239
|
-
virtual ~CoinSet ( );
|
240
|
-
//@}
|
241
|
-
|
242
|
-
|
243
|
-
/**@name gets */
|
244
|
-
//@{
|
245
|
-
/// Returns number of entries
|
246
|
-
inline int numberEntries ( ) const
|
247
|
-
{ return numberEntries_; }
|
248
|
-
/// Returns type of set - 1 =SOS1, 2 =SOS2
|
249
|
-
inline int setType ( ) const
|
250
|
-
{ return setType_; }
|
251
|
-
/// Returns list of variables
|
252
|
-
inline const int * which ( ) const
|
253
|
-
{ return which_; }
|
254
|
-
/// Returns weights
|
255
|
-
inline const double * weights ( ) const
|
256
|
-
{ return weights_; }
|
257
|
-
//@}
|
258
|
-
|
259
|
-
#ifdef USE_SBB
|
260
|
-
/**@name Use in sbb */
|
261
|
-
//@{
|
262
|
-
/// returns an object of type SbbObject
|
263
|
-
virtual SbbObject * sbbObject(SbbModel * model) const
|
264
|
-
{ return NULL;}
|
265
|
-
//@}
|
266
|
-
#endif
|
267
|
-
|
268
|
-
////////////////// data //////////////////
|
269
|
-
protected:
|
270
|
-
|
271
|
-
/**@name data */
|
272
|
-
//@{
|
273
|
-
/// Number of entries
|
274
|
-
int numberEntries_;
|
275
|
-
/// type of set
|
276
|
-
int setType_;
|
277
|
-
/// Which variables are in set
|
278
|
-
int * which_;
|
279
|
-
/// Weights
|
280
|
-
double * weights_;
|
281
|
-
//@}
|
282
|
-
};
|
283
|
-
|
284
|
-
//#############################################################################
|
285
|
-
/// Very simple class for containing SOS set
|
286
|
-
class CoinSosSet : public CoinSet{
|
287
|
-
|
288
|
-
public:
|
289
|
-
|
290
|
-
/**@name Constructor and destructor */
|
291
|
-
//@{
|
292
|
-
/// Constructor
|
293
|
-
CoinSosSet ( int numberEntries, const int * which, const double * weights, int type);
|
294
|
-
|
295
|
-
/// Destructor
|
296
|
-
virtual ~CoinSosSet ( );
|
297
|
-
//@}
|
298
|
-
|
299
|
-
|
300
|
-
#ifdef USE_SBB
|
301
|
-
/**@name Use in sbb */
|
302
|
-
//@{
|
303
|
-
/// returns an object of type SbbObject
|
304
|
-
virtual SbbObject * sbbObject(SbbModel * model) const ;
|
305
|
-
//@}
|
306
|
-
#endif
|
307
|
-
|
308
|
-
////////////////// data //////////////////
|
309
|
-
protected:
|
310
|
-
|
311
|
-
/**@name data */
|
312
|
-
//@{
|
313
|
-
//@}
|
314
|
-
};
|
315
|
-
|
316
|
-
//#############################################################################
|
317
|
-
|
318
|
-
/** MPS IO Interface
|
319
|
-
|
320
|
-
This class can be used to read in mps files without a solver. After
|
321
|
-
reading the file, the CoinMpsIO object contains all relevant data, which
|
322
|
-
may be more than a particular OsiSolverInterface allows for. Items may
|
323
|
-
be deleted to allow for flexibility of data storage.
|
324
|
-
|
325
|
-
The implementation makes the CoinMpsIO object look very like a dummy solver,
|
326
|
-
as the same conventions are used.
|
327
|
-
*/
|
328
|
-
|
329
|
-
class CoinMpsIO {
|
330
|
-
friend void CoinMpsIOUnitTest(const std::string & mpsDir);
|
331
|
-
|
332
|
-
public:
|
333
|
-
|
334
|
-
/** @name Methods to retrieve problem information
|
335
|
-
|
336
|
-
These methods return information about the problem held by the CoinMpsIO
|
337
|
-
object.
|
338
|
-
|
339
|
-
Querying an object that has no data associated with it result in zeros for
|
340
|
-
the number of rows and columns, and NULL pointers from the methods that
|
341
|
-
return vectors. Const pointers returned from any data-query method are
|
342
|
-
always valid
|
343
|
-
*/
|
344
|
-
//@{
|
345
|
-
/// Get number of columns
|
346
|
-
int getNumCols() const;
|
347
|
-
|
348
|
-
/// Get number of rows
|
349
|
-
int getNumRows() const;
|
350
|
-
|
351
|
-
/// Get number of nonzero elements
|
352
|
-
int getNumElements() const;
|
353
|
-
|
354
|
-
/// Get pointer to array[getNumCols()] of column lower bounds
|
355
|
-
const double * getColLower() const;
|
356
|
-
|
357
|
-
/// Get pointer to array[getNumCols()] of column upper bounds
|
358
|
-
const double * getColUpper() const;
|
359
|
-
|
360
|
-
/** Get pointer to array[getNumRows()] of constraint senses.
|
361
|
-
<ul>
|
362
|
-
<li>'L': <= constraint
|
363
|
-
<li>'E': = constraint
|
364
|
-
<li>'G': >= constraint
|
365
|
-
<li>'R': ranged constraint
|
366
|
-
<li>'N': free constraint
|
367
|
-
</ul>
|
368
|
-
*/
|
369
|
-
const char * getRowSense() const;
|
370
|
-
|
371
|
-
/** Get pointer to array[getNumRows()] of constraint right-hand sides.
|
372
|
-
|
373
|
-
Given constraints with upper (rowupper) and/or lower (rowlower) bounds,
|
374
|
-
the constraint right-hand side (rhs) is set as
|
375
|
-
<ul>
|
376
|
-
<li> if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
|
377
|
-
<li> if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
|
378
|
-
<li> if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
|
379
|
-
<li> if rowsense()[i] == 'N' then rhs()[i] == 0.0
|
380
|
-
</ul>
|
381
|
-
*/
|
382
|
-
const double * getRightHandSide() const;
|
383
|
-
|
384
|
-
/** Get pointer to array[getNumRows()] of row ranges.
|
385
|
-
|
386
|
-
Given constraints with upper (rowupper) and/or lower (rowlower) bounds,
|
387
|
-
the constraint range (rowrange) is set as
|
388
|
-
<ul>
|
389
|
-
<li> if rowsense()[i] == 'R' then
|
390
|
-
rowrange()[i] == rowupper()[i] - rowlower()[i]
|
391
|
-
<li> if rowsense()[i] != 'R' then
|
392
|
-
rowrange()[i] is 0.0
|
393
|
-
</ul>
|
394
|
-
Put another way, only range constraints have a nontrivial value for
|
395
|
-
rowrange.
|
396
|
-
*/
|
397
|
-
const double * getRowRange() const;
|
398
|
-
|
399
|
-
/// Get pointer to array[getNumRows()] of row lower bounds
|
400
|
-
const double * getRowLower() const;
|
401
|
-
|
402
|
-
/// Get pointer to array[getNumRows()] of row upper bounds
|
403
|
-
const double * getRowUpper() const;
|
404
|
-
|
405
|
-
/// Get pointer to array[getNumCols()] of objective function coefficients
|
406
|
-
const double * getObjCoefficients() const;
|
407
|
-
|
408
|
-
/// Get pointer to row-wise copy of the coefficient matrix
|
409
|
-
const CoinPackedMatrix * getMatrixByRow() const;
|
410
|
-
|
411
|
-
/// Get pointer to column-wise copy of the coefficient matrix
|
412
|
-
const CoinPackedMatrix * getMatrixByCol() const;
|
413
|
-
|
414
|
-
/// Return true if column is a continuous variable
|
415
|
-
bool isContinuous(int colNumber) const;
|
416
|
-
|
417
|
-
/** Return true if a column is an integer variable
|
418
|
-
|
419
|
-
Note: This function returns true if the the column
|
420
|
-
is a binary or general integer variable.
|
421
|
-
*/
|
422
|
-
bool isInteger(int columnNumber) const;
|
423
|
-
|
424
|
-
/** Returns array[getNumCols()] specifying if a variable is integer.
|
425
|
-
|
426
|
-
At present, simply coded as zero (continuous) and non-zero (integer)
|
427
|
-
May be extended at a later date.
|
428
|
-
*/
|
429
|
-
const char * integerColumns() const;
|
430
|
-
|
431
|
-
/** Returns the row name for the specified index.
|
432
|
-
|
433
|
-
Returns 0 if the index is out of range.
|
434
|
-
*/
|
435
|
-
const char * rowName(int index) const;
|
436
|
-
|
437
|
-
/** Returns the column name for the specified index.
|
438
|
-
|
439
|
-
Returns 0 if the index is out of range.
|
440
|
-
*/
|
441
|
-
const char * columnName(int index) const;
|
442
|
-
|
443
|
-
/** Returns the index for the specified row name
|
444
|
-
|
445
|
-
Returns -1 if the name is not found.
|
446
|
-
Returns numberRows for the objective row and > numberRows for
|
447
|
-
dropped free rows.
|
448
|
-
*/
|
449
|
-
int rowIndex(const char * name) const;
|
450
|
-
|
451
|
-
/** Returns the index for the specified column name
|
452
|
-
|
453
|
-
Returns -1 if the name is not found.
|
454
|
-
*/
|
455
|
-
int columnIndex(const char * name) const;
|
456
|
-
|
457
|
-
/** Returns the (constant) objective offset
|
458
|
-
|
459
|
-
This is the RHS entry for the objective row
|
460
|
-
*/
|
461
|
-
double objectiveOffset() const;
|
462
|
-
/// Set objective offset
|
463
|
-
inline void setObjectiveOffset(double value)
|
464
|
-
{ objectiveOffset_=value;}
|
465
|
-
|
466
|
-
/// Return the problem name
|
467
|
-
const char * getProblemName() const;
|
468
|
-
|
469
|
-
/// Return the objective name
|
470
|
-
const char * getObjectiveName() const;
|
471
|
-
|
472
|
-
/// Return the RHS vector name
|
473
|
-
const char * getRhsName() const;
|
474
|
-
|
475
|
-
/// Return the range vector name
|
476
|
-
const char * getRangeName() const;
|
477
|
-
|
478
|
-
/// Return the bound vector name
|
479
|
-
const char * getBoundName() const;
|
480
|
-
/// Number of string elements
|
481
|
-
inline int numberStringElements() const
|
482
|
-
{ return numberStringElements_;}
|
483
|
-
/// String element
|
484
|
-
inline const char * stringElement(int i) const
|
485
|
-
{ return stringElements_[i];}
|
486
|
-
//@}
|
487
|
-
|
488
|
-
|
489
|
-
/** @name Methods to set problem information
|
490
|
-
|
491
|
-
Methods to load a problem into the CoinMpsIO object.
|
492
|
-
*/
|
493
|
-
//@{
|
494
|
-
|
495
|
-
/// Set the problem data
|
496
|
-
void setMpsData(const CoinPackedMatrix& m, const double infinity,
|
497
|
-
const double* collb, const double* colub,
|
498
|
-
const double* obj, const char* integrality,
|
499
|
-
const double* rowlb, const double* rowub,
|
500
|
-
char const * const * const colnames,
|
501
|
-
char const * const * const rownames);
|
502
|
-
void setMpsData(const CoinPackedMatrix& m, const double infinity,
|
503
|
-
const double* collb, const double* colub,
|
504
|
-
const double* obj, const char* integrality,
|
505
|
-
const double* rowlb, const double* rowub,
|
506
|
-
const std::vector<std::string> & colnames,
|
507
|
-
const std::vector<std::string> & rownames);
|
508
|
-
void setMpsData(const CoinPackedMatrix& m, const double infinity,
|
509
|
-
const double* collb, const double* colub,
|
510
|
-
const double* obj, const char* integrality,
|
511
|
-
const char* rowsen, const double* rowrhs,
|
512
|
-
const double* rowrng,
|
513
|
-
char const * const * const colnames,
|
514
|
-
char const * const * const rownames);
|
515
|
-
void setMpsData(const CoinPackedMatrix& m, const double infinity,
|
516
|
-
const double* collb, const double* colub,
|
517
|
-
const double* obj, const char* integrality,
|
518
|
-
const char* rowsen, const double* rowrhs,
|
519
|
-
const double* rowrng,
|
520
|
-
const std::vector<std::string> & colnames,
|
521
|
-
const std::vector<std::string> & rownames);
|
522
|
-
|
523
|
-
/** Pass in an array[getNumCols()] specifying if a variable is integer.
|
524
|
-
|
525
|
-
At present, simply coded as zero (continuous) and non-zero (integer)
|
526
|
-
May be extended at a later date.
|
527
|
-
*/
|
528
|
-
void copyInIntegerInformation(const char * integerInformation);
|
529
|
-
|
530
|
-
/// Set problem name
|
531
|
-
void setProblemName(const char *name) ;
|
532
|
-
|
533
|
-
/// Set objective name
|
534
|
-
void setObjectiveName(const char *name) ;
|
535
|
-
|
536
|
-
//@}
|
537
|
-
|
538
|
-
/** @name Parameter set/get methods
|
539
|
-
|
540
|
-
Methods to set and retrieve MPS IO parameters.
|
541
|
-
*/
|
542
|
-
|
543
|
-
//@{
|
544
|
-
/// Set infinity
|
545
|
-
void setInfinity(double value);
|
546
|
-
|
547
|
-
/// Get infinity
|
548
|
-
double getInfinity() const;
|
549
|
-
|
550
|
-
/// Set default upper bound for integer variables
|
551
|
-
void setDefaultBound(int value);
|
552
|
-
|
553
|
-
/// Get default upper bound for integer variables
|
554
|
-
int getDefaultBound() const;
|
555
|
-
/// Whether to allow string elements
|
556
|
-
inline int allowStringElements() const
|
557
|
-
{ return allowStringElements_;}
|
558
|
-
/// Whether to allow string elements (0 no, 1 yes, 2 yes and try flip)
|
559
|
-
inline void setAllowStringElements(int yesNo)
|
560
|
-
{ allowStringElements_ = yesNo;}
|
561
|
-
/** Small element value - elements less than this set to zero on input
|
562
|
-
default is 1.0e-14 */
|
563
|
-
inline double getSmallElementValue() const
|
564
|
-
{ return smallElement_;}
|
565
|
-
inline void setSmallElementValue(double value)
|
566
|
-
{ smallElement_=value;}
|
567
|
-
//@}
|
568
|
-
|
569
|
-
|
570
|
-
/** @name Methods for problem input and output
|
571
|
-
|
572
|
-
Methods to read and write MPS format problem files.
|
573
|
-
|
574
|
-
The read and write methods return the number of errors that occurred during
|
575
|
-
the IO operation, or -1 if no file is opened.
|
576
|
-
|
577
|
-
\note
|
578
|
-
If the CoinMpsIO class was compiled with support for libz then
|
579
|
-
readMps will automatically try to append .gz to the file name and open it as
|
580
|
-
a compressed file if the specified file name cannot be opened.
|
581
|
-
(Automatic append of the .bz2 suffix when libbz is used is on the TODO list.)
|
582
|
-
|
583
|
-
\todo
|
584
|
-
Allow for file pointers and positioning
|
585
|
-
*/
|
586
|
-
|
587
|
-
//@{
|
588
|
-
/// Set the current file name for the CoinMpsIO object
|
589
|
-
void setFileName(const char * name);
|
590
|
-
|
591
|
-
/// Get the current file name for the CoinMpsIO object
|
592
|
-
const char * getFileName() const;
|
593
|
-
|
594
|
-
/** Read a problem in MPS format from the given filename.
|
595
|
-
|
596
|
-
Use "stdin" or "-" to read from stdin.
|
597
|
-
*/
|
598
|
-
int readMps(const char *filename, const char *extension = "mps");
|
599
|
-
|
600
|
-
/** Read a problem in MPS format from the given filename.
|
601
|
-
|
602
|
-
Use "stdin" or "-" to read from stdin.
|
603
|
-
But do sets as well
|
604
|
-
*/
|
605
|
-
int readMps(const char *filename, const char *extension ,
|
606
|
-
int & numberSets, CoinSet **& sets);
|
607
|
-
|
608
|
-
/** Read a problem in MPS format from a previously opened file
|
609
|
-
|
610
|
-
More precisely, read a problem using a CoinMpsCardReader object already
|
611
|
-
associated with this CoinMpsIO object.
|
612
|
-
|
613
|
-
\todo
|
614
|
-
Provide an interface that will allow a client to associate a
|
615
|
-
CoinMpsCardReader object with a CoinMpsIO object by setting the
|
616
|
-
cardReader_ field.
|
617
|
-
*/
|
618
|
-
int readMps();
|
619
|
-
/// and
|
620
|
-
int readMps(int & numberSets, CoinSet **& sets);
|
621
|
-
/** Read a basis in MPS format from the given filename.
|
622
|
-
If VALUES on NAME card and solution not NULL fills in solution
|
623
|
-
status values as for CoinWarmStartBasis (but one per char)
|
624
|
-
-1 file error, 0 normal, 1 has solution values
|
625
|
-
|
626
|
-
Use "stdin" or "-" to read from stdin.
|
627
|
-
|
628
|
-
If sizes of names incorrect - read without names
|
629
|
-
*/
|
630
|
-
int readBasis(const char *filename, const char *extension ,
|
631
|
-
double * solution, unsigned char *rowStatus, unsigned char *columnStatus,
|
632
|
-
const std::vector<std::string> & colnames,int numberColumns,
|
633
|
-
const std::vector<std::string> & rownames, int numberRows);
|
634
|
-
|
635
|
-
/** Read a problem in GAMS format from the given filename.
|
636
|
-
|
637
|
-
Use "stdin" or "-" to read from stdin.
|
638
|
-
if convertObjective then massages objective column
|
639
|
-
*/
|
640
|
-
int readGms(const char *filename, const char *extension = "gms",bool convertObjective=false);
|
641
|
-
|
642
|
-
/** Read a problem in GAMS format from the given filename.
|
643
|
-
|
644
|
-
Use "stdin" or "-" to read from stdin.
|
645
|
-
But do sets as well
|
646
|
-
*/
|
647
|
-
int readGms(const char *filename, const char *extension ,
|
648
|
-
int & numberSets, CoinSet **& sets);
|
649
|
-
|
650
|
-
/** Read a problem in GAMS format from a previously opened file
|
651
|
-
|
652
|
-
More precisely, read a problem using a CoinMpsCardReader object already
|
653
|
-
associated with this CoinMpsIO object.
|
654
|
-
|
655
|
-
*/
|
656
|
-
// Not for now int readGms();
|
657
|
-
/// and
|
658
|
-
int readGms(int & numberSets, CoinSet **& sets);
|
659
|
-
/** Read a problem in GMPL (subset of AMPL) format from the given filenames.
|
660
|
-
*/
|
661
|
-
int readGMPL(const char *modelName, const char * dataName=NULL, bool keepNames=false);
|
662
|
-
|
663
|
-
/** Write the problem in MPS format to a file with the given filename.
|
664
|
-
|
665
|
-
\param compression can be set to three values to indicate what kind
|
666
|
-
of file should be written
|
667
|
-
<ul>
|
668
|
-
<li> 0: plain text (default)
|
669
|
-
<li> 1: gzip compressed (.gz is appended to \c filename)
|
670
|
-
<li> 2: bzip2 compressed (.bz2 is appended to \c filename) (TODO)
|
671
|
-
</ul>
|
672
|
-
If the library was not compiled with the requested compression then
|
673
|
-
writeMps falls back to writing a plain text file.
|
674
|
-
|
675
|
-
\param formatType specifies the precision to used for values in the
|
676
|
-
MPS file
|
677
|
-
<ul>
|
678
|
-
<li> 0: normal precision (default)
|
679
|
-
<li> 1: extra accuracy
|
680
|
-
<li> 2: IEEE hex
|
681
|
-
</ul>
|
682
|
-
|
683
|
-
\param numberAcross specifies whether 1 or 2 (default) values should be
|
684
|
-
specified on every data line in the MPS file.
|
685
|
-
|
686
|
-
\param quadratic specifies quadratic objective to be output
|
687
|
-
*/
|
688
|
-
int writeMps(const char *filename, int compression = 0,
|
689
|
-
int formatType = 0, int numberAcross = 2,
|
690
|
-
CoinPackedMatrix * quadratic = NULL,
|
691
|
-
int numberSOS=0,const CoinSet * setInfo=NULL) const;
|
692
|
-
|
693
|
-
/// Return card reader object so can see what last card was e.g. QUADOBJ
|
694
|
-
inline const CoinMpsCardReader * reader() const
|
695
|
-
{ return cardReader_;}
|
696
|
-
|
697
|
-
/** Read in a quadratic objective from the given filename.
|
698
|
-
|
699
|
-
If filename is NULL (or the same as the currently open file) then
|
700
|
-
reading continues from the current file.
|
701
|
-
If not, the file is closed and the specified file is opened.
|
702
|
-
|
703
|
-
Code should be added to
|
704
|
-
general MPS reader to read this if QSECTION
|
705
|
-
Data is assumed to be Q and objective is c + 1/2 xT Q x
|
706
|
-
No assumption is made for symmetry, positive definite, etc.
|
707
|
-
No check is made for duplicates or non-triangular if checkSymmetry==0.
|
708
|
-
If 1 checks lower triangular (so off diagonal should be 2*Q)
|
709
|
-
if 2 makes lower triangular and assumes full Q (but adds off diagonals)
|
710
|
-
|
711
|
-
Arrays should be deleted by delete []
|
712
|
-
|
713
|
-
Returns number of errors:
|
714
|
-
<ul>
|
715
|
-
<li> -1: bad file
|
716
|
-
<li> -2: no Quadratic section
|
717
|
-
<li> -3: an empty section
|
718
|
-
<li> +n: then matching errors etc (symmetry forced)
|
719
|
-
<li> -4: no matching errors but fails triangular test
|
720
|
-
(triangularity forced)
|
721
|
-
</ul>
|
722
|
-
columnStart is numberColumns+1 long, others numberNonZeros
|
723
|
-
*/
|
724
|
-
int readQuadraticMps(const char * filename,
|
725
|
-
int * &columnStart, int * &column, double * &elements,
|
726
|
-
int checkSymmetry);
|
727
|
-
|
728
|
-
/** Read in a list of cones from the given filename.
|
729
|
-
|
730
|
-
If filename is NULL (or the same as the currently open file) then
|
731
|
-
reading continues from the current file.
|
732
|
-
If not, the file is closed and the specified file is opened.
|
733
|
-
|
734
|
-
Code should be added to
|
735
|
-
general MPS reader to read this if CSECTION
|
736
|
-
No checking is done that in unique cone
|
737
|
-
|
738
|
-
Arrays should be deleted by delete []
|
739
|
-
|
740
|
-
Returns number of errors, -1 bad file, -2 no conic section,
|
741
|
-
-3 empty section
|
742
|
-
|
743
|
-
columnStart is numberCones+1 long, other number of columns in matrix
|
744
|
-
|
745
|
-
coneType is 1 for QUAD, 2 for RQUAD (numberCones long)
|
746
|
-
*/
|
747
|
-
int readConicMps(const char * filename,
|
748
|
-
int * &columnStart, int * &column, int * &coneType, int & numberCones);
|
749
|
-
/// Set whether to move objective from matrix
|
750
|
-
inline void setConvertObjective(bool trueFalse)
|
751
|
-
{ convertObjective_=trueFalse;}
|
752
|
-
/// copies in strings from a CoinModel - returns number
|
753
|
-
int copyStringElements(const CoinModel * model);
|
754
|
-
//@}
|
755
|
-
|
756
|
-
/** @name Constructors and destructors */
|
757
|
-
//@{
|
758
|
-
/// Default Constructor
|
759
|
-
CoinMpsIO();
|
760
|
-
|
761
|
-
/// Copy constructor
|
762
|
-
CoinMpsIO (const CoinMpsIO &);
|
763
|
-
|
764
|
-
/// Assignment operator
|
765
|
-
CoinMpsIO & operator=(const CoinMpsIO& rhs);
|
766
|
-
|
767
|
-
/// Destructor
|
768
|
-
~CoinMpsIO ();
|
769
|
-
//@}
|
770
|
-
|
771
|
-
|
772
|
-
/**@name Message handling */
|
773
|
-
//@{
|
774
|
-
/** Pass in Message handler
|
775
|
-
|
776
|
-
Supply a custom message handler. It will not be destroyed when the
|
777
|
-
CoinMpsIO object is destroyed.
|
778
|
-
*/
|
779
|
-
void passInMessageHandler(CoinMessageHandler * handler);
|
780
|
-
|
781
|
-
/// Set the language for messages.
|
782
|
-
void newLanguage(CoinMessages::Language language);
|
783
|
-
|
784
|
-
/// Set the language for messages.
|
785
|
-
inline void setLanguage(CoinMessages::Language language) {newLanguage(language);}
|
786
|
-
|
787
|
-
/// Return the message handler
|
788
|
-
inline CoinMessageHandler * messageHandler() const {return handler_;}
|
789
|
-
|
790
|
-
/// Return the messages
|
791
|
-
inline CoinMessages messages() {return messages_;}
|
792
|
-
/// Return the messages pointer
|
793
|
-
inline CoinMessages * messagesPointer() {return & messages_;}
|
794
|
-
//@}
|
795
|
-
|
796
|
-
|
797
|
-
/**@name Methods to release storage
|
798
|
-
|
799
|
-
These methods allow the client to reduce the storage used by the CoinMpsIO
|
800
|
-
object be selectively releasing unneeded problem information.
|
801
|
-
*/
|
802
|
-
//@{
|
803
|
-
/** Release all information which can be re-calculated.
|
804
|
-
|
805
|
-
E.g., row sense, copies of rows, hash tables for names.
|
806
|
-
*/
|
807
|
-
void releaseRedundantInformation();
|
808
|
-
|
809
|
-
/// Release all row information (lower, upper)
|
810
|
-
void releaseRowInformation();
|
811
|
-
|
812
|
-
/// Release all column information (lower, upper, objective)
|
813
|
-
void releaseColumnInformation();
|
814
|
-
|
815
|
-
/// Release integer information
|
816
|
-
void releaseIntegerInformation();
|
817
|
-
|
818
|
-
/// Release row names
|
819
|
-
void releaseRowNames();
|
820
|
-
|
821
|
-
/// Release column names
|
822
|
-
void releaseColumnNames();
|
823
|
-
|
824
|
-
/// Release matrix information
|
825
|
-
void releaseMatrixInformation();
|
826
|
-
//@}
|
827
|
-
|
828
|
-
protected:
|
829
|
-
|
830
|
-
/**@name Miscellaneous helper functions */
|
831
|
-
//@{
|
832
|
-
|
833
|
-
/// Utility method used several times to implement public methods
|
834
|
-
void
|
835
|
-
setMpsDataWithoutRowAndColNames(
|
836
|
-
const CoinPackedMatrix& m, const double infinity,
|
837
|
-
const double* collb, const double* colub,
|
838
|
-
const double* obj, const char* integrality,
|
839
|
-
const double* rowlb, const double* rowub);
|
840
|
-
void
|
841
|
-
setMpsDataColAndRowNames(
|
842
|
-
const std::vector<std::string> & colnames,
|
843
|
-
const std::vector<std::string> & rownames);
|
844
|
-
void
|
845
|
-
setMpsDataColAndRowNames(
|
846
|
-
char const * const * const colnames,
|
847
|
-
char const * const * const rownames);
|
848
|
-
|
849
|
-
|
850
|
-
/// Does the heavy lifting for destruct and assignment.
|
851
|
-
void gutsOfDestructor();
|
852
|
-
|
853
|
-
/// Does the heavy lifting for copy and assignment.
|
854
|
-
void gutsOfCopy(const CoinMpsIO &);
|
855
|
-
|
856
|
-
/// Clears problem data from the CoinMpsIO object.
|
857
|
-
void freeAll();
|
858
|
-
|
859
|
-
|
860
|
-
/** A quick inlined function to convert from lb/ub style constraint
|
861
|
-
definition to sense/rhs/range style */
|
862
|
-
inline void
|
863
|
-
convertBoundToSense(const double lower, const double upper,
|
864
|
-
char& sense, double& right, double& range) const;
|
865
|
-
/** A quick inlined function to convert from sense/rhs/range stryle
|
866
|
-
constraint definition to lb/ub style */
|
867
|
-
inline void
|
868
|
-
convertSenseToBound(const char sense, const double right,
|
869
|
-
const double range,
|
870
|
-
double& lower, double& upper) const;
|
871
|
-
|
872
|
-
/** Deal with a filename
|
873
|
-
|
874
|
-
As the name says.
|
875
|
-
Returns +1 if the file name is new, 0 if it's the same as before
|
876
|
-
(i.e., matches fileName_), and -1 if there's an error and the file
|
877
|
-
can't be opened.
|
878
|
-
Handles automatic append of .gz suffix when compiled with libz.
|
879
|
-
|
880
|
-
\todo
|
881
|
-
Add automatic append of .bz2 suffix when compiled with libbz.
|
882
|
-
*/
|
883
|
-
|
884
|
-
int dealWithFileName(const char * filename, const char * extension,
|
885
|
-
CoinFileInput * &input);
|
886
|
-
/** Add string to list
|
887
|
-
iRow==numberRows is objective, nr+1 is lo, nr+2 is up
|
888
|
-
iColumn==nc is rhs (can't cope with ranges at present)
|
889
|
-
*/
|
890
|
-
void addString(int iRow,int iColumn, const char * value);
|
891
|
-
/// Decode string
|
892
|
-
void decodeString(int iString, int & iRow, int & iColumn, const char * & value) const;
|
893
|
-
//@}
|
894
|
-
|
895
|
-
|
896
|
-
// for hashing
|
897
|
-
typedef struct {
|
898
|
-
int index, next;
|
899
|
-
} CoinHashLink;
|
900
|
-
|
901
|
-
/**@name Hash table methods */
|
902
|
-
//@{
|
903
|
-
/// Creates hash list for names (section = 0 for rows, 1 columns)
|
904
|
-
void startHash ( char **names, const int number , int section );
|
905
|
-
/// This one does it when names are already in
|
906
|
-
void startHash ( int section ) const;
|
907
|
-
/// Deletes hash storage
|
908
|
-
void stopHash ( int section );
|
909
|
-
/// Finds match using hash, -1 not found
|
910
|
-
int findHash ( const char *name , int section ) const;
|
911
|
-
//@}
|
912
|
-
|
913
|
-
/**@name Cached problem information */
|
914
|
-
//@{
|
915
|
-
/// Problem name
|
916
|
-
char * problemName_;
|
917
|
-
|
918
|
-
/// Objective row name
|
919
|
-
char * objectiveName_;
|
920
|
-
|
921
|
-
/// Right-hand side vector name
|
922
|
-
char * rhsName_;
|
923
|
-
|
924
|
-
/// Range vector name
|
925
|
-
char * rangeName_;
|
926
|
-
|
927
|
-
/// Bounds vector name
|
928
|
-
char * boundName_;
|
929
|
-
|
930
|
-
/// Number of rows
|
931
|
-
int numberRows_;
|
932
|
-
|
933
|
-
/// Number of columns
|
934
|
-
int numberColumns_;
|
935
|
-
|
936
|
-
/// Number of coefficients
|
937
|
-
CoinBigIndex numberElements_;
|
938
|
-
|
939
|
-
/// Pointer to dense vector of row sense indicators
|
940
|
-
mutable char *rowsense_;
|
941
|
-
|
942
|
-
/// Pointer to dense vector of row right-hand side values
|
943
|
-
mutable double *rhs_;
|
944
|
-
|
945
|
-
/** Pointer to dense vector of slack variable upper bounds for range
|
946
|
-
constraints (undefined for non-range rows)
|
947
|
-
*/
|
948
|
-
mutable double *rowrange_;
|
949
|
-
|
950
|
-
/// Pointer to row-wise copy of problem matrix coefficients.
|
951
|
-
mutable CoinPackedMatrix *matrixByRow_;
|
952
|
-
|
953
|
-
/// Pointer to column-wise copy of problem matrix coefficients.
|
954
|
-
CoinPackedMatrix *matrixByColumn_;
|
955
|
-
|
956
|
-
/// Pointer to dense vector of row lower bounds
|
957
|
-
double * rowlower_;
|
958
|
-
|
959
|
-
/// Pointer to dense vector of row upper bounds
|
960
|
-
double * rowupper_;
|
961
|
-
|
962
|
-
/// Pointer to dense vector of column lower bounds
|
963
|
-
double * collower_;
|
964
|
-
|
965
|
-
/// Pointer to dense vector of column upper bounds
|
966
|
-
double * colupper_;
|
967
|
-
|
968
|
-
/// Pointer to dense vector of objective coefficients
|
969
|
-
double * objective_;
|
970
|
-
|
971
|
-
/// Constant offset for objective value (i.e., RHS value for OBJ row)
|
972
|
-
double objectiveOffset_;
|
973
|
-
|
974
|
-
|
975
|
-
/** Pointer to dense vector specifying if a variable is continuous
|
976
|
-
(0) or integer (1).
|
977
|
-
*/
|
978
|
-
char * integerType_;
|
979
|
-
|
980
|
-
/** Row and column names
|
981
|
-
Linked to hash table sections (0 - row names, 1 column names)
|
982
|
-
*/
|
983
|
-
char **names_[2];
|
984
|
-
//@}
|
985
|
-
|
986
|
-
/** @name Hash tables */
|
987
|
-
//@{
|
988
|
-
/// Current file name
|
989
|
-
char * fileName_;
|
990
|
-
|
991
|
-
/// Number of entries in a hash table section
|
992
|
-
int numberHash_[2];
|
993
|
-
|
994
|
-
/// Hash tables (two sections, 0 - row names, 1 - column names)
|
995
|
-
mutable CoinHashLink *hash_[2];
|
996
|
-
//@}
|
997
|
-
|
998
|
-
/** @name CoinMpsIO object parameters */
|
999
|
-
//@{
|
1000
|
-
/// Upper bound when no bounds for integers
|
1001
|
-
int defaultBound_;
|
1002
|
-
|
1003
|
-
/// Value to use for infinity
|
1004
|
-
double infinity_;
|
1005
|
-
/// Small element value
|
1006
|
-
double smallElement_;
|
1007
|
-
|
1008
|
-
/// Message handler
|
1009
|
-
CoinMessageHandler * handler_;
|
1010
|
-
/** Flag to say if the message handler is the default handler.
|
1011
|
-
|
1012
|
-
If true, the handler will be destroyed when the CoinMpsIO
|
1013
|
-
object is destroyed; if false, it will not be destroyed.
|
1014
|
-
*/
|
1015
|
-
bool defaultHandler_;
|
1016
|
-
/// Messages
|
1017
|
-
CoinMessages messages_;
|
1018
|
-
/// Card reader
|
1019
|
-
CoinMpsCardReader * cardReader_;
|
1020
|
-
/// If .gms file should it be massaged to move objective
|
1021
|
-
bool convertObjective_;
|
1022
|
-
/// Whether to allow string elements
|
1023
|
-
int allowStringElements_;
|
1024
|
-
/// Maximum number of string elements
|
1025
|
-
int maximumStringElements_;
|
1026
|
-
/// Number of string elements
|
1027
|
-
int numberStringElements_;
|
1028
|
-
/// String elements
|
1029
|
-
char ** stringElements_;
|
1030
|
-
//@}
|
1031
|
-
|
1032
|
-
};
|
1033
|
-
|
1034
|
-
//#############################################################################
|
1035
|
-
/** A function that tests the methods in the CoinMpsIO class. The
|
1036
|
-
only reason for it not to be a member method is that this way it doesn't
|
1037
|
-
have to be compiled into the library. And that's a gain, because the
|
1038
|
-
library should be compiled with optimization on, but this method should be
|
1039
|
-
compiled with debugging. Also, if this method is compiled with
|
1040
|
-
optimization, the compilation takes 10-15 minutes and the machine pages
|
1041
|
-
(has 256M core memory!)... */
|
1042
|
-
void
|
1043
|
-
CoinMpsIOUnitTest(const std::string & mpsDir);
|
1044
|
-
// Function to return number in most efficient way
|
1045
|
-
// section is 0 for columns, 1 for rhs,ranges and 2 for bounds
|
1046
|
-
/* formatType is
|
1047
|
-
0 - normal and 8 character names
|
1048
|
-
1 - extra accuracy
|
1049
|
-
2 - IEEE hex - INTEL
|
1050
|
-
3 - IEEE hex - not INTEL
|
1051
|
-
*/
|
1052
|
-
void
|
1053
|
-
CoinConvertDouble(int section, int formatType, double value, char outputValue[24]);
|
1054
|
-
|
1055
|
-
#endif
|
1056
|
-
|