Repository navigation
SCIP 11: Split Model into BaseModel and Model #1292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Joao-Dionisio
wants to merge
19
commits into
master
Choose a base branch
from
base-model
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
97f5ccd
Split Model into BaseModel and Model, moving fp-only methods and Colu…
Joao-Dionisio a2fda0e
Pin the BaseModel surface and lint it for fp markers and Model-only c…
Joao-Dionisio 7e2bf79
Split the Model stub into BaseModel and Model
Joao-Dionisio e7e42d2
Move getBipartiteGraphRepresentation, copyLargeNeighborhoodSearch and…
Joao-Dionisio 69d1207
Merge origin/master into base-model
Joao-Dionisio e9b3e1a
Add ExactModel skeleton and move the exact LP classes to exact.pxi
Joao-Dionisio 92b5d6a
Apply batched suggestions from code review
Joao-Dionisio 508ac8d
Move BaseModel to basemodel.pxi
Joao-Dionisio 0316de4
Move getConsVars to BaseModel
Joao-Dionisio 39c094f
Export ExactModel with the exact LP operations and deprecate the Mode…
Joao-Dionisio b322c8e
Add exact wrapper subclasses chosen by the factories, with value gett…
Joao-Dionisio a644918
Spell out the floating-point markers and source paths in the base-mod…
Joao-Dionisio df410c5
Move the Benders methods to Model
Joao-Dionisio 10e9029
Move the fp LP, probing LP and IIS methods to Model and add raising c…
Joao-Dionisio b1d99bb
Move isLPSolBasic to Model and format the stub file
Joao-Dionisio 194be26
Move the methods SCIP cannot serve in exact mode to Model
Joao-Dionisio 80c2844
Drop the pinned BaseModel method list
Joao-Dionisio a9d91c3
Merge remote-tracking branch 'origin/master' into base-model
Joao-Dionisio 794dc9e
Return SCIP_RESULT from ExactModel.branchLP, document inherited Model…
Joao-Dionisio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ Model API | |
| ######### | ||
|
|
||
| .. autoclass:: pyscipopt.Model | ||
| :members: | ||
| :members: | ||
| :inherited-members: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it more than one pass already, but can you check whether I missed something @DominikKamp ? Either a method in
BaseModelthat relies on floating-point, or a method inModelthat can also be used by exact SCIP. There are many methods that could, in theory, be used in exact SCIP, but haven't been implemented in SCIP yet, like methods related to AND constraints, for example. For these, I just put them inModel, rather thanBaseModeland raisingNotImplementedErrorinExactModel.Methods in
BaseModel:addConss, addMatrixCons, addNNodes, addSol, addVarLocks, addVarLocksType, allColsInLP, attachEventHandlerCallback, backtrackProbing, branchVar, catchEvent, catchVarEvent, checkSol, chgVarBranchPriority, chgVarType, constructLP, create, createChild, createProbBasic, cutoffNode, deactivatePricer, delCons, delConsLocal, delVar, disableDebugSol, disablePropagation, dropEvent, dropVarEvent, enableDebugSol, endProbing, free, freeProb, freeSol, freeTransform, from_ptr, getBestChild, getBestLeaf, getBestNode, getBestSibling, getBestSol, getBestboundNode, getBranchScoreMultiple, getChildren, getConsNVars, getConsVars, getConss, getCurrentNode, getDepth, getDeterministicTime, getFocusDepth, getFocusNode, getHeurTiming, getLeaves, getMajorVersion, getMaxDepth, getMaxTotalDepth, getMemExternEstim, getMemTotal, getMemUsed, getMinorVersion, getNBacktracks, getNBestSolsFound, getNBinVars, getNChildren, getNConss, getNContVars, getNCuts, getNCutsApplied, getNFeasibleLeaves, getNImplVars, getNInfeasibleLeaves, getNIntVars, getNLPBranchCands, getNLPCols, getNLPIterations, getNLPRows, getNLPs, getNLeaves, getNLimSolsFound, getNNodeLPIterations, getNNodes, getNNodesLeft, getNObjlimLeaves, getNReaders, getNRuns, getNSepaRounds, getNSiblings, getNSols, getNSolsFound, getNStrongbranchLPIterations, getNTotalNodes, getNVars, getObjVal, getObjectiveSense, getOpenNodes, getParam, getParams, getPlungeDepth, getPresolvingTime, getPrimalDualIntegral, getPrioChild, getPrioSibling, getProbName, getProbingDepth, getPseudoBranchCands, getReadingTime, getRootNode, getSiblings, getSolTime, getSols, getSolvingTime, getStage, getStageName, getStatus, getTechVersion, getTotalTime, getTransformedCons, getTransformedVar, getTreesizeEstimation, getVarPseudocost, getVarPseudocostScore, getVarStrongbranchNode, getVars, hideOutput, inProbing, inRepropagation, includeBranchrule, includeConshdlr, includeCutsel, includeDefaultPlugins, includeEventhdlr, includeHeur, includeNodesel, includePresol, includePricer, includeProp, includeReader, includeRelax, includeSepa, interruptSolve, isObjChangedProbing, isObjIntegral, markDoNotAggrVar, markDoNotMultaggrVar, newProbingNode, nodesGetCommonAncestor, nodesSharePath, optimize, optimizeNogil, presolve, printCons, printExternalCodeVersions, printProblem, printStatistics, printStatisticsJson, printVersion, readParams, readProblem, redirectOutput, relax, repropagateNode, resetParam, resetParams, restartSolve, separateSol, setBoolParam, setCharParam, setCheck, setEmphasis, setEnforced, setHeurTiming, setHeuristics, setInitial, setIntParam, setLogfile, setLongintParam, setMaximize, setMinimize, setModifiable, setObjIntegral, setParam, setParams, setPresolve, setProbName, setRealParam, setRemovable, setSeparating, setStringParam, startProbing, to_ptr, updateVarPseudocost, version, wasNodeLastBranchParent, writeName, writeParams, writeProblem, writeStatistics, writeStatisticsJsonMethods in
Model:activateBenders, addBendersSubproblem, addCoefKnapsack, addCoefLinear, addCoefLogicor, addCons, addConsAnd, addConsCardinality, addConsCoeff, addConsCumulative, addConsDisjunction, addConsElemDisjunction, addConsIndicator, addConsKnapsack, addConsLinear, addConsLocal, addConsLogicor, addConsNode, addConsOr, addConsSOS1, addConsSOS2, addConsXor, addCut, addExprNonlinear, addMatrixConsDisjunction, addMatrixConsIndicator, addMatrixVar, addObjoffset, addPoolCut, addPyCons, addRowDive, addRowExact, addVar, addVarSOS1, addVarSOS2, addVarToRow, adjustedVarLb, adjustedVarUb, aggregateVars, allowNegSlackExact, appendVarSOS1, appendVarSOS2, applyCutsProbing, branchLPExact, branchVarVal, cacheRowExtensions, calcChildEstimate, calcNodeselPriority, catchRowEvent, checkBendersSubproblemOptimality, checkQuadraticNonlinear, chgCapacityKnapsack, chgCoefLinear, chgLhs, chgReoptObjective, chgRhs, chgRowLhsDive, chgRowRhsDive, chgVarLb, chgVarLbDive, chgVarLbGlobal, chgVarLbNode, chgVarLbProbing, chgVarObjDive, chgVarObjProbing, chgVarUb, chgVarUbDive, chgVarUbGlobal, chgVarUbNode, chgVarUbProbing, computeBestSolSubproblems, copyLargeNeighborhoodSearch, count, createCons, createConsFromExpr, createEmptyRowSepa, createEmptyRowUnspec, createOrigSol, createPartialSol, createSol, delCoefLinear, dropRowEvent, enableExactSolving, enableReoptimization, endDive, endStrongbranch, epsilon, feasCeil, feasFloor, feasFrac, feasRound, feastol, fixVar, fixVarProbing, flushRowExtensions, frac, freeBendersSubproblems, freeReoptSolve, generateIIS, getActivity, getAvgDualbound, getAvgLowerbound, getBendersAuxiliaryVar, getBendersSubproblem, getBendersVar, getBipartiteGraphRepresentation, getCapacityKnapsack, getColRedCost, getCondition, getConsVals, getCountedSols, getCutEfficacy, getCutLPSolCutoffDistance, getCutoffbound, getDualMultiplier, getDualSolVal, getDualbound, getDualboundRoot, getDualfarkasKnapsack, getDualfarkasLinear, getDualfarkasLogicor, getDualsolKnapsack, getDualsolLinear, getDualsolLogicor, getFirstPrimalBound, getGap, getIIS, getLPBInvARow, getLPBInvRow, getLPBasisInd, getLPBranchCands, getLPColsData, getLPObjVal, getLPRowsData, getLPSolstat, getLhs, getLinearConsIndicator, getLocalEstimate, getLowerbound, getLowerboundRoot, getNCountedSols, getNNlRows, getNReoptRuns, getNVarsAnd, getNVarsLogicor, getNlRowActivityBounds, getNlRowSolActivity, getNlRowSolFeasibility, getNlRows, getObjective, getObjlimit, getObjoffset, getPrimalRay, getPrimalRayVal, getPrimalbound, getResultantAnd, getRhs, getRowActivity, getRowDualSol, getRowLPActivity, getRowLinear, getRowNumIntCols, getRowObjParallelism, getRowParallelism, getSlack, getSlackVarIndicator, getSolObjVal, getSolVal, getTermsQuadratic, getUpperbound, getVal, getValsLinear, getVarDict, getVarLbDive, getVarRedcost, getVarStrongbranch, getVarStrongbranchLast, getVarUbDive, getVarsAnd, getVarsLogicor, getWeightsKnapsack, hasPrimalRay, includeBenders, includeBendersDefaultCuts, includeBenderscut, includeIISfinder, infinity, initBendersDefault, isAndConsSorted, isCutEfficacious, isEQ, isExact, isFeasEQ, isFeasGE, isFeasGT, isFeasIntegral, isFeasLE, isFeasLT, isFeasNegative, isFeasPositive, isFeasZero, isGE, isGT, isHugeValue, isInfinity, isIntegral, isLE, isLPSolBasic, isLT, isNLPConstructed, isNegative, isPositive, isReoptEnabled, isZero, lpiGetIterations, printBestSol, printNlRow, printRow, printSol, propagateProbing, readSol, readSolFile, releaseRow, setBendersSubproblemIsConvex, setObjective, setObjlimit, setParamsCountsols, setRelaxSolVal, setSolVal, setupBendersSubproblem, solveBendersSubproblem, solveConcurrent, solveDiveLP, solveProbingLP, solveProbingLPWithPricing, sortAndCons, startDive, startStrongbranch, tightenVarLb, tightenVarLbGlobal, tightenVarUb, tightenVarUbGlobal, translateSubSol, trySol, updateBendersLowerbounds, updateNodeLowerbound, writeBestSol, writeBestTransSol, writeLP, writeMIP, writeSol, writeTransSolThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also going to move to
Modelthe methods that do not yet have a getter in the exact model (likeisLPSolBasic, for which there is no public getter).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, do we also get a
BaseVariableor is this distinction not required?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't implemented this distinction, since the number of methods would not justify it.
BaseVariablewould have 25 methods,ExactVariable10,Variable1.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not still be simpler than duplicating 25 methods?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no duplication.
ExactVariableis a subclass ofVariableand overwrites the methods that are not exact-compatible (raising an error with the one method that would be going into the non-exactVariableclass, which isgetAvgSol()).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the same issue as with subclassing
Model. We do not need anExactVariableclass for this then.