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,280 +0,0 @@
|
|
1
|
-
/* $Id: CoinOslFactorization.hpp 1416 2011-04-17 09:57:29Z stefan $ */
|
2
|
-
// Copyright (C) 1987, 2009, International Business Machines
|
3
|
-
// Corporation and others. All Rights Reserved.
|
4
|
-
// This code is licensed under the terms of the Eclipse Public License (EPL).
|
5
|
-
|
6
|
-
/*
|
7
|
-
Authors
|
8
|
-
|
9
|
-
John Forrest
|
10
|
-
|
11
|
-
*/
|
12
|
-
#ifndef CoinOslFactorization_H
|
13
|
-
#define CoinOslFactorization_H
|
14
|
-
#include <iostream>
|
15
|
-
#include <string>
|
16
|
-
#include <cassert>
|
17
|
-
#include "CoinTypes.hpp"
|
18
|
-
#include "CoinIndexedVector.hpp"
|
19
|
-
#include "CoinDenseFactorization.hpp"
|
20
|
-
class CoinPackedMatrix;
|
21
|
-
/** This deals with Factorization and Updates
|
22
|
-
This is ripped off from OSL!!!!!!!!!
|
23
|
-
|
24
|
-
I am assuming that 32 bits is enough for number of rows or columns, but CoinBigIndex
|
25
|
-
may be redefined to get 64 bits.
|
26
|
-
*/
|
27
|
-
|
28
|
-
typedef struct {int suc, pre;} EKKHlink;
|
29
|
-
typedef struct _EKKfactinfo {
|
30
|
-
double drtpiv;
|
31
|
-
double demark;
|
32
|
-
double zpivlu;
|
33
|
-
double zeroTolerance;
|
34
|
-
double areaFactor;
|
35
|
-
int *xrsadr;
|
36
|
-
int *xcsadr;
|
37
|
-
int *xrnadr;
|
38
|
-
int *xcnadr;
|
39
|
-
int *krpadr;
|
40
|
-
int *kcpadr;
|
41
|
-
int *mpermu;
|
42
|
-
int *bitArray;
|
43
|
-
int * back;
|
44
|
-
char * nonzero;
|
45
|
-
double * trueStart;
|
46
|
-
mutable double *kadrpm;
|
47
|
-
int *R_etas_index;
|
48
|
-
int *R_etas_start;
|
49
|
-
double *R_etas_element;
|
50
|
-
|
51
|
-
int *xecadr;
|
52
|
-
int *xeradr;
|
53
|
-
double *xeeadr;
|
54
|
-
double *xe2adr;
|
55
|
-
EKKHlink * kp1adr;
|
56
|
-
EKKHlink * kp2adr;
|
57
|
-
double * kw1adr;
|
58
|
-
double * kw2adr;
|
59
|
-
double * kw3adr;
|
60
|
-
int * hpivcoR;
|
61
|
-
int nrow;
|
62
|
-
int nrowmx;
|
63
|
-
int firstDoRow;
|
64
|
-
int firstLRow;
|
65
|
-
int maxinv;
|
66
|
-
int nnetas;
|
67
|
-
int iterin;
|
68
|
-
int iter0;
|
69
|
-
int invok;
|
70
|
-
int nbfinv;
|
71
|
-
int num_resets;
|
72
|
-
int nnentl;
|
73
|
-
int nnentu;
|
74
|
-
#ifdef CLP_REUSE_ETAS
|
75
|
-
int save_nnentu;
|
76
|
-
#endif
|
77
|
-
int ndenuc;
|
78
|
-
int npivots; /* use as xpivsq in factorization */
|
79
|
-
int kmxeta;
|
80
|
-
int xnetal;
|
81
|
-
int first_dense;
|
82
|
-
int last_dense;
|
83
|
-
int iterno;
|
84
|
-
int numberSlacks;
|
85
|
-
int lastSlack;
|
86
|
-
int firstNonSlack;
|
87
|
-
int xnetalval;
|
88
|
-
int lstart;
|
89
|
-
int if_sparse_update;
|
90
|
-
mutable int packedMode;
|
91
|
-
int switch_off_sparse_update;
|
92
|
-
int nuspike;
|
93
|
-
bool rows_ok; /* replaces test using mrstrt[1] */
|
94
|
-
#ifdef CLP_REUSE_ETAS
|
95
|
-
mutable int reintro;
|
96
|
-
#endif
|
97
|
-
int nR_etas;
|
98
|
-
int sortedEta; /* if vector for F-T is sorted */
|
99
|
-
int lastEtaCount;
|
100
|
-
int ifvsol;
|
101
|
-
int eta_size;
|
102
|
-
int last_eta_size;
|
103
|
-
int maxNNetas;
|
104
|
-
} EKKfactinfo;
|
105
|
-
|
106
|
-
class CoinOslFactorization : public CoinOtherFactorization {
|
107
|
-
friend void CoinOslFactorizationUnitTest( const std::string & mpsDir );
|
108
|
-
|
109
|
-
public:
|
110
|
-
|
111
|
-
/**@name Constructors and destructor and copy */
|
112
|
-
//@{
|
113
|
-
/// Default constructor
|
114
|
-
CoinOslFactorization ( );
|
115
|
-
/// Copy constructor
|
116
|
-
CoinOslFactorization ( const CoinOslFactorization &other);
|
117
|
-
|
118
|
-
/// Destructor
|
119
|
-
virtual ~CoinOslFactorization ( );
|
120
|
-
/// = copy
|
121
|
-
CoinOslFactorization & operator = ( const CoinOslFactorization & other );
|
122
|
-
/// Clone
|
123
|
-
virtual CoinOtherFactorization * clone() const ;
|
124
|
-
//@}
|
125
|
-
|
126
|
-
/**@name Do factorization - public */
|
127
|
-
//@{
|
128
|
-
/// Gets space for a factorization
|
129
|
-
virtual void getAreas ( int numberRows,
|
130
|
-
int numberColumns,
|
131
|
-
CoinBigIndex maximumL,
|
132
|
-
CoinBigIndex maximumU );
|
133
|
-
|
134
|
-
/// PreProcesses column ordered copy of basis
|
135
|
-
virtual void preProcess ( );
|
136
|
-
/** Does most of factorization returning status
|
137
|
-
0 - OK
|
138
|
-
-99 - needs more memory
|
139
|
-
-1 - singular - use numberGoodColumns and redo
|
140
|
-
*/
|
141
|
-
virtual int factor ( );
|
142
|
-
/// Does post processing on valid factorization - putting variables on correct rows
|
143
|
-
virtual void postProcess(const int * sequence, int * pivotVariable);
|
144
|
-
/// Makes a non-singular basis by replacing variables
|
145
|
-
virtual void makeNonSingular(int * sequence, int numberColumns);
|
146
|
-
/** When part of LP - given by basic variables.
|
147
|
-
Actually does factorization.
|
148
|
-
Arrays passed in have non negative value to say basic.
|
149
|
-
If status is okay, basic variables have pivot row - this is only needed
|
150
|
-
If status is singular, then basic variables have pivot row
|
151
|
-
and ones thrown out have -1
|
152
|
-
returns 0 -okay, -1 singular, -2 too many in basis, -99 memory */
|
153
|
-
int factorize ( const CoinPackedMatrix & matrix,
|
154
|
-
int rowIsBasic[], int columnIsBasic[] ,
|
155
|
-
double areaFactor = 0.0 );
|
156
|
-
//@}
|
157
|
-
|
158
|
-
/**@name general stuff such as number of elements */
|
159
|
-
//@{
|
160
|
-
/// Total number of elements in factorization
|
161
|
-
virtual inline int numberElements ( ) const {
|
162
|
-
return numberRows_*(numberColumns_+numberPivots_);
|
163
|
-
}
|
164
|
-
/// Returns array to put basis elements in
|
165
|
-
virtual CoinFactorizationDouble * elements() const;
|
166
|
-
/// Returns pivot row
|
167
|
-
virtual int * pivotRow() const;
|
168
|
-
/// Returns work area
|
169
|
-
virtual CoinFactorizationDouble * workArea() const;
|
170
|
-
/// Returns int work area
|
171
|
-
virtual int * intWorkArea() const;
|
172
|
-
/// Number of entries in each row
|
173
|
-
virtual int * numberInRow() const;
|
174
|
-
/// Number of entries in each column
|
175
|
-
virtual int * numberInColumn() const;
|
176
|
-
/// Returns array to put basis starts in
|
177
|
-
virtual CoinBigIndex * starts() const;
|
178
|
-
/// Returns permute back
|
179
|
-
virtual int * permuteBack() const;
|
180
|
-
/// Returns true if wants tableauColumn in replaceColumn
|
181
|
-
virtual bool wantsTableauColumn() const;
|
182
|
-
/** Useful information for factorization
|
183
|
-
0 - iteration number
|
184
|
-
whereFrom is 0 for factorize and 1 for replaceColumn
|
185
|
-
*/
|
186
|
-
virtual void setUsefulInformation(const int * info,int whereFrom);
|
187
|
-
/// Set maximum pivots
|
188
|
-
virtual void maximumPivots ( int value );
|
189
|
-
|
190
|
-
/// Returns maximum absolute value in factorization
|
191
|
-
double maximumCoefficient() const;
|
192
|
-
/// Condition number - product of pivots after factorization
|
193
|
-
double conditionNumber() const;
|
194
|
-
/// Get rid of all memory
|
195
|
-
virtual void clearArrays();
|
196
|
-
//@}
|
197
|
-
|
198
|
-
/**@name rank one updates which do exist */
|
199
|
-
//@{
|
200
|
-
|
201
|
-
/** Replaces one Column to basis,
|
202
|
-
returns 0=OK, 1=Probably OK, 2=singular, 3=no room
|
203
|
-
If checkBeforeModifying is true will do all accuracy checks
|
204
|
-
before modifying factorization. Whether to set this depends on
|
205
|
-
speed considerations. You could just do this on first iteration
|
206
|
-
after factorization and thereafter re-factorize
|
207
|
-
partial update already in U */
|
208
|
-
virtual int replaceColumn ( CoinIndexedVector * regionSparse,
|
209
|
-
int pivotRow,
|
210
|
-
double pivotCheck ,
|
211
|
-
bool checkBeforeModifying=false,
|
212
|
-
double acceptablePivot=1.0e-8);
|
213
|
-
//@}
|
214
|
-
|
215
|
-
/**@name various uses of factorization (return code number elements)
|
216
|
-
which user may want to know about */
|
217
|
-
//@{
|
218
|
-
/** Updates one column (FTRAN) from regionSparse2
|
219
|
-
Tries to do FT update
|
220
|
-
number returned is negative if no room
|
221
|
-
regionSparse starts as zero and is zero at end.
|
222
|
-
Note - if regionSparse2 packed on input - will be packed on output
|
223
|
-
*/
|
224
|
-
virtual int updateColumnFT ( CoinIndexedVector * regionSparse,
|
225
|
-
CoinIndexedVector * regionSparse2,
|
226
|
-
bool noPermute=false);
|
227
|
-
/** This version has same effect as above with FTUpdate==false
|
228
|
-
so number returned is always >=0 */
|
229
|
-
virtual int updateColumn ( CoinIndexedVector * regionSparse,
|
230
|
-
CoinIndexedVector * regionSparse2,
|
231
|
-
bool noPermute=false) const;
|
232
|
-
/// does FTRAN on two columns
|
233
|
-
virtual int updateTwoColumnsFT(CoinIndexedVector * regionSparse1,
|
234
|
-
CoinIndexedVector * regionSparse2,
|
235
|
-
CoinIndexedVector * regionSparse3,
|
236
|
-
bool noPermute=false);
|
237
|
-
/** Updates one column (BTRAN) from regionSparse2
|
238
|
-
regionSparse starts as zero and is zero at end
|
239
|
-
Note - if regionSparse2 packed on input - will be packed on output
|
240
|
-
*/
|
241
|
-
virtual int updateColumnTranspose ( CoinIndexedVector * regionSparse,
|
242
|
-
CoinIndexedVector * regionSparse2) const;
|
243
|
-
//@}
|
244
|
-
/// *** Below this user may not want to know about
|
245
|
-
|
246
|
-
/**@name various uses of factorization
|
247
|
-
which user may not want to know about (left over from my LP code) */
|
248
|
-
//@{
|
249
|
-
/// Get rid of all memory
|
250
|
-
//inline void clearArrays()
|
251
|
-
//{ gutsOfDestructor();}
|
252
|
-
/// Returns array to put basis indices in
|
253
|
-
virtual int * indices() const;
|
254
|
-
/// Returns permute in
|
255
|
-
virtual inline int * permute() const
|
256
|
-
{ return NULL;/*pivotRow_*/;}
|
257
|
-
//@}
|
258
|
-
|
259
|
-
/// The real work of desstructor
|
260
|
-
void gutsOfDestructor(bool clearFact=true);
|
261
|
-
/// The real work of constructor
|
262
|
-
void gutsOfInitialize(bool zapFact=true);
|
263
|
-
/// The real work of copy
|
264
|
-
void gutsOfCopy(const CoinOslFactorization &other);
|
265
|
-
|
266
|
-
//@}
|
267
|
-
protected:
|
268
|
-
/** Returns accuracy status of replaceColumn
|
269
|
-
returns 0=OK, 1=Probably OK, 2=singular */
|
270
|
-
int checkPivot(double saveFromU, double oldPivot) const;
|
271
|
-
////////////////// data //////////////////
|
272
|
-
protected:
|
273
|
-
|
274
|
-
/**@name data */
|
275
|
-
//@{
|
276
|
-
/// Osl factorization data
|
277
|
-
EKKfactinfo factInfo_;
|
278
|
-
//@}
|
279
|
-
};
|
280
|
-
#endif
|
@@ -1,947 +0,0 @@
|
|
1
|
-
/* $Id: CoinPackedMatrix.hpp 1560 2012-11-24 00:29:01Z lou $ */
|
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 CoinPackedMatrix_H
|
7
|
-
#define CoinPackedMatrix_H
|
8
|
-
|
9
|
-
#include "CoinError.hpp"
|
10
|
-
#include "CoinTypes.hpp"
|
11
|
-
#ifndef CLP_NO_VECTOR
|
12
|
-
#include "CoinPackedVectorBase.hpp"
|
13
|
-
#include "CoinShallowPackedVector.hpp"
|
14
|
-
#else
|
15
|
-
class CoinRelFltEq;
|
16
|
-
#endif
|
17
|
-
|
18
|
-
/** Sparse Matrix Base Class
|
19
|
-
|
20
|
-
This class is intended to represent sparse matrices using row-major
|
21
|
-
or column-major ordering. The representation is very efficient for
|
22
|
-
adding, deleting, or retrieving major-dimension vectors. Adding
|
23
|
-
a minor-dimension vector is less efficient, but can be helped by
|
24
|
-
providing "extra" space as described in the next paragraph. Deleting
|
25
|
-
a minor-dimension vector requires inspecting all coefficients in the
|
26
|
-
matrix. Retrieving a minor-dimension vector would incur the same cost
|
27
|
-
and is not supported (except in the sense that you can write a loop to
|
28
|
-
retrieve all coefficients one at a time). Consider physically transposing
|
29
|
-
the matrix, or keeping a second copy with the other major-vector ordering.
|
30
|
-
|
31
|
-
The sparse represention can be completely compact or it can have "extra"
|
32
|
-
space available at the end of each major vector. Incorporating extra
|
33
|
-
space into the sparse matrix representation can improve performance in
|
34
|
-
cases where new data needs to be inserted into the packed matrix against
|
35
|
-
the major-vector orientation (e.g, inserting a row into a matrix stored
|
36
|
-
in column-major order).
|
37
|
-
|
38
|
-
For example if the matrix:
|
39
|
-
@verbatim
|
40
|
-
3 1 0 -2 -1 0 0 -1
|
41
|
-
0 2 1.1 0 0 0 0 0
|
42
|
-
0 0 1 0 0 1 0 0
|
43
|
-
0 0 0 2.8 0 0 -1.2 0
|
44
|
-
5.6 0 0 0 1 0 0 1.9
|
45
|
-
|
46
|
-
was stored by rows (with no extra space) in
|
47
|
-
CoinPackedMatrix r then:
|
48
|
-
r.getElements() returns a vector containing:
|
49
|
-
3 1 -2 -1 -1 2 1.1 1 1 2.8 -1.2 5.6 1 1.9
|
50
|
-
r.getIndices() returns a vector containing:
|
51
|
-
0 1 3 4 7 1 2 2 5 3 6 0 4 7
|
52
|
-
r.getVectorStarts() returns a vector containing:
|
53
|
-
0 5 7 9 11 14
|
54
|
-
r.getNumElements() returns 14.
|
55
|
-
r.getMajorDim() returns 5.
|
56
|
-
r.getVectorSize(0) returns 5.
|
57
|
-
r.getVectorSize(1) returns 2.
|
58
|
-
r.getVectorSize(2) returns 2.
|
59
|
-
r.getVectorSize(3) returns 2.
|
60
|
-
r.getVectorSize(4) returns 3.
|
61
|
-
|
62
|
-
If stored by columns (with no extra space) then:
|
63
|
-
c.getElements() returns a vector containing:
|
64
|
-
3 5.6 1 2 1.1 1 -2 2.8 -1 1 1 -1.2 -1 1.9
|
65
|
-
c.getIndices() returns a vector containing:
|
66
|
-
0 4 0 1 1 2 0 3 0 4 2 3 0 4
|
67
|
-
c.getVectorStarts() returns a vector containing:
|
68
|
-
0 2 4 6 8 10 11 12 14
|
69
|
-
c.getNumElements() returns 14.
|
70
|
-
c.getMajorDim() returns 8.
|
71
|
-
@endverbatim
|
72
|
-
|
73
|
-
Compiling this class with CLP_NO_VECTOR defined will excise all methods
|
74
|
-
which use CoinPackedVectorBase, CoinPackedVector, or CoinShallowPackedVector
|
75
|
-
as parameters or return types.
|
76
|
-
|
77
|
-
Compiling this class with COIN_FAST_CODE defined removes index range checks.
|
78
|
-
*/
|
79
|
-
class CoinPackedMatrix {
|
80
|
-
friend void CoinPackedMatrixUnitTest();
|
81
|
-
|
82
|
-
public:
|
83
|
-
|
84
|
-
|
85
|
-
//---------------------------------------------------------------------------
|
86
|
-
/**@name Query members */
|
87
|
-
//@{
|
88
|
-
/** Return the current setting of the extra gap. */
|
89
|
-
inline double getExtraGap() const { return extraGap_; }
|
90
|
-
/** Return the current setting of the extra major. */
|
91
|
-
inline double getExtraMajor() const { return extraMajor_; }
|
92
|
-
|
93
|
-
/** Reserve sufficient space for appending major-ordered vectors.
|
94
|
-
If create is true, empty columns are created (for column generation) */
|
95
|
-
void reserve(const int newMaxMajorDim, const CoinBigIndex newMaxSize,
|
96
|
-
bool create=false);
|
97
|
-
/** Clear the data, but do not free any arrays */
|
98
|
-
void clear();
|
99
|
-
|
100
|
-
/** Whether the packed matrix is column major ordered or not. */
|
101
|
-
inline bool isColOrdered() const { return colOrdered_; }
|
102
|
-
|
103
|
-
/** Whether the packed matrix has gaps or not. */
|
104
|
-
inline bool hasGaps() const { return (size_<start_[majorDim_]) ; }
|
105
|
-
|
106
|
-
/** Number of entries in the packed matrix. */
|
107
|
-
inline CoinBigIndex getNumElements() const { return size_; }
|
108
|
-
|
109
|
-
/** Number of columns. */
|
110
|
-
inline int getNumCols() const
|
111
|
-
{ return colOrdered_ ? majorDim_ : minorDim_; }
|
112
|
-
|
113
|
-
/** Number of rows. */
|
114
|
-
inline int getNumRows() const
|
115
|
-
{ return colOrdered_ ? minorDim_ : majorDim_; }
|
116
|
-
|
117
|
-
/*! \brief A vector containing the elements in the packed matrix.
|
118
|
-
|
119
|
-
Returns #elements_. Note that there might be gaps in this vector,
|
120
|
-
entries that do not belong to any major-dimension vector. To get
|
121
|
-
the actual elements one should look at this vector together with
|
122
|
-
vectorStarts (#start_) and vectorLengths (#length_).
|
123
|
-
*/
|
124
|
-
inline const double * getElements() const { return element_; }
|
125
|
-
|
126
|
-
/*! \brief A vector containing the minor indices of the elements in
|
127
|
-
the packed matrix.
|
128
|
-
|
129
|
-
Returns #index_. Note that there might be gaps in this list,
|
130
|
-
entries that do not belong to any major-dimension vector. To get
|
131
|
-
the actual elements one should look at this vector together with
|
132
|
-
vectorStarts (#start_) and vectorLengths (#length_).
|
133
|
-
*/
|
134
|
-
inline const int * getIndices() const { return index_; }
|
135
|
-
|
136
|
-
/*! \brief The size of the <code>vectorStarts</code> array
|
137
|
-
|
138
|
-
See #start_.
|
139
|
-
*/
|
140
|
-
inline int getSizeVectorStarts() const
|
141
|
-
{ return ((majorDim_ > 0)?(majorDim_+1):(0)) ; }
|
142
|
-
|
143
|
-
/*! \brief The size of the <code>vectorLengths</code> array
|
144
|
-
|
145
|
-
See #length_.
|
146
|
-
*/
|
147
|
-
inline int getSizeVectorLengths() const { return majorDim_; }
|
148
|
-
|
149
|
-
/*! \brief The positions where the major-dimension vectors start in
|
150
|
-
elements and indices.
|
151
|
-
|
152
|
-
See #start_.
|
153
|
-
*/
|
154
|
-
inline const CoinBigIndex * getVectorStarts() const { return start_; }
|
155
|
-
|
156
|
-
/*! \brief The lengths of the major-dimension vectors.
|
157
|
-
|
158
|
-
See #length_.
|
159
|
-
*/
|
160
|
-
inline const int * getVectorLengths() const { return length_; }
|
161
|
-
|
162
|
-
/** The position of the first element in the i'th major-dimension vector.
|
163
|
-
*/
|
164
|
-
CoinBigIndex getVectorFirst(const int i) const {
|
165
|
-
#ifndef COIN_FAST_CODE
|
166
|
-
if (i < 0 || i >= majorDim_)
|
167
|
-
throw CoinError("bad index", "vectorFirst", "CoinPackedMatrix");
|
168
|
-
#endif
|
169
|
-
return start_[i];
|
170
|
-
}
|
171
|
-
/** The position of the last element (well, one entry <em>past</em> the
|
172
|
-
last) in the i'th major-dimension vector. */
|
173
|
-
CoinBigIndex getVectorLast(const int i) const {
|
174
|
-
#ifndef COIN_FAST_CODE
|
175
|
-
if (i < 0 || i >= majorDim_)
|
176
|
-
throw CoinError("bad index", "vectorLast", "CoinPackedMatrix");
|
177
|
-
#endif
|
178
|
-
return start_[i] + length_[i];
|
179
|
-
}
|
180
|
-
/** The length of i'th vector. */
|
181
|
-
inline int getVectorSize(const int i) const {
|
182
|
-
#ifndef COIN_FAST_CODE
|
183
|
-
if (i < 0 || i >= majorDim_)
|
184
|
-
throw CoinError("bad index", "vectorSize", "CoinPackedMatrix");
|
185
|
-
#endif
|
186
|
-
return length_[i];
|
187
|
-
}
|
188
|
-
#ifndef CLP_NO_VECTOR
|
189
|
-
/** Return the i'th vector in matrix. */
|
190
|
-
const CoinShallowPackedVector getVector(int i) const {
|
191
|
-
#ifndef COIN_FAST_CODE
|
192
|
-
if (i < 0 || i >= majorDim_)
|
193
|
-
throw CoinError("bad index", "vector", "CoinPackedMatrix");
|
194
|
-
#endif
|
195
|
-
return CoinShallowPackedVector(length_[i],
|
196
|
-
index_ + start_[i],
|
197
|
-
element_ + start_[i],
|
198
|
-
false);
|
199
|
-
}
|
200
|
-
#endif
|
201
|
-
/** Returns an array containing major indices. The array is
|
202
|
-
getNumElements long and if getVectorStarts() is 0,2,5 then
|
203
|
-
the array would start 0,0,1,1,1,2...
|
204
|
-
This method is provided to go back from a packed format
|
205
|
-
to a triple format. It returns NULL if there are gaps in
|
206
|
-
matrix so user should use removeGaps() if there are any gaps.
|
207
|
-
It does this as this array has to match getElements() and
|
208
|
-
getIndices() and because it makes no sense otherwise.
|
209
|
-
The returned array is allocated with <code>new int[]</code>,
|
210
|
-
free it with <code>delete[]</code>. */
|
211
|
-
int * getMajorIndices() const;
|
212
|
-
//@}
|
213
|
-
|
214
|
-
//---------------------------------------------------------------------------
|
215
|
-
/**@name Modifying members */
|
216
|
-
//@{
|
217
|
-
/*! \brief Set the dimensions of the matrix.
|
218
|
-
|
219
|
-
The method name is deceptive; the effect is to append empty columns
|
220
|
-
and/or rows to the matrix to reach the specified dimensions.
|
221
|
-
A negative number for either dimension means that that dimension
|
222
|
-
doesn't change. An exception will be thrown if the specified dimensions
|
223
|
-
are smaller than the current dimensions.
|
224
|
-
*/
|
225
|
-
void setDimensions(int numrows, int numcols);
|
226
|
-
|
227
|
-
/** Set the extra gap to be allocated to the specified value. */
|
228
|
-
void setExtraGap(const double newGap);
|
229
|
-
/** Set the extra major to be allocated to the specified value. */
|
230
|
-
void setExtraMajor(const double newMajor);
|
231
|
-
#ifndef CLP_NO_VECTOR
|
232
|
-
/*! Append a column to the end of the matrix.
|
233
|
-
|
234
|
-
When compiled with COIN_DEBUG defined this method throws an exception
|
235
|
-
if the column vector specifies a nonexistent row index. Otherwise the
|
236
|
-
method assumes that every index fits into the matrix.
|
237
|
-
*/
|
238
|
-
void appendCol(const CoinPackedVectorBase& vec);
|
239
|
-
#endif
|
240
|
-
/*! Append a column to the end of the matrix.
|
241
|
-
|
242
|
-
When compiled with COIN_DEBUG defined this method throws an exception
|
243
|
-
if the column vector specifies a nonexistent row index. Otherwise the
|
244
|
-
method assumes that every index fits into the matrix.
|
245
|
-
*/
|
246
|
-
void appendCol(const int vecsize,
|
247
|
-
const int *vecind, const double *vecelem);
|
248
|
-
#ifndef CLP_NO_VECTOR
|
249
|
-
/*! Append a set of columns to the end of the matrix.
|
250
|
-
|
251
|
-
When compiled with COIN_DEBUG defined this method throws an exception
|
252
|
-
if any of the column vectors specify a nonexistent row index. Otherwise
|
253
|
-
the method assumes that every index fits into the matrix.
|
254
|
-
*/
|
255
|
-
void appendCols(const int numcols,
|
256
|
-
const CoinPackedVectorBase * const * cols);
|
257
|
-
#endif
|
258
|
-
/*! Append a set of columns to the end of the matrix.
|
259
|
-
|
260
|
-
Returns the number of errors (nonexistent or duplicate row index).
|
261
|
-
No error checking is performed if \p numberRows < 0.
|
262
|
-
*/
|
263
|
-
int appendCols(const int numcols,
|
264
|
-
const CoinBigIndex * columnStarts, const int * row,
|
265
|
-
const double * element, int numberRows=-1);
|
266
|
-
#ifndef CLP_NO_VECTOR
|
267
|
-
/*! Append a row to the end of the matrix.
|
268
|
-
|
269
|
-
When compiled with COIN_DEBUG defined this method throws an exception
|
270
|
-
if the row vector specifies a nonexistent column index. Otherwise the
|
271
|
-
method assumes that every index fits into the matrix.
|
272
|
-
*/
|
273
|
-
void appendRow(const CoinPackedVectorBase& vec);
|
274
|
-
#endif
|
275
|
-
/*! Append a row to the end of the matrix.
|
276
|
-
|
277
|
-
When compiled with COIN_DEBUG defined this method throws an exception
|
278
|
-
if the row vector specifies a nonexistent column index. Otherwise the
|
279
|
-
method assumes that every index fits into the matrix.
|
280
|
-
*/
|
281
|
-
void appendRow(const int vecsize,
|
282
|
-
const int *vecind, const double *vecelem);
|
283
|
-
#ifndef CLP_NO_VECTOR
|
284
|
-
/*! Append a set of rows to the end of the matrix.
|
285
|
-
|
286
|
-
When compiled with COIN_DEBUG defined this method throws an exception
|
287
|
-
if any of the row vectors specify a nonexistent column index. Otherwise
|
288
|
-
the method assumes that every index fits into the matrix.
|
289
|
-
*/
|
290
|
-
void appendRows(const int numrows,
|
291
|
-
const CoinPackedVectorBase * const * rows);
|
292
|
-
#endif
|
293
|
-
/*! Append a set of rows to the end of the matrix.
|
294
|
-
|
295
|
-
Returns the number of errors (nonexistent or duplicate column index).
|
296
|
-
No error checking is performed if \p numberColumns < 0.
|
297
|
-
*/
|
298
|
-
int appendRows(const int numrows,
|
299
|
-
const CoinBigIndex * rowStarts, const int * column,
|
300
|
-
const double * element, int numberColumns=-1);
|
301
|
-
|
302
|
-
/** Append the argument to the "right" of the current matrix. Imagine this
|
303
|
-
as adding new columns (don't worry about how the matrices are ordered,
|
304
|
-
that is taken care of). An exception is thrown if the number of rows
|
305
|
-
is different in the matrices. */
|
306
|
-
void rightAppendPackedMatrix(const CoinPackedMatrix& matrix);
|
307
|
-
/** Append the argument to the "bottom" of the current matrix. Imagine this
|
308
|
-
as adding new rows (don't worry about how the matrices are ordered,
|
309
|
-
that is taken care of). An exception is thrown if the number of columns
|
310
|
-
is different in the matrices. */
|
311
|
-
void bottomAppendPackedMatrix(const CoinPackedMatrix& matrix);
|
312
|
-
|
313
|
-
/** Delete the columns whose indices are listed in <code>indDel</code>. */
|
314
|
-
void deleteCols(const int numDel, const int * indDel);
|
315
|
-
/** Delete the rows whose indices are listed in <code>indDel</code>. */
|
316
|
-
void deleteRows(const int numDel, const int * indDel);
|
317
|
-
|
318
|
-
/** Replace the elements of a vector. The indices remain the same.
|
319
|
-
At most the number specified will be replaced.
|
320
|
-
The index is between 0 and major dimension of matrix */
|
321
|
-
void replaceVector(const int index,
|
322
|
-
const int numReplace, const double * newElements);
|
323
|
-
/** Modify one element of packed matrix. An element may be added.
|
324
|
-
This works for either ordering
|
325
|
-
If the new element is zero it will be deleted unless
|
326
|
-
keepZero true */
|
327
|
-
void modifyCoefficient(int row, int column, double newElement,
|
328
|
-
bool keepZero=false);
|
329
|
-
/** Return one element of packed matrix.
|
330
|
-
This works for either ordering
|
331
|
-
If it is not present will return 0.0 */
|
332
|
-
double getCoefficient(int row, int column) const;
|
333
|
-
|
334
|
-
/** Eliminate all elements in matrix whose
|
335
|
-
absolute value is less than threshold.
|
336
|
-
The column starts are not affected. Returns number of elements
|
337
|
-
eliminated. Elements eliminated are at end of each vector
|
338
|
-
*/
|
339
|
-
int compress(double threshold);
|
340
|
-
/** Eliminate all duplicate AND small elements in matrix
|
341
|
-
The column starts are not affected. Returns number of elements
|
342
|
-
eliminated.
|
343
|
-
*/
|
344
|
-
int eliminateDuplicates(double threshold);
|
345
|
-
/** Sort all columns so indices are increasing.in each column */
|
346
|
-
void orderMatrix();
|
347
|
-
/** Really clean up matrix.
|
348
|
-
a) eliminate all duplicate AND small elements in matrix
|
349
|
-
b) remove all gaps and set extraGap_ and extraMajor_ to 0.0
|
350
|
-
c) reallocate arrays and make max lengths equal to lengths
|
351
|
-
d) orders elements
|
352
|
-
returns number of elements eliminated
|
353
|
-
*/
|
354
|
-
int cleanMatrix(double threshold=1.0e-20);
|
355
|
-
//@}
|
356
|
-
|
357
|
-
//---------------------------------------------------------------------------
|
358
|
-
/**@name Methods that reorganize the whole matrix */
|
359
|
-
//@{
|
360
|
-
/** Remove the gaps from the matrix if there were any
|
361
|
-
Can also remove small elements fabs() <= removeValue*/
|
362
|
-
void removeGaps(double removeValue=-1.0);
|
363
|
-
|
364
|
-
/** Extract a submatrix from matrix. Those major-dimension vectors of
|
365
|
-
the matrix comprise the submatrix whose indices are given in the
|
366
|
-
arguments. Does not allow duplicates. */
|
367
|
-
void submatrixOf(const CoinPackedMatrix& matrix,
|
368
|
-
const int numMajor, const int * indMajor);
|
369
|
-
/** Extract a submatrix from matrix. Those major-dimension vectors of
|
370
|
-
the matrix comprise the submatrix whose indices are given in the
|
371
|
-
arguments. Allows duplicates and keeps order. */
|
372
|
-
void submatrixOfWithDuplicates(const CoinPackedMatrix& matrix,
|
373
|
-
const int numMajor, const int * indMajor);
|
374
|
-
#if 0
|
375
|
-
/** Extract a submatrix from matrix. Those major/minor-dimension vectors of
|
376
|
-
the matrix comprise the submatrix whose indices are given in the
|
377
|
-
arguments. */
|
378
|
-
void submatrixOf(const CoinPackedMatrix& matrix,
|
379
|
-
const int numMajor, const int * indMajor,
|
380
|
-
const int numMinor, const int * indMinor);
|
381
|
-
#endif
|
382
|
-
|
383
|
-
/** Copy method. This method makes an exact replica of the argument,
|
384
|
-
including the extra space parameters. */
|
385
|
-
void copyOf(const CoinPackedMatrix& rhs);
|
386
|
-
/** Copy the arguments to the matrix. If <code>len</code> is a NULL pointer
|
387
|
-
then the matrix is assumed to have no gaps in it and <code>len</code>
|
388
|
-
will be created accordingly. */
|
389
|
-
void copyOf(const bool colordered,
|
390
|
-
const int minor, const int major, const CoinBigIndex numels,
|
391
|
-
const double * elem, const int * ind,
|
392
|
-
const CoinBigIndex * start, const int * len,
|
393
|
-
const double extraMajor=0.0, const double extraGap=0.0);
|
394
|
-
/** Copy method. This method makes an exact replica of the argument,
|
395
|
-
including the extra space parameters.
|
396
|
-
If there is room it will re-use arrays */
|
397
|
-
void copyReuseArrays(const CoinPackedMatrix& rhs);
|
398
|
-
|
399
|
-
/*! \brief Make a reverse-ordered copy.
|
400
|
-
|
401
|
-
This method makes an exact replica of the argument with the major
|
402
|
-
vector orientation changed from row (column) to column (row).
|
403
|
-
The extra space parameters are also copied and reversed.
|
404
|
-
(Cf. #reverseOrdering, which does the same thing in place.)
|
405
|
-
*/
|
406
|
-
void reverseOrderedCopyOf(const CoinPackedMatrix& rhs);
|
407
|
-
|
408
|
-
/** Assign the arguments to the matrix. If <code>len</code> is a NULL
|
409
|
-
pointer then the matrix is assumed to have no gaps in it and
|
410
|
-
<code>len</code> will be created accordingly. <br>
|
411
|
-
<strong>NOTE 1</strong>: After this method returns the pointers
|
412
|
-
passed to the method will be NULL pointers! <br>
|
413
|
-
<strong>NOTE 2</strong>: When the matrix is eventually destructed the
|
414
|
-
arrays will be deleted by <code>delete[]</code>. Hence one should use
|
415
|
-
this method ONLY if all array swere allocated by <code>new[]</code>! */
|
416
|
-
void assignMatrix(const bool colordered,
|
417
|
-
const int minor, const int major,
|
418
|
-
const CoinBigIndex numels,
|
419
|
-
double *& elem, int *& ind,
|
420
|
-
CoinBigIndex *& start, int *& len,
|
421
|
-
const int maxmajor = -1, const CoinBigIndex maxsize = -1);
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
/** Assignment operator. This copies out the data, but uses the current
|
426
|
-
matrix's extra space parameters. */
|
427
|
-
CoinPackedMatrix & operator=(const CoinPackedMatrix& rhs);
|
428
|
-
|
429
|
-
/*! \brief Reverse the ordering of the packed matrix.
|
430
|
-
|
431
|
-
Change the major vector orientation of the matrix data structures from
|
432
|
-
row (column) to column (row). (Cf. #reverseOrderedCopyOf, which does
|
433
|
-
the same thing but produces a new matrix.)
|
434
|
-
*/
|
435
|
-
void reverseOrdering();
|
436
|
-
|
437
|
-
/*! \brief Transpose the matrix.
|
438
|
-
|
439
|
-
\note
|
440
|
-
If you start with a column-ordered matrix and invoke transpose, you
|
441
|
-
will have a row-ordered transposed matrix. To change the major vector
|
442
|
-
orientation (e.g., to transform a column-ordered matrix to a
|
443
|
-
column-ordered transposed matrix), invoke transpose() followed by
|
444
|
-
#reverseOrdering().
|
445
|
-
*/
|
446
|
-
void transpose();
|
447
|
-
|
448
|
-
/*! \brief Swap the content of two packed matrices. */
|
449
|
-
void swap(CoinPackedMatrix& matrix);
|
450
|
-
|
451
|
-
//@}
|
452
|
-
|
453
|
-
//---------------------------------------------------------------------------
|
454
|
-
/**@name Matrix times vector methods */
|
455
|
-
//@{
|
456
|
-
/** Return <code>A * x</code> in <code>y</code>.
|
457
|
-
@pre <code>x</code> must be of size <code>numColumns()</code>
|
458
|
-
@pre <code>y</code> must be of size <code>numRows()</code> */
|
459
|
-
void times(const double * x, double * y) const;
|
460
|
-
#ifndef CLP_NO_VECTOR
|
461
|
-
/** Return <code>A * x</code> in <code>y</code>. Same as the previous
|
462
|
-
method, just <code>x</code> is given in the form of a packed vector. */
|
463
|
-
void times(const CoinPackedVectorBase& x, double * y) const;
|
464
|
-
#endif
|
465
|
-
/** Return <code>x * A</code> in <code>y</code>.
|
466
|
-
@pre <code>x</code> must be of size <code>numRows()</code>
|
467
|
-
@pre <code>y</code> must be of size <code>numColumns()</code> */
|
468
|
-
void transposeTimes(const double * x, double * y) const;
|
469
|
-
#ifndef CLP_NO_VECTOR
|
470
|
-
/** Return <code>x * A</code> in <code>y</code>. Same as the previous
|
471
|
-
method, just <code>x</code> is given in the form of a packed vector. */
|
472
|
-
void transposeTimes(const CoinPackedVectorBase& x, double * y) const;
|
473
|
-
#endif
|
474
|
-
//@}
|
475
|
-
|
476
|
-
//---------------------------------------------------------------------------
|
477
|
-
/**@name Helper functions used internally, but maybe useful externally.
|
478
|
-
|
479
|
-
These methods do not worry about testing whether the packed matrix is
|
480
|
-
row or column major ordered; they operate under the assumption that the
|
481
|
-
correct version is invoked. In fact, a number of other methods simply
|
482
|
-
just call one of these after testing the ordering of the matrix. */
|
483
|
-
//@{
|
484
|
-
|
485
|
-
//-------------------------------------------------------------------------
|
486
|
-
/**@name Queries */
|
487
|
-
//@{
|
488
|
-
/** Count the number of entries in every minor-dimension vector and
|
489
|
-
return an array containing these lengths. The returned array is
|
490
|
-
allocated with <code>new int[]</code>, free it with
|
491
|
-
<code>delete[]</code>. */
|
492
|
-
int * countOrthoLength() const;
|
493
|
-
/** Count the number of entries in every minor-dimension vector and
|
494
|
-
fill in an array containing these lengths. */
|
495
|
-
void countOrthoLength(int * counts) const;
|
496
|
-
/** Major dimension. For row ordered matrix this would be the number of
|
497
|
-
rows. */
|
498
|
-
inline int getMajorDim() const { return majorDim_; }
|
499
|
-
/** Set major dimension. For row ordered matrix this would be the number of
|
500
|
-
rows. Use with great care.*/
|
501
|
-
inline void setMajorDim(int value) { majorDim_ = value; }
|
502
|
-
/** Minor dimension. For row ordered matrix this would be the number of
|
503
|
-
columns. */
|
504
|
-
inline int getMinorDim() const { return minorDim_; }
|
505
|
-
/** Set minor dimension. For row ordered matrix this would be the number of
|
506
|
-
columns. Use with great care.*/
|
507
|
-
inline void setMinorDim(int value) { minorDim_ = value; }
|
508
|
-
/** Current maximum for major dimension. For row ordered matrix this many
|
509
|
-
rows can be added without reallocating the vector related to the
|
510
|
-
major dimension (<code>start_</code> and <code>length_</code>). */
|
511
|
-
inline int getMaxMajorDim() const { return maxMajorDim_; }
|
512
|
-
|
513
|
-
/** Dump the matrix on stdout. When in dire straits this method can
|
514
|
-
help. */
|
515
|
-
void dumpMatrix(const char* fname = NULL) const;
|
516
|
-
|
517
|
-
/// Print a single matrix element.
|
518
|
-
void printMatrixElement(const int row_val, const int col_val) const;
|
519
|
-
//@}
|
520
|
-
|
521
|
-
//-------------------------------------------------------------------------
|
522
|
-
/*! @name Append vectors
|
523
|
-
|
524
|
-
\details
|
525
|
-
When compiled with COIN_DEBUG defined these methods throw an exception
|
526
|
-
if the major (minor) vector contains an index that's invalid for the
|
527
|
-
minor (major) dimension. Otherwise the methods assume that every index
|
528
|
-
fits into the matrix.
|
529
|
-
*/
|
530
|
-
//@{
|
531
|
-
#ifndef CLP_NO_VECTOR
|
532
|
-
/** Append a major-dimension vector to the end of the matrix. */
|
533
|
-
void appendMajorVector(const CoinPackedVectorBase& vec);
|
534
|
-
#endif
|
535
|
-
/** Append a major-dimension vector to the end of the matrix. */
|
536
|
-
void appendMajorVector(const int vecsize, const int *vecind,
|
537
|
-
const double *vecelem);
|
538
|
-
#ifndef CLP_NO_VECTOR
|
539
|
-
/** Append several major-dimensonvectors to the end of the matrix */
|
540
|
-
void appendMajorVectors(const int numvecs,
|
541
|
-
const CoinPackedVectorBase * const * vecs);
|
542
|
-
|
543
|
-
/** Append a minor-dimension vector to the end of the matrix. */
|
544
|
-
void appendMinorVector(const CoinPackedVectorBase& vec);
|
545
|
-
#endif
|
546
|
-
/** Append a minor-dimension vector to the end of the matrix. */
|
547
|
-
void appendMinorVector(const int vecsize, const int *vecind,
|
548
|
-
const double *vecelem);
|
549
|
-
#ifndef CLP_NO_VECTOR
|
550
|
-
/** Append several minor-dimension vectors to the end of the matrix */
|
551
|
-
void appendMinorVectors(const int numvecs,
|
552
|
-
const CoinPackedVectorBase * const * vecs);
|
553
|
-
#endif
|
554
|
-
/*! \brief Append a set of rows (columns) to the end of a column (row)
|
555
|
-
ordered matrix.
|
556
|
-
|
557
|
-
This case is when we know there are no gaps and majorDim_ will not
|
558
|
-
change.
|
559
|
-
|
560
|
-
\todo
|
561
|
-
This method really belongs in the group of protected methods with
|
562
|
-
#appendMinor; there are no safeties here even with COIN_DEBUG.
|
563
|
-
Apparently this method was needed in ClpPackedMatrix and giving it
|
564
|
-
proper visibility was too much trouble. Should be moved.
|
565
|
-
*/
|
566
|
-
void appendMinorFast(const int number,
|
567
|
-
const CoinBigIndex * starts, const int * index,
|
568
|
-
const double * element);
|
569
|
-
//@}
|
570
|
-
|
571
|
-
//-------------------------------------------------------------------------
|
572
|
-
/*! \name Append matrices
|
573
|
-
|
574
|
-
\details
|
575
|
-
We'll document these methods assuming that the current matrix is
|
576
|
-
column major ordered (Hence in the <code>...SameOrdered()</code>
|
577
|
-
methods the argument is column ordered, in the
|
578
|
-
<code>OrthoOrdered()</code> methods the argument is row ordered.)
|
579
|
-
*/
|
580
|
-
//@{
|
581
|
-
/** Append the columns of the argument to the right end of this matrix.
|
582
|
-
@pre <code>minorDim_ == matrix.minorDim_</code> <br>
|
583
|
-
This method throws an exception if the minor dimensions are not the
|
584
|
-
same. */
|
585
|
-
void majorAppendSameOrdered(const CoinPackedMatrix& matrix);
|
586
|
-
/** Append the columns of the argument to the bottom end of this matrix.
|
587
|
-
@pre <code>majorDim_ == matrix.majorDim_</code> <br>
|
588
|
-
This method throws an exception if the major dimensions are not the
|
589
|
-
same. */
|
590
|
-
void minorAppendSameOrdered(const CoinPackedMatrix& matrix);
|
591
|
-
/** Append the rows of the argument to the right end of this matrix.
|
592
|
-
@pre <code>minorDim_ == matrix.majorDim_</code> <br>
|
593
|
-
This method throws an exception if the minor dimension of the
|
594
|
-
current matrix is not the same as the major dimension of the
|
595
|
-
argument matrix. */
|
596
|
-
void majorAppendOrthoOrdered(const CoinPackedMatrix& matrix);
|
597
|
-
/** Append the rows of the argument to the bottom end of this matrix.
|
598
|
-
@pre <code>majorDim_ == matrix.minorDim_</code> <br>
|
599
|
-
This method throws an exception if the major dimension of the
|
600
|
-
current matrix is not the same as the minor dimension of the
|
601
|
-
argument matrix. */
|
602
|
-
void minorAppendOrthoOrdered(const CoinPackedMatrix& matrix);
|
603
|
-
//@}
|
604
|
-
|
605
|
-
//-----------------------------------------------------------------------
|
606
|
-
/**@name Delete vectors */
|
607
|
-
//@{
|
608
|
-
/** Delete the major-dimension vectors whose indices are listed in
|
609
|
-
<code>indDel</code>. */
|
610
|
-
void deleteMajorVectors(const int numDel, const int * indDel);
|
611
|
-
/** Delete the minor-dimension vectors whose indices are listed in
|
612
|
-
<code>indDel</code>. */
|
613
|
-
void deleteMinorVectors(const int numDel, const int * indDel);
|
614
|
-
//@}
|
615
|
-
|
616
|
-
//-----------------------------------------------------------------------
|
617
|
-
/**@name Various dot products. */
|
618
|
-
//@{
|
619
|
-
/** Return <code>A * x</code> (multiplied from the "right" direction) in
|
620
|
-
<code>y</code>.
|
621
|
-
@pre <code>x</code> must be of size <code>majorDim()</code>
|
622
|
-
@pre <code>y</code> must be of size <code>minorDim()</code> */
|
623
|
-
void timesMajor(const double * x, double * y) const;
|
624
|
-
#ifndef CLP_NO_VECTOR
|
625
|
-
/** Return <code>A * x</code> (multiplied from the "right" direction) in
|
626
|
-
<code>y</code>. Same as the previous method, just <code>x</code> is
|
627
|
-
given in the form of a packed vector. */
|
628
|
-
void timesMajor(const CoinPackedVectorBase& x, double * y) const;
|
629
|
-
#endif
|
630
|
-
/** Return <code>A * x</code> (multiplied from the "right" direction) in
|
631
|
-
<code>y</code>.
|
632
|
-
@pre <code>x</code> must be of size <code>minorDim()</code>
|
633
|
-
@pre <code>y</code> must be of size <code>majorDim()</code> */
|
634
|
-
void timesMinor(const double * x, double * y) const;
|
635
|
-
#ifndef CLP_NO_VECTOR
|
636
|
-
/** Return <code>A * x</code> (multiplied from the "right" direction) in
|
637
|
-
<code>y</code>. Same as the previous method, just <code>x</code> is
|
638
|
-
given in the form of a packed vector. */
|
639
|
-
void timesMinor(const CoinPackedVectorBase& x, double * y) const;
|
640
|
-
#endif
|
641
|
-
//@}
|
642
|
-
//@}
|
643
|
-
|
644
|
-
//--------------------------------------------------------------------------
|
645
|
-
/**@name Logical Operations. */
|
646
|
-
//@{
|
647
|
-
#ifndef CLP_NO_VECTOR
|
648
|
-
/*! \brief Test for equivalence.
|
649
|
-
|
650
|
-
Two matrices are equivalent if they are both row- or column-ordered,
|
651
|
-
they have the same dimensions, and each (major) vector is equivalent.
|
652
|
-
The operator used to test for equality can be specified using the
|
653
|
-
\p FloatEqual template parameter.
|
654
|
-
*/
|
655
|
-
template <class FloatEqual> bool
|
656
|
-
isEquivalent(const CoinPackedMatrix& rhs, const FloatEqual& eq) const
|
657
|
-
{
|
658
|
-
// Both must be column order or both row ordered and must be of same size
|
659
|
-
if ((isColOrdered() ^ rhs.isColOrdered()) ||
|
660
|
-
(getNumCols() != rhs.getNumCols()) ||
|
661
|
-
(getNumRows() != rhs.getNumRows()) ||
|
662
|
-
(getNumElements() != rhs.getNumElements()))
|
663
|
-
return false;
|
664
|
-
|
665
|
-
for (int i=getMajorDim()-1; i >= 0; --i) {
|
666
|
-
CoinShallowPackedVector pv = getVector(i);
|
667
|
-
CoinShallowPackedVector rhsPv = rhs.getVector(i);
|
668
|
-
if ( !pv.isEquivalent(rhsPv,eq) )
|
669
|
-
return false;
|
670
|
-
}
|
671
|
-
return true;
|
672
|
-
}
|
673
|
-
|
674
|
-
/*! \brief Test for equivalence and report differences
|
675
|
-
|
676
|
-
Equivalence is defined as for #isEquivalent. In addition, this method will
|
677
|
-
print differences to std::cerr. Intended for use in unit tests and
|
678
|
-
for debugging.
|
679
|
-
*/
|
680
|
-
bool isEquivalent2(const CoinPackedMatrix& rhs) const;
|
681
|
-
#else
|
682
|
-
/*! \brief Test for equivalence.
|
683
|
-
|
684
|
-
Two matrices are equivalent if they are both row- or column-ordered,
|
685
|
-
they have the same dimensions, and each (major) vector is equivalent.
|
686
|
-
This method is optimised for speed. CoinPackedVector#isEquivalent is
|
687
|
-
replaced with more efficient code for repeated comparison of
|
688
|
-
equal-length vectors. The CoinRelFltEq operator is used.
|
689
|
-
*/
|
690
|
-
bool isEquivalent(const CoinPackedMatrix& rhs, const CoinRelFltEq & eq) const;
|
691
|
-
#endif
|
692
|
-
/*! \brief Test for equivalence.
|
693
|
-
|
694
|
-
The test for element equality is the default CoinRelFltEq operator.
|
695
|
-
*/
|
696
|
-
bool isEquivalent(const CoinPackedMatrix& rhs) const;
|
697
|
-
//@}
|
698
|
-
|
699
|
-
//--------------------------------------------------------------------------
|
700
|
-
/*! \name Non-const methods
|
701
|
-
|
702
|
-
These are to be used with great care when doing column generation, etc.
|
703
|
-
*/
|
704
|
-
//@{
|
705
|
-
/** A vector containing the elements in the packed matrix. Note that there
|
706
|
-
might be gaps in this list, entries that do not belong to any
|
707
|
-
major-dimension vector. To get the actual elements one should look at
|
708
|
-
this vector together with #start_ and #length_. */
|
709
|
-
inline double * getMutableElements() const { return element_; }
|
710
|
-
/** A vector containing the minor indices of the elements in the packed
|
711
|
-
matrix. Note that there might be gaps in this list, entries that do not
|
712
|
-
belong to any major-dimension vector. To get the actual elements one
|
713
|
-
should look at this vector together with #start_ and
|
714
|
-
#length_. */
|
715
|
-
inline int * getMutableIndices() const { return index_; }
|
716
|
-
|
717
|
-
/** The positions where the major-dimension vectors start in #element_ and
|
718
|
-
#index_. */
|
719
|
-
inline CoinBigIndex * getMutableVectorStarts() const { return start_; }
|
720
|
-
/** The lengths of the major-dimension vectors. */
|
721
|
-
inline int * getMutableVectorLengths() const { return length_; }
|
722
|
-
/// Change the size of the bulk store after modifying - be careful
|
723
|
-
inline void setNumElements(CoinBigIndex value)
|
724
|
-
{ size_ = value;}
|
725
|
-
/*! NULLify element array
|
726
|
-
|
727
|
-
Used when space is very tight. Does not free the space!
|
728
|
-
*/
|
729
|
-
inline void nullElementArray() {element_=NULL;}
|
730
|
-
|
731
|
-
/*! NULLify start array
|
732
|
-
|
733
|
-
Used when space is very tight. Does not free the space!
|
734
|
-
*/
|
735
|
-
inline void nullStartArray() {start_=NULL;}
|
736
|
-
|
737
|
-
/*! NULLify length array
|
738
|
-
|
739
|
-
Used when space is very tight. Does not free the space!
|
740
|
-
*/
|
741
|
-
inline void nullLengthArray() {length_=NULL;}
|
742
|
-
|
743
|
-
/*! NULLify index array
|
744
|
-
|
745
|
-
Used when space is very tight. Does not free the space!
|
746
|
-
*/
|
747
|
-
inline void nullIndexArray() {index_=NULL;}
|
748
|
-
//@}
|
749
|
-
|
750
|
-
//--------------------------------------------------------------------------
|
751
|
-
/*! \name Constructors and destructors */
|
752
|
-
//@{
|
753
|
-
/// Default Constructor creates an empty column ordered packed matrix
|
754
|
-
CoinPackedMatrix();
|
755
|
-
|
756
|
-
/// A constructor where the ordering and the gaps are specified
|
757
|
-
CoinPackedMatrix(const bool colordered,
|
758
|
-
const double extraMajor, const double extraGap);
|
759
|
-
|
760
|
-
CoinPackedMatrix(const bool colordered,
|
761
|
-
const int minor, const int major, const CoinBigIndex numels,
|
762
|
-
const double * elem, const int * ind,
|
763
|
-
const CoinBigIndex * start, const int * len,
|
764
|
-
const double extraMajor, const double extraGap);
|
765
|
-
|
766
|
-
CoinPackedMatrix(const bool colordered,
|
767
|
-
const int minor, const int major, const CoinBigIndex numels,
|
768
|
-
const double * elem, const int * ind,
|
769
|
-
const CoinBigIndex * start, const int * len);
|
770
|
-
|
771
|
-
/** Create packed matrix from triples.
|
772
|
-
If colordered is true then the created matrix will be column ordered.
|
773
|
-
Duplicate matrix elements are allowed. The created matrix will have
|
774
|
-
the sum of the duplicates. <br>
|
775
|
-
For example if: <br>
|
776
|
-
rowIndices[0]=2; colIndices[0]=5; elements[0]=2.0 <br>
|
777
|
-
rowIndices[1]=2; colIndices[1]=5; elements[1]=0.5 <br>
|
778
|
-
then the created matrix will contain a value of 2.5 in row 2 and column 5.<br>
|
779
|
-
The matrix is created without gaps.
|
780
|
-
*/
|
781
|
-
CoinPackedMatrix(const bool colordered,
|
782
|
-
const int * rowIndices,
|
783
|
-
const int * colIndices,
|
784
|
-
const double * elements,
|
785
|
-
CoinBigIndex numels );
|
786
|
-
|
787
|
-
/// Copy constructor
|
788
|
-
CoinPackedMatrix(const CoinPackedMatrix& m);
|
789
|
-
|
790
|
-
/*! \brief Copy constructor with fine tuning
|
791
|
-
|
792
|
-
This constructor allows for the specification of an exact amount of extra
|
793
|
-
space and/or reverse ordering.
|
794
|
-
|
795
|
-
\p extraForMajor is the exact number of spare major vector slots after
|
796
|
-
any possible reverse ordering. If \p extraForMajor < 0, all gaps and small
|
797
|
-
elements will be removed from the copy, otherwise gaps and small elements
|
798
|
-
are preserved.
|
799
|
-
|
800
|
-
\p extraElements is the exact number of spare element entries.
|
801
|
-
|
802
|
-
The usual multipliers, #extraMajor_ and #extraGap_, are set to zero.
|
803
|
-
*/
|
804
|
-
CoinPackedMatrix(const CoinPackedMatrix &m,
|
805
|
-
int extraForMajor, int extraElements,
|
806
|
-
bool reverseOrdering = false) ;
|
807
|
-
|
808
|
-
/** Subset constructor (without gaps). Duplicates are allowed
|
809
|
-
and order is as given */
|
810
|
-
CoinPackedMatrix (const CoinPackedMatrix & wholeModel,
|
811
|
-
int numberRows, const int * whichRows,
|
812
|
-
int numberColumns, const int * whichColumns);
|
813
|
-
|
814
|
-
/// Destructor
|
815
|
-
virtual ~CoinPackedMatrix();
|
816
|
-
//@}
|
817
|
-
|
818
|
-
/*! \name Debug Utilities */
|
819
|
-
//@{
|
820
|
-
/*! \brief Scan the matrix for anomalies.
|
821
|
-
|
822
|
-
Returns the number of anomalies. Scans the structure for gaps,
|
823
|
-
obviously bogus indices and coefficients, and inconsistencies. Gaps
|
824
|
-
are not an error unless #hasGaps() says the matrix should be
|
825
|
-
gap-free. Zeroes are not an error unless \p zeroesAreError is set to
|
826
|
-
true.
|
827
|
-
|
828
|
-
Values for verbosity are:
|
829
|
-
- 0: No messages, just the return value
|
830
|
-
- 1: Messages about errors
|
831
|
-
- 2: If there are no errors, a message indicating the matrix was
|
832
|
-
checked is printed (positive confirmation).
|
833
|
-
- 3: Adds a bit more information about the matrix.
|
834
|
-
- 4: Prints warnings about zeroes even if they're not considered
|
835
|
-
errors.
|
836
|
-
|
837
|
-
Obviously bogus coefficients are coefficients that are NaN or have
|
838
|
-
absolute value greater than 1e50. Zeros have absolute value less
|
839
|
-
than 1e-50.
|
840
|
-
*/
|
841
|
-
int verifyMtx(int verbosity = 1, bool zeroesAreError = false) const ;
|
842
|
-
//@}
|
843
|
-
|
844
|
-
//--------------------------------------------------------------------------
|
845
|
-
protected:
|
846
|
-
void gutsOfDestructor();
|
847
|
-
void gutsOfCopyOf(const bool colordered,
|
848
|
-
const int minor, const int major, const CoinBigIndex numels,
|
849
|
-
const double * elem, const int * ind,
|
850
|
-
const CoinBigIndex * start, const int * len,
|
851
|
-
const double extraMajor=0.0, const double extraGap=0.0);
|
852
|
-
/// When no gaps we can do faster
|
853
|
-
void gutsOfCopyOfNoGaps(const bool colordered,
|
854
|
-
const int minor, const int major,
|
855
|
-
const double * elem, const int * ind,
|
856
|
-
const CoinBigIndex * start);
|
857
|
-
void gutsOfOpEqual(const bool colordered,
|
858
|
-
const int minor, const int major, const CoinBigIndex numels,
|
859
|
-
const double * elem, const int * ind,
|
860
|
-
const CoinBigIndex * start, const int * len);
|
861
|
-
void resizeForAddingMajorVectors(const int numVec, const int * lengthVec);
|
862
|
-
void resizeForAddingMinorVectors(const int * addedEntries);
|
863
|
-
|
864
|
-
/*! \brief Append a set of rows (columns) to the end of a row (colum)
|
865
|
-
ordered matrix.
|
866
|
-
|
867
|
-
If \p numberOther > 0 the method will check if any of the new rows
|
868
|
-
(columns) contain duplicate indices or invalid indices and return the
|
869
|
-
number of errors. A valid minor index must satisfy
|
870
|
-
\code 0 <= k < numberOther \endcode
|
871
|
-
If \p numberOther < 0 no checking is performed.
|
872
|
-
*/
|
873
|
-
int appendMajor(const int number,
|
874
|
-
const CoinBigIndex * starts, const int * index,
|
875
|
-
const double * element, int numberOther=-1);
|
876
|
-
/*! \brief Append a set of rows (columns) to the end of a column (row)
|
877
|
-
ordered matrix.
|
878
|
-
|
879
|
-
If \p numberOther > 0 the method will check if any of the new rows
|
880
|
-
(columns) contain duplicate indices or indices outside the current
|
881
|
-
range for the major dimension and return the number of violations.
|
882
|
-
If \p numberOther <= 0 the major dimension will be expanded as
|
883
|
-
necessary and there are no checks for duplicate indices.
|
884
|
-
*/
|
885
|
-
int appendMinor(const int number,
|
886
|
-
const CoinBigIndex * starts, const int * index,
|
887
|
-
const double * element, int numberOther=-1);
|
888
|
-
|
889
|
-
private:
|
890
|
-
inline CoinBigIndex getLastStart() const {
|
891
|
-
return majorDim_ == 0 ? 0 : start_[majorDim_];
|
892
|
-
}
|
893
|
-
|
894
|
-
//--------------------------------------------------------------------------
|
895
|
-
protected:
|
896
|
-
/**@name Data members
|
897
|
-
The data members are protected to allow access for derived classes. */
|
898
|
-
//@{
|
899
|
-
/** A flag indicating whether the matrix is column or row major ordered. */
|
900
|
-
bool colOrdered_;
|
901
|
-
/** This much times more space should be allocated for each major-dimension
|
902
|
-
vector (with respect to the number of entries in the vector) when the
|
903
|
-
matrix is resized. The purpose of these gaps is to allow fast insertion
|
904
|
-
of new minor-dimension vectors. */
|
905
|
-
double extraGap_;
|
906
|
-
/** his much times more space should be allocated for major-dimension
|
907
|
-
vectors when the matrix is resized. The purpose of these gaps is to
|
908
|
-
allow fast addition of new major-dimension vectors. */
|
909
|
-
double extraMajor_;
|
910
|
-
|
911
|
-
/** List of nonzero element values. The entries in the gaps between
|
912
|
-
major-dimension vectors are undefined. */
|
913
|
-
double *element_;
|
914
|
-
/** List of nonzero element minor-dimension indices. The entries in the gaps
|
915
|
-
between major-dimension vectors are undefined. */
|
916
|
-
int *index_;
|
917
|
-
/** Starting positions of major-dimension vectors. */
|
918
|
-
CoinBigIndex *start_;
|
919
|
-
/** Lengths of major-dimension vectors. */
|
920
|
-
int *length_;
|
921
|
-
|
922
|
-
/// number of vectors in matrix
|
923
|
-
int majorDim_;
|
924
|
-
/// size of other dimension
|
925
|
-
int minorDim_;
|
926
|
-
/// the number of nonzero entries
|
927
|
-
CoinBigIndex size_;
|
928
|
-
|
929
|
-
/// max space allocated for major-dimension
|
930
|
-
int maxMajorDim_;
|
931
|
-
/// max space allocated for entries
|
932
|
-
CoinBigIndex maxSize_;
|
933
|
-
//@}
|
934
|
-
};
|
935
|
-
|
936
|
-
//#############################################################################
|
937
|
-
/*! \brief Test the methods in the CoinPackedMatrix class.
|
938
|
-
|
939
|
-
The only reason for it not to be a member method is that this way
|
940
|
-
it doesn't have to be compiled into the library. And that's a gain,
|
941
|
-
because the library should be compiled with optimization on, but this
|
942
|
-
method should be compiled with debugging.
|
943
|
-
*/
|
944
|
-
void
|
945
|
-
CoinPackedMatrixUnitTest();
|
946
|
-
|
947
|
-
#endif
|