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,657 +0,0 @@
|
|
1
|
-
/* $Id: CoinPackedVector.hpp 1509 2011-12-05 13:50:48Z forrest $ */
|
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 CoinPackedVector_H
|
7
|
-
#define CoinPackedVector_H
|
8
|
-
|
9
|
-
#include <map>
|
10
|
-
|
11
|
-
#include "CoinPragma.hpp"
|
12
|
-
#include "CoinPackedVectorBase.hpp"
|
13
|
-
#include "CoinSort.hpp"
|
14
|
-
|
15
|
-
#ifdef COIN_FAST_CODE
|
16
|
-
#ifndef COIN_NOTEST_DUPLICATE
|
17
|
-
#define COIN_NOTEST_DUPLICATE
|
18
|
-
#endif
|
19
|
-
#endif
|
20
|
-
|
21
|
-
#ifndef COIN_NOTEST_DUPLICATE
|
22
|
-
#define COIN_DEFAULT_VALUE_FOR_DUPLICATE true
|
23
|
-
#else
|
24
|
-
#define COIN_DEFAULT_VALUE_FOR_DUPLICATE false
|
25
|
-
#endif
|
26
|
-
/** Sparse Vector
|
27
|
-
|
28
|
-
Stores vector of indices and associated element values.
|
29
|
-
Supports sorting of vector while maintaining the original indices.
|
30
|
-
|
31
|
-
Here is a sample usage:
|
32
|
-
@verbatim
|
33
|
-
const int ne = 4;
|
34
|
-
int inx[ne] = { 1, 4, 0, 2 }
|
35
|
-
double el[ne] = { 10., 40., 1., 50. }
|
36
|
-
|
37
|
-
// Create vector and set its value
|
38
|
-
CoinPackedVector r(ne,inx,el);
|
39
|
-
|
40
|
-
// access each index and element
|
41
|
-
assert( r.indices ()[0]== 1 );
|
42
|
-
assert( r.elements()[0]==10. );
|
43
|
-
assert( r.indices ()[1]== 4 );
|
44
|
-
assert( r.elements()[1]==40. );
|
45
|
-
assert( r.indices ()[2]== 0 );
|
46
|
-
assert( r.elements()[2]== 1. );
|
47
|
-
assert( r.indices ()[3]== 2 );
|
48
|
-
assert( r.elements()[3]==50. );
|
49
|
-
|
50
|
-
// access original position of index
|
51
|
-
assert( r.originalPosition()[0]==0 );
|
52
|
-
assert( r.originalPosition()[1]==1 );
|
53
|
-
assert( r.originalPosition()[2]==2 );
|
54
|
-
assert( r.originalPosition()[3]==3 );
|
55
|
-
|
56
|
-
// access as a full storage vector
|
57
|
-
assert( r[ 0]==1. );
|
58
|
-
assert( r[ 1]==10.);
|
59
|
-
assert( r[ 2]==50.);
|
60
|
-
assert( r[ 3]==0. );
|
61
|
-
assert( r[ 4]==40.);
|
62
|
-
|
63
|
-
// sort Elements in increasing order
|
64
|
-
r.sortIncrElement();
|
65
|
-
|
66
|
-
// access each index and element
|
67
|
-
assert( r.indices ()[0]== 0 );
|
68
|
-
assert( r.elements()[0]== 1. );
|
69
|
-
assert( r.indices ()[1]== 1 );
|
70
|
-
assert( r.elements()[1]==10. );
|
71
|
-
assert( r.indices ()[2]== 4 );
|
72
|
-
assert( r.elements()[2]==40. );
|
73
|
-
assert( r.indices ()[3]== 2 );
|
74
|
-
assert( r.elements()[3]==50. );
|
75
|
-
|
76
|
-
// access original position of index
|
77
|
-
assert( r.originalPosition()[0]==2 );
|
78
|
-
assert( r.originalPosition()[1]==0 );
|
79
|
-
assert( r.originalPosition()[2]==1 );
|
80
|
-
assert( r.originalPosition()[3]==3 );
|
81
|
-
|
82
|
-
// access as a full storage vector
|
83
|
-
assert( r[ 0]==1. );
|
84
|
-
assert( r[ 1]==10.);
|
85
|
-
assert( r[ 2]==50.);
|
86
|
-
assert( r[ 3]==0. );
|
87
|
-
assert( r[ 4]==40.);
|
88
|
-
|
89
|
-
// Restore orignal sort order
|
90
|
-
r.sortOriginalOrder();
|
91
|
-
|
92
|
-
assert( r.indices ()[0]== 1 );
|
93
|
-
assert( r.elements()[0]==10. );
|
94
|
-
assert( r.indices ()[1]== 4 );
|
95
|
-
assert( r.elements()[1]==40. );
|
96
|
-
assert( r.indices ()[2]== 0 );
|
97
|
-
assert( r.elements()[2]== 1. );
|
98
|
-
assert( r.indices ()[3]== 2 );
|
99
|
-
assert( r.elements()[3]==50. );
|
100
|
-
|
101
|
-
// Tests for equality and equivalence
|
102
|
-
CoinPackedVector r1;
|
103
|
-
r1=r;
|
104
|
-
assert( r==r1 );
|
105
|
-
assert( r.equivalent(r1) );
|
106
|
-
r.sortIncrElement();
|
107
|
-
assert( r!=r1 );
|
108
|
-
assert( r.equivalent(r1) );
|
109
|
-
|
110
|
-
// Add packed vectors.
|
111
|
-
// Similarly for subtraction, multiplication,
|
112
|
-
// and division.
|
113
|
-
CoinPackedVector add = r + r1;
|
114
|
-
assert( add[0] == 1.+ 1. );
|
115
|
-
assert( add[1] == 10.+10. );
|
116
|
-
assert( add[2] == 50.+50. );
|
117
|
-
assert( add[3] == 0.+ 0. );
|
118
|
-
assert( add[4] == 40.+40. );
|
119
|
-
|
120
|
-
assert( r.sum() == 10.+40.+1.+50. );
|
121
|
-
@endverbatim
|
122
|
-
*/
|
123
|
-
class CoinPackedVector : public CoinPackedVectorBase {
|
124
|
-
friend void CoinPackedVectorUnitTest();
|
125
|
-
|
126
|
-
public:
|
127
|
-
/**@name Get methods. */
|
128
|
-
//@{
|
129
|
-
/// Get the size
|
130
|
-
virtual int getNumElements() const { return nElements_; }
|
131
|
-
/// Get indices of elements
|
132
|
-
virtual const int * getIndices() const { return indices_; }
|
133
|
-
/// Get element values
|
134
|
-
virtual const double * getElements() const { return elements_; }
|
135
|
-
/// Get indices of elements
|
136
|
-
int * getIndices() { return indices_; }
|
137
|
-
/// Get the size
|
138
|
-
inline int getVectorNumElements() const { return nElements_; }
|
139
|
-
/// Get indices of elements
|
140
|
-
inline const int * getVectorIndices() const { return indices_; }
|
141
|
-
/// Get element values
|
142
|
-
inline const double * getVectorElements() const { return elements_; }
|
143
|
-
/// Get element values
|
144
|
-
double * getElements() { return elements_; }
|
145
|
-
/** Get pointer to int * vector of original postions.
|
146
|
-
If the packed vector has not been sorted then this
|
147
|
-
function returns the vector: 0, 1, 2, ..., size()-1. */
|
148
|
-
const int * getOriginalPosition() const { return origIndices_; }
|
149
|
-
//@}
|
150
|
-
|
151
|
-
//-------------------------------------------------------------------
|
152
|
-
// Set indices and elements
|
153
|
-
//-------------------------------------------------------------------
|
154
|
-
/**@name Set methods */
|
155
|
-
//@{
|
156
|
-
/// Reset the vector (as if were just created an empty vector)
|
157
|
-
void clear();
|
158
|
-
/** Assignment operator. <br>
|
159
|
-
<strong>NOTE</strong>: This operator keeps the current
|
160
|
-
<code>testForDuplicateIndex</code> setting, and affter copying the data
|
161
|
-
it acts accordingly. */
|
162
|
-
CoinPackedVector & operator=(const CoinPackedVector &);
|
163
|
-
/** Assignment operator from a CoinPackedVectorBase. <br>
|
164
|
-
<strong>NOTE</strong>: This operator keeps the current
|
165
|
-
<code>testForDuplicateIndex</code> setting, and affter copying the data
|
166
|
-
it acts accordingly. */
|
167
|
-
CoinPackedVector & operator=(const CoinPackedVectorBase & rhs);
|
168
|
-
|
169
|
-
/** Assign the ownership of the arguments to this vector.
|
170
|
-
Size is the length of both the indices and elements vectors.
|
171
|
-
The indices and elements vectors are copied into this class instance's
|
172
|
-
member data. The last argument indicates whether this vector will have
|
173
|
-
to be tested for duplicate indices.
|
174
|
-
*/
|
175
|
-
void assignVector(int size, int*& inds, double*& elems,
|
176
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
177
|
-
|
178
|
-
/** Set vector size, indices, and elements.
|
179
|
-
Size is the length of both the indices and elements vectors.
|
180
|
-
The indices and elements vectors are copied into this class instance's
|
181
|
-
member data. The last argument specifies whether this vector will have
|
182
|
-
to be checked for duplicate indices whenever that can happen. */
|
183
|
-
void setVector(int size, const int * inds, const double * elems,
|
184
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
185
|
-
|
186
|
-
/** Elements set to have the same scalar value */
|
187
|
-
void setConstant(int size, const int * inds, double elems,
|
188
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
189
|
-
|
190
|
-
/** Indices are not specified and are taken to be 0,1,...,size-1 */
|
191
|
-
void setFull(int size, const double * elems,
|
192
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
193
|
-
|
194
|
-
/** Indices are not specified and are taken to be 0,1,...,size-1,
|
195
|
-
but only where non zero*/
|
196
|
-
void setFullNonZero(int size, const double * elems,
|
197
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
198
|
-
|
199
|
-
/** Set an existing element in the packed vector
|
200
|
-
The first argument is the "index" into the elements() array
|
201
|
-
*/
|
202
|
-
void setElement(int index, double element);
|
203
|
-
|
204
|
-
/// Insert an element into the vector
|
205
|
-
void insert(int index, double element);
|
206
|
-
/// Append a CoinPackedVector to the end
|
207
|
-
void append(const CoinPackedVectorBase & caboose);
|
208
|
-
|
209
|
-
/// Swap values in positions i and j of indices and elements
|
210
|
-
void swap(int i, int j);
|
211
|
-
|
212
|
-
/** Resize the packed vector to be the first newSize elements.
|
213
|
-
Problem with truncate: what happens with origIndices_ ??? */
|
214
|
-
void truncate(int newSize);
|
215
|
-
//@}
|
216
|
-
|
217
|
-
/**@name Arithmetic operators. */
|
218
|
-
//@{
|
219
|
-
/// add <code>value</code> to every entry
|
220
|
-
void operator+=(double value);
|
221
|
-
/// subtract <code>value</code> from every entry
|
222
|
-
void operator-=(double value);
|
223
|
-
/// multiply every entry by <code>value</code>
|
224
|
-
void operator*=(double value);
|
225
|
-
/// divide every entry by <code>value</code>
|
226
|
-
void operator/=(double value);
|
227
|
-
//@}
|
228
|
-
|
229
|
-
/**@name Sorting */
|
230
|
-
//@{
|
231
|
-
/** Sort the packed storage vector.
|
232
|
-
Typcical usages:
|
233
|
-
<pre>
|
234
|
-
packedVector.sort(CoinIncrIndexOrdered()); //increasing indices
|
235
|
-
packedVector.sort(CoinIncrElementOrdered()); // increasing elements
|
236
|
-
</pre>
|
237
|
-
*/
|
238
|
-
template <class CoinCompare3>
|
239
|
-
void sort(const CoinCompare3 & tc)
|
240
|
-
{ CoinSort_3(indices_, indices_ + nElements_, origIndices_, elements_,
|
241
|
-
tc); }
|
242
|
-
|
243
|
-
void sortIncrIndex()
|
244
|
-
{ CoinSort_3(indices_, indices_ + nElements_, origIndices_, elements_,
|
245
|
-
CoinFirstLess_3<int, int, double>()); }
|
246
|
-
|
247
|
-
void sortDecrIndex()
|
248
|
-
{ CoinSort_3(indices_, indices_ + nElements_, origIndices_, elements_,
|
249
|
-
CoinFirstGreater_3<int, int, double>()); }
|
250
|
-
|
251
|
-
void sortIncrElement()
|
252
|
-
{ CoinSort_3(elements_, elements_ + nElements_, origIndices_, indices_,
|
253
|
-
CoinFirstLess_3<double, int, int>()); }
|
254
|
-
|
255
|
-
void sortDecrElement()
|
256
|
-
{ CoinSort_3(elements_, elements_ + nElements_, origIndices_, indices_,
|
257
|
-
CoinFirstGreater_3<double, int, int>()); }
|
258
|
-
|
259
|
-
|
260
|
-
/** Sort in original order.
|
261
|
-
If the vector has been sorted, then this method restores
|
262
|
-
to its orignal sort order.
|
263
|
-
*/
|
264
|
-
void sortOriginalOrder();
|
265
|
-
//@}
|
266
|
-
|
267
|
-
/**@name Memory usage */
|
268
|
-
//@{
|
269
|
-
/** Reserve space.
|
270
|
-
If one knows the eventual size of the packed vector,
|
271
|
-
then it may be more efficient to reserve the space.
|
272
|
-
*/
|
273
|
-
void reserve(int n);
|
274
|
-
/** capacity returns the size which could be accomodated without
|
275
|
-
having to reallocate storage.
|
276
|
-
*/
|
277
|
-
int capacity() const { return capacity_; }
|
278
|
-
//@}
|
279
|
-
/**@name Constructors and destructors */
|
280
|
-
//@{
|
281
|
-
/** Default constructor */
|
282
|
-
CoinPackedVector(bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
283
|
-
/** \brief Alternate Constructors - set elements to vector of doubles
|
284
|
-
|
285
|
-
This constructor copies the vectors provided as parameters.
|
286
|
-
*/
|
287
|
-
CoinPackedVector(int size, const int * inds, const double * elems,
|
288
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
289
|
-
/** \brief Alternate Constructors - set elements to vector of doubles
|
290
|
-
|
291
|
-
This constructor takes ownership of the vectors passed as parameters.
|
292
|
-
\p inds and \p elems will be NULL on return.
|
293
|
-
*/
|
294
|
-
CoinPackedVector(int capacity, int size, int *&inds, double *&elems,
|
295
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
296
|
-
/** Alternate Constructors - set elements to same scalar value */
|
297
|
-
CoinPackedVector(int size, const int * inds, double element,
|
298
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
299
|
-
/** Alternate Constructors - construct full storage with indices 0 through
|
300
|
-
size-1. */
|
301
|
-
CoinPackedVector(int size, const double * elements,
|
302
|
-
bool testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE);
|
303
|
-
/** Copy constructor. */
|
304
|
-
CoinPackedVector(const CoinPackedVector &);
|
305
|
-
/** Copy constructor <em>from a PackedVectorBase</em>. */
|
306
|
-
CoinPackedVector(const CoinPackedVectorBase & rhs);
|
307
|
-
/** Destructor */
|
308
|
-
virtual ~CoinPackedVector ();
|
309
|
-
//@}
|
310
|
-
|
311
|
-
private:
|
312
|
-
/**@name Private methods */
|
313
|
-
//@{
|
314
|
-
/// Copy internal date
|
315
|
-
void gutsOfSetVector(int size,
|
316
|
-
const int * inds, const double * elems,
|
317
|
-
bool testForDuplicateIndex,
|
318
|
-
const char * method);
|
319
|
-
///
|
320
|
-
void gutsOfSetConstant(int size,
|
321
|
-
const int * inds, double value,
|
322
|
-
bool testForDuplicateIndex,
|
323
|
-
const char * method);
|
324
|
-
//@}
|
325
|
-
|
326
|
-
private:
|
327
|
-
/**@name Private member data */
|
328
|
-
//@{
|
329
|
-
/// Vector indices
|
330
|
-
int * indices_;
|
331
|
-
///Vector elements
|
332
|
-
double * elements_;
|
333
|
-
/// Size of indices and elements vectors
|
334
|
-
int nElements_;
|
335
|
-
/// original unsorted indices
|
336
|
-
int * origIndices_;
|
337
|
-
/// Amount of memory allocated for indices_, origIndices_, and elements_.
|
338
|
-
int capacity_;
|
339
|
-
//@}
|
340
|
-
};
|
341
|
-
|
342
|
-
//#############################################################################
|
343
|
-
|
344
|
-
/**@name Arithmetic operators on packed vectors.
|
345
|
-
|
346
|
-
<strong>NOTE</strong>: These methods operate on those positions where at
|
347
|
-
least one of the arguments has a value listed. At those positions the
|
348
|
-
appropriate operation is executed, Otherwise the result of the operation is
|
349
|
-
considered 0.<br>
|
350
|
-
<strong>NOTE 2</strong>: There are two kind of operators here. One is used
|
351
|
-
like "c = binaryOp(a, b)", the other is used like "binaryOp(c, a, b)", but
|
352
|
-
they are really the same. The first is much more natural to use, but it
|
353
|
-
involves the creation of a temporary object (the function *must* return an
|
354
|
-
object), while the second form puts the result directly into the argument
|
355
|
-
"c". Therefore, depending on the circumstances, the second form can be
|
356
|
-
significantly faster.
|
357
|
-
*/
|
358
|
-
//@{
|
359
|
-
template <class BinaryFunction> void
|
360
|
-
binaryOp(CoinPackedVector& retVal,
|
361
|
-
const CoinPackedVectorBase& op1, double value,
|
362
|
-
BinaryFunction bf)
|
363
|
-
{
|
364
|
-
retVal.clear();
|
365
|
-
const int s = op1.getNumElements();
|
366
|
-
if (s > 0) {
|
367
|
-
retVal.reserve(s);
|
368
|
-
const int * inds = op1.getIndices();
|
369
|
-
const double * elems = op1.getElements();
|
370
|
-
for (int i=0; i<s; ++i ) {
|
371
|
-
retVal.insert(inds[i], bf(value, elems[i]));
|
372
|
-
}
|
373
|
-
}
|
374
|
-
}
|
375
|
-
|
376
|
-
template <class BinaryFunction> inline void
|
377
|
-
binaryOp(CoinPackedVector& retVal,
|
378
|
-
double value, const CoinPackedVectorBase& op2,
|
379
|
-
BinaryFunction bf)
|
380
|
-
{
|
381
|
-
binaryOp(retVal, op2, value, bf);
|
382
|
-
}
|
383
|
-
|
384
|
-
template <class BinaryFunction> void
|
385
|
-
binaryOp(CoinPackedVector& retVal,
|
386
|
-
const CoinPackedVectorBase& op1, const CoinPackedVectorBase& op2,
|
387
|
-
BinaryFunction bf)
|
388
|
-
{
|
389
|
-
retVal.clear();
|
390
|
-
const int s1 = op1.getNumElements();
|
391
|
-
const int s2 = op2.getNumElements();
|
392
|
-
/*
|
393
|
-
Replaced || with &&, in response to complaint from Sven deVries, who
|
394
|
-
rightly points out || is not appropriate for additive operations. &&
|
395
|
-
should be ok as long as binaryOp is understood not to create something
|
396
|
-
from nothing. -- lh, 04.06.11
|
397
|
-
*/
|
398
|
-
if (s1 == 0 && s2 == 0)
|
399
|
-
return;
|
400
|
-
|
401
|
-
retVal.reserve(s1+s2);
|
402
|
-
|
403
|
-
const int * inds1 = op1.getIndices();
|
404
|
-
const double * elems1 = op1.getElements();
|
405
|
-
const int * inds2 = op2.getIndices();
|
406
|
-
const double * elems2 = op2.getElements();
|
407
|
-
|
408
|
-
int i;
|
409
|
-
// loop once for each element in op1
|
410
|
-
for ( i=0; i<s1; ++i ) {
|
411
|
-
const int index = inds1[i];
|
412
|
-
const int pos2 = op2.findIndex(index);
|
413
|
-
const double val = bf(elems1[i], pos2 == -1 ? 0.0 : elems2[pos2]);
|
414
|
-
// if (val != 0.0) // *THINK* : should we put in only nonzeros?
|
415
|
-
retVal.insert(index, val);
|
416
|
-
}
|
417
|
-
// loop once for each element in operand2
|
418
|
-
for ( i=0; i<s2; ++i ) {
|
419
|
-
const int index = inds2[i];
|
420
|
-
// if index exists in op1, then element was processed in prior loop
|
421
|
-
if ( op1.isExistingIndex(index) )
|
422
|
-
continue;
|
423
|
-
// Index does not exist in op1, so the element value must be zero
|
424
|
-
const double val = bf(0.0, elems2[i]);
|
425
|
-
// if (val != 0.0) // *THINK* : should we put in only nonzeros?
|
426
|
-
retVal.insert(index, val);
|
427
|
-
}
|
428
|
-
}
|
429
|
-
|
430
|
-
//-----------------------------------------------------------------------------
|
431
|
-
|
432
|
-
template <class BinaryFunction> CoinPackedVector
|
433
|
-
binaryOp(const CoinPackedVectorBase& op1, double value,
|
434
|
-
BinaryFunction bf)
|
435
|
-
{
|
436
|
-
CoinPackedVector retVal;
|
437
|
-
retVal.setTestForDuplicateIndex(true);
|
438
|
-
binaryOp(retVal, op1, value, bf);
|
439
|
-
return retVal;
|
440
|
-
}
|
441
|
-
|
442
|
-
template <class BinaryFunction> CoinPackedVector
|
443
|
-
binaryOp(double value, const CoinPackedVectorBase& op2,
|
444
|
-
BinaryFunction bf)
|
445
|
-
{
|
446
|
-
CoinPackedVector retVal;
|
447
|
-
retVal.setTestForDuplicateIndex(true);
|
448
|
-
binaryOp(retVal, op2, value, bf);
|
449
|
-
return retVal;
|
450
|
-
}
|
451
|
-
|
452
|
-
template <class BinaryFunction> CoinPackedVector
|
453
|
-
binaryOp(const CoinPackedVectorBase& op1, const CoinPackedVectorBase& op2,
|
454
|
-
BinaryFunction bf)
|
455
|
-
{
|
456
|
-
CoinPackedVector retVal;
|
457
|
-
retVal.setTestForDuplicateIndex(true);
|
458
|
-
binaryOp(retVal, op1, op2, bf);
|
459
|
-
return retVal;
|
460
|
-
}
|
461
|
-
|
462
|
-
//-----------------------------------------------------------------------------
|
463
|
-
/// Return the sum of two packed vectors
|
464
|
-
inline CoinPackedVector operator+(const CoinPackedVectorBase& op1,
|
465
|
-
const CoinPackedVectorBase& op2)
|
466
|
-
{
|
467
|
-
CoinPackedVector retVal;
|
468
|
-
retVal.setTestForDuplicateIndex(true);
|
469
|
-
binaryOp(retVal, op1, op2, std::plus<double>());
|
470
|
-
return retVal;
|
471
|
-
}
|
472
|
-
|
473
|
-
/// Return the difference of two packed vectors
|
474
|
-
inline CoinPackedVector operator-(const CoinPackedVectorBase& op1,
|
475
|
-
const CoinPackedVectorBase& op2)
|
476
|
-
{
|
477
|
-
CoinPackedVector retVal;
|
478
|
-
retVal.setTestForDuplicateIndex(true);
|
479
|
-
binaryOp(retVal, op1, op2, std::minus<double>());
|
480
|
-
return retVal;
|
481
|
-
}
|
482
|
-
|
483
|
-
/// Return the element-wise product of two packed vectors
|
484
|
-
inline CoinPackedVector operator*(const CoinPackedVectorBase& op1,
|
485
|
-
const CoinPackedVectorBase& op2)
|
486
|
-
{
|
487
|
-
CoinPackedVector retVal;
|
488
|
-
retVal.setTestForDuplicateIndex(true);
|
489
|
-
binaryOp(retVal, op1, op2, std::multiplies<double>());
|
490
|
-
return retVal;
|
491
|
-
}
|
492
|
-
|
493
|
-
/// Return the element-wise ratio of two packed vectors
|
494
|
-
inline CoinPackedVector operator/(const CoinPackedVectorBase& op1,
|
495
|
-
const CoinPackedVectorBase& op2)
|
496
|
-
{
|
497
|
-
CoinPackedVector retVal;
|
498
|
-
retVal.setTestForDuplicateIndex(true);
|
499
|
-
binaryOp(retVal, op1, op2, std::divides<double>());
|
500
|
-
return retVal;
|
501
|
-
}
|
502
|
-
//@}
|
503
|
-
|
504
|
-
/// Returns the dot product of two CoinPackedVector objects whose elements are
|
505
|
-
/// doubles. Use this version if the vectors are *not* guaranteed to be sorted.
|
506
|
-
inline double sparseDotProduct(const CoinPackedVectorBase& op1,
|
507
|
-
const CoinPackedVectorBase& op2){
|
508
|
-
int len, i;
|
509
|
-
double acc = 0.0;
|
510
|
-
CoinPackedVector retVal;
|
511
|
-
|
512
|
-
CoinPackedVector retval = op1*op2;
|
513
|
-
len = retval.getNumElements();
|
514
|
-
double * CParray = retval.getElements();
|
515
|
-
|
516
|
-
for(i = 0; i < len; i++){
|
517
|
-
acc += CParray[i];
|
518
|
-
}
|
519
|
-
return acc;
|
520
|
-
}
|
521
|
-
|
522
|
-
|
523
|
-
/// Returns the dot product of two sorted CoinPackedVector objects.
|
524
|
-
/// The vectors should be sorted in ascending order of indices.
|
525
|
-
inline double sortedSparseDotProduct(const CoinPackedVectorBase& op1,
|
526
|
-
const CoinPackedVectorBase& op2){
|
527
|
-
int i, j, len1, len2;
|
528
|
-
double acc = 0.0;
|
529
|
-
|
530
|
-
const double* v1val = op1.getElements();
|
531
|
-
const double* v2val = op2.getElements();
|
532
|
-
const int* v1ind = op1.getIndices();
|
533
|
-
const int* v2ind = op2.getIndices();
|
534
|
-
|
535
|
-
len1 = op1.getNumElements();
|
536
|
-
len2 = op2.getNumElements();
|
537
|
-
|
538
|
-
i = 0;
|
539
|
-
j = 0;
|
540
|
-
|
541
|
-
while(i < len1 && j < len2){
|
542
|
-
if(v1ind[i] == v2ind[j]){
|
543
|
-
acc += v1val[i] * v2val[j];
|
544
|
-
i++;
|
545
|
-
j++;
|
546
|
-
}
|
547
|
-
else if(v2ind[j] < v1ind[i]){
|
548
|
-
j++;
|
549
|
-
}
|
550
|
-
else{
|
551
|
-
i++;
|
552
|
-
} // end if-else-elseif
|
553
|
-
} // end while
|
554
|
-
return acc;
|
555
|
-
}
|
556
|
-
|
557
|
-
|
558
|
-
//-----------------------------------------------------------------------------
|
559
|
-
|
560
|
-
/**@name Arithmetic operators on packed vector and a constant. <br>
|
561
|
-
These functions create a packed vector as a result. That packed vector will
|
562
|
-
have the same indices as <code>op1</code> and the specified operation is
|
563
|
-
done entry-wise with the given value. */
|
564
|
-
//@{
|
565
|
-
/// Return the sum of a packed vector and a constant
|
566
|
-
inline CoinPackedVector
|
567
|
-
operator+(const CoinPackedVectorBase& op1, double value)
|
568
|
-
{
|
569
|
-
CoinPackedVector retVal(op1);
|
570
|
-
retVal += value;
|
571
|
-
return retVal;
|
572
|
-
}
|
573
|
-
|
574
|
-
/// Return the difference of a packed vector and a constant
|
575
|
-
inline CoinPackedVector
|
576
|
-
operator-(const CoinPackedVectorBase& op1, double value)
|
577
|
-
{
|
578
|
-
CoinPackedVector retVal(op1);
|
579
|
-
retVal -= value;
|
580
|
-
return retVal;
|
581
|
-
}
|
582
|
-
|
583
|
-
/// Return the element-wise product of a packed vector and a constant
|
584
|
-
inline CoinPackedVector
|
585
|
-
operator*(const CoinPackedVectorBase& op1, double value)
|
586
|
-
{
|
587
|
-
CoinPackedVector retVal(op1);
|
588
|
-
retVal *= value;
|
589
|
-
return retVal;
|
590
|
-
}
|
591
|
-
|
592
|
-
/// Return the element-wise ratio of a packed vector and a constant
|
593
|
-
inline CoinPackedVector
|
594
|
-
operator/(const CoinPackedVectorBase& op1, double value)
|
595
|
-
{
|
596
|
-
CoinPackedVector retVal(op1);
|
597
|
-
retVal /= value;
|
598
|
-
return retVal;
|
599
|
-
}
|
600
|
-
|
601
|
-
//-----------------------------------------------------------------------------
|
602
|
-
|
603
|
-
/// Return the sum of a constant and a packed vector
|
604
|
-
inline CoinPackedVector
|
605
|
-
operator+(double value, const CoinPackedVectorBase& op1)
|
606
|
-
{
|
607
|
-
CoinPackedVector retVal(op1);
|
608
|
-
retVal += value;
|
609
|
-
return retVal;
|
610
|
-
}
|
611
|
-
|
612
|
-
/// Return the difference of a constant and a packed vector
|
613
|
-
inline CoinPackedVector
|
614
|
-
operator-(double value, const CoinPackedVectorBase& op1)
|
615
|
-
{
|
616
|
-
CoinPackedVector retVal(op1);
|
617
|
-
const int size = retVal.getNumElements();
|
618
|
-
double* elems = retVal.getElements();
|
619
|
-
for (int i = 0; i < size; ++i) {
|
620
|
-
elems[i] = value - elems[i];
|
621
|
-
}
|
622
|
-
return retVal;
|
623
|
-
}
|
624
|
-
|
625
|
-
/// Return the element-wise product of a constant and a packed vector
|
626
|
-
inline CoinPackedVector
|
627
|
-
operator*(double value, const CoinPackedVectorBase& op1)
|
628
|
-
{
|
629
|
-
CoinPackedVector retVal(op1);
|
630
|
-
retVal *= value;
|
631
|
-
return retVal;
|
632
|
-
}
|
633
|
-
|
634
|
-
/// Return the element-wise ratio of a a constant and packed vector
|
635
|
-
inline CoinPackedVector
|
636
|
-
operator/(double value, const CoinPackedVectorBase& op1)
|
637
|
-
{
|
638
|
-
CoinPackedVector retVal(op1);
|
639
|
-
const int size = retVal.getNumElements();
|
640
|
-
double* elems = retVal.getElements();
|
641
|
-
for (int i = 0; i < size; ++i) {
|
642
|
-
elems[i] = value / elems[i];
|
643
|
-
}
|
644
|
-
return retVal;
|
645
|
-
}
|
646
|
-
//@}
|
647
|
-
|
648
|
-
//#############################################################################
|
649
|
-
/** A function that tests the methods in the CoinPackedVector class. The
|
650
|
-
only reason for it not to be a member method is that this way it doesn't
|
651
|
-
have to be compiled into the library. And that's a gain, because the
|
652
|
-
library should be compiled with optimization on, but this method should be
|
653
|
-
compiled with debugging. */
|
654
|
-
void
|
655
|
-
CoinPackedVectorUnitTest();
|
656
|
-
|
657
|
-
#endif
|