Public Types

CbcModel Class Reference

Simple Branch and bound class. More...

#include <CbcModel.hpp>

List of all members.

Public Types

enum  CbcIntParam {
  CbcMaxNumNode = 0, CbcMaxNumSol, CbcFathomDiscipline, CbcPrinting,
  CbcNumberBranches, CbcLastIntParam, CbcMaxNumNode = 0, CbcMaxNumSol,
  CbcFathomDiscipline, CbcPrinting, CbcNumberBranches, CbcLastIntParam
}
enum  CbcDblParam {
  CbcIntegerTolerance = 0, CbcInfeasibilityWeight, CbcCutoffIncrement, CbcAllowableGap,
  CbcAllowableFractionGap, CbcMaximumSeconds, CbcCurrentCutoff, CbcOptimizationDirection,
  CbcCurrentObjectiveValue, CbcCurrentMinimizationObjectiveValue, CbcStartSeconds, CbcHeuristicGap,
  CbcHeuristicFractionGap, CbcSmallestChange, CbcSumChange, CbcLargestChange,
  CbcSmallChange, CbcLastDblParam, CbcIntegerTolerance = 0, CbcInfeasibilityWeight,
  CbcCutoffIncrement, CbcAllowableGap, CbcAllowableFractionGap, CbcMaximumSeconds,
  CbcCurrentCutoff, CbcOptimizationDirection, CbcCurrentObjectiveValue, CbcCurrentMinimizationObjectiveValue,
  CbcStartSeconds, CbcHeuristicGap, CbcHeuristicFractionGap, CbcSmallestChange,
  CbcSumChange, CbcLargestChange, CbcSmallChange, CbcLastDblParam
}
enum  CbcIntParam {
  CbcMaxNumNode = 0, CbcMaxNumSol, CbcFathomDiscipline, CbcPrinting,
  CbcNumberBranches, CbcLastIntParam, CbcMaxNumNode = 0, CbcMaxNumSol,
  CbcFathomDiscipline, CbcPrinting, CbcNumberBranches, CbcLastIntParam
}
enum  CbcDblParam {
  CbcIntegerTolerance = 0, CbcInfeasibilityWeight, CbcCutoffIncrement, CbcAllowableGap,
  CbcAllowableFractionGap, CbcMaximumSeconds, CbcCurrentCutoff, CbcOptimizationDirection,
  CbcCurrentObjectiveValue, CbcCurrentMinimizationObjectiveValue, CbcStartSeconds, CbcHeuristicGap,
  CbcHeuristicFractionGap, CbcSmallestChange, CbcSumChange, CbcLargestChange,
  CbcSmallChange, CbcLastDblParam, CbcIntegerTolerance = 0, CbcInfeasibilityWeight,
  CbcCutoffIncrement, CbcAllowableGap, CbcAllowableFractionGap, CbcMaximumSeconds,
  CbcCurrentCutoff, CbcOptimizationDirection, CbcCurrentObjectiveValue, CbcCurrentMinimizationObjectiveValue,
  CbcStartSeconds, CbcHeuristicGap, CbcHeuristicFractionGap, CbcSmallestChange,
  CbcSumChange, CbcLargestChange, CbcSmallChange, CbcLastDblParam
}

Public Member Functions

Presolve methods

CbcModelfindCliques (bool makeEquality, int atLeastThisMany, int lessThanThis, int defaultValue=1000)
 Identify cliques and construct corresponding objects.
CbcModelintegerPresolve (bool weak=false)
 Do integer presolve, creating a new (presolved) model.
bool integerPresolveThisModel (OsiSolverInterface *originalSolver, bool weak=false)
 Do integer presolve, modifying the current model.
void originalModel (CbcModel *presolvedModel, bool weak)
 Put back information into the original model after integer presolve.
bool tightenVubs (int type, bool allowMultipleBinary=false, double useCutoff=1.0e50)
 For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.
bool tightenVubs (int numberVubs, const int *which, double useCutoff=1.0e50)
 For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.
void analyzeObjective ()
 Analyze problem to find a minimum change in the objective function.
void AddIntegers ()
 Add additional integers.
void saveModel (OsiSolverInterface *saveSolver, double *checkCutoffForRestart, bool *feasible)
 Save copy of the model.
CbcModelfindCliques (bool makeEquality, int atLeastThisMany, int lessThanThis, int defaultValue=1000)
 Identify cliques and construct corresponding objects.
CbcModelintegerPresolve (bool weak=false)
 Do integer presolve, creating a new (presolved) model.
bool integerPresolveThisModel (OsiSolverInterface *originalSolver, bool weak=false)
 Do integer presolve, modifying the current model.
void originalModel (CbcModel *presolvedModel, bool weak)
 Put back information into the original model after integer presolve.
bool tightenVubs (int type, bool allowMultipleBinary=false, double useCutoff=1.0e50)
 For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.
bool tightenVubs (int numberVubs, const int *which, double useCutoff=1.0e50)
 For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.
void analyzeObjective ()
 Analyze problem to find a minimum change in the objective function.
void AddIntegers ()
 Add additional integers.
void saveModel (OsiSolverInterface *saveSolver, double *checkCutoffForRestart, bool *feasible)
 Save copy of the model.
Object manipulation routines

See OsiObject for an explanation of `object' in the context of CbcModel.

int numberObjects () const
 Get the number of objects.
void setNumberObjects (int number)
 Set the number of objects.
OsiObject ** objects () const
 Get the array of objects.
const OsiObject * object (int which) const
 Get the specified object.
OsiObject * modifiableObject (int which) const
 Get the specified object.
void setOptionalInteger (int index)
 Get the number of objects.
void deleteObjects (bool findIntegers=true)
 Delete all object information (and just back to integers if true).
void addObjects (int numberObjects, OsiObject **objects)
 Add in object information.
void addObjects (int numberObjects, CbcObject **objects)
 Add in object information.
void synchronizeModel ()
 Ensure attached objects point to this model.
void findIntegers (bool startAgain, int type=0)
 Identify integer variables and create corresponding objects.
int numberObjects () const
 Get the number of objects.
void setNumberObjects (int number)
 Set the number of objects.
OsiObject ** objects () const
 Get the array of objects.
const OsiObject * object (int which) const
 Get the specified object.
OsiObject * modifiableObject (int which) const
 Get the specified object.
void setOptionalInteger (int index)
 Get the number of objects.
void deleteObjects (bool findIntegers=true)
 Delete all object information (and just back to integers if true).
void addObjects (int numberObjects, OsiObject **objects)
 Add in object information.
void addObjects (int numberObjects, CbcObject **objects)
 Add in object information.
void synchronizeModel ()
 Ensure attached objects point to this model.
void findIntegers (bool startAgain, int type=0)
 Identify integer variables and create corresponding objects.
Parameter set/get methods

The set methods return true if the parameter was set to the given value, false if the value of the parameter is out of range.

The get methods return the value of the parameter.

bool setIntParam (CbcIntParam key, int value)
 Set an integer parameter.
bool setDblParam (CbcDblParam key, double value)
 Set a double parameter.
int getIntParam (CbcIntParam key) const
 Get an integer parameter.
double getDblParam (CbcDblParam key) const
 Get a double parameter.
void setCutoff (double value)
 Set cutoff bound on the objective function.
double getCutoff () const
 Get the cutoff bound on the objective function - always as minimize.
bool setMaximumNodes (int value)
 Set the maximum node limit .
int getMaximumNodes () const
 Get the maximum node limit .
bool setMaximumSolutions (int value)
 Set the maximum number of solutions desired.
int getMaximumSolutions () const
 Get the maximum number of solutions desired.
bool setPrintingMode (int value)
 Set the printing mode.
int getPrintingMode () const
 Get the printing mode.
bool setMaximumSeconds (double value)
 Set the maximum number of seconds desired.
double getMaximumSeconds () const
 Get the maximum number of seconds desired.
double getCurrentSeconds () const
 Current time since start of branchAndbound.
bool maximumSecondsReached () const
 Return true if maximum time reached.
bool setIntegerTolerance (double value)
 Set the integrality tolerance .
double getIntegerTolerance () const
 Get the integrality tolerance .
bool setInfeasibilityWeight (double value)
 Set the weight per integer infeasibility .
double getInfeasibilityWeight () const
 Get the weight per integer infeasibility .
bool setAllowableGap (double value)
 Set the allowable gap between the best known solution and the best possible solution.
double getAllowableGap () const
 Get the allowable gap between the best known solution and the best possible solution.
bool setAllowableFractionGap (double value)
 Set the fraction allowable gap between the best known solution and the best possible solution.
double getAllowableFractionGap () const
 Get the fraction allowable gap between the best known solution and the best possible solution.
bool setAllowablePercentageGap (double value)
 Set the percentage allowable gap between the best known solution and the best possible solution.
double getAllowablePercentageGap () const
 Get the percentage allowable gap between the best known solution and the best possible solution.
bool setHeuristicGap (double value)
 Set the heuristic gap between the best known solution and the best possible solution.
double getHeuristicGap () const
 Get the heuristic gap between the best known solution and the best possible solution.
bool setHeuristicFractionGap (double value)
 Set the fraction heuristic gap between the best known solution and the best possible solution.
double getHeuristicFractionGap () const
 Get the fraction heuristic gap between the best known solution and the best possible solution.
bool setCutoffIncrement (double value)
 Set the CbcModel::CbcCutoffIncrement desired.
double getCutoffIncrement () const
 Get the CbcModel::CbcCutoffIncrement desired.
void setHotstartSolution (const double *solution, const int *priorities=NULL)
 Pass in target solution and optional priorities.
void setMinimumDrop (double value)
 Set the minimum drop to continue cuts.
double getMinimumDrop () const
 Get the minimum drop to continue cuts.
void setMaximumCutPassesAtRoot (int value)
 Set the maximum number of cut passes at root node (default 20) Minimum drop can also be used for fine tuning.
int getMaximumCutPassesAtRoot () const
 Get the maximum number of cut passes at root node.
void setMaximumCutPasses (int value)
 Set the maximum number of cut passes at other nodes (default 10) Minimum drop can also be used for fine tuning.
int getMaximumCutPasses () const
 Get the maximum number of cut passes at other nodes (default 10).
int getCurrentPassNumber () const
 Get current cut pass number in this round of cuts.
void setNumberStrong (int number)
 Set the maximum number of candidates to be evaluated for strong branching.
int numberStrong () const
 Get the maximum number of candidates to be evaluated for strong branching.
void setPreferredWay (int value)
 Set global preferred way to branch -1 down, +1 up, 0 no preference.
int getPreferredWay () const
 Get the preferred way to branch (default 0).
int whenCuts () const
 Get at which depths to do cuts.
void setWhenCuts (int value)
 Set at which depths to do cuts.
bool doCutsNow (int allowForTopOfTree) const
 Return true if we want to do cuts If allowForTopOfTree zero then just does on multiples of depth if 1 then allows for doing at top of tree if 2 then says if cuts allowed anywhere apart from root.
void setNumberBeforeTrust (int number)
 Set the number of branches before pseudo costs believed in dynamic strong branching.
int numberBeforeTrust () const
 get the number of branches before pseudo costs believed in dynamic strong branching.
void setNumberPenalties (int number)
 Set the number of variables for which to compute penalties in dynamic strong branching.
int numberPenalties () const
 get the number of variables for which to compute penalties in dynamic strong branching.
void setNumberAnalyzeIterations (int number)
 Number of analyze iterations to do.
int numberAnalyzeIterations () const
 Set an integer parameter.
double penaltyScaleFactor () const
 Get scale factor to make penalties match strong.
void setPenaltyScaleFactor (double value)
 Set scale factor to make penalties match strong.
void setProblemType (int number)
 Problem type as set by user or found by analysis.
int problemType () const
 Set an integer parameter.
int currentDepth () const
 Current depth.
void setHowOftenGlobalScan (int number)
 Set how often to scan global cuts.
int howOftenGlobalScan () const
 Get how often to scan global cuts.
int * originalColumns () const
 Original columns as created by integerPresolve or preprocessing.
void setOriginalColumns (const int *originalColumns)
 Set original columns as created by preprocessing.
void setPrintFrequency (int number)
 Set the print frequency.
int printFrequency () const
 Get the print frequency.
bool setIntParam (CbcIntParam key, int value)
 Set an integer parameter.
bool setDblParam (CbcDblParam key, double value)
 Set a double parameter.
int getIntParam (CbcIntParam key) const
 Get an integer parameter.
double getDblParam (CbcDblParam key) const
 Get a double parameter.
void setCutoff (double value)
 Set cutoff bound on the objective function.
double getCutoff () const
 Get the cutoff bound on the objective function - always as minimize.
bool setMaximumNodes (int value)
 Set the maximum node limit .
int getMaximumNodes () const
 Get the maximum node limit .
bool setMaximumSolutions (int value)
 Set the maximum number of solutions desired.
int getMaximumSolutions () const
 Get the maximum number of solutions desired.
bool setPrintingMode (int value)
 Set the printing mode.
int getPrintingMode () const
 Get the printing mode.
bool setMaximumSeconds (double value)
 Set the maximum number of seconds desired.
double getMaximumSeconds () const
 Get the maximum number of seconds desired.
double getCurrentSeconds () const
 Current time since start of branchAndbound.
bool maximumSecondsReached () const
 Return true if maximum time reached.
bool setIntegerTolerance (double value)
 Set the integrality tolerance .
double getIntegerTolerance () const
 Get the integrality tolerance .
bool setInfeasibilityWeight (double value)
 Set the weight per integer infeasibility .
double getInfeasibilityWeight () const
 Get the weight per integer infeasibility .
bool setAllowableGap (double value)
 Set the allowable gap between the best known solution and the best possible solution.
double getAllowableGap () const
 Get the allowable gap between the best known solution and the best possible solution.
bool setAllowableFractionGap (double value)
 Set the fraction allowable gap between the best known solution and the best possible solution.
double getAllowableFractionGap () const
 Get the fraction allowable gap between the best known solution and the best possible solution.
bool setAllowablePercentageGap (double value)
 Set the percentage allowable gap between the best known solution and the best possible solution.
double getAllowablePercentageGap () const
 Get the percentage allowable gap between the best known solution and the best possible solution.
bool setHeuristicGap (double value)
 Set the heuristic gap between the best known solution and the best possible solution.
double getHeuristicGap () const
 Get the heuristic gap between the best known solution and the best possible solution.
bool setHeuristicFractionGap (double value)
 Set the fraction heuristic gap between the best known solution and the best possible solution.
double getHeuristicFractionGap () const
 Get the fraction heuristic gap between the best known solution and the best possible solution.
bool setCutoffIncrement (double value)
 Set the CbcModel::CbcCutoffIncrement desired.
double getCutoffIncrement () const
 Get the CbcModel::CbcCutoffIncrement desired.
void setHotstartSolution (const double *solution, const int *priorities=NULL)
 Pass in target solution and optional priorities.
void setMinimumDrop (double value)
 Set the minimum drop to continue cuts.
double getMinimumDrop () const
 Get the minimum drop to continue cuts.
void setMaximumCutPassesAtRoot (int value)
 Set the maximum number of cut passes at root node (default 20) Minimum drop can also be used for fine tuning.
int getMaximumCutPassesAtRoot () const
 Get the maximum number of cut passes at root node.
void setMaximumCutPasses (int value)
 Set the maximum number of cut passes at other nodes (default 10) Minimum drop can also be used for fine tuning.
int getMaximumCutPasses () const
 Get the maximum number of cut passes at other nodes (default 10).
int getCurrentPassNumber () const
 Get current cut pass number in this round of cuts.
void setNumberStrong (int number)
 Set the maximum number of candidates to be evaluated for strong branching.
int numberStrong () const
 Get the maximum number of candidates to be evaluated for strong branching.
void setPreferredWay (int value)
 Set global preferred way to branch -1 down, +1 up, 0 no preference.
int getPreferredWay () const
 Get the preferred way to branch (default 0).
int whenCuts () const
 Get at which depths to do cuts.
void setWhenCuts (int value)
 Set at which depths to do cuts.
bool doCutsNow (int allowForTopOfTree) const
 Return true if we want to do cuts If allowForTopOfTree zero then just does on multiples of depth if 1 then allows for doing at top of tree if 2 then says if cuts allowed anywhere apart from root.
void setNumberBeforeTrust (int number)
 Set the number of branches before pseudo costs believed in dynamic strong branching.
int numberBeforeTrust () const
 get the number of branches before pseudo costs believed in dynamic strong branching.
void setNumberPenalties (int number)
 Set the number of variables for which to compute penalties in dynamic strong branching.
int numberPenalties () const
 get the number of variables for which to compute penalties in dynamic strong branching.
void setNumberAnalyzeIterations (int number)
 Number of analyze iterations to do.
int numberAnalyzeIterations () const
 Set an integer parameter.
double penaltyScaleFactor () const
 Get scale factor to make penalties match strong.
void setPenaltyScaleFactor (double value)
 Set scale factor to make penalties match strong.
void setProblemType (int number)
 Problem type as set by user or found by analysis.
int problemType () const
 Set an integer parameter.
int currentDepth () const
 Current depth.
void setHowOftenGlobalScan (int number)
 Set how often to scan global cuts.
int howOftenGlobalScan () const
 Get how often to scan global cuts.
int * originalColumns () const
 Original columns as created by integerPresolve or preprocessing.
void setOriginalColumns (const int *originalColumns)
 Set original columns as created by preprocessing.
void setPrintFrequency (int number)
 Set the print frequency.
int printFrequency () const
 Get the print frequency.
Methods returning info on how the solution process terminated

bool isAbandoned () const
 Are there a numerical difficulties?
bool isProvenOptimal () const
 Is optimality proven?
bool isProvenInfeasible () const
 Is infeasiblity proven (or none better than cutoff)?
bool isContinuousUnbounded () const
 Was continuous solution unbounded.
bool isProvenDualInfeasible () const
 Was continuous solution unbounded.
bool isNodeLimitReached () const
 Node limit reached?
bool isSecondsLimitReached () const
 Time limit reached?
bool isSolutionLimitReached () const
 Solution limit reached?
int getIterationCount () const
 Get how many iterations it took to solve the problem.
void incrementIterationCount (int value)
 Increment how many iterations it took to solve the problem.
int getNodeCount () const
 Get how many Nodes it took to solve the problem.
void incrementNodeCount (int value)
 Increment how many nodes it took to solve the problem.
int status () const
 Final status of problem Some of these can be found out by is......
void setProblemStatus (int value)
 Are there a numerical difficulties?
int secondaryStatus () const
 Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions 7 linear relaxation unbounded.
void setSecondaryStatus (int value)
 Are there a numerical difficulties?
bool isInitialSolveAbandoned () const
 Are there numerical difficulties (for initialSolve) ?
bool isInitialSolveProvenOptimal () const
 Is optimality proven (for initialSolve) ?
bool isInitialSolveProvenPrimalInfeasible () const
 Is primal infeasiblity proven (for initialSolve) ?
bool isInitialSolveProvenDualInfeasible () const
 Is dual infeasiblity proven (for initialSolve) ?
bool isAbandoned () const
 Are there a numerical difficulties?
bool isProvenOptimal () const
 Is optimality proven?
bool isProvenInfeasible () const
 Is infeasiblity proven (or none better than cutoff)?
bool isContinuousUnbounded () const
 Was continuous solution unbounded.
bool isProvenDualInfeasible () const
 Was continuous solution unbounded.
bool isNodeLimitReached () const
 Node limit reached?
bool isSecondsLimitReached () const
 Time limit reached?
bool isSolutionLimitReached () const
 Solution limit reached?
int getIterationCount () const
 Get how many iterations it took to solve the problem.
void incrementIterationCount (int value)
 Increment how many iterations it took to solve the problem.
int getNodeCount () const
 Get how many Nodes it took to solve the problem.
void incrementNodeCount (int value)
 Increment how many nodes it took to solve the problem.
int status () const
 Final status of problem Some of these can be found out by is......
void setProblemStatus (int value)
 Are there a numerical difficulties?
int secondaryStatus () const
 Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions 7 linear relaxation unbounded.
void setSecondaryStatus (int value)
 Are there a numerical difficulties?
bool isInitialSolveAbandoned () const
 Are there numerical difficulties (for initialSolve) ?
bool isInitialSolveProvenOptimal () const
 Is optimality proven (for initialSolve) ?
bool isInitialSolveProvenPrimalInfeasible () const
 Is primal infeasiblity proven (for initialSolve) ?
bool isInitialSolveProvenDualInfeasible () const
 Is dual infeasiblity proven (for initialSolve) ?
Problem information methods

These methods call the solver's query routines to return information about the problem referred to by the current object.

Querying a problem that has no data associated with it result in zeros for the number of rows and columns, and NULL pointers from the methods that return vectors.

Const pointers returned from any data-query method are valid as long as the data is unchanged and the solver is not called.

int numberRowsAtContinuous () const
 Number of rows in continuous (root) problem.
int getNumCols () const
 Get number of columns.
int getNumRows () const
 Get number of rows.
CoinBigIndex getNumElements () const
 Get number of nonzero elements.
int numberIntegers () const
 Number of integers in problem.
const int * integerVariable () const
 Number of rows in continuous (root) problem.
char integerType (int i) const
 Whether or not integer.
const char * integerType () const
 Whether or not integer.
const double * getColLower () const
 Get pointer to array[getNumCols()] of column lower bounds.
const double * getColUpper () const
 Get pointer to array[getNumCols()] of column upper bounds.
const char * getRowSense () const
 Get pointer to array[getNumRows()] of row constraint senses.
const double * getRightHandSide () const
 Get pointer to array[getNumRows()] of rows right-hand sides.
const double * getRowRange () const
 Get pointer to array[getNumRows()] of row ranges.
const double * getRowLower () const
 Get pointer to array[getNumRows()] of row lower bounds.
const double * getRowUpper () const
 Get pointer to array[getNumRows()] of row upper bounds.
const double * getObjCoefficients () const
 Get pointer to array[getNumCols()] of objective function coefficients.
double getObjSense () const
 Get objective function sense (1 for min (default), -1 for max).
bool isContinuous (int colIndex) const
 Return true if variable is continuous.
bool isBinary (int colIndex) const
 Return true if variable is binary.
bool isInteger (int colIndex) const
 Return true if column is integer.
bool isIntegerNonBinary (int colIndex) const
 Return true if variable is general integer.
bool isFreeBinary (int colIndex) const
 Return true if variable is binary and not fixed at either bound.
const CoinPackedMatrix * getMatrixByRow () const
 Get pointer to row-wise copy of matrix.
const CoinPackedMatrix * getMatrixByCol () const
 Get pointer to column-wise copy of matrix.
double getInfinity () const
 Get solver's value for infinity.
const double * getCbcColLower () const
 Get pointer to array[getNumCols()] (for speed) of column lower bounds.
const double * getCbcColUpper () const
 Get pointer to array[getNumCols()] (for speed) of column upper bounds.
const double * getCbcRowLower () const
 Get pointer to array[getNumRows()] (for speed) of row lower bounds.
const double * getCbcRowUpper () const
 Get pointer to array[getNumRows()] (for speed) of row upper bounds.
const double * getCbcColSolution () const
 Get pointer to array[getNumCols()] (for speed) of primal solution vector.
const double * getCbcRowPrice () const
 Get pointer to array[getNumRows()] (for speed) of dual prices.
const double * getCbcReducedCost () const
 Get a pointer to array[getNumCols()] (for speed) of reduced costs.
const double * getCbcRowActivity () const
 Get pointer to array[getNumRows()] (for speed) of row activity levels.
int numberRowsAtContinuous () const
 Number of rows in continuous (root) problem.
int getNumCols () const
 Get number of columns.
int getNumRows () const
 Get number of rows.
CoinBigIndex getNumElements () const
 Get number of nonzero elements.
int numberIntegers () const
 Number of integers in problem.
const int * integerVariable () const
 Number of rows in continuous (root) problem.
char integerType (int i) const
 Whether or not integer.
const char * integerType () const
 Whether or not integer.
const double * getColLower () const
 Get pointer to array[getNumCols()] of column lower bounds.
const double * getColUpper () const
 Get pointer to array[getNumCols()] of column upper bounds.
const char * getRowSense () const
 Get pointer to array[getNumRows()] of row constraint senses.
const double * getRightHandSide () const
 Get pointer to array[getNumRows()] of rows right-hand sides.
const double * getRowRange () const
 Get pointer to array[getNumRows()] of row ranges.
const double * getRowLower () const
 Get pointer to array[getNumRows()] of row lower bounds.
const double * getRowUpper () const
 Get pointer to array[getNumRows()] of row upper bounds.
const double * getObjCoefficients () const
 Get pointer to array[getNumCols()] of objective function coefficients.
double getObjSense () const
 Get objective function sense (1 for min (default), -1 for max).
bool isContinuous (int colIndex) const
 Return true if variable is continuous.
bool isBinary (int colIndex) const
 Return true if variable is binary.
bool isInteger (int colIndex) const
 Return true if column is integer.
bool isIntegerNonBinary (int colIndex) const
 Return true if variable is general integer.
bool isFreeBinary (int colIndex) const
 Return true if variable is binary and not fixed at either bound.
const CoinPackedMatrix * getMatrixByRow () const
 Get pointer to row-wise copy of matrix.
const CoinPackedMatrix * getMatrixByCol () const
 Get pointer to column-wise copy of matrix.
double getInfinity () const
 Get solver's value for infinity.
const double * getCbcColLower () const
 Get pointer to array[getNumCols()] (for speed) of column lower bounds.
const double * getCbcColUpper () const
 Get pointer to array[getNumCols()] (for speed) of column upper bounds.
const double * getCbcRowLower () const
 Get pointer to array[getNumRows()] (for speed) of row lower bounds.
const double * getCbcRowUpper () const
 Get pointer to array[getNumRows()] (for speed) of row upper bounds.
const double * getCbcColSolution () const
 Get pointer to array[getNumCols()] (for speed) of primal solution vector.
const double * getCbcRowPrice () const
 Get pointer to array[getNumRows()] (for speed) of dual prices.
const double * getCbcReducedCost () const
 Get a pointer to array[getNumCols()] (for speed) of reduced costs.
const double * getCbcRowActivity () const
 Get pointer to array[getNumRows()] (for speed) of row activity levels.
Methods related to querying the solution

double * continuousSolution () const
 Holds solution at continuous (after cuts if branchAndBound called).
int * usedInSolution () const
 Array marked whenever a solution is found if non-zero.
void incrementUsed (const double *solution)
 Increases usedInSolution for nonzeros.
void setBestSolution (CBC_Message how, double &objectiveValue, const double *solution, int fixVariables=0)
 Record a new incumbent solution and update objectiveValue.
void setBestObjectiveValue (double objectiveValue)
 Just update objectiveValue.
CbcEventHandler::CbcAction dealWithEventHandler (CbcEventHandler::CbcEvent event, double objValue, const double *solution)
 Deals with event handler and solution.
double checkSolution (double cutoff, double *solution, int fixVariables, double originalObjValue)
 Call this to really test if a valid solution can be feasible Solution is number columns in size.
bool feasibleSolution (int &numberIntegerInfeasibilities, int &numberObjectInfeasibilities) const
 Test the current solution for feasiblility.
double * currentSolution () const
 Solution to the most recent lp relaxation.
const double * testSolution () const
 For testing infeasibilities - will point to currentSolution_ or solver-->getColSolution().
void setTestSolution (const double *solution)
 Holds solution at continuous (after cuts if branchAndBound called).
void reserveCurrentSolution (const double *solution=NULL)
 Make sure region there and optionally copy solution.
const double * getColSolution () const
 Get pointer to array[getNumCols()] of primal solution vector.
const double * getRowPrice () const
 Get pointer to array[getNumRows()] of dual prices.
const double * getReducedCost () const
 Get a pointer to array[getNumCols()] of reduced costs.
const double * getRowActivity () const
 Get pointer to array[getNumRows()] of row activity levels.
double getCurrentObjValue () const
 Get current objective function value.
double getCurrentMinimizationObjValue () const
 Get current minimization objective function value.
double getMinimizationObjValue () const
 Get best objective function value as minimization.
void setMinimizationObjValue (double value)
 Set best objective function value as minimization.
double getObjValue () const
 Get best objective function value.
double getBestPossibleObjValue () const
 Get best possible objective function value.
void setObjValue (double value)
 Set best objective function value.
double getSolverObjValue () const
 Get solver objective function value (as minimization).
double * bestSolution () const
 The best solution to the integer programming problem.
void setBestSolution (const double *solution, int numberColumns, double objectiveValue, bool check=false)
 User callable setBestSolution.
int getSolutionCount () const
 Get number of solutions.
void setSolutionCount (int value)
 Set number of solutions (so heuristics will be different).
int numberSavedSolutions () const
 Number of saved solutions (including best).
int maximumSavedSolutions () const
 Maximum number of extra saved solutions.
void setMaximumSavedSolutions (int value)
 Set maximum number of extra saved solutions.
const double * savedSolution (int which) const
 Return a saved solution (0==best) - NULL if off end.
double savedSolutionObjective (int which) const
 Return a saved solution objective (0==best) - COIN_DBL_MAX if off end.
int phase () const
 Current phase (so heuristics etc etc can find out).
int getNumberHeuristicSolutions () const
 Get number of heuristic solutions.
void setNumberHeuristicSolutions (int value)
 Set number of heuristic solutions.
void setObjSense (double s)
 Set objective function sense (1 for min (default), -1 for max,).
double getContinuousObjective () const
 Value of objective at continuous.
void setContinuousObjective (double value)
 Holds solution at continuous (after cuts if branchAndBound called).
int getContinuousInfeasibilities () const
 Number of infeasibilities at continuous.
void setContinuousInfeasibilities (int value)
 Holds solution at continuous (after cuts if branchAndBound called).
double rootObjectiveAfterCuts () const
 Value of objective after root node cuts added.
double sumChangeObjective () const
 Sum of Changes to objective by first solve.
int numberGlobalViolations () const
 Number of times global cuts violated.
void clearNumberGlobalViolations ()
 Holds solution at continuous (after cuts if branchAndBound called).
bool resolveAfterTakeOffCuts () const
 Whether to force a resolve after takeOffCuts.
void setResolveAfterTakeOffCuts (bool yesNo)
 Holds solution at continuous (after cuts if branchAndBound called).
int maximumRows () const
 Maximum number of rows.
CoinWarmStartBasis & workingBasis ()
 Work basis for temporary use.
int getStopNumberIterations () const
 Get number of "iterations" to stop after.
void setStopNumberIterations (int value)
 Set number of "iterations" to stop after.
double * continuousSolution () const
 Holds solution at continuous (after cuts if branchAndBound called).
int * usedInSolution () const
 Array marked whenever a solution is found if non-zero.
void incrementUsed (const double *solution)
 Increases usedInSolution for nonzeros.
void setBestSolution (CBC_Message how, double &objectiveValue, const double *solution, int fixVariables=0)
 Record a new incumbent solution and update objectiveValue.
void setBestObjectiveValue (double objectiveValue)
 Just update objectiveValue.
CbcEventHandler::CbcAction dealWithEventHandler (CbcEventHandler::CbcEvent event, double objValue, const double *solution)
 Deals with event handler and solution.
double checkSolution (double cutoff, double *solution, int fixVariables, double originalObjValue)
 Call this to really test if a valid solution can be feasible Solution is number columns in size.
bool feasibleSolution (int &numberIntegerInfeasibilities, int &numberObjectInfeasibilities) const
 Test the current solution for feasiblility.
double * currentSolution () const
 Solution to the most recent lp relaxation.
const double * testSolution () const
 For testing infeasibilities - will point to currentSolution_ or solver-->getColSolution().
void setTestSolution (const double *solution)
 Holds solution at continuous (after cuts if branchAndBound called).
void reserveCurrentSolution (const double *solution=NULL)
 Make sure region there and optionally copy solution.
const double * getColSolution () const
 Get pointer to array[getNumCols()] of primal solution vector.
const double * getRowPrice () const
 Get pointer to array[getNumRows()] of dual prices.
const double * getReducedCost () const
 Get a pointer to array[getNumCols()] of reduced costs.
const double * getRowActivity () const
 Get pointer to array[getNumRows()] of row activity levels.
double getCurrentObjValue () const
 Get current objective function value.
double getCurrentMinimizationObjValue () const
 Get current minimization objective function value.
double getMinimizationObjValue () const
 Get best objective function value as minimization.
void setMinimizationObjValue (double value)
 Set best objective function value as minimization.
double getObjValue () const
 Get best objective function value.
double getBestPossibleObjValue () const
 Get best possible objective function value.
void setObjValue (double value)
 Set best objective function value.
double getSolverObjValue () const
 Get solver objective function value (as minimization).
double * bestSolution () const
 The best solution to the integer programming problem.
void setBestSolution (const double *solution, int numberColumns, double objectiveValue, bool check=false)
 User callable setBestSolution.
int getSolutionCount () const
 Get number of solutions.
void setSolutionCount (int value)
 Set number of solutions (so heuristics will be different).
int numberSavedSolutions () const
 Number of saved solutions (including best).
int maximumSavedSolutions () const
 Maximum number of extra saved solutions.
void setMaximumSavedSolutions (int value)
 Set maximum number of extra saved solutions.
const double * savedSolution (int which) const
 Return a saved solution (0==best) - NULL if off end.
double savedSolutionObjective (int which) const
 Return a saved solution objective (0==best) - COIN_DBL_MAX if off end.
int phase () const
 Current phase (so heuristics etc etc can find out).
int getNumberHeuristicSolutions () const
 Get number of heuristic solutions.
void setNumberHeuristicSolutions (int value)
 Set number of heuristic solutions.
void setObjSense (double s)
 Set objective function sense (1 for min (default), -1 for max,).
double getContinuousObjective () const
 Value of objective at continuous.
void setContinuousObjective (double value)
 Holds solution at continuous (after cuts if branchAndBound called).
int getContinuousInfeasibilities () const
 Number of infeasibilities at continuous.
void setContinuousInfeasibilities (int value)
 Holds solution at continuous (after cuts if branchAndBound called).
double rootObjectiveAfterCuts () const
 Value of objective after root node cuts added.
double sumChangeObjective () const
 Sum of Changes to objective by first solve.
int numberGlobalViolations () const
 Number of times global cuts violated.
void clearNumberGlobalViolations ()
 Holds solution at continuous (after cuts if branchAndBound called).
bool resolveAfterTakeOffCuts () const
 Whether to force a resolve after takeOffCuts.
void setResolveAfterTakeOffCuts (bool yesNo)
 Holds solution at continuous (after cuts if branchAndBound called).
int maximumRows () const
 Maximum number of rows.
CoinWarmStartBasis & workingBasis ()
 Work basis for temporary use.
int getStopNumberIterations () const
 Get number of "iterations" to stop after.
void setStopNumberIterations (int value)
 Set number of "iterations" to stop after.
Node selection

CbcCompareBasenodeComparison () const
void setNodeComparison (CbcCompareBase *compare)
void setNodeComparison (CbcCompareBase &compare)
CbcCompareBasenodeComparison () const
void setNodeComparison (CbcCompareBase *compare)
void setNodeComparison (CbcCompareBase &compare)
Problem feasibility checking

CbcFeasibilityBaseproblemFeasibility () const
void setProblemFeasibility (CbcFeasibilityBase *feasibility)
void setProblemFeasibility (CbcFeasibilityBase &feasibility)
CbcFeasibilityBaseproblemFeasibility () const
void setProblemFeasibility (CbcFeasibilityBase *feasibility)
void setProblemFeasibility (CbcFeasibilityBase &feasibility)
Tree methods and subtree methods

CbcTreetree () const
 Tree method e.g. heap (which may be overridden by inheritance).
void passInTreeHandler (CbcTree &tree)
 For modifying tree handling (original is cloned).
void passInSubTreeModel (CbcModel &model)
 For passing in an CbcModel to do a sub Tree (with derived tree handlers).
CbcModelsubTreeModel (OsiSolverInterface *solver=NULL) const
 For retrieving a copy of subtree model with given OsiSolver.
int numberStoppedSubTrees () const
 Returns number of times any subtree stopped on nodes, time etc.
void incrementSubTreeStopped ()
 Says a sub tree was stopped.
int typePresolve () const
 Whether to automatically do presolve before branch and bound (subTrees).
void setTypePresolve (int value)
 Tree method e.g. heap (which may be overridden by inheritance).
CbcTreetree () const
 Tree method e.g. heap (which may be overridden by inheritance).
void passInTreeHandler (CbcTree &tree)
 For modifying tree handling (original is cloned).
void passInSubTreeModel (CbcModel &model)
 For passing in an CbcModel to do a sub Tree (with derived tree handlers).
CbcModelsubTreeModel (OsiSolverInterface *solver=NULL) const
 For retrieving a copy of subtree model with given OsiSolver.
int numberStoppedSubTrees () const
 Returns number of times any subtree stopped on nodes, time etc.
void incrementSubTreeStopped ()
 Says a sub tree was stopped.
int typePresolve () const
 Whether to automatically do presolve before branch and bound (subTrees).
void setTypePresolve (int value)
 Tree method e.g. heap (which may be overridden by inheritance).
Branching Decisions

See the CbcBranchDecision class for additional information.

CbcBranchDecisionbranchingMethod () const
 Get the current branching decision method.
void setBranchingMethod (CbcBranchDecision *method)
 Set the branching decision method.
void setBranchingMethod (CbcBranchDecision &method)
 Set the branching method.
CbcCutModifiercutModifier () const
 Get the current cut modifier method.
void setCutModifier (CbcCutModifier *modifier)
 Set the cut modifier method.
void setCutModifier (CbcCutModifier &modifier)
 Set the cut modifier method.
CbcBranchDecisionbranchingMethod () const
 Get the current branching decision method.
void setBranchingMethod (CbcBranchDecision *method)
 Set the branching decision method.
void setBranchingMethod (CbcBranchDecision &method)
 Set the branching method.
CbcCutModifiercutModifier () const
 Get the current cut modifier method.
void setCutModifier (CbcCutModifier *modifier)
 Set the cut modifier method.
void setCutModifier (CbcCutModifier &modifier)
 Set the cut modifier method.
Row (constraint) and Column (variable) cut generation

int stateOfSearch () const
 State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.
void setStateOfSearch (int state)
 State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.
int searchStrategy () const
 Strategy worked out - mainly at root node for use by CbcNode.
void setSearchStrategy (int value)
 Set strategy worked out - mainly at root node for use by CbcNode.
int numberCutGenerators () const
 Get the number of cut generators.
CbcCutGenerator ** cutGenerators () const
 Get the list of cut generators.
CbcCutGeneratorcutGenerator (int i) const
 Get the specified cut generator.
CbcCutGeneratorvirginCutGenerator (int i) const
 Get the specified cut generator before any changes.
void addCutGenerator (CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false, int howOftenInSub=-100, int whatDepth=-1, int whatDepthInSub=-1)
 Add one generator - up to user to delete generators.
int stateOfSearch () const
 State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.
void setStateOfSearch (int state)
 State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.
int searchStrategy () const
 Strategy worked out - mainly at root node for use by CbcNode.
void setSearchStrategy (int value)
 Set strategy worked out - mainly at root node for use by CbcNode.
int numberCutGenerators () const
 Get the number of cut generators.
CbcCutGenerator ** cutGenerators () const
 Get the list of cut generators.
CbcCutGeneratorcutGenerator (int i) const
 Get the specified cut generator.
CbcCutGeneratorvirginCutGenerator (int i) const
 Get the specified cut generator before any changes.
void addCutGenerator (CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false, int howOftenInSub=-100, int whatDepth=-1, int whatDepthInSub=-1)
 Add one generator - up to user to delete generators.
Strategy and sub models

See the CbcStrategy class for additional information.

CbcStrategystrategy () const
 Get the current strategy.
void setStrategy (CbcStrategy &strategy)
 Set the strategy. Clones.
void setStrategy (CbcStrategy *strategy)
 Set the strategy. assigns.
CbcModelparentModel () const
 Get the current parent model.
void setParentModel (CbcModel &parentModel)
 Set the parent model.
CbcStrategystrategy () const
 Get the current strategy.
void setStrategy (CbcStrategy &strategy)
 Set the strategy. Clones.
void setStrategy (CbcStrategy *strategy)
 Set the strategy. assigns.
CbcModelparentModel () const
 Get the current parent model.
void setParentModel (CbcModel &parentModel)
 Set the parent model.
Heuristics and priorities

void addHeuristic (CbcHeuristic *generator, const char *name=NULL, int before=-1)
 Add one heuristic - up to user to delete.
CbcHeuristicheuristic (int i) const
 Get the specified heuristic.
int numberHeuristics () const
 Get the number of heuristics.
CbcHeuristiclastHeuristic () const
 Pointer to heuristic solver which found last solution (or NULL).
void setLastHeuristic (CbcHeuristic *last)
 set last heuristic which found a solution
void passInPriorities (const int *priorities, bool ifNotSimpleIntegers)
 Pass in branching priorities.
int priority (int sequence) const
 Returns priority level for an object (or 1000 if no priorities exist).
void passInEventHandler (const CbcEventHandler *eventHandler)
 Set an event handler.
CbcEventHandlergetEventHandler () const
 Retrieve a pointer to the event handler.
void addHeuristic (CbcHeuristic *generator, const char *name=NULL, int before=-1)
 Add one heuristic - up to user to delete.
CbcHeuristicheuristic (int i) const
 Get the specified heuristic.
int numberHeuristics () const
 Get the number of heuristics.
CbcHeuristiclastHeuristic () const
 Pointer to heuristic solver which found last solution (or NULL).
void setLastHeuristic (CbcHeuristic *last)
 set last heuristic which found a solution
void passInPriorities (const int *priorities, bool ifNotSimpleIntegers)
 Pass in branching priorities.
int priority (int sequence) const
 Returns priority level for an object (or 1000 if no priorities exist).
void passInEventHandler (const CbcEventHandler *eventHandler)
 Set an event handler.
CbcEventHandlergetEventHandler () const
 Retrieve a pointer to the event handler.
Setting/Accessing application data

void setApplicationData (void *appData)
 Set application data.
void * getApplicationData () const
 Get application data.
void passInSolverCharacteristics (OsiBabSolver *solverCharacteristics)
 For advanced applications you may wish to modify the behavior of Cbc e.g.
const OsiBabSolver * solverCharacteristics () const
 Get solver characteristics.
void setApplicationData (void *appData)
 Set application data.
void * getApplicationData () const
 Get application data.
void passInSolverCharacteristics (OsiBabSolver *solverCharacteristics)
 For advanced applications you may wish to modify the behavior of Cbc e.g.
const OsiBabSolver * solverCharacteristics () const
 Get solver characteristics.
Message handling etc

void passInMessageHandler (CoinMessageHandler *handler)
 Pass in Message handler (not deleted at end).
void newLanguage (CoinMessages::Language language)
 Set language.
void setLanguage (CoinMessages::Language language)
 Pass in Message handler (not deleted at end).
CoinMessageHandler * messageHandler () const
 Return handler.
CoinMessages & messages ()
 Return messages.
CoinMessages * messagesPointer ()
 Return pointer to messages.
void setLogLevel (int value)
 Set log level.
int logLevel () const
 Get log level.
void setDefaultHandler (bool yesNo)
 Set flag to say if handler_ is the default handler.
void passInMessageHandler (CoinMessageHandler *handler)
 Pass in Message handler (not deleted at end).
void newLanguage (CoinMessages::Language language)
 Set language.
void setLanguage (CoinMessages::Language language)
 Pass in Message handler (not deleted at end).
CoinMessageHandler * messageHandler () const
 Return handler.
CoinMessages & messages ()
 Return messages.
CoinMessages * messagesPointer ()
 Return pointer to messages.
void setLogLevel (int value)
 Set log level.
int logLevel () const
 Get log level.
void setDefaultHandler (bool yesNo)
 Set flag to say if handler_ is the default handler.
Specialized

void setSpecialOptions (int value)
 Set special options 0 bit (1) - check if cuts valid (if on debugger list) 1 bit (2) - use current basis to check integer solution (rather than all slack) 2 bit (4) - don't check integer solution (by solving LP) 3 bit (8) - fast analyze 4 bit (16) - non-linear model - so no well defined CoinPackedMatrix 5 bit (32) - keep names 6 bit (64) - try for dominated columns 7 bit (128) - SOS type 1 but all declared integer 8 bit (256) - Set to say solution just found, unset by doing cuts 9 bit (512) - Try reduced model after 100 nodes 10 bit (1024) - Switch on some heuristics even if seems unlikely 11 bit (2048) - Mark as in small branch and bound 12 bit (4096) - Funny cuts so do slow way (in some places) 13 bit (8192) - Funny cuts so do slow way (in other places) 14 bit (16384) - Use Cplex! for fathoming 15 bit (32768) - Try reduced model after 0 nodes 16 bit (65536) - Original model had integer bounds 17 bit (131072) - Perturbation switched off.
int specialOptions () const
 Get special options.
bool normalSolver () const
 Says if normal solver i.e. has well defined CoinPackedMatrix.
void setMoreSpecialOptions (int value)
 Set more special options at present bottom 6 bits used for shadow price mode 1024 for experimental hotstart 2048,4096 breaking out of cuts 8192 slowly increase minimum drop 16384 gomory.
int moreSpecialOptions () const
 Get more special options.
bool ownObjects () const
 Go to dantzig pivot selection if easy problem (clp only).
void checkModel ()
 Check original model before it gets messed up.
void setSpecialOptions (int value)
 Set special options 0 bit (1) - check if cuts valid (if on debugger list) 1 bit (2) - use current basis to check integer solution (rather than all slack) 2 bit (4) - don't check integer solution (by solving LP) 3 bit (8) - fast analyze 4 bit (16) - non-linear model - so no well defined CoinPackedMatrix 5 bit (32) - keep names 6 bit (64) - try for dominated columns 7 bit (128) - SOS type 1 but all declared integer 8 bit (256) - Set to say solution just found, unset by doing cuts 9 bit (512) - Try reduced model after 100 nodes 10 bit (1024) - Switch on some heuristics even if seems unlikely 11 bit (2048) - Mark as in small branch and bound 12 bit (4096) - Funny cuts so do slow way (in some places) 13 bit (8192) - Funny cuts so do slow way (in other places) 14 bit (16384) - Use Cplex! for fathoming 15 bit (32768) - Try reduced model after 0 nodes 16 bit (65536) - Original model had integer bounds 17 bit (131072) - Perturbation switched off.
int specialOptions () const
 Get special options.
bool normalSolver () const
 Says if normal solver i.e. has well defined CoinPackedMatrix.
void setMoreSpecialOptions (int value)
 Set more special options at present bottom 6 bits used for shadow price mode 1024 for experimental hotstart 2048,4096 breaking out of cuts 8192 slowly increase minimum drop 16384 gomory.
int moreSpecialOptions () const
 Get more special options.
bool ownObjects () const
 Go to dantzig pivot selection if easy problem (clp only).
void checkModel ()
 Check original model before it gets messed up.
Constructors and destructors etc

 CbcModel ()
 Default Constructor.
 CbcModel (const OsiSolverInterface &)
 Constructor from solver.
void assignSolver (OsiSolverInterface *&solver, bool deleteSolver=true)
 Assign a solver to the model (model assumes ownership).
void setModelOwnsSolver (bool ourSolver)
 Set ownership of solver.
bool modelOwnsSolver ()
 Get ownership of solver.
 CbcModel (const CbcModel &rhs, bool cloneHandler=false)
 Copy constructor .
CbcModeloperator= (const CbcModel &rhs)
 Assignment operator.
 ~CbcModel ()
 Destructor.
OsiSolverInterface * solver () const
 Returns solver - has current state.
OsiSolverInterface * swapSolver (OsiSolverInterface *solver)
 Returns current solver - sets new one.
OsiSolverInterface * continuousSolver () const
 Returns solver with continuous state.
void createContinuousSolver ()
 Create solver with continuous state.
void clearContinuousSolver ()
 Clear solver with continuous state.
OsiSolverInterface * referenceSolver () const
 A copy of the solver, taken at constructor or by saveReferenceSolver.
void saveReferenceSolver ()
 Save a copy of the current solver so can be reset to.
void resetToReferenceSolver ()
 Uses a copy of reference solver to be current solver.
void gutsOfDestructor ()
 Clears out as much as possible (except solver).
void gutsOfDestructor2 ()
 Clears out enough to reset CbcModel as if no branch and bound done.
void resetModel ()
 Clears out enough to reset CbcModel cutoff etc.
void gutsOfCopy (const CbcModel &rhs, int mode=0)
 Most of copy constructor mode - 0 copy but don't delete before 1 copy and delete before 2 copy and delete before (but use virgin generators).
void moveInfo (const CbcModel &rhs)
 Move status, nodes etc etc across.
 CbcModel ()
 Default Constructor.
 CbcModel (const OsiSolverInterface &)
 Constructor from solver.
void assignSolver (OsiSolverInterface *&solver, bool deleteSolver=true)
 Assign a solver to the model (model assumes ownership).
void setModelOwnsSolver (bool ourSolver)
 Set ownership of solver.
bool modelOwnsSolver ()
 Get ownership of solver.
 CbcModel (const CbcModel &rhs, bool cloneHandler=false)
 Copy constructor .
CbcModeloperator= (const CbcModel &rhs)
 Assignment operator.
 ~CbcModel ()
 Destructor.
OsiSolverInterface * solver () const
 Returns solver - has current state.
OsiSolverInterface * swapSolver (OsiSolverInterface *solver)
 Returns current solver - sets new one.
OsiSolverInterface * continuousSolver () const
 Returns solver with continuous state.
void createContinuousSolver ()
 Create solver with continuous state.
void clearContinuousSolver ()
 Clear solver with continuous state.
OsiSolverInterface * referenceSolver () const
 A copy of the solver, taken at constructor or by saveReferenceSolver.
void saveReferenceSolver ()
 Save a copy of the current solver so can be reset to.
void resetToReferenceSolver ()
 Uses a copy of reference solver to be current solver.
void gutsOfDestructor ()
 Clears out as much as possible (except solver).
void gutsOfDestructor2 ()
 Clears out enough to reset CbcModel as if no branch and bound done.
void resetModel ()
 Clears out enough to reset CbcModel cutoff etc.
void gutsOfCopy (const CbcModel &rhs, int mode=0)
 Most of copy constructor mode - 0 copy but don't delete before 1 copy and delete before 2 copy and delete before (but use virgin generators).
void moveInfo (const CbcModel &rhs)
 Move status, nodes etc etc across.

CbcThreadmasterThread () const
 To do with threads.
CbcNodeInfo ** walkback () const
 Get pointer to walkback.
int getNumberThreads () const
 Get number of threads.
void setNumberThreads (int value)
 Set number of threads.
int getThreadMode () const
 Get thread mode.
void setThreadMode (int value)
 Set thread mode always use numberThreads for branching 1 set then deterministic 2 set then use numberThreads for root cuts 4 set then use numberThreads in root mini branch and bound 8 set and numberThreads - do heuristics numberThreads at a time 8 set and numberThreads==0 do all heuristics at once default is 0.
int parallelMode () const
 Return -2 if deterministic threaded and main thread -1 if deterministic threaded and serial thread 0 if serial 1 if opportunistic threaded.
bool isLocked () const
 From here to end of section - code in CbcThread.cpp until class changed Returns true if locked.
void lockThread ()
 To do with threads.
void unlockThread ()
 To do with threads.
void setInfoInChild (int type, CbcThread *info)
 Set information in a child -3 pass pointer to child thread info -2 just stop -1 delete simple child stuff 0 delete opportunistic child stuff 1 delete deterministic child stuff.
void moveToModel (CbcModel *baseModel, int mode)
 Move/copy information from one model to another -1 - initialization 0 - from base model 1 - to base model (and reset) 2 - add in final statistics etc (and reset so can do clean destruction).
int splitModel (int numberModels, CbcModel **model, int numberNodes)
 Split up nodes.
void startSplitModel (int numberIterations)
 Start threads.
void mergeModels (int numberModel, CbcModel **model, int numberNodes)
 Merge models.

int getNodeCount2 () const
 semi-private i.e. users should not use
void setPointers (const OsiSolverInterface *solver)
 Set pointers for speed.
int reducedCostFix ()
 Perform reduced cost fixing.
void synchronizeHandlers (int makeDefault)
 Makes all handlers same.
void saveExtraSolution (const double *solution, double objectiveValue)
 Save a solution to saved list.
void saveBestSolution (const double *solution, double objectiveValue)
 Save a solution to best and move current to saved.
void deleteSolutions ()
 Delete best and saved solutions.
int resolve (OsiSolverInterface *solver)
 Encapsulates solver resolve.
int chooseBranch (CbcNode *&newNode, int numberPassesLeft, CbcNode *oldNode, OsiCuts &cuts, bool &resolved, CoinWarmStartBasis *lastws, const double *lowerBefore, const double *upperBefore, OsiSolverBranch *&branches)
 Encapsulates choosing a variable - anyAction -2, infeasible (-1 round again), 0 done.
int chooseBranch (CbcNode *newNode, int numberPassesLeft, bool &resolved)
 semi-private i.e. users should not use
CoinWarmStartBasis * getEmptyBasis (int ns=0, int na=0) const
 Return an empty basis object of the specified size.
int takeOffCuts (OsiCuts &cuts, bool allowResolve, OsiCuts *saveCuts, int numberNewCuts=0, const OsiRowCut **newCuts=NULL)
 Remove inactive cuts from the model.
int addCuts (CbcNode *node, CoinWarmStartBasis *&lastws, bool canFix)
 Determine and install the active cuts that need to be added for the current subproblem.
bool addCuts1 (CbcNode *node, CoinWarmStartBasis *&lastws)
 Traverse the tree from node to root and prep the model.
void previousBounds (CbcNode *node, CbcNodeInfo *where, int iColumn, double &lower, double &upper, int force)
 Returns bounds just before where - initially original bounds.
void setObjectiveValue (CbcNode *thisNode, const CbcNode *parentNode) const
 Set objective value in a node.
void convertToDynamic ()
 If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.
void synchronizeNumberBeforeTrust (int type=0)
 Set numberBeforeTrust in all objects.
void zapIntegerInformation (bool leaveObjects=true)
 Zap integer information in problem (may leave object info).
int cliquePseudoCosts (int doStatistics)
 Use cliques for pseudocost information - return nonzero if infeasible.
void pseudoShadow (int type)
 Fill in useful estimates.
void fillPseudoCosts (double *downCosts, double *upCosts, int *priority=NULL, int *numberDown=NULL, int *numberUp=NULL, int *numberDownInfeasible=NULL, int *numberUpInfeasible=NULL) const
 Return pseudo costs If not all integers or not pseudo costs - returns all zero Length of arrays are numberIntegers() and entries correspond to integerVariable()[i] User must allocate arrays before call.
void doHeuristicsAtRoot (int deleteHeuristicsAfterwards=0)
 Do heuristics at root.
void adjustHeuristics ()
 Adjust heuristics based on model.
const double * hotstartSolution () const
 Get the hotstart solution.
const int * hotstartPriorities () const
 Get the hotstart priorities.
CbcCountRowCut ** addedCuts () const
 Return the list of cuts initially collected for this subproblem.
int currentNumberCuts () const
 Number of entries in the list returned by addedCuts().
OsiCuts * globalCuts ()
 Global cuts.
void setNextRowCut (const OsiRowCut &cut)
 Copy and set a pointer to a row cut which will be added instead of normal branching.
CbcNodecurrentNode () const
 Get a pointer to current node (be careful).
CglTreeProbingInfo * probingInfo () const
 Get a pointer to probing info.
CoinThreadRandom * randomNumberGenerator ()
 Thread specific random number generator.
void setNumberStrongIterations (int number)
 Set the number of iterations done in strong branching.
int numberStrongIterations () const
 Get the number of iterations done in strong branching.
int maximumNumberIterations () const
 Get maximum number of iterations (designed to be used in heuristics).
void setMaximumNumberIterations (int value)
 Set maximum number of iterations (designed to be used in heuristics).
int numberExtraIterations () const
 Number of extra iterations.
void incrementStrongInfo (int numberTimes, int numberIterations, int numberFixed, bool ifInfeasible)
 Increment strong info.
const int * strongInfo () const
 Return strong info.
int * mutableStrongInfo ()
 Return mutable strong info.
CglStored * storedRowCuts () const
 Get stored row cuts for donor/recipient CbcModel.
void setStoredRowCuts (CglStored *cuts)
 Set stored row cuts for donor/recipient CbcModel.
bool allDynamic () const
 Says whether all dynamic integers.
void generateCpp (FILE *fp, int options)
 Create C++ lines to get to current state.
OsiBranchingInformation usefulInformation () const
 Generate an OsiBranchingInformation object.
void setBestSolutionBasis (const CoinWarmStartBasis &bestSolutionBasis)
 Warm start object produced by heuristic or strong branching.
void redoWalkBack ()
 Redo walkback arrays.

CbcThreadmasterThread () const
 To do with threads.
CbcNodeInfo ** walkback () const
 Get pointer to walkback.
int getNumberThreads () const
 Get number of threads.
void setNumberThreads (int value)
 Set number of threads.
int getThreadMode () const
 Get thread mode.
void setThreadMode (int value)
 Set thread mode always use numberThreads for branching 1 set then deterministic 2 set then use numberThreads for root cuts 4 set then use numberThreads in root mini branch and bound 8 set and numberThreads - do heuristics numberThreads at a time 8 set and numberThreads==0 do all heuristics at once default is 0.
int parallelMode () const
 Return -2 if deterministic threaded and main thread -1 if deterministic threaded and serial thread 0 if serial 1 if opportunistic threaded.
bool isLocked () const
 From here to end of section - code in CbcThread.cpp until class changed Returns true if locked.
void lockThread ()
 To do with threads.
void unlockThread ()
 To do with threads.
void setInfoInChild (int type, CbcThread *info)
 Set information in a child -3 pass pointer to child thread info -2 just stop -1 delete simple child stuff 0 delete opportunistic child stuff 1 delete deterministic child stuff.
void moveToModel (CbcModel *baseModel, int mode)
 Move/copy information from one model to another -1 - initialization 0 - from base model 1 - to base model (and reset) 2 - add in final statistics etc (and reset so can do clean destruction).
int splitModel (int numberModels, CbcModel **model, int numberNodes)
 Split up nodes.
void startSplitModel (int numberIterations)
 Start threads.
void mergeModels (int numberModel, CbcModel **model, int numberNodes)
 Merge models.

int getNodeCount2 () const
 semi-private i.e. users should not use
void setPointers (const OsiSolverInterface *solver)
 Set pointers for speed.
int reducedCostFix ()
 Perform reduced cost fixing.
void synchronizeHandlers (int makeDefault)
 Makes all handlers same.
void saveExtraSolution (const double *solution, double objectiveValue)
 Save a solution to saved list.
void saveBestSolution (const double *solution, double objectiveValue)
 Save a solution to best and move current to saved.
void deleteSolutions ()
 Delete best and saved solutions.
int resolve (OsiSolverInterface *solver)
 Encapsulates solver resolve.
int chooseBranch (CbcNode *&newNode, int numberPassesLeft, CbcNode *oldNode, OsiCuts &cuts, bool &resolved, CoinWarmStartBasis *lastws, const double *lowerBefore, const double *upperBefore, OsiSolverBranch *&branches)
 Encapsulates choosing a variable - anyAction -2, infeasible (-1 round again), 0 done.
int chooseBranch (CbcNode *newNode, int numberPassesLeft, bool &resolved)
 semi-private i.e. users should not use
CoinWarmStartBasis * getEmptyBasis (int ns=0, int na=0) const
 Return an empty basis object of the specified size.
int takeOffCuts (OsiCuts &cuts, bool allowResolve, OsiCuts *saveCuts, int numberNewCuts=0, const OsiRowCut **newCuts=NULL)
 Remove inactive cuts from the model.
int addCuts (CbcNode *node, CoinWarmStartBasis *&lastws, bool canFix)
 Determine and install the active cuts that need to be added for the current subproblem.
bool addCuts1 (CbcNode *node, CoinWarmStartBasis *&lastws)
 Traverse the tree from node to root and prep the model.
void previousBounds (CbcNode *node, CbcNodeInfo *where, int iColumn, double &lower, double &upper, int force)
 Returns bounds just before where - initially original bounds.
void setObjectiveValue (CbcNode *thisNode, const CbcNode *parentNode) const
 Set objective value in a node.
void convertToDynamic ()
 If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.
void synchronizeNumberBeforeTrust (int type=0)
 Set numberBeforeTrust in all objects.
void zapIntegerInformation (bool leaveObjects=true)
 Zap integer information in problem (may leave object info).
int cliquePseudoCosts (int doStatistics)
 Use cliques for pseudocost information - return nonzero if infeasible.
void pseudoShadow (int type)
 Fill in useful estimates.
void fillPseudoCosts (double *downCosts, double *upCosts, int *priority=NULL, int *numberDown=NULL, int *numberUp=NULL, int *numberDownInfeasible=NULL, int *numberUpInfeasible=NULL) const
 Return pseudo costs If not all integers or not pseudo costs - returns all zero Length of arrays are numberIntegers() and entries correspond to integerVariable()[i] User must allocate arrays before call.
void doHeuristicsAtRoot (int deleteHeuristicsAfterwards=0)
 Do heuristics at root.
void adjustHeuristics ()
 Adjust heuristics based on model.
const double * hotstartSolution () const
 Get the hotstart solution.
const int * hotstartPriorities () const
 Get the hotstart priorities.
CbcCountRowCut ** addedCuts () const
 Return the list of cuts initially collected for this subproblem.
int currentNumberCuts () const
 Number of entries in the list returned by addedCuts().
OsiCuts * globalCuts ()
 Global cuts.
void setNextRowCut (const OsiRowCut &cut)
 Copy and set a pointer to a row cut which will be added instead of normal branching.
CbcNodecurrentNode () const
 Get a pointer to current node (be careful).
CglTreeProbingInfo * probingInfo () const
 Get a pointer to probing info.
CoinThreadRandom * randomNumberGenerator ()
 Thread specific random number generator.
void setNumberStrongIterations (int number)
 Set the number of iterations done in strong branching.
int numberStrongIterations () const
 Get the number of iterations done in strong branching.
int maximumNumberIterations () const
 Get maximum number of iterations (designed to be used in heuristics).
void setMaximumNumberIterations (int value)
 Set maximum number of iterations (designed to be used in heuristics).
int numberExtraIterations () const
 Number of extra iterations.
void incrementStrongInfo (int numberTimes, int numberIterations, int numberFixed, bool ifInfeasible)
 Increment strong info.
const int * strongInfo () const
 Return strong info.
int * mutableStrongInfo ()
 Return mutable strong info.
CglStored * storedRowCuts () const
 Get stored row cuts for donor/recipient CbcModel.
void setStoredRowCuts (CglStored *cuts)
 Set stored row cuts for donor/recipient CbcModel.
bool allDynamic () const
 Says whether all dynamic integers.
void generateCpp (FILE *fp, int options)
 Create C++ lines to get to current state.
OsiBranchingInformation usefulInformation () const
 Generate an OsiBranchingInformation object.
void setBestSolutionBasis (const CoinWarmStartBasis &bestSolutionBasis)
 Warm start object produced by heuristic or strong branching.
void redoWalkBack ()
 Redo walkback arrays.

Private Attributes

Private member data

OsiSolverInterface * solver_
 The solver associated with this model.
unsigned int ownership_
 Ownership of objects and other stuff.
OsiSolverInterface * continuousSolver_
 A copy of the solver, taken at the continuous (root) node.
OsiSolverInterface * referenceSolver_
 A copy of the solver, taken at constructor or by saveReferenceSolver.
CoinMessageHandler * handler_
 Message handler.
bool defaultHandler_
 Flag to say if handler_ is the default handler.
CoinMessages messages_
 Cbc messages.
int intParam_ [CbcLastIntParam]
 Array for integer parameters.
double dblParam_ [CbcLastDblParam]
 Array for double parameters.
CoinWarmStart * emptyWarmStart_
 Pointer to an empty warm start object.
double bestObjective_
 Best objective.
double bestPossibleObjective_
 Best possible objective.
double sumChangeObjective1_
 Sum of Changes to objective by first solve.
double sumChangeObjective2_
 Sum of Changes to objective by subsequent solves.
double * bestSolution_
 Array holding the incumbent (best) solution.
double ** savedSolutions_
 Arrays holding other solutions.
double * currentSolution_
 Array holding the current solution.
const double * testSolution_
 For testing infeasibilities - will point to currentSolution_ or solver-->getColSolution().
CoinWarmStartBasis bestSolutionBasis_
 Warm start object produced by heuristic or strong branching.
OsiCuts globalCuts_
 Global cuts.
double minimumDrop_
 Minimum degradation in objective value to continue cut generation.
int numberSolutions_
 Number of solutions.
int numberSavedSolutions_
 Number of saved solutions.
int maximumSavedSolutions_
 Maximum number of saved solutions.
int stateOfSearch_
 State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.
int whenCuts_
 At which depths to do cuts.
double * hotstartSolution_
 Hotstart solution.
int * hotstartPriorities_
 Hotstart priorities.
int numberHeuristicSolutions_
 Number of heuristic solutions.
int numberNodes_
 Cumulative number of nodes.
int numberNodes2_
 Cumulative number of nodes for statistics.
int numberIterations_
 Cumulative number of iterations.
int numberSolves_
 Cumulative number of solves.
int status_
 Status of problem - 0 finished, 1 stopped, 2 difficulties.
int secondaryStatus_
 Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions.
int numberIntegers_
 Number of integers in problem.
int numberRowsAtContinuous_
 Number of rows at continuous.
int maximumNumberCuts_
 Maximum number of cuts.
int phase_
 Current phase (so heuristics etc etc can find out).
int currentNumberCuts_
 Number of entries in addedCuts_.
int maximumDepth_
 Current limit on search tree depth.
CbcNodeInfo ** walkback_
 Array used to assemble the path between a node and the search tree root.
CbcNodeInfo ** lastNodeInfo_
 The solver associated with this model.
const OsiRowCut ** lastCut_
 The solver associated with this model.
int lastDepth_
 The solver associated with this model.
int lastNumberCuts2_
 The solver associated with this model.
int maximumCuts_
 The solver associated with this model.
int * lastNumberCuts_
 The solver associated with this model.
CbcCountRowCut ** addedCuts_
 The list of cuts initially collected for this subproblem.
OsiRowCut * nextRowCut_
 A pointer to a row cut which will be added instead of normal branching.
CbcNodecurrentNode_
 Current node so can be used elsewhere.
int * integerVariable_
 Indices of integer variables.
char * integerInfo_
 Whether of not integer.
double * continuousSolution_
 Holds solution at continuous (after cuts).
int * usedInSolution_
 Array marked whenever a solution is found if non-zero.
int specialOptions_
 Special options 0 bit (1) - check if cuts valid (if on debugger list) 1 bit (2) - use current basis to check integer solution (rather than all slack) 2 bit (4) - don't check integer solution (by solving LP) 3 bit (8) - fast analyze 4 bit (16) - non-linear model - so no well defined CoinPackedMatrix 5 bit (32) - keep names 6 bit (64) - try for dominated columns 7 bit (128) - SOS type 1 but all declared integer 8 bit (256) - Set to say solution just found, unset by doing cuts 9 bit (512) - Try reduced model after 100 nodes 10 bit (1024) - Switch on some heuristics even if seems unlikely 11 bit (2048) - Mark as in small branch and bound 12 bit (4096) - Funny cuts so do slow way (in some places) 13 bit (8192) - Funny cuts so do slow way (in other places) 14 bit (16384) - Use Cplex! for fathoming 15 bit (32768) - Try reduced model after 0 nodes 16 bit (65536) - Original model had integer bounds 17 bit (131072) - Perturbation switched off 18 bit (262144) - donor CbcModel 19 bit (524288) - recipient CbcModel.
int moreSpecialOptions_
 More special options at present bottom 3 bits used for shadow price mode.
CbcCompareBasenodeCompare_
 User node comparison function.
CbcFeasibilityBaseproblemFeasibility_
 User feasibility function (see CbcFeasibleBase.hpp).
CbcTreetree_
 Tree.
CbcModelsubTreeModel_
 A pointer to model to be used for subtrees.
int numberStoppedSubTrees_
 Number of times any subtree stopped on nodes, time etc.
CbcBranchDecisionbranchingMethod_
 Variable selection function.
CbcCutModifiercutModifier_
 Cut modifier function.
CbcStrategystrategy_
 Strategy.
CbcModelparentModel_
 Parent model.
const double * cbcColLower_
 Whether to automatically do presolve before branch and bound.
const double * cbcColUpper_
 Pointer to array[getNumCols()] (for speed) of column upper bounds.
const double * cbcRowLower_
 Pointer to array[getNumRows()] (for speed) of row lower bounds.
const double * cbcRowUpper_
 Pointer to array[getNumRows()] (for speed) of row upper bounds.
const double * cbcColSolution_
 Pointer to array[getNumCols()] (for speed) of primal solution vector.
const double * cbcRowPrice_
 Pointer to array[getNumRows()] (for speed) of dual prices.
const double * cbcReducedCost_
 Get a pointer to array[getNumCols()] (for speed) of reduced costs.
const double * cbcRowActivity_
 Pointer to array[getNumRows()] (for speed) of row activity levels.
void * appData_
 Pointer to user-defined data structure.
int presolve_
 Presolve for CbcTreeLocal.
int numberStrong_
 Maximum number of candidates to consider for strong branching.
int numberBeforeTrust_
 The number of branches before pseudo costs believed in dynamic strong branching.
int numberPenalties_
 The number of variables for which to compute penalties in dynamic strong branching.
int stopNumberIterations_
 For threads - stop after this many "iterations".
double penaltyScaleFactor_
 Scale factor to make penalties match strong.
int numberAnalyzeIterations_
 Number of analyze iterations to do.
double * analyzeResults_
 Arrays with analysis results.
int numberInfeasibleNodes_
 Number of nodes infeasible by normal branching (before cuts).
int problemType_
 Problem type as set by user or found by analysis.
int printFrequency_
 Print frequency.
int numberCutGenerators_
 Number of cut generators.
CbcCutGenerator ** generator_
 The solver associated with this model.
CbcCutGenerator ** virginGenerator_
 The solver associated with this model.
int numberHeuristics_
 Number of heuristics.
CbcHeuristic ** heuristic_
 Heuristic solvers.
CbcHeuristiclastHeuristic_
 Pointer to heuristic solver which found last solution (or NULL).
CbcEventHandlereventHandler_
int numberObjects_
 Total number of objects.
OsiObject ** object_
 Integer and Clique and ...
bool ownObjects_
 Now we may not own objects - just point to solver's objects.
int * originalColumns_
 Original columns as created by integerPresolve or preprocessing.
int howOftenGlobalScan_
 How often to scan global cuts.
int numberGlobalViolations_
 Number of times global cuts violated.
int numberExtraIterations_
 Number of extra iterations in fast lp.
int numberExtraNodes_
 Number of extra nodes in fast lp.
double continuousObjective_
 Value of objective at continuous (Well actually after initial round of cuts).
double originalContinuousObjective_
 Value of objective before root node cuts added.
int continuousInfeasibilities_
 Number of infeasibilities at continuous.
int maximumCutPassesAtRoot_
 Maximum number of cut passes at root.
int maximumCutPasses_
 Maximum number of cut passes.
int preferredWay_
 Preferred way of branching.
int currentPassNumber_
 Current cut pass number.
int maximumWhich_
 Maximum number of cuts (for whichGenerator_).
int maximumRows_
 Maximum number of rows.
int currentDepth_
 Current depth.
CoinThreadRandom randomNumberGenerator_
 Thread specific random number generator.
CoinWarmStartBasis workingBasis_
 Work basis for temporary use.
int * whichGenerator_
 Which cut generator generated this cut.
int maximumStatistics_
 Maximum number of statistics.
CbcStatistics ** statistics_
 statistics
int maximumDepthActual_
 Maximum depth reached.
double numberDJFixed_
 Number of reduced cost fixings.
CglTreeProbingInfo * probingInfo_
 Probing info.
int numberFixedAtRoot_
 Number of fixed by analyze at root.
int numberFixedNow_
 Number fixed by analyze so far.
bool stoppedOnGap_
 Whether stopping on gap.
bool eventHappened_
 Whether event happened.
int numberLongStrong_
 Number of long strong goes.
int numberOldActiveCuts_
 Number of old active cuts.
int numberNewCuts_
 Number of new cuts.
int searchStrategy_
 Strategy worked out - mainly at root node.
int numberStrongIterations_
 Number of iterations in strong branching.
int strongInfo_ [7]
 0 - number times strong branching done, 1 - number fixed, 2 - number infeasible Second group of three is a snapshot at node [6]
OsiBabSolver * solverCharacteristics_
 For advanced applications you may wish to modify the behavior of Cbc e.g.
bool resolveAfterTakeOffCuts_
 Whether to force a resolve after takeOffCuts.
int maximumNumberIterations_
 Maximum number of iterations (designed to be used in heuristics).
int continuousPriority_
 Anything with priority >= this can be treated as continuous.
int numberUpdateItems_
 Number of outstanding update information items.
int maximumNumberUpdateItems_
 Maximum number of outstanding update information items.
CbcObjectUpdateDataupdateItems_
 Update items.
CglStored * storedRowCuts_
 Stored row cuts for donor/recipient CbcModel.
int numberThreads_
 Parallel 0 - off 1 - testing 2-99 threads other special meanings.
int threadMode_
 thread mode always use numberThreads for branching 1 set then deterministic 2 set then use numberThreads for root cuts 4 set then use numberThreads in root mini branch and bound default is 0
CbcBaseModelmaster_
 Thread stuff for master.
CbcThreadmasterThread_
 Pointer to masterthread.

Solve methods



void initialSolve ()
 Solve the initial LP relaxation.
void branchAndBound (int doStatistics=0)
 Invoke the branch & cut algorithm.
void addUpdateInformation (const CbcObjectUpdateData &data)
 Adds an update information object.
int doOneNode (CbcModel *baseModel, CbcNode *&node, CbcNode *&newNode)
 Do one node - broken out for clarity? also for parallel (when baseModel!=this) Returns 1 if solution found node NULL on return if no branches left newNode NULL if no new node created.
int resolve (CbcNodeInfo *parent, int whereFrom, double *saveSolution=NULL, double *saveLower=NULL, double *saveUpper=NULL)
 Reoptimise an LP relaxation.
void makeGlobalCuts (int numberRows, const int *which)
 Make given rows (L or G) into global cuts and remove from lp.
void makeGlobalCut (const OsiRowCut *cut)
 Make given cut into a global cut.
void makeGlobalCut (const OsiRowCut &cut)
 Make given cut into a global cut.
void makeGlobalCut (const OsiColCut *cut)
 Make given column cut into a global cut.
void makeGlobalCut (const OsiColCut &cut)
 Make given column cut into a global cut.
void initialSolve ()
 Solve the initial LP relaxation.
void branchAndBound (int doStatistics=0)
 Invoke the branch & cut algorithm.
void addUpdateInformation (const CbcObjectUpdateData &data)
 Adds an update information object.
int doOneNode (CbcModel *baseModel, CbcNode *&node, CbcNode *&newNode)
 Do one node - broken out for clarity? also for parallel (when baseModel!=this) Returns 1 if solution found node NULL on return if no branches left newNode NULL if no new node created.
int resolve (CbcNodeInfo *parent, int whereFrom, double *saveSolution=NULL, double *saveLower=NULL, double *saveUpper=NULL)
 Reoptimise an LP relaxation.
void makeGlobalCuts (int numberRows, const int *which)
 Make given rows (L or G) into global cuts and remove from lp.
void makeGlobalCut (const OsiRowCut *cut)
 Make given cut into a global cut.
void makeGlobalCut (const OsiRowCut &cut)
 Make given cut into a global cut.
void makeGlobalCut (const OsiColCut *cut)
 Make given column cut into a global cut.
void makeGlobalCut (const OsiColCut &cut)
 Make given column cut into a global cut.
bool solveWithCuts (OsiCuts &cuts, int numberTries, CbcNode *node)
 Evaluate a subproblem using cutting planes and heuristics.
int serialCuts (OsiCuts &cuts, CbcNode *node, OsiCuts &slackCuts, int lastNumberCuts)
 Generate one round of cuts - serial mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.
int parallelCuts (CbcBaseModel *master, OsiCuts &cuts, CbcNode *node, OsiCuts &slackCuts, int lastNumberCuts)
 Generate one round of cuts - parallel mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.
CbcNode ** solveOneNode (int whichSolver, CbcNode *node, int &numberNodesOutput, int &status)
 Input one node output N nodes to put on tree and optional solution update This should be able to operate in parallel so is given a solver and is const(ish) However we will need to keep an array of solver_ and bases and more status is 0 for normal, 1 if solution Calling code should always push nodes back on tree.
void resizeWhichGenerator (int numberNow, int numberAfter)
 Update size of whichGenerator.
bool solveWithCuts (OsiCuts &cuts, int numberTries, CbcNode *node)
 Evaluate a subproblem using cutting planes and heuristics.
int serialCuts (OsiCuts &cuts, CbcNode *node, OsiCuts &slackCuts, int lastNumberCuts)
 Generate one round of cuts - serial mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.
int parallelCuts (CbcBaseModel *master, OsiCuts &cuts, CbcNode *node, OsiCuts &slackCuts, int lastNumberCuts)
 Generate one round of cuts - parallel mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.
CbcNode ** solveOneNode (int whichSolver, CbcNode *node, int &numberNodesOutput, int &status)
 Input one node output N nodes to put on tree and optional solution update This should be able to operate in parallel so is given a solver and is const(ish) However we will need to keep an array of solver_ and bases and more status is 0 for normal, 1 if solution Calling code should always push nodes back on tree.
void resizeWhichGenerator (int numberNow, int numberAfter)
 Update size of whichGenerator.

Detailed Description

Simple Branch and bound class.

The initialSolve() method solves the initial LP relaxation of the MIP problem. The branchAndBound() method can then be called to finish using a branch and cut algorithm.

Search Tree Traversal

Subproblems (aka nodes) requiring additional evaluation are stored using the CbcNode and CbcNodeInfo objects. Ancestry linkage is maintained in the CbcNodeInfo object. Evaluation of a subproblem within branchAndBound() proceeds as follows:

Note that there is never a node representing the active subproblem; the model and solver represent the active subproblem.

Row (Constraint) Cut Handling

For a typical subproblem, the sequence of events is as follows:

See CbcCountRowCut for details of the bookkeeping associated with cut management.

Definition at line 98 of file CbcModel.hpp.


Member Enumeration Documentation

Enumerator:
CbcMaxNumNode 

The maximum number of nodes before terminating.

CbcMaxNumSol 

The maximum number of solutions before terminating.

CbcFathomDiscipline 

Fathoming discipline.

Controls objective function comparisons for purposes of fathoming by bound or determining monotonic variables.

If 1, action is taken only when the current objective is strictly worse than the target. Implementation is handled by adding a small tolerance to the target.

CbcPrinting 

Adjusts printout 1 does different node message with number unsatisfied on last branch.

CbcNumberBranches 

Number of branches (may be more than number of nodes as may include strong branching).

CbcLastIntParam 

Just a marker, so that a static sized array can store parameters.

CbcMaxNumNode 

The maximum number of nodes before terminating.

CbcMaxNumSol 

The maximum number of solutions before terminating.

CbcFathomDiscipline 

Fathoming discipline.

Controls objective function comparisons for purposes of fathoming by bound or determining monotonic variables.

If 1, action is taken only when the current objective is strictly worse than the target. Implementation is handled by adding a small tolerance to the target.

CbcPrinting 

Adjusts printout 1 does different node message with number unsatisfied on last branch.

CbcNumberBranches 

Number of branches (may be more than number of nodes as may include strong branching).

CbcLastIntParam 

Just a marker, so that a static sized array can store parameters.

Definition at line 102 of file CbcModel.hpp.

Enumerator:
CbcIntegerTolerance 

The maximum amount the value of an integer variable can vary from integer and still be considered feasible.

CbcInfeasibilityWeight 

The objective is assumed to worsen by this amount for each integer infeasibility.

CbcCutoffIncrement 

The amount by which to tighten the objective function cutoff when a new solution is discovered.

CbcAllowableGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcAllowableFractionGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcMaximumSeconds 

The maximum number of seconds before terminating.

A double should be adequate!

CbcCurrentCutoff 

Cutoff - stored for speed.

CbcOptimizationDirection 

Optimization direction - stored for speed.

CbcCurrentObjectiveValue 

Current objective value.

CbcCurrentMinimizationObjectiveValue 

Current minimization objective value.

CbcStartSeconds 

The time at start of model.

So that other pieces of code can access

CbcHeuristicGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcHeuristicFractionGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcSmallestChange 

Smallest non-zero change on a branch.

CbcSumChange 

Sum of non-zero changes on a branch.

CbcLargestChange 

Largest non-zero change on a branch.

CbcSmallChange 

Small non-zero change on a branch to be used as guess.

CbcLastDblParam 

Just a marker, so that a static sized array can store parameters.

CbcIntegerTolerance 

The maximum amount the value of an integer variable can vary from integer and still be considered feasible.

CbcInfeasibilityWeight 

The objective is assumed to worsen by this amount for each integer infeasibility.

CbcCutoffIncrement 

The amount by which to tighten the objective function cutoff when a new solution is discovered.

CbcAllowableGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcAllowableFractionGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcMaximumSeconds 

The maximum number of seconds before terminating.

A double should be adequate!

CbcCurrentCutoff 

Cutoff - stored for speed.

CbcOptimizationDirection 

Optimization direction - stored for speed.

CbcCurrentObjectiveValue 

Current objective value.

CbcCurrentMinimizationObjectiveValue 

Current minimization objective value.

CbcStartSeconds 

The time at start of model.

So that other pieces of code can access

CbcHeuristicGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcHeuristicFractionGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcSmallestChange 

Smallest non-zero change on a branch.

CbcSumChange 

Sum of non-zero changes on a branch.

CbcLargestChange 

Largest non-zero change on a branch.

CbcSmallChange 

Small non-zero change on a branch to be used as guess.

CbcLastDblParam 

Just a marker, so that a static sized array can store parameters.

Definition at line 128 of file CbcModel.hpp.

Enumerator:
CbcMaxNumNode 

The maximum number of nodes before terminating.

CbcMaxNumSol 

The maximum number of solutions before terminating.

CbcFathomDiscipline 

Fathoming discipline.

Controls objective function comparisons for purposes of fathoming by bound or determining monotonic variables.

If 1, action is taken only when the current objective is strictly worse than the target. Implementation is handled by adding a small tolerance to the target.

CbcPrinting 

Adjusts printout 1 does different node message with number unsatisfied on last branch.

CbcNumberBranches 

Number of branches (may be more than number of nodes as may include strong branching).

CbcLastIntParam 

Just a marker, so that a static sized array can store parameters.

CbcMaxNumNode 

The maximum number of nodes before terminating.

CbcMaxNumSol 

The maximum number of solutions before terminating.

CbcFathomDiscipline 

Fathoming discipline.

Controls objective function comparisons for purposes of fathoming by bound or determining monotonic variables.

If 1, action is taken only when the current objective is strictly worse than the target. Implementation is handled by adding a small tolerance to the target.

CbcPrinting 

Adjusts printout 1 does different node message with number unsatisfied on last branch.

CbcNumberBranches 

Number of branches (may be more than number of nodes as may include strong branching).

CbcLastIntParam 

Just a marker, so that a static sized array can store parameters.

Definition at line 102 of file CbcModel.hpp.

Enumerator:
CbcIntegerTolerance 

The maximum amount the value of an integer variable can vary from integer and still be considered feasible.

CbcInfeasibilityWeight 

The objective is assumed to worsen by this amount for each integer infeasibility.

CbcCutoffIncrement 

The amount by which to tighten the objective function cutoff when a new solution is discovered.

CbcAllowableGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcAllowableFractionGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcMaximumSeconds 

The maximum number of seconds before terminating.

A double should be adequate!

CbcCurrentCutoff 

Cutoff - stored for speed.

CbcOptimizationDirection 

Optimization direction - stored for speed.

CbcCurrentObjectiveValue 

Current objective value.

CbcCurrentMinimizationObjectiveValue 

Current minimization objective value.

CbcStartSeconds 

The time at start of model.

So that other pieces of code can access

CbcHeuristicGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcHeuristicFractionGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcSmallestChange 

Smallest non-zero change on a branch.

CbcSumChange 

Sum of non-zero changes on a branch.

CbcLargestChange 

Largest non-zero change on a branch.

CbcSmallChange 

Small non-zero change on a branch to be used as guess.

CbcLastDblParam 

Just a marker, so that a static sized array can store parameters.

CbcIntegerTolerance 

The maximum amount the value of an integer variable can vary from integer and still be considered feasible.

CbcInfeasibilityWeight 

The objective is assumed to worsen by this amount for each integer infeasibility.

CbcCutoffIncrement 

The amount by which to tighten the objective function cutoff when a new solution is discovered.

CbcAllowableGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcAllowableFractionGap 

Stop when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcMaximumSeconds 

The maximum number of seconds before terminating.

A double should be adequate!

CbcCurrentCutoff 

Cutoff - stored for speed.

CbcOptimizationDirection 

Optimization direction - stored for speed.

CbcCurrentObjectiveValue 

Current objective value.

CbcCurrentMinimizationObjectiveValue 

Current minimization objective value.

CbcStartSeconds 

The time at start of model.

So that other pieces of code can access

CbcHeuristicGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this.

This is an absolute value. Conversion from a percentage is left to the client.

CbcHeuristicFractionGap 

Stop doing heuristics when the gap between the objective value of the best known solution and the best bound on the objective of any solution is less than this fraction of of the absolute value of best known solution.

Code stops if either this test or CbcAllowableGap test succeeds

CbcSmallestChange 

Smallest non-zero change on a branch.

CbcSumChange 

Sum of non-zero changes on a branch.

CbcLargestChange 

Largest non-zero change on a branch.

CbcSmallChange 

Small non-zero change on a branch to be used as guess.

CbcLastDblParam 

Just a marker, so that a static sized array can store parameters.

Definition at line 128 of file CbcModel.hpp.


Constructor & Destructor Documentation

CbcModel::CbcModel (  ) 

Default Constructor.

CbcModel::CbcModel ( const OsiSolverInterface &   ) 

Constructor from solver.

CbcModel::CbcModel ( const CbcModel rhs,
bool  cloneHandler = false 
)

Copy constructor .

If cloneHandler is true then message handler is cloned

CbcModel::~CbcModel (  ) 

Destructor.

CbcModel::CbcModel (  ) 

Default Constructor.

CbcModel::CbcModel ( const OsiSolverInterface &   ) 

Constructor from solver.

CbcModel::CbcModel ( const CbcModel rhs,
bool  cloneHandler = false 
)

Copy constructor .

If cloneHandler is true then message handler is cloned

CbcModel::~CbcModel (  ) 

Destructor.


Member Function Documentation

void CbcModel::initialSolve (  ) 

Solve the initial LP relaxation.

Invoke the solver's initialSolve() method.

void CbcModel::branchAndBound ( int  doStatistics = 0  ) 

Invoke the branch & cut algorithm.

The method assumes that initialSolve() has been called to solve the LP relaxation. It processes the root node, then proceeds to explore the branch & cut search tree. The search ends when the tree is exhausted or one of several execution limits is reached. If doStatistics is 1 summary statistics are printed if 2 then also the path to best solution (if found by branching) if 3 then also one line per node

bool CbcModel::solveWithCuts ( OsiCuts &  cuts,
int  numberTries,
CbcNode node 
) [private]

Evaluate a subproblem using cutting planes and heuristics.

The method invokes a main loop which generates cuts, applies heuristics, and reoptimises using the solver's native resolve() method. It returns true if the subproblem remains feasible at the end of the evaluation.

int CbcModel::serialCuts ( OsiCuts &  cuts,
CbcNode node,
OsiCuts &  slackCuts,
int  lastNumberCuts 
) [private]

Generate one round of cuts - serial mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.

int CbcModel::parallelCuts ( CbcBaseModel master,
OsiCuts &  cuts,
CbcNode node,
OsiCuts &  slackCuts,
int  lastNumberCuts 
) [private]

Generate one round of cuts - parallel mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.

CbcNode** CbcModel::solveOneNode ( int  whichSolver,
CbcNode node,
int &  numberNodesOutput,
int &  status 
) [private]

Input one node output N nodes to put on tree and optional solution update This should be able to operate in parallel so is given a solver and is const(ish) However we will need to keep an array of solver_ and bases and more status is 0 for normal, 1 if solution Calling code should always push nodes back on tree.

void CbcModel::resizeWhichGenerator ( int  numberNow,
int  numberAfter 
) [private]

Update size of whichGenerator.

void CbcModel::addUpdateInformation ( const CbcObjectUpdateData data  ) 

Adds an update information object.

int CbcModel::doOneNode ( CbcModel baseModel,
CbcNode *&  node,
CbcNode *&  newNode 
)

Do one node - broken out for clarity? also for parallel (when baseModel!=this) Returns 1 if solution found node NULL on return if no branches left newNode NULL if no new node created.

int CbcModel::resolve ( CbcNodeInfo parent,
int  whereFrom,
double *  saveSolution = NULL,
double *  saveLower = NULL,
double *  saveUpper = NULL 
)

Reoptimise an LP relaxation.

Invoke the solver's resolve() method. whereFrom - 0 - initial continuous 1 - resolve on branch (before new cuts) 2 - after new cuts 3 - obsolete code or something modified problem in unexpected way 10 - after strong branching has fixed variables at root 11 - after strong branching has fixed variables in tree

returns 1 feasible, 0 infeasible, -1 feasible but skip cuts

void CbcModel::makeGlobalCuts ( int  numberRows,
const int *  which 
)

Make given rows (L or G) into global cuts and remove from lp.

void CbcModel::makeGlobalCut ( const OsiRowCut *  cut  ) 

Make given cut into a global cut.

void CbcModel::makeGlobalCut ( const OsiRowCut &  cut  ) 

Make given cut into a global cut.

void CbcModel::makeGlobalCut ( const OsiColCut *  cut  ) 

Make given column cut into a global cut.

void CbcModel::makeGlobalCut ( const OsiColCut &  cut  ) 

Make given column cut into a global cut.

CbcModel* CbcModel::findCliques ( bool  makeEquality,
int  atLeastThisMany,
int  lessThanThis,
int  defaultValue = 1000 
)

Identify cliques and construct corresponding objects.

Find cliques with size in the range [atLeastThisMany, lessThanThis] and construct corresponding CbcClique objects. If makeEquality is true then a new model may be returned if modifications had to be made, otherwise this is returned. If the problem is infeasible numberObjects_ is set to -1. A client must use deleteObjects() before a second call to findCliques(). If priorities exist, clique priority is set to the default.

CbcModel* CbcModel::integerPresolve ( bool  weak = false  ) 

Do integer presolve, creating a new (presolved) model.

Returns the new model, or NULL if feasibility is lost. If weak is true then just does a normal presolve

Todo:
It remains to work out the cleanest way of getting a solution to the original problem at the end. So this is very preliminary.
bool CbcModel::integerPresolveThisModel ( OsiSolverInterface *  originalSolver,
bool  weak = false 
)

Do integer presolve, modifying the current model.

Returns true if the model remains feasible after presolve.

void CbcModel::originalModel ( CbcModel presolvedModel,
bool  weak 
)

Put back information into the original model after integer presolve.

bool CbcModel::tightenVubs ( int  type,
bool  allowMultipleBinary = false,
double  useCutoff = 1.0e50 
)

For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.

Returns false if feasibility is lost. If CglProbing is available, it will be tried as well to see if it can tighten bounds. This routine is just a front end for tightenVubs(int,const int*,double).

If type = -1 all variables are processed (could be very slow). If type = 0 only variables involved in VUBs are processed. If type = n > 0, only the n most expensive VUB variables are processed, where it is assumed that x is at its maximum so delta would have to go to 1 (if x not at bound).

If allowMultipleBinary is true, then a VUB constraint is a row with one continuous variable and any number of binary variables.

If useCutoff < 1.0e30, the original objective is installed as a constraint with useCutoff as a bound.

bool CbcModel::tightenVubs ( int  numberVubs,
const int *  which,
double  useCutoff = 1.0e50 
)

For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.

This version is just handed a list of variables to be processed.

void CbcModel::analyzeObjective (  ) 

Analyze problem to find a minimum change in the objective function.

void CbcModel::AddIntegers (  ) 

Add additional integers.

void CbcModel::saveModel ( OsiSolverInterface *  saveSolver,
double *  checkCutoffForRestart,
bool *  feasible 
)

Save copy of the model.

int CbcModel::numberObjects (  )  const [inline]

Get the number of objects.

Definition at line 450 of file CbcModel.hpp.

void CbcModel::setNumberObjects ( int  number  )  [inline]

Set the number of objects.

Definition at line 454 of file CbcModel.hpp.

OsiObject** CbcModel::objects (  )  const [inline]

Get the array of objects.

Definition at line 459 of file CbcModel.hpp.

const OsiObject* CbcModel::object ( int  which  )  const [inline]

Get the specified object.

Definition at line 464 of file CbcModel.hpp.

OsiObject* CbcModel::modifiableObject ( int  which  )  const [inline]

Get the specified object.

Definition at line 468 of file CbcModel.hpp.

void CbcModel::setOptionalInteger ( int  index  ) 

Get the number of objects.

void CbcModel::deleteObjects ( bool  findIntegers = true  ) 

Delete all object information (and just back to integers if true).

void CbcModel::addObjects ( int  numberObjects,
OsiObject **  objects 
)

Add in object information.

Objects are cloned; the owner can delete the originals.

void CbcModel::addObjects ( int  numberObjects,
CbcObject **  objects 
)

Add in object information.

Objects are cloned; the owner can delete the originals.

void CbcModel::synchronizeModel (  ) 

Ensure attached objects point to this model.

void CbcModel::findIntegers ( bool  startAgain,
int  type = 0 
)

Identify integer variables and create corresponding objects.

Record integer variables and create an CbcSimpleInteger object for each one. If startAgain is true, a new scan is forced, overwriting any existing integer variable information. If type > 0 then 1==PseudoCost, 2 new ones low priority

bool CbcModel::setIntParam ( CbcIntParam  key,
int  value 
) [inline]

Set an integer parameter.

Definition at line 517 of file CbcModel.hpp.

bool CbcModel::setDblParam ( CbcDblParam  key,
double  value 
) [inline]

Set a double parameter.

Definition at line 522 of file CbcModel.hpp.

int CbcModel::getIntParam ( CbcIntParam  key  )  const [inline]

Get an integer parameter.

Definition at line 527 of file CbcModel.hpp.

double CbcModel::getDblParam ( CbcDblParam  key  )  const [inline]

Get a double parameter.

Definition at line 531 of file CbcModel.hpp.

void CbcModel::setCutoff ( double  value  ) 

Set cutoff bound on the objective function.

When using strict comparison, the bound is adjusted by a tolerance to avoid accidentally cutting off the optimal solution.

double CbcModel::getCutoff (  )  const [inline]

Get the cutoff bound on the objective function - always as minimize.

Definition at line 542 of file CbcModel.hpp.

bool CbcModel::setMaximumNodes ( int  value  )  [inline]

Set the maximum node limit .

Definition at line 549 of file CbcModel.hpp.

int CbcModel::getMaximumNodes (  )  const [inline]

Get the maximum node limit .

Definition at line 554 of file CbcModel.hpp.

bool CbcModel::setMaximumSolutions ( int  value  )  [inline]

Set the maximum number of solutions desired.

Definition at line 562 of file CbcModel.hpp.

int CbcModel::getMaximumSolutions (  )  const [inline]

Get the maximum number of solutions desired.

Definition at line 569 of file CbcModel.hpp.

bool CbcModel::setPrintingMode ( int  value  )  [inline]

Set the printing mode.

Definition at line 573 of file CbcModel.hpp.

int CbcModel::getPrintingMode (  )  const [inline]

Get the printing mode.

Definition at line 578 of file CbcModel.hpp.

bool CbcModel::setMaximumSeconds ( double  value  )  [inline]

Set the maximum number of seconds desired.

Definition at line 586 of file CbcModel.hpp.

double CbcModel::getMaximumSeconds (  )  const [inline]

Get the maximum number of seconds desired.

Definition at line 593 of file CbcModel.hpp.

double CbcModel::getCurrentSeconds (  )  const

Current time since start of branchAndbound.

bool CbcModel::maximumSecondsReached (  )  const

Return true if maximum time reached.

bool CbcModel::setIntegerTolerance ( double  value  )  [inline]

Set the integrality tolerance .

Definition at line 605 of file CbcModel.hpp.

double CbcModel::getIntegerTolerance (  )  const [inline]

Get the integrality tolerance .

Definition at line 611 of file CbcModel.hpp.

bool CbcModel::setInfeasibilityWeight ( double  value  )  [inline]

Set the weight per integer infeasibility .

Definition at line 619 of file CbcModel.hpp.

double CbcModel::getInfeasibilityWeight (  )  const [inline]

Get the weight per integer infeasibility .

Definition at line 626 of file CbcModel.hpp.

bool CbcModel::setAllowableGap ( double  value  )  [inline]

Set the allowable gap between the best known solution and the best possible solution.

Definition at line 633 of file CbcModel.hpp.

double CbcModel::getAllowableGap (  )  const [inline]

Get the allowable gap between the best known solution and the best possible solution.

Definition at line 639 of file CbcModel.hpp.

bool CbcModel::setAllowableFractionGap ( double  value  )  [inline]

Set the fraction allowable gap between the best known solution and the best possible solution.

Definition at line 646 of file CbcModel.hpp.

double CbcModel::getAllowableFractionGap (  )  const [inline]

Get the fraction allowable gap between the best known solution and the best possible solution.

Definition at line 652 of file CbcModel.hpp.

bool CbcModel::setAllowablePercentageGap ( double  value  )  [inline]

Set the percentage allowable gap between the best known solution and the best possible solution.

Definition at line 658 of file CbcModel.hpp.

double CbcModel::getAllowablePercentageGap (  )  const [inline]

Get the percentage allowable gap between the best known solution and the best possible solution.

Definition at line 664 of file CbcModel.hpp.

bool CbcModel::setHeuristicGap ( double  value  )  [inline]

Set the heuristic gap between the best known solution and the best possible solution.

Definition at line 670 of file CbcModel.hpp.

double CbcModel::getHeuristicGap (  )  const [inline]

Get the heuristic gap between the best known solution and the best possible solution.

Definition at line 676 of file CbcModel.hpp.

bool CbcModel::setHeuristicFractionGap ( double  value  )  [inline]

Set the fraction heuristic gap between the best known solution and the best possible solution.

Definition at line 683 of file CbcModel.hpp.

double CbcModel::getHeuristicFractionGap (  )  const [inline]

Get the fraction heuristic gap between the best known solution and the best possible solution.

Definition at line 689 of file CbcModel.hpp.

bool CbcModel::setCutoffIncrement ( double  value  )  [inline]

Set the CbcModel::CbcCutoffIncrement desired.

Definition at line 696 of file CbcModel.hpp.

double CbcModel::getCutoffIncrement (  )  const [inline]

Get the CbcModel::CbcCutoffIncrement desired.

Definition at line 703 of file CbcModel.hpp.

void CbcModel::setHotstartSolution ( const double *  solution,
const int *  priorities = NULL 
)

Pass in target solution and optional priorities.

If priorities then >0 means only branch if incorrect while <0 means branch even if correct. +1 or -1 are highest priority

void CbcModel::setMinimumDrop ( double  value  )  [inline]

Set the minimum drop to continue cuts.

Definition at line 714 of file CbcModel.hpp.

double CbcModel::getMinimumDrop (  )  const [inline]

Get the minimum drop to continue cuts.

Definition at line 718 of file CbcModel.hpp.

void CbcModel::setMaximumCutPassesAtRoot ( int  value  )  [inline]

Set the maximum number of cut passes at root node (default 20) Minimum drop can also be used for fine tuning.

Definition at line 724 of file CbcModel.hpp.

int CbcModel::getMaximumCutPassesAtRoot (  )  const [inline]

Get the maximum number of cut passes at root node.

Definition at line 728 of file CbcModel.hpp.

void CbcModel::setMaximumCutPasses ( int  value  )  [inline]

Set the maximum number of cut passes at other nodes (default 10) Minimum drop can also be used for fine tuning.

Definition at line 734 of file CbcModel.hpp.

int CbcModel::getMaximumCutPasses (  )  const [inline]

Get the maximum number of cut passes at other nodes (default 10).

Definition at line 738 of file CbcModel.hpp.

int CbcModel::getCurrentPassNumber (  )  const [inline]

Get current cut pass number in this round of cuts.

(1 is first pass)

Definition at line 743 of file CbcModel.hpp.

void CbcModel::setNumberStrong ( int  number  ) 

Set the maximum number of candidates to be evaluated for strong branching.

A value of 0 disables strong branching.

int CbcModel::numberStrong (  )  const [inline]

Get the maximum number of candidates to be evaluated for strong branching.

Definition at line 756 of file CbcModel.hpp.

void CbcModel::setPreferredWay ( int  value  )  [inline]

Set global preferred way to branch -1 down, +1 up, 0 no preference.

Definition at line 761 of file CbcModel.hpp.

int CbcModel::getPreferredWay (  )  const [inline]

Get the preferred way to branch (default 0).

Definition at line 765 of file CbcModel.hpp.

int CbcModel::whenCuts (  )  const [inline]

Get at which depths to do cuts.

Definition at line 769 of file CbcModel.hpp.

void CbcModel::setWhenCuts ( int  value  )  [inline]

Set at which depths to do cuts.

Definition at line 773 of file CbcModel.hpp.

bool CbcModel::doCutsNow ( int  allowForTopOfTree  )  const

Return true if we want to do cuts If allowForTopOfTree zero then just does on multiples of depth if 1 then allows for doing at top of tree if 2 then says if cuts allowed anywhere apart from root.

void CbcModel::setNumberBeforeTrust ( int  number  ) 

Set the number of branches before pseudo costs believed in dynamic strong branching.

A value of 0 disables dynamic strong branching.

int CbcModel::numberBeforeTrust (  )  const [inline]

get the number of branches before pseudo costs believed in dynamic strong branching.

Definition at line 791 of file CbcModel.hpp.

void CbcModel::setNumberPenalties ( int  number  ) 

Set the number of variables for which to compute penalties in dynamic strong branching.

A value of 0 disables penalties.

int CbcModel::numberPenalties (  )  const [inline]

get the number of variables for which to compute penalties in dynamic strong branching.

Definition at line 802 of file CbcModel.hpp.

void CbcModel::setNumberAnalyzeIterations ( int  number  )  [inline]

Number of analyze iterations to do.

Definition at line 806 of file CbcModel.hpp.

int CbcModel::numberAnalyzeIterations (  )  const [inline]

Set an integer parameter.

Definition at line 809 of file CbcModel.hpp.

double CbcModel::penaltyScaleFactor (  )  const [inline]

Get scale factor to make penalties match strong.

Should/will be computed

Definition at line 814 of file CbcModel.hpp.

void CbcModel::setPenaltyScaleFactor ( double  value  ) 

Set scale factor to make penalties match strong.

Should/will be computed

void CbcModel::setProblemType ( int  number  )  [inline]

Problem type as set by user or found by analysis.

This will be extended 0 - not known 1 - Set partitioning <= 2 - Set partitioning == 3 - Set covering 4 - all +- 1 or all +1 and odd

Definition at line 827 of file CbcModel.hpp.

int CbcModel::problemType (  )  const [inline]

Set an integer parameter.

Definition at line 830 of file CbcModel.hpp.

int CbcModel::currentDepth (  )  const [inline]

Current depth.

Definition at line 834 of file CbcModel.hpp.

void CbcModel::setHowOftenGlobalScan ( int  number  ) 

Set how often to scan global cuts.

int CbcModel::howOftenGlobalScan (  )  const [inline]

Get how often to scan global cuts.

Definition at line 841 of file CbcModel.hpp.

int* CbcModel::originalColumns (  )  const [inline]

Original columns as created by integerPresolve or preprocessing.

Definition at line 845 of file CbcModel.hpp.

void CbcModel::setOriginalColumns ( const int *  originalColumns  ) 

Set original columns as created by preprocessing.

void CbcModel::setPrintFrequency ( int  number  )  [inline]

Set the print frequency.

Controls the number of nodes evaluated between status prints. If number <=0 the print frequency is set to 100 nodes for large problems, 1000 for small problems. Print frequency has very slight overhead if small.

Definition at line 858 of file CbcModel.hpp.

int CbcModel::printFrequency (  )  const [inline]

Get the print frequency.

Definition at line 862 of file CbcModel.hpp.

bool CbcModel::isAbandoned (  )  const

Are there a numerical difficulties?

bool CbcModel::isProvenOptimal (  )  const

Is optimality proven?

bool CbcModel::isProvenInfeasible (  )  const

Is infeasiblity proven (or none better than cutoff)?

bool CbcModel::isContinuousUnbounded (  )  const

Was continuous solution unbounded.

bool CbcModel::isProvenDualInfeasible (  )  const

Was continuous solution unbounded.

bool CbcModel::isNodeLimitReached (  )  const

Node limit reached?

bool CbcModel::isSecondsLimitReached (  )  const

Time limit reached?

bool CbcModel::isSolutionLimitReached (  )  const

Solution limit reached?

int CbcModel::getIterationCount (  )  const [inline]

Get how many iterations it took to solve the problem.

Definition at line 887 of file CbcModel.hpp.

void CbcModel::incrementIterationCount ( int  value  )  [inline]

Increment how many iterations it took to solve the problem.

Definition at line 891 of file CbcModel.hpp.

int CbcModel::getNodeCount (  )  const [inline]

Get how many Nodes it took to solve the problem.

Definition at line 895 of file CbcModel.hpp.

void CbcModel::incrementNodeCount ( int  value  )  [inline]

Increment how many nodes it took to solve the problem.

Definition at line 899 of file CbcModel.hpp.

int CbcModel::status (  )  const [inline]

Final status of problem Some of these can be found out by is......

functions -1 before branchAndBound 0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found (or check value of best solution) 1 stopped - on maxnodes, maxsols, maxtime 2 difficulties so run was abandoned (5 event user programmed event occurred)

Definition at line 911 of file CbcModel.hpp.

void CbcModel::setProblemStatus ( int  value  )  [inline]

Are there a numerical difficulties?

Definition at line 914 of file CbcModel.hpp.

int CbcModel::secondaryStatus (  )  const [inline]

Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions 7 linear relaxation unbounded.

Definition at line 928 of file CbcModel.hpp.

void CbcModel::setSecondaryStatus ( int  value  )  [inline]

Are there a numerical difficulties?

Definition at line 931 of file CbcModel.hpp.

bool CbcModel::isInitialSolveAbandoned (  )  const

Are there numerical difficulties (for initialSolve) ?

bool CbcModel::isInitialSolveProvenOptimal (  )  const

Is optimality proven (for initialSolve) ?

bool CbcModel::isInitialSolveProvenPrimalInfeasible (  )  const

Is primal infeasiblity proven (for initialSolve) ?

bool CbcModel::isInitialSolveProvenDualInfeasible (  )  const

Is dual infeasiblity proven (for initialSolve) ?

int CbcModel::numberRowsAtContinuous (  )  const [inline]

Number of rows in continuous (root) problem.

Definition at line 959 of file CbcModel.hpp.

int CbcModel::getNumCols (  )  const [inline]

Get number of columns.

Definition at line 964 of file CbcModel.hpp.

int CbcModel::getNumRows (  )  const [inline]

Get number of rows.

Definition at line 969 of file CbcModel.hpp.

CoinBigIndex CbcModel::getNumElements (  )  const [inline]

Get number of nonzero elements.

Definition at line 974 of file CbcModel.hpp.

int CbcModel::numberIntegers (  )  const [inline]

Number of integers in problem.

Definition at line 979 of file CbcModel.hpp.

const int* CbcModel::integerVariable (  )  const [inline]

Number of rows in continuous (root) problem.

Definition at line 983 of file CbcModel.hpp.

char CbcModel::integerType ( int  i  )  const [inline]

Whether or not integer.

Definition at line 987 of file CbcModel.hpp.

const char* CbcModel::integerType (  )  const [inline]

Whether or not integer.

Definition at line 993 of file CbcModel.hpp.

const double* CbcModel::getColLower (  )  const [inline]

Get pointer to array[getNumCols()] of column lower bounds.

Definition at line 998 of file CbcModel.hpp.

const double* CbcModel::getColUpper (  )  const [inline]

Get pointer to array[getNumCols()] of column upper bounds.

Definition at line 1003 of file CbcModel.hpp.

const char* CbcModel::getRowSense (  )  const [inline]

Get pointer to array[getNumRows()] of row constraint senses.

  • 'L': <= constraint
  • 'E': = constraint
  • 'G': >= constraint
  • 'R': ranged constraint
  • 'N': free constraint

Definition at line 1016 of file CbcModel.hpp.

const double* CbcModel::getRightHandSide (  )  const [inline]

Get pointer to array[getNumRows()] of rows right-hand sides.

  • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
  • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
  • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
  • if rowsense()[i] == 'N' then rhs()[i] == 0.0

Definition at line 1028 of file CbcModel.hpp.

const double* CbcModel::getRowRange (  )  const [inline]

Get pointer to array[getNumRows()] of row ranges.

  • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
  • if rowsense()[i] != 'R' then rowrange()[i] is 0.0

Definition at line 1040 of file CbcModel.hpp.

const double* CbcModel::getRowLower (  )  const [inline]

Get pointer to array[getNumRows()] of row lower bounds.

Definition at line 1045 of file CbcModel.hpp.

const double* CbcModel::getRowUpper (  )  const [inline]

Get pointer to array[getNumRows()] of row upper bounds.

Definition at line 1050 of file CbcModel.hpp.

const double* CbcModel::getObjCoefficients (  )  const [inline]

Get pointer to array[getNumCols()] of objective function coefficients.

Definition at line 1055 of file CbcModel.hpp.

double CbcModel::getObjSense (  )  const [inline]

Get objective function sense (1 for min (default), -1 for max).

Definition at line 1060 of file CbcModel.hpp.

bool CbcModel::isContinuous ( int  colIndex  )  const [inline]

Return true if variable is continuous.

Definition at line 1066 of file CbcModel.hpp.

bool CbcModel::isBinary ( int  colIndex  )  const [inline]

Return true if variable is binary.

Definition at line 1071 of file CbcModel.hpp.

bool CbcModel::isInteger ( int  colIndex  )  const [inline]

Return true if column is integer.

Note: This function returns true if the the column is binary or a general integer.

Definition at line 1079 of file CbcModel.hpp.

bool CbcModel::isIntegerNonBinary ( int  colIndex  )  const [inline]

Return true if variable is general integer.

Definition at line 1084 of file CbcModel.hpp.

bool CbcModel::isFreeBinary ( int  colIndex  )  const [inline]

Return true if variable is binary and not fixed at either bound.

Definition at line 1089 of file CbcModel.hpp.

const CoinPackedMatrix* CbcModel::getMatrixByRow (  )  const [inline]

Get pointer to row-wise copy of matrix.

Definition at line 1094 of file CbcModel.hpp.

const CoinPackedMatrix* CbcModel::getMatrixByCol (  )  const [inline]

Get pointer to column-wise copy of matrix.

Definition at line 1099 of file CbcModel.hpp.

double CbcModel::getInfinity (  )  const [inline]

Get solver's value for infinity.

Definition at line 1104 of file CbcModel.hpp.

const double* CbcModel::getCbcColLower (  )  const [inline]

Get pointer to array[getNumCols()] (for speed) of column lower bounds.

Definition at line 1108 of file CbcModel.hpp.

const double* CbcModel::getCbcColUpper (  )  const [inline]

Get pointer to array[getNumCols()] (for speed) of column upper bounds.

Definition at line 1112 of file CbcModel.hpp.

const double* CbcModel::getCbcRowLower (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of row lower bounds.

Definition at line 1116 of file CbcModel.hpp.

const double* CbcModel::getCbcRowUpper (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of row upper bounds.

Definition at line 1120 of file CbcModel.hpp.

const double* CbcModel::getCbcColSolution (  )  const [inline]

Get pointer to array[getNumCols()] (for speed) of primal solution vector.

Definition at line 1124 of file CbcModel.hpp.

const double* CbcModel::getCbcRowPrice (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of dual prices.

Definition at line 1128 of file CbcModel.hpp.

const double* CbcModel::getCbcReducedCost (  )  const [inline]

Get a pointer to array[getNumCols()] (for speed) of reduced costs.

Definition at line 1132 of file CbcModel.hpp.

const double* CbcModel::getCbcRowActivity (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of row activity levels.

Definition at line 1136 of file CbcModel.hpp.

double* CbcModel::continuousSolution (  )  const [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1145 of file CbcModel.hpp.

int* CbcModel::usedInSolution (  )  const [inline]

Array marked whenever a solution is found if non-zero.

Code marks if heuristic returns better so heuristic need only mark if it wants to on solutions which are worse than current

Definition at line 1152 of file CbcModel.hpp.

void CbcModel::incrementUsed ( const double *  solution  ) 

Increases usedInSolution for nonzeros.

void CbcModel::setBestSolution ( CBC_Message  how,
double &  objectiveValue,
const double *  solution,
int  fixVariables = 0 
)

Record a new incumbent solution and update objectiveValue.

void CbcModel::setBestObjectiveValue ( double  objectiveValue  ) 

Just update objectiveValue.

CbcEventHandler::CbcAction CbcModel::dealWithEventHandler ( CbcEventHandler::CbcEvent  event,
double  objValue,
const double *  solution 
)

Deals with event handler and solution.

double CbcModel::checkSolution ( double  cutoff,
double *  solution,
int  fixVariables,
double  originalObjValue 
)

Call this to really test if a valid solution can be feasible Solution is number columns in size.

If fixVariables true then bounds of continuous solver updated. Returns objective value (worse than cutoff if not feasible) Previously computed objective value is now passed in (in case user does not do solve)

bool CbcModel::feasibleSolution ( int &  numberIntegerInfeasibilities,
int &  numberObjectInfeasibilities 
) const

Test the current solution for feasiblility.

Scan all objects for indications of infeasibility. This is broken down into simple integer infeasibility (numberIntegerInfeasibilities) and all other reports of infeasibility (numberObjectInfeasibilities).

double* CbcModel::currentSolution (  )  const [inline]

Solution to the most recent lp relaxation.

The solver's solution to the most recent lp relaxation.

Definition at line 1190 of file CbcModel.hpp.

const double* CbcModel::testSolution (  )  const [inline]

For testing infeasibilities - will point to currentSolution_ or solver-->getColSolution().

Definition at line 1196 of file CbcModel.hpp.

void CbcModel::setTestSolution ( const double *  solution  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1199 of file CbcModel.hpp.

void CbcModel::reserveCurrentSolution ( const double *  solution = NULL  ) 

Make sure region there and optionally copy solution.

const double* CbcModel::getColSolution (  )  const [inline]

Get pointer to array[getNumCols()] of primal solution vector.

Definition at line 1206 of file CbcModel.hpp.

const double* CbcModel::getRowPrice (  )  const [inline]

Get pointer to array[getNumRows()] of dual prices.

Definition at line 1211 of file CbcModel.hpp.

const double* CbcModel::getReducedCost (  )  const [inline]

Get a pointer to array[getNumCols()] of reduced costs.

Definition at line 1216 of file CbcModel.hpp.

const double* CbcModel::getRowActivity (  )  const [inline]

Get pointer to array[getNumRows()] of row activity levels.

Definition at line 1221 of file CbcModel.hpp.

double CbcModel::getCurrentObjValue (  )  const [inline]

Get current objective function value.

Definition at line 1226 of file CbcModel.hpp.

double CbcModel::getCurrentMinimizationObjValue (  )  const [inline]

Get current minimization objective function value.

Definition at line 1230 of file CbcModel.hpp.

double CbcModel::getMinimizationObjValue (  )  const [inline]

Get best objective function value as minimization.

Definition at line 1235 of file CbcModel.hpp.

void CbcModel::setMinimizationObjValue ( double  value  )  [inline]

Set best objective function value as minimization.

Definition at line 1239 of file CbcModel.hpp.

double CbcModel::getObjValue (  )  const [inline]

Get best objective function value.

Definition at line 1244 of file CbcModel.hpp.

double CbcModel::getBestPossibleObjValue (  )  const

Get best possible objective function value.

This is better of best possible left on tree and best solution found. If called from within branch and cut may be optimistic.

void CbcModel::setObjValue ( double  value  )  [inline]

Set best objective function value.

Definition at line 1254 of file CbcModel.hpp.

double CbcModel::getSolverObjValue (  )  const [inline]

Get solver objective function value (as minimization).

Definition at line 1258 of file CbcModel.hpp.

double* CbcModel::bestSolution (  )  const [inline]

The best solution to the integer programming problem.

The best solution to the integer programming problem found during the search. If no solution is found, the method returns null.

Definition at line 1268 of file CbcModel.hpp.

void CbcModel::setBestSolution ( const double *  solution,
int  numberColumns,
double  objectiveValue,
bool  check = false 
)

User callable setBestSolution.

If check false does not check valid If true then sees if feasible and warns if objective value worse than given (so just set to COIN_DBL_MAX if you don't care). If check true then does not save solution if not feasible

int CbcModel::getSolutionCount (  )  const [inline]

Get number of solutions.

Definition at line 1281 of file CbcModel.hpp.

void CbcModel::setSolutionCount ( int  value  )  [inline]

Set number of solutions (so heuristics will be different).

Definition at line 1286 of file CbcModel.hpp.

int CbcModel::numberSavedSolutions (  )  const

Number of saved solutions (including best).

int CbcModel::maximumSavedSolutions (  )  const [inline]

Maximum number of extra saved solutions.

Definition at line 1292 of file CbcModel.hpp.

void CbcModel::setMaximumSavedSolutions ( int  value  ) 

Set maximum number of extra saved solutions.

const double* CbcModel::savedSolution ( int  which  )  const

Return a saved solution (0==best) - NULL if off end.

double CbcModel::savedSolutionObjective ( int  which  )  const

Return a saved solution objective (0==best) - COIN_DBL_MAX if off end.

int CbcModel::phase (  )  const [inline]

Current phase (so heuristics etc etc can find out).

0 - initial solve 1 - solve with cuts at root 2 - solve with cuts 3 - other e.g. strong branching 4 - trying to validate a solution 5 - at end of search

Definition at line 1310 of file CbcModel.hpp.

int CbcModel::getNumberHeuristicSolutions (  )  const [inline]

Get number of heuristic solutions.

Definition at line 1315 of file CbcModel.hpp.

void CbcModel::setNumberHeuristicSolutions ( int  value  )  [inline]

Set number of heuristic solutions.

Definition at line 1319 of file CbcModel.hpp.

void CbcModel::setObjSense ( double  s  )  [inline]

Set objective function sense (1 for min (default), -1 for max,).

Definition at line 1324 of file CbcModel.hpp.

double CbcModel::getContinuousObjective (  )  const [inline]

Value of objective at continuous.

Definition at line 1330 of file CbcModel.hpp.

void CbcModel::setContinuousObjective ( double  value  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1333 of file CbcModel.hpp.

int CbcModel::getContinuousInfeasibilities (  )  const [inline]

Number of infeasibilities at continuous.

Definition at line 1337 of file CbcModel.hpp.

void CbcModel::setContinuousInfeasibilities ( int  value  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1340 of file CbcModel.hpp.

double CbcModel::rootObjectiveAfterCuts (  )  const [inline]

Value of objective after root node cuts added.

Definition at line 1344 of file CbcModel.hpp.

double CbcModel::sumChangeObjective (  )  const [inline]

Sum of Changes to objective by first solve.

Definition at line 1348 of file CbcModel.hpp.

int CbcModel::numberGlobalViolations (  )  const [inline]

Number of times global cuts violated.

When global cut pool then this should be kept for each cut and type of cut

Definition at line 1353 of file CbcModel.hpp.

void CbcModel::clearNumberGlobalViolations (  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1356 of file CbcModel.hpp.

bool CbcModel::resolveAfterTakeOffCuts (  )  const [inline]

Whether to force a resolve after takeOffCuts.

Definition at line 1360 of file CbcModel.hpp.

void CbcModel::setResolveAfterTakeOffCuts ( bool  yesNo  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1363 of file CbcModel.hpp.

int CbcModel::maximumRows (  )  const [inline]

Maximum number of rows.

Definition at line 1367 of file CbcModel.hpp.

CoinWarmStartBasis& CbcModel::workingBasis (  )  [inline]

Work basis for temporary use.

Definition at line 1371 of file CbcModel.hpp.

int CbcModel::getStopNumberIterations (  )  const [inline]

Get number of "iterations" to stop after.

Definition at line 1375 of file CbcModel.hpp.

void CbcModel::setStopNumberIterations ( int  value  )  [inline]

Set number of "iterations" to stop after.

Definition at line 1379 of file CbcModel.hpp.

CbcCompareBase* CbcModel::nodeComparison (  )  const [inline]

Definition at line 1387 of file CbcModel.hpp.

void CbcModel::setNodeComparison ( CbcCompareBase compare  ) 
void CbcModel::setNodeComparison ( CbcCompareBase compare  ) 
CbcFeasibilityBase* CbcModel::problemFeasibility (  )  const [inline]

Definition at line 1397 of file CbcModel.hpp.

void CbcModel::setProblemFeasibility ( CbcFeasibilityBase feasibility  ) 
void CbcModel::setProblemFeasibility ( CbcFeasibilityBase feasibility  ) 
CbcTree* CbcModel::tree (  )  const [inline]

Tree method e.g. heap (which may be overridden by inheritance).

Definition at line 1407 of file CbcModel.hpp.

void CbcModel::passInTreeHandler ( CbcTree tree  ) 

For modifying tree handling (original is cloned).

void CbcModel::passInSubTreeModel ( CbcModel model  ) 

For passing in an CbcModel to do a sub Tree (with derived tree handlers).

Passed in model must exist for duration of branch and bound

CbcModel* CbcModel::subTreeModel ( OsiSolverInterface *  solver = NULL  )  const

For retrieving a copy of subtree model with given OsiSolver.

If no subtree model will use self (up to user to reset cutoff etc). If solver NULL uses current

int CbcModel::numberStoppedSubTrees (  )  const [inline]

Returns number of times any subtree stopped on nodes, time etc.

Definition at line 1422 of file CbcModel.hpp.

void CbcModel::incrementSubTreeStopped (  )  [inline]

Says a sub tree was stopped.

Definition at line 1426 of file CbcModel.hpp.

int CbcModel::typePresolve (  )  const [inline]

Whether to automatically do presolve before branch and bound (subTrees).

0 - no 1 - ordinary presolve 2 - integer presolve (dodgy)

Definition at line 1434 of file CbcModel.hpp.

void CbcModel::setTypePresolve ( int  value  )  [inline]

Tree method e.g. heap (which may be overridden by inheritance).

Definition at line 1437 of file CbcModel.hpp.

CbcBranchDecision* CbcModel::branchingMethod (  )  const [inline]

Get the current branching decision method.

Definition at line 1450 of file CbcModel.hpp.

void CbcModel::setBranchingMethod ( CbcBranchDecision method  )  [inline]

Set the branching decision method.

Definition at line 1454 of file CbcModel.hpp.

void CbcModel::setBranchingMethod ( CbcBranchDecision method  )  [inline]

Set the branching method.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1462 of file CbcModel.hpp.

CbcCutModifier* CbcModel::cutModifier (  )  const [inline]

Get the current cut modifier method.

Definition at line 1467 of file CbcModel.hpp.

void CbcModel::setCutModifier ( CbcCutModifier modifier  ) 

Set the cut modifier method.

void CbcModel::setCutModifier ( CbcCutModifier modifier  ) 

Set the cut modifier method.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int CbcModel::stateOfSearch (  )  const [inline]

State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.

Definition at line 1488 of file CbcModel.hpp.

void CbcModel::setStateOfSearch ( int  state  )  [inline]

State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.

Definition at line 1491 of file CbcModel.hpp.

int CbcModel::searchStrategy (  )  const [inline]

Strategy worked out - mainly at root node for use by CbcNode.

Definition at line 1495 of file CbcModel.hpp.

void CbcModel::setSearchStrategy ( int  value  )  [inline]

Set strategy worked out - mainly at root node for use by CbcNode.

Definition at line 1499 of file CbcModel.hpp.

int CbcModel::numberCutGenerators (  )  const [inline]

Get the number of cut generators.

Definition at line 1504 of file CbcModel.hpp.

CbcCutGenerator** CbcModel::cutGenerators (  )  const [inline]

Get the list of cut generators.

Definition at line 1508 of file CbcModel.hpp.

CbcCutGenerator* CbcModel::cutGenerator ( int  i  )  const [inline]

Get the specified cut generator.

Definition at line 1512 of file CbcModel.hpp.

CbcCutGenerator* CbcModel::virginCutGenerator ( int  i  )  const [inline]

Get the specified cut generator before any changes.

Definition at line 1516 of file CbcModel.hpp.

void CbcModel::addCutGenerator ( CglCutGenerator *  generator,
int  howOften = 1,
const char *  name = NULL,
bool  normal = true,
bool  atSolution = false,
bool  infeasible = false,
int  howOftenInSub = -100,
int  whatDepth = -1,
int  whatDepthInSub = -1 
)

Add one generator - up to user to delete generators.

howoften affects how generator is used. 0 or 1 means always, >1 means every that number of nodes. Negative values have same meaning as positive but they may be switched off (-> -100) by code if not many cuts generated at continuous. -99 is just done at root. Name is just for printout. If depth >0 overrides how often generator is called (if howOften==-1 or >0).

CbcStrategy* CbcModel::strategy (  )  const [inline]

Get the current strategy.

Definition at line 1540 of file CbcModel.hpp.

void CbcModel::setStrategy ( CbcStrategy strategy  ) 

Set the strategy. Clones.

void CbcModel::setStrategy ( CbcStrategy strategy  )  [inline]

Set the strategy. assigns.

Definition at line 1546 of file CbcModel.hpp.

CbcModel* CbcModel::parentModel (  )  const [inline]

Get the current parent model.

Definition at line 1550 of file CbcModel.hpp.

void CbcModel::setParentModel ( CbcModel parentModel  )  [inline]

Set the parent model.

Definition at line 1554 of file CbcModel.hpp.

void CbcModel::addHeuristic ( CbcHeuristic generator,
const char *  name = NULL,
int  before = -1 
)

Add one heuristic - up to user to delete.

The name is just used for print messages.

CbcHeuristic* CbcModel::heuristic ( int  i  )  const [inline]

Get the specified heuristic.

Definition at line 1569 of file CbcModel.hpp.

int CbcModel::numberHeuristics (  )  const [inline]

Get the number of heuristics.

Definition at line 1573 of file CbcModel.hpp.

CbcHeuristic* CbcModel::lastHeuristic (  )  const [inline]

Pointer to heuristic solver which found last solution (or NULL).

Definition at line 1577 of file CbcModel.hpp.

void CbcModel::setLastHeuristic ( CbcHeuristic last  )  [inline]

set last heuristic which found a solution

Definition at line 1581 of file CbcModel.hpp.

void CbcModel::passInPriorities ( const int *  priorities,
bool  ifNotSimpleIntegers 
)

Pass in branching priorities.

If ifClique then priorities are on cliques otherwise priorities are on integer variables. Other type (if exists set to default) 1 is highest priority. (well actually -INT_MAX is but that's ugly) If hotstart > 0 then branches are created to force the variable to the value given by best solution. This enables a sort of hot start. The node choice should be greatest depth and hotstart should normally be switched off after a solution.

If ifNotSimpleIntegers true then appended to normal integers

This is now deprecated except for simple usage. If user creates Cbcobjects then set priority in them

int CbcModel::priority ( int  sequence  )  const [inline]

Returns priority level for an object (or 1000 if no priorities exist).

Definition at line 1606 of file CbcModel.hpp.

void CbcModel::passInEventHandler ( const CbcEventHandler eventHandler  ) 

Set an event handler.

A clone of the handler passed as a parameter is stored in CbcModel.

CbcEventHandler* CbcModel::getEventHandler (  )  const [inline]

Retrieve a pointer to the event handler.

Definition at line 1617 of file CbcModel.hpp.

void CbcModel::setApplicationData ( void *  appData  ) 

Set application data.

This is a pointer that the application can store into and retrieve from the solver interface. This field is available for the application to optionally define and use.

void* CbcModel::getApplicationData (  )  const

Get application data.

void CbcModel::passInSolverCharacteristics ( OsiBabSolver *  solverCharacteristics  ) 

For advanced applications you may wish to modify the behavior of Cbc e.g.

if the solver is a NLP solver then you may not have an exact optimum solution at each step. Information could be built into OsiSolverInterface but this is an alternative so that that interface does not have to be changed. If something similar is useful to enough solvers then it could be migrated You can also pass in by using solver->setAuxiliaryInfo. You should do that if solver is odd - if solver is normal simplex then use this. NOTE - characteristics are not cloned

const OsiBabSolver* CbcModel::solverCharacteristics (  )  const [inline]

Get solver characteristics.

Definition at line 1650 of file CbcModel.hpp.

void CbcModel::passInMessageHandler ( CoinMessageHandler *  handler  ) 

Pass in Message handler (not deleted at end).

void CbcModel::newLanguage ( CoinMessages::Language  language  ) 

Set language.

void CbcModel::setLanguage ( CoinMessages::Language  language  )  [inline]

Pass in Message handler (not deleted at end).

Definition at line 1663 of file CbcModel.hpp.

CoinMessageHandler* CbcModel::messageHandler (  )  const [inline]

Return handler.

Definition at line 1667 of file CbcModel.hpp.

CoinMessages& CbcModel::messages (  )  [inline]

Return messages.

Definition at line 1671 of file CbcModel.hpp.

CoinMessages* CbcModel::messagesPointer (  )  [inline]

Return pointer to messages.

Definition at line 1675 of file CbcModel.hpp.

void CbcModel::setLogLevel ( int  value  ) 

Set log level.

int CbcModel::logLevel (  )  const [inline]

Get log level.

Definition at line 1681 of file CbcModel.hpp.

void CbcModel::setDefaultHandler ( bool  yesNo  )  [inline]

Set flag to say if handler_ is the default handler.

The default handler is deleted when the model is deleted. Other handlers (supplied by the client) will not be deleted.

Definition at line 1689 of file CbcModel.hpp.

void CbcModel::setSpecialOptions ( int  value  )  [inline]

Set special options 0 bit (1) - check if cuts valid (if on debugger list) 1 bit (2) - use current basis to check integer solution (rather than all slack) 2 bit (4) - don't check integer solution (by solving LP) 3 bit (8) - fast analyze 4 bit (16) - non-linear model - so no well defined CoinPackedMatrix 5 bit (32) - keep names 6 bit (64) - try for dominated columns 7 bit (128) - SOS type 1 but all declared integer 8 bit (256) - Set to say solution just found, unset by doing cuts 9 bit (512) - Try reduced model after 100 nodes 10 bit (1024) - Switch on some heuristics even if seems unlikely 11 bit (2048) - Mark as in small branch and bound 12 bit (4096) - Funny cuts so do slow way (in some places) 13 bit (8192) - Funny cuts so do slow way (in other places) 14 bit (16384) - Use Cplex! for fathoming 15 bit (32768) - Try reduced model after 0 nodes 16 bit (65536) - Original model had integer bounds 17 bit (131072) - Perturbation switched off.

Definition at line 1718 of file CbcModel.hpp.

int CbcModel::specialOptions (  )  const [inline]

Get special options.

Definition at line 1722 of file CbcModel.hpp.

bool CbcModel::normalSolver (  )  const [inline]

Says if normal solver i.e. has well defined CoinPackedMatrix.

Definition at line 1726 of file CbcModel.hpp.

void CbcModel::setMoreSpecialOptions ( int  value  )  [inline]

Set more special options at present bottom 6 bits used for shadow price mode 1024 for experimental hotstart 2048,4096 breaking out of cuts 8192 slowly increase minimum drop 16384 gomory.

Definition at line 1736 of file CbcModel.hpp.

int CbcModel::moreSpecialOptions (  )  const [inline]

Get more special options.

Definition at line 1740 of file CbcModel.hpp.

bool CbcModel::ownObjects (  )  const [inline]

Go to dantzig pivot selection if easy problem (clp only).

Now we may not own objects - just point to solver's objects

Definition at line 1748 of file CbcModel.hpp.

void CbcModel::checkModel (  ) 

Check original model before it gets messed up.

void CbcModel::assignSolver ( OsiSolverInterface *&  solver,
bool  deleteSolver = true 
)

Assign a solver to the model (model assumes ownership).

On return, solver will be NULL. If deleteSolver then current solver deleted (if model owned)

Note:
Parameter settings in the outgoing solver are not inherited by the incoming solver.
void CbcModel::setModelOwnsSolver ( bool  ourSolver  )  [inline]

Set ownership of solver.

A parameter of false tells CbcModel it does not own the solver and should not delete it. Once you claim ownership of the solver, you're responsible for eventually deleting it. Note that CbcModel clones solvers with abandon. Unless you have a deep understanding of the workings of CbcModel, the only time you want to claim ownership is when you're about to delete the CbcModel object but want the solver to continue to exist (as, for example, when branchAndBound has finished and you want to hang on to the answer).

Definition at line 1785 of file CbcModel.hpp.

bool CbcModel::modelOwnsSolver (  )  [inline]

Get ownership of solver.

A return value of true means that CbcModel owns the solver and will take responsibility for deleting it when that becomes necessary.

Definition at line 1794 of file CbcModel.hpp.

CbcModel& CbcModel::operator= ( const CbcModel rhs  ) 

Assignment operator.

OsiSolverInterface* CbcModel::solver (  )  const [inline]

Returns solver - has current state.

Definition at line 1810 of file CbcModel.hpp.

OsiSolverInterface* CbcModel::swapSolver ( OsiSolverInterface *  solver  )  [inline]

Returns current solver - sets new one.

Definition at line 1815 of file CbcModel.hpp.

OsiSolverInterface* CbcModel::continuousSolver (  )  const [inline]

Returns solver with continuous state.

Definition at line 1822 of file CbcModel.hpp.

void CbcModel::createContinuousSolver (  )  [inline]

Create solver with continuous state.

Definition at line 1827 of file CbcModel.hpp.

void CbcModel::clearContinuousSolver (  )  [inline]

Clear solver with continuous state.

Definition at line 1831 of file CbcModel.hpp.

OsiSolverInterface* CbcModel::referenceSolver (  )  const [inline]

A copy of the solver, taken at constructor or by saveReferenceSolver.

Definition at line 1837 of file CbcModel.hpp.

void CbcModel::saveReferenceSolver (  ) 

Save a copy of the current solver so can be reset to.

void CbcModel::resetToReferenceSolver (  ) 

Uses a copy of reference solver to be current solver.

Because of possible mismatches all exotic integer information is loat (apart from normal information in OsiSolverInterface) so SOS etc and priorities will have to be redone

void CbcModel::gutsOfDestructor (  ) 

Clears out as much as possible (except solver).

void CbcModel::gutsOfDestructor2 (  ) 

Clears out enough to reset CbcModel as if no branch and bound done.

void CbcModel::resetModel (  ) 

Clears out enough to reset CbcModel cutoff etc.

void CbcModel::gutsOfCopy ( const CbcModel rhs,
int  mode = 0 
)

Most of copy constructor mode - 0 copy but don't delete before 1 copy and delete before 2 copy and delete before (but use virgin generators).

void CbcModel::moveInfo ( const CbcModel rhs  ) 

Move status, nodes etc etc across.

CbcThread* CbcModel::masterThread (  )  const [inline]

To do with threads.

Get pointer to masterthread

Definition at line 1872 of file CbcModel.hpp.

CbcNodeInfo** CbcModel::walkback (  )  const [inline]

Get pointer to walkback.

Definition at line 1876 of file CbcModel.hpp.

int CbcModel::getNumberThreads (  )  const [inline]

Get number of threads.

Definition at line 1880 of file CbcModel.hpp.

void CbcModel::setNumberThreads ( int  value  )  [inline]

Set number of threads.

Definition at line 1884 of file CbcModel.hpp.

int CbcModel::getThreadMode (  )  const [inline]

Get thread mode.

Definition at line 1888 of file CbcModel.hpp.

void CbcModel::setThreadMode ( int  value  )  [inline]

Set thread mode always use numberThreads for branching 1 set then deterministic 2 set then use numberThreads for root cuts 4 set then use numberThreads in root mini branch and bound 8 set and numberThreads - do heuristics numberThreads at a time 8 set and numberThreads==0 do all heuristics at once default is 0.

Definition at line 1900 of file CbcModel.hpp.

int CbcModel::parallelMode (  )  const [inline]

Return -2 if deterministic threaded and main thread -1 if deterministic threaded and serial thread 0 if serial 1 if opportunistic threaded.

Definition at line 1909 of file CbcModel.hpp.

bool CbcModel::isLocked (  )  const

From here to end of section - code in CbcThread.cpp until class changed Returns true if locked.

void CbcModel::lockThread (  )  [inline]

To do with threads.

Get pointer to masterthread

Definition at line 1937 of file CbcModel.hpp.

void CbcModel::unlockThread (  )  [inline]

To do with threads.

Get pointer to masterthread

Definition at line 1938 of file CbcModel.hpp.

void CbcModel::setInfoInChild ( int  type,
CbcThread info 
)

Set information in a child -3 pass pointer to child thread info -2 just stop -1 delete simple child stuff 0 delete opportunistic child stuff 1 delete deterministic child stuff.

void CbcModel::moveToModel ( CbcModel baseModel,
int  mode 
)

Move/copy information from one model to another -1 - initialization 0 - from base model 1 - to base model (and reset) 2 - add in final statistics etc (and reset so can do clean destruction).

int CbcModel::splitModel ( int  numberModels,
CbcModel **  model,
int  numberNodes 
)

Split up nodes.

void CbcModel::startSplitModel ( int  numberIterations  ) 

Start threads.

void CbcModel::mergeModels ( int  numberModel,
CbcModel **  model,
int  numberNodes 
)

Merge models.

int CbcModel::getNodeCount2 (  )  const [inline]

semi-private i.e. users should not use

Get how many Nodes it took to solve the problem.

Definition at line 1968 of file CbcModel.hpp.

void CbcModel::setPointers ( const OsiSolverInterface *  solver  ) 

Set pointers for speed.

int CbcModel::reducedCostFix (  ) 

Perform reduced cost fixing.

Fixes integer variables at their current value based on reduced cost penalties. Returns number fixed

void CbcModel::synchronizeHandlers ( int  makeDefault  ) 

Makes all handlers same.

If makeDefault 1 then makes top level default and rest point to that. If 2 then each is copy

void CbcModel::saveExtraSolution ( const double *  solution,
double  objectiveValue 
)

Save a solution to saved list.

void CbcModel::saveBestSolution ( const double *  solution,
double  objectiveValue 
)

Save a solution to best and move current to saved.

void CbcModel::deleteSolutions (  ) 

Delete best and saved solutions.

int CbcModel::resolve ( OsiSolverInterface *  solver  ) 

Encapsulates solver resolve.

int CbcModel::chooseBranch ( CbcNode *&  newNode,
int  numberPassesLeft,
CbcNode oldNode,
OsiCuts &  cuts,
bool &  resolved,
CoinWarmStartBasis *  lastws,
const double *  lowerBefore,
const double *  upperBefore,
OsiSolverBranch *&  branches 
)

Encapsulates choosing a variable - anyAction -2, infeasible (-1 round again), 0 done.

int CbcModel::chooseBranch ( CbcNode newNode,
int  numberPassesLeft,
bool &  resolved 
)

semi-private i.e. users should not use

Get how many Nodes it took to solve the problem.

CoinWarmStartBasis* CbcModel::getEmptyBasis ( int  ns = 0,
int  na = 0 
) const

Return an empty basis object of the specified size.

A useful utility when constructing a basis for a subproblem from scratch. The object returned will be of the requested capacity and appropriate for the solver attached to the model.

int CbcModel::takeOffCuts ( OsiCuts &  cuts,
bool  allowResolve,
OsiCuts *  saveCuts,
int  numberNewCuts = 0,
const OsiRowCut **  newCuts = NULL 
)

Remove inactive cuts from the model.

An OsiSolverInterface is expected to maintain a valid basis, but not a valid solution, when loose cuts are deleted. Restoring a valid solution requires calling the solver to reoptimise. If it's certain the solution will not be required, set allowResolve to false to suppress reoptimisation. If saveCuts then slack cuts will be saved On input current cuts are cuts and newCuts on exit current cuts will be correct. Returns number dropped

int CbcModel::addCuts ( CbcNode node,
CoinWarmStartBasis *&  lastws,
bool  canFix 
)

Determine and install the active cuts that need to be added for the current subproblem.

The whole truth is a bit more complicated. The first action is a call to addCuts1(). addCuts() then sorts through the list, installs the tight cuts in the model, and does bookkeeping (adjusts reference counts). The basis returned from addCuts1() is adjusted accordingly.

If it turns out that the node should really be fathomed by bound, addCuts() simply treats all the cuts as loose as it does the bookkeeping.

canFix true if extra information being passed

bool CbcModel::addCuts1 ( CbcNode node,
CoinWarmStartBasis *&  lastws 
)

Traverse the tree from node to root and prep the model.

addCuts1() begins the job of prepping the model to match the current subproblem. The model is stripped of all cuts, and the search tree is traversed from node to root to determine the changes required. Appropriate bounds changes are installed, a list of cuts is collected but not installed, and an appropriate basis (minus the cuts, but big enough to accommodate them) is constructed.

Returns true if new problem similar to old

Todo:
addCuts1() is called in contexts where it's known in advance that all that's desired is to determine a list of cuts and do the bookkeeping (adjust the reference counts). The work of installing bounds and building a basis goes to waste.
void CbcModel::previousBounds ( CbcNode node,
CbcNodeInfo where,
int  iColumn,
double &  lower,
double &  upper,
int  force 
)

Returns bounds just before where - initially original bounds.

Also sets downstream nodes (lower if force 1, upper if 2)

void CbcModel::setObjectiveValue ( CbcNode thisNode,
const CbcNode parentNode 
) const

Set objective value in a node.

This is separated out so that odd solvers can use. It may look at extra information in solverCharacteriscs_ and will also use bound from parent node

void CbcModel::convertToDynamic (  ) 

If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.

Scan and convert CbcSimpleInteger objects

void CbcModel::synchronizeNumberBeforeTrust ( int  type = 0  ) 

Set numberBeforeTrust in all objects.

void CbcModel::zapIntegerInformation ( bool  leaveObjects = true  ) 

Zap integer information in problem (may leave object info).

int CbcModel::cliquePseudoCosts ( int  doStatistics  ) 

Use cliques for pseudocost information - return nonzero if infeasible.

void CbcModel::pseudoShadow ( int  type  ) 

Fill in useful estimates.

void CbcModel::fillPseudoCosts ( double *  downCosts,
double *  upCosts,
int *  priority = NULL,
int *  numberDown = NULL,
int *  numberUp = NULL,
int *  numberDownInfeasible = NULL,
int *  numberUpInfeasible = NULL 
) const

Return pseudo costs If not all integers or not pseudo costs - returns all zero Length of arrays are numberIntegers() and entries correspond to integerVariable()[i] User must allocate arrays before call.

void CbcModel::doHeuristicsAtRoot ( int  deleteHeuristicsAfterwards = 0  ) 

Do heuristics at root.

0 - don't delete 1 - delete 2 - just delete - don't even use

void CbcModel::adjustHeuristics (  ) 

Adjust heuristics based on model.

const double* CbcModel::hotstartSolution (  )  const [inline]

Get the hotstart solution.

Definition at line 2100 of file CbcModel.hpp.

const int* CbcModel::hotstartPriorities (  )  const [inline]

Get the hotstart priorities.

Definition at line 2104 of file CbcModel.hpp.

CbcCountRowCut** CbcModel::addedCuts (  )  const [inline]

Return the list of cuts initially collected for this subproblem.

Definition at line 2109 of file CbcModel.hpp.

int CbcModel::currentNumberCuts (  )  const [inline]

Number of entries in the list returned by addedCuts().

Definition at line 2113 of file CbcModel.hpp.

OsiCuts* CbcModel::globalCuts (  )  [inline]

Global cuts.

Definition at line 2117 of file CbcModel.hpp.

void CbcModel::setNextRowCut ( const OsiRowCut &  cut  ) 

Copy and set a pointer to a row cut which will be added instead of normal branching.

CbcNode* CbcModel::currentNode (  )  const [inline]

Get a pointer to current node (be careful).

Definition at line 2123 of file CbcModel.hpp.

CglTreeProbingInfo* CbcModel::probingInfo (  )  const [inline]

Get a pointer to probing info.

Definition at line 2127 of file CbcModel.hpp.

CoinThreadRandom* CbcModel::randomNumberGenerator (  )  [inline]

Thread specific random number generator.

Definition at line 2131 of file CbcModel.hpp.

void CbcModel::setNumberStrongIterations ( int  number  )  [inline]

Set the number of iterations done in strong branching.

Definition at line 2135 of file CbcModel.hpp.

int CbcModel::numberStrongIterations (  )  const [inline]

Get the number of iterations done in strong branching.

Definition at line 2139 of file CbcModel.hpp.

int CbcModel::maximumNumberIterations (  )  const [inline]

Get maximum number of iterations (designed to be used in heuristics).

Definition at line 2143 of file CbcModel.hpp.

void CbcModel::setMaximumNumberIterations ( int  value  )  [inline]

Set maximum number of iterations (designed to be used in heuristics).

Definition at line 2147 of file CbcModel.hpp.

int CbcModel::numberExtraIterations (  )  const [inline]

Number of extra iterations.

Definition at line 2173 of file CbcModel.hpp.

void CbcModel::incrementStrongInfo ( int  numberTimes,
int  numberIterations,
int  numberFixed,
bool  ifInfeasible 
)

Increment strong info.

const int* CbcModel::strongInfo (  )  const [inline]

Return strong info.

Definition at line 2180 of file CbcModel.hpp.

int* CbcModel::mutableStrongInfo (  )  [inline]

Return mutable strong info.

Definition at line 2185 of file CbcModel.hpp.

CglStored* CbcModel::storedRowCuts (  )  const [inline]

Get stored row cuts for donor/recipient CbcModel.

Definition at line 2189 of file CbcModel.hpp.

void CbcModel::setStoredRowCuts ( CglStored *  cuts  )  [inline]

Set stored row cuts for donor/recipient CbcModel.

Definition at line 2193 of file CbcModel.hpp.

bool CbcModel::allDynamic (  )  const [inline]

Says whether all dynamic integers.

Definition at line 2197 of file CbcModel.hpp.

void CbcModel::generateCpp ( FILE *  fp,
int  options 
)

Create C++ lines to get to current state.

OsiBranchingInformation CbcModel::usefulInformation (  )  const

Generate an OsiBranchingInformation object.

void CbcModel::setBestSolutionBasis ( const CoinWarmStartBasis &  bestSolutionBasis  )  [inline]

Warm start object produced by heuristic or strong branching.

If get a valid integer solution outside branch and bound then it can take a reasonable time to solve LP which produces clean solution. If this object has any size then it will be used in solve.

Definition at line 2210 of file CbcModel.hpp.

void CbcModel::redoWalkBack (  ) 

Redo walkback arrays.

void CbcModel::initialSolve (  ) 

Solve the initial LP relaxation.

Invoke the solver's initialSolve() method.

void CbcModel::branchAndBound ( int  doStatistics = 0  ) 

Invoke the branch & cut algorithm.

The method assumes that initialSolve() has been called to solve the LP relaxation. It processes the root node, then proceeds to explore the branch & cut search tree. The search ends when the tree is exhausted or one of several execution limits is reached. If doStatistics is 1 summary statistics are printed if 2 then also the path to best solution (if found by branching) if 3 then also one line per node

bool CbcModel::solveWithCuts ( OsiCuts &  cuts,
int  numberTries,
CbcNode node 
) [private]

Evaluate a subproblem using cutting planes and heuristics.

The method invokes a main loop which generates cuts, applies heuristics, and reoptimises using the solver's native resolve() method. It returns true if the subproblem remains feasible at the end of the evaluation.

int CbcModel::serialCuts ( OsiCuts &  cuts,
CbcNode node,
OsiCuts &  slackCuts,
int  lastNumberCuts 
) [private]

Generate one round of cuts - serial mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.

int CbcModel::parallelCuts ( CbcBaseModel master,
OsiCuts &  cuts,
CbcNode node,
OsiCuts &  slackCuts,
int  lastNumberCuts 
) [private]

Generate one round of cuts - parallel mode returns - 0 - normal 1 - must keep going 2 - set numberTries to zero -1 - infeasible.

CbcNode** CbcModel::solveOneNode ( int  whichSolver,
CbcNode node,
int &  numberNodesOutput,
int &  status 
) [private]

Input one node output N nodes to put on tree and optional solution update This should be able to operate in parallel so is given a solver and is const(ish) However we will need to keep an array of solver_ and bases and more status is 0 for normal, 1 if solution Calling code should always push nodes back on tree.

void CbcModel::resizeWhichGenerator ( int  numberNow,
int  numberAfter 
) [private]

Update size of whichGenerator.

void CbcModel::addUpdateInformation ( const CbcObjectUpdateData data  ) 

Adds an update information object.

int CbcModel::doOneNode ( CbcModel baseModel,
CbcNode *&  node,
CbcNode *&  newNode 
)

Do one node - broken out for clarity? also for parallel (when baseModel!=this) Returns 1 if solution found node NULL on return if no branches left newNode NULL if no new node created.

int CbcModel::resolve ( CbcNodeInfo parent,
int  whereFrom,
double *  saveSolution = NULL,
double *  saveLower = NULL,
double *  saveUpper = NULL 
)

Reoptimise an LP relaxation.

Invoke the solver's resolve() method. whereFrom - 0 - initial continuous 1 - resolve on branch (before new cuts) 2 - after new cuts 3 - obsolete code or something modified problem in unexpected way 10 - after strong branching has fixed variables at root 11 - after strong branching has fixed variables in tree

returns 1 feasible, 0 infeasible, -1 feasible but skip cuts

void CbcModel::makeGlobalCuts ( int  numberRows,
const int *  which 
)

Make given rows (L or G) into global cuts and remove from lp.

void CbcModel::makeGlobalCut ( const OsiRowCut *  cut  ) 

Make given cut into a global cut.

void CbcModel::makeGlobalCut ( const OsiRowCut &  cut  ) 

Make given cut into a global cut.

void CbcModel::makeGlobalCut ( const OsiColCut *  cut  ) 

Make given column cut into a global cut.

void CbcModel::makeGlobalCut ( const OsiColCut &  cut  ) 

Make given column cut into a global cut.

CbcModel* CbcModel::findCliques ( bool  makeEquality,
int  atLeastThisMany,
int  lessThanThis,
int  defaultValue = 1000 
)

Identify cliques and construct corresponding objects.

Find cliques with size in the range [atLeastThisMany, lessThanThis] and construct corresponding CbcClique objects. If makeEquality is true then a new model may be returned if modifications had to be made, otherwise this is returned. If the problem is infeasible numberObjects_ is set to -1. A client must use deleteObjects() before a second call to findCliques(). If priorities exist, clique priority is set to the default.

CbcModel* CbcModel::integerPresolve ( bool  weak = false  ) 

Do integer presolve, creating a new (presolved) model.

Returns the new model, or NULL if feasibility is lost. If weak is true then just does a normal presolve

Todo:
It remains to work out the cleanest way of getting a solution to the original problem at the end. So this is very preliminary.
bool CbcModel::integerPresolveThisModel ( OsiSolverInterface *  originalSolver,
bool  weak = false 
)

Do integer presolve, modifying the current model.

Returns true if the model remains feasible after presolve.

void CbcModel::originalModel ( CbcModel presolvedModel,
bool  weak 
)

Put back information into the original model after integer presolve.

bool CbcModel::tightenVubs ( int  type,
bool  allowMultipleBinary = false,
double  useCutoff = 1.0e50 
)

For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.

Returns false if feasibility is lost. If CglProbing is available, it will be tried as well to see if it can tighten bounds. This routine is just a front end for tightenVubs(int,const int*,double).

If type = -1 all variables are processed (could be very slow). If type = 0 only variables involved in VUBs are processed. If type = n > 0, only the n most expensive VUB variables are processed, where it is assumed that x is at its maximum so delta would have to go to 1 (if x not at bound).

If allowMultipleBinary is true, then a VUB constraint is a row with one continuous variable and any number of binary variables.

If useCutoff < 1.0e30, the original objective is installed as a constraint with useCutoff as a bound.

bool CbcModel::tightenVubs ( int  numberVubs,
const int *  which,
double  useCutoff = 1.0e50 
)

For variables involved in VUB constraints, see if we can tighten bounds by solving lp's.

This version is just handed a list of variables to be processed.

void CbcModel::analyzeObjective (  ) 

Analyze problem to find a minimum change in the objective function.

void CbcModel::AddIntegers (  ) 

Add additional integers.

void CbcModel::saveModel ( OsiSolverInterface *  saveSolver,
double *  checkCutoffForRestart,
bool *  feasible 
)

Save copy of the model.

int CbcModel::numberObjects (  )  const [inline]

Get the number of objects.

Definition at line 450 of file CbcModel.hpp.

void CbcModel::setNumberObjects ( int  number  )  [inline]

Set the number of objects.

Definition at line 454 of file CbcModel.hpp.

OsiObject** CbcModel::objects (  )  const [inline]

Get the array of objects.

Definition at line 459 of file CbcModel.hpp.

const OsiObject* CbcModel::object ( int  which  )  const [inline]

Get the specified object.

Definition at line 464 of file CbcModel.hpp.

OsiObject* CbcModel::modifiableObject ( int  which  )  const [inline]

Get the specified object.

Definition at line 468 of file CbcModel.hpp.

void CbcModel::setOptionalInteger ( int  index  ) 

Get the number of objects.

void CbcModel::deleteObjects ( bool  findIntegers = true  ) 

Delete all object information (and just back to integers if true).

void CbcModel::addObjects ( int  numberObjects,
OsiObject **  objects 
)

Add in object information.

Objects are cloned; the owner can delete the originals.

void CbcModel::addObjects ( int  numberObjects,
CbcObject **  objects 
)

Add in object information.

Objects are cloned; the owner can delete the originals.

void CbcModel::synchronizeModel (  ) 

Ensure attached objects point to this model.

void CbcModel::findIntegers ( bool  startAgain,
int  type = 0 
)

Identify integer variables and create corresponding objects.

Record integer variables and create an CbcSimpleInteger object for each one. If startAgain is true, a new scan is forced, overwriting any existing integer variable information. If type > 0 then 1==PseudoCost, 2 new ones low priority

bool CbcModel::setIntParam ( CbcIntParam  key,
int  value 
) [inline]

Set an integer parameter.

Definition at line 517 of file CbcModel.hpp.

bool CbcModel::setDblParam ( CbcDblParam  key,
double  value 
) [inline]

Set a double parameter.

Definition at line 522 of file CbcModel.hpp.

int CbcModel::getIntParam ( CbcIntParam  key  )  const [inline]

Get an integer parameter.

Definition at line 527 of file CbcModel.hpp.

double CbcModel::getDblParam ( CbcDblParam  key  )  const [inline]

Get a double parameter.

Definition at line 531 of file CbcModel.hpp.

void CbcModel::setCutoff ( double  value  ) 

Set cutoff bound on the objective function.

When using strict comparison, the bound is adjusted by a tolerance to avoid accidentally cutting off the optimal solution.

double CbcModel::getCutoff (  )  const [inline]

Get the cutoff bound on the objective function - always as minimize.

Definition at line 542 of file CbcModel.hpp.

bool CbcModel::setMaximumNodes ( int  value  )  [inline]

Set the maximum node limit .

Definition at line 549 of file CbcModel.hpp.

int CbcModel::getMaximumNodes (  )  const [inline]

Get the maximum node limit .

Definition at line 554 of file CbcModel.hpp.

bool CbcModel::setMaximumSolutions ( int  value  )  [inline]

Set the maximum number of solutions desired.

Definition at line 562 of file CbcModel.hpp.

int CbcModel::getMaximumSolutions (  )  const [inline]

Get the maximum number of solutions desired.

Definition at line 569 of file CbcModel.hpp.

bool CbcModel::setPrintingMode ( int  value  )  [inline]

Set the printing mode.

Definition at line 573 of file CbcModel.hpp.

int CbcModel::getPrintingMode (  )  const [inline]

Get the printing mode.

Definition at line 578 of file CbcModel.hpp.

bool CbcModel::setMaximumSeconds ( double  value  )  [inline]

Set the maximum number of seconds desired.

Definition at line 586 of file CbcModel.hpp.

double CbcModel::getMaximumSeconds (  )  const [inline]

Get the maximum number of seconds desired.

Definition at line 593 of file CbcModel.hpp.

double CbcModel::getCurrentSeconds (  )  const

Current time since start of branchAndbound.

bool CbcModel::maximumSecondsReached (  )  const

Return true if maximum time reached.

bool CbcModel::setIntegerTolerance ( double  value  )  [inline]

Set the integrality tolerance .

Definition at line 605 of file CbcModel.hpp.

double CbcModel::getIntegerTolerance (  )  const [inline]

Get the integrality tolerance .

Definition at line 611 of file CbcModel.hpp.

bool CbcModel::setInfeasibilityWeight ( double  value  )  [inline]

Set the weight per integer infeasibility .

Definition at line 619 of file CbcModel.hpp.

double CbcModel::getInfeasibilityWeight (  )  const [inline]

Get the weight per integer infeasibility .

Definition at line 626 of file CbcModel.hpp.

bool CbcModel::setAllowableGap ( double  value  )  [inline]

Set the allowable gap between the best known solution and the best possible solution.

Definition at line 633 of file CbcModel.hpp.

double CbcModel::getAllowableGap (  )  const [inline]

Get the allowable gap between the best known solution and the best possible solution.

Definition at line 639 of file CbcModel.hpp.

bool CbcModel::setAllowableFractionGap ( double  value  )  [inline]

Set the fraction allowable gap between the best known solution and the best possible solution.

Definition at line 646 of file CbcModel.hpp.

double CbcModel::getAllowableFractionGap (  )  const [inline]

Get the fraction allowable gap between the best known solution and the best possible solution.

Definition at line 652 of file CbcModel.hpp.

bool CbcModel::setAllowablePercentageGap ( double  value  )  [inline]

Set the percentage allowable gap between the best known solution and the best possible solution.

Definition at line 658 of file CbcModel.hpp.

double CbcModel::getAllowablePercentageGap (  )  const [inline]

Get the percentage allowable gap between the best known solution and the best possible solution.

Definition at line 664 of file CbcModel.hpp.

bool CbcModel::setHeuristicGap ( double  value  )  [inline]

Set the heuristic gap between the best known solution and the best possible solution.

Definition at line 670 of file CbcModel.hpp.

double CbcModel::getHeuristicGap (  )  const [inline]

Get the heuristic gap between the best known solution and the best possible solution.

Definition at line 676 of file CbcModel.hpp.

bool CbcModel::setHeuristicFractionGap ( double  value  )  [inline]

Set the fraction heuristic gap between the best known solution and the best possible solution.

Definition at line 683 of file CbcModel.hpp.

double CbcModel::getHeuristicFractionGap (  )  const [inline]

Get the fraction heuristic gap between the best known solution and the best possible solution.

Definition at line 689 of file CbcModel.hpp.

bool CbcModel::setCutoffIncrement ( double  value  )  [inline]

Set the CbcModel::CbcCutoffIncrement desired.

Definition at line 696 of file CbcModel.hpp.

double CbcModel::getCutoffIncrement (  )  const [inline]

Get the CbcModel::CbcCutoffIncrement desired.

Definition at line 703 of file CbcModel.hpp.

void CbcModel::setHotstartSolution ( const double *  solution,
const int *  priorities = NULL 
)

Pass in target solution and optional priorities.

If priorities then >0 means only branch if incorrect while <0 means branch even if correct. +1 or -1 are highest priority

void CbcModel::setMinimumDrop ( double  value  )  [inline]

Set the minimum drop to continue cuts.

Definition at line 714 of file CbcModel.hpp.

double CbcModel::getMinimumDrop (  )  const [inline]

Get the minimum drop to continue cuts.

Definition at line 718 of file CbcModel.hpp.

void CbcModel::setMaximumCutPassesAtRoot ( int  value  )  [inline]

Set the maximum number of cut passes at root node (default 20) Minimum drop can also be used for fine tuning.

Definition at line 724 of file CbcModel.hpp.

int CbcModel::getMaximumCutPassesAtRoot (  )  const [inline]

Get the maximum number of cut passes at root node.

Definition at line 728 of file CbcModel.hpp.

void CbcModel::setMaximumCutPasses ( int  value  )  [inline]

Set the maximum number of cut passes at other nodes (default 10) Minimum drop can also be used for fine tuning.

Definition at line 734 of file CbcModel.hpp.

int CbcModel::getMaximumCutPasses (  )  const [inline]

Get the maximum number of cut passes at other nodes (default 10).

Definition at line 738 of file CbcModel.hpp.

int CbcModel::getCurrentPassNumber (  )  const [inline]

Get current cut pass number in this round of cuts.

(1 is first pass)

Definition at line 743 of file CbcModel.hpp.

void CbcModel::setNumberStrong ( int  number  ) 

Set the maximum number of candidates to be evaluated for strong branching.

A value of 0 disables strong branching.

int CbcModel::numberStrong (  )  const [inline]

Get the maximum number of candidates to be evaluated for strong branching.

Definition at line 756 of file CbcModel.hpp.

void CbcModel::setPreferredWay ( int  value  )  [inline]

Set global preferred way to branch -1 down, +1 up, 0 no preference.

Definition at line 761 of file CbcModel.hpp.

int CbcModel::getPreferredWay (  )  const [inline]

Get the preferred way to branch (default 0).

Definition at line 765 of file CbcModel.hpp.

int CbcModel::whenCuts (  )  const [inline]

Get at which depths to do cuts.

Definition at line 769 of file CbcModel.hpp.

void CbcModel::setWhenCuts ( int  value  )  [inline]

Set at which depths to do cuts.

Definition at line 773 of file CbcModel.hpp.

bool CbcModel::doCutsNow ( int  allowForTopOfTree  )  const

Return true if we want to do cuts If allowForTopOfTree zero then just does on multiples of depth if 1 then allows for doing at top of tree if 2 then says if cuts allowed anywhere apart from root.

void CbcModel::setNumberBeforeTrust ( int  number  ) 

Set the number of branches before pseudo costs believed in dynamic strong branching.

A value of 0 disables dynamic strong branching.

int CbcModel::numberBeforeTrust (  )  const [inline]

get the number of branches before pseudo costs believed in dynamic strong branching.

Definition at line 791 of file CbcModel.hpp.

void CbcModel::setNumberPenalties ( int  number  ) 

Set the number of variables for which to compute penalties in dynamic strong branching.

A value of 0 disables penalties.

int CbcModel::numberPenalties (  )  const [inline]

get the number of variables for which to compute penalties in dynamic strong branching.

Definition at line 802 of file CbcModel.hpp.

void CbcModel::setNumberAnalyzeIterations ( int  number  )  [inline]

Number of analyze iterations to do.

Definition at line 806 of file CbcModel.hpp.

int CbcModel::numberAnalyzeIterations (  )  const [inline]

Set an integer parameter.

Definition at line 809 of file CbcModel.hpp.

double CbcModel::penaltyScaleFactor (  )  const [inline]

Get scale factor to make penalties match strong.

Should/will be computed

Definition at line 814 of file CbcModel.hpp.

void CbcModel::setPenaltyScaleFactor ( double  value  ) 

Set scale factor to make penalties match strong.

Should/will be computed

void CbcModel::setProblemType ( int  number  )  [inline]

Problem type as set by user or found by analysis.

This will be extended 0 - not known 1 - Set partitioning <= 2 - Set partitioning == 3 - Set covering 4 - all +- 1 or all +1 and odd

Definition at line 827 of file CbcModel.hpp.

int CbcModel::problemType (  )  const [inline]

Set an integer parameter.

Definition at line 830 of file CbcModel.hpp.

int CbcModel::currentDepth (  )  const [inline]

Current depth.

Definition at line 834 of file CbcModel.hpp.

void CbcModel::setHowOftenGlobalScan ( int  number  ) 

Set how often to scan global cuts.

int CbcModel::howOftenGlobalScan (  )  const [inline]

Get how often to scan global cuts.

Definition at line 841 of file CbcModel.hpp.

int* CbcModel::originalColumns (  )  const [inline]

Original columns as created by integerPresolve or preprocessing.

Definition at line 845 of file CbcModel.hpp.

void CbcModel::setOriginalColumns ( const int *  originalColumns  ) 

Set original columns as created by preprocessing.

void CbcModel::setPrintFrequency ( int  number  )  [inline]

Set the print frequency.

Controls the number of nodes evaluated between status prints. If number <=0 the print frequency is set to 100 nodes for large problems, 1000 for small problems. Print frequency has very slight overhead if small.

Definition at line 858 of file CbcModel.hpp.

int CbcModel::printFrequency (  )  const [inline]

Get the print frequency.

Definition at line 862 of file CbcModel.hpp.

bool CbcModel::isAbandoned (  )  const

Are there a numerical difficulties?

bool CbcModel::isProvenOptimal (  )  const

Is optimality proven?

bool CbcModel::isProvenInfeasible (  )  const

Is infeasiblity proven (or none better than cutoff)?

bool CbcModel::isContinuousUnbounded (  )  const

Was continuous solution unbounded.

bool CbcModel::isProvenDualInfeasible (  )  const

Was continuous solution unbounded.

bool CbcModel::isNodeLimitReached (  )  const

Node limit reached?

bool CbcModel::isSecondsLimitReached (  )  const

Time limit reached?

bool CbcModel::isSolutionLimitReached (  )  const

Solution limit reached?

int CbcModel::getIterationCount (  )  const [inline]

Get how many iterations it took to solve the problem.

Definition at line 887 of file CbcModel.hpp.

void CbcModel::incrementIterationCount ( int  value  )  [inline]

Increment how many iterations it took to solve the problem.

Definition at line 891 of file CbcModel.hpp.

int CbcModel::getNodeCount (  )  const [inline]

Get how many Nodes it took to solve the problem.

Definition at line 895 of file CbcModel.hpp.

void CbcModel::incrementNodeCount ( int  value  )  [inline]

Increment how many nodes it took to solve the problem.

Definition at line 899 of file CbcModel.hpp.

int CbcModel::status (  )  const [inline]

Final status of problem Some of these can be found out by is......

functions -1 before branchAndBound 0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found (or check value of best solution) 1 stopped - on maxnodes, maxsols, maxtime 2 difficulties so run was abandoned (5 event user programmed event occurred)

Definition at line 911 of file CbcModel.hpp.

void CbcModel::setProblemStatus ( int  value  )  [inline]

Are there a numerical difficulties?

Definition at line 914 of file CbcModel.hpp.

int CbcModel::secondaryStatus (  )  const [inline]

Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions 7 linear relaxation unbounded.

Definition at line 928 of file CbcModel.hpp.

void CbcModel::setSecondaryStatus ( int  value  )  [inline]

Are there a numerical difficulties?

Definition at line 931 of file CbcModel.hpp.

bool CbcModel::isInitialSolveAbandoned (  )  const

Are there numerical difficulties (for initialSolve) ?

bool CbcModel::isInitialSolveProvenOptimal (  )  const

Is optimality proven (for initialSolve) ?

bool CbcModel::isInitialSolveProvenPrimalInfeasible (  )  const

Is primal infeasiblity proven (for initialSolve) ?

bool CbcModel::isInitialSolveProvenDualInfeasible (  )  const

Is dual infeasiblity proven (for initialSolve) ?

int CbcModel::numberRowsAtContinuous (  )  const [inline]

Number of rows in continuous (root) problem.

Definition at line 959 of file CbcModel.hpp.

int CbcModel::getNumCols (  )  const [inline]

Get number of columns.

Definition at line 964 of file CbcModel.hpp.

int CbcModel::getNumRows (  )  const [inline]

Get number of rows.

Definition at line 969 of file CbcModel.hpp.

CoinBigIndex CbcModel::getNumElements (  )  const [inline]

Get number of nonzero elements.

Definition at line 974 of file CbcModel.hpp.

int CbcModel::numberIntegers (  )  const [inline]

Number of integers in problem.

Definition at line 979 of file CbcModel.hpp.

const int* CbcModel::integerVariable (  )  const [inline]

Number of rows in continuous (root) problem.

Definition at line 983 of file CbcModel.hpp.

char CbcModel::integerType ( int  i  )  const [inline]

Whether or not integer.

Definition at line 987 of file CbcModel.hpp.

const char* CbcModel::integerType (  )  const [inline]

Whether or not integer.

Definition at line 993 of file CbcModel.hpp.

const double* CbcModel::getColLower (  )  const [inline]

Get pointer to array[getNumCols()] of column lower bounds.

Definition at line 998 of file CbcModel.hpp.

const double* CbcModel::getColUpper (  )  const [inline]

Get pointer to array[getNumCols()] of column upper bounds.

Definition at line 1003 of file CbcModel.hpp.

const char* CbcModel::getRowSense (  )  const [inline]

Get pointer to array[getNumRows()] of row constraint senses.

  • 'L': <= constraint
  • 'E': = constraint
  • 'G': >= constraint
  • 'R': ranged constraint
  • 'N': free constraint

Definition at line 1016 of file CbcModel.hpp.

const double* CbcModel::getRightHandSide (  )  const [inline]

Get pointer to array[getNumRows()] of rows right-hand sides.

  • if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
  • if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
  • if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
  • if rowsense()[i] == 'N' then rhs()[i] == 0.0

Definition at line 1028 of file CbcModel.hpp.

const double* CbcModel::getRowRange (  )  const [inline]

Get pointer to array[getNumRows()] of row ranges.

  • if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
  • if rowsense()[i] != 'R' then rowrange()[i] is 0.0

Definition at line 1040 of file CbcModel.hpp.

const double* CbcModel::getRowLower (  )  const [inline]

Get pointer to array[getNumRows()] of row lower bounds.

Definition at line 1045 of file CbcModel.hpp.

const double* CbcModel::getRowUpper (  )  const [inline]

Get pointer to array[getNumRows()] of row upper bounds.

Definition at line 1050 of file CbcModel.hpp.

const double* CbcModel::getObjCoefficients (  )  const [inline]

Get pointer to array[getNumCols()] of objective function coefficients.

Definition at line 1055 of file CbcModel.hpp.

double CbcModel::getObjSense (  )  const [inline]

Get objective function sense (1 for min (default), -1 for max).

Definition at line 1060 of file CbcModel.hpp.

bool CbcModel::isContinuous ( int  colIndex  )  const [inline]

Return true if variable is continuous.

Definition at line 1066 of file CbcModel.hpp.

bool CbcModel::isBinary ( int  colIndex  )  const [inline]

Return true if variable is binary.

Definition at line 1071 of file CbcModel.hpp.

bool CbcModel::isInteger ( int  colIndex  )  const [inline]

Return true if column is integer.

Note: This function returns true if the the column is binary or a general integer.

Definition at line 1079 of file CbcModel.hpp.

bool CbcModel::isIntegerNonBinary ( int  colIndex  )  const [inline]

Return true if variable is general integer.

Definition at line 1084 of file CbcModel.hpp.

bool CbcModel::isFreeBinary ( int  colIndex  )  const [inline]

Return true if variable is binary and not fixed at either bound.

Definition at line 1089 of file CbcModel.hpp.

const CoinPackedMatrix* CbcModel::getMatrixByRow (  )  const [inline]

Get pointer to row-wise copy of matrix.

Definition at line 1094 of file CbcModel.hpp.

const CoinPackedMatrix* CbcModel::getMatrixByCol (  )  const [inline]

Get pointer to column-wise copy of matrix.

Definition at line 1099 of file CbcModel.hpp.

double CbcModel::getInfinity (  )  const [inline]

Get solver's value for infinity.

Definition at line 1104 of file CbcModel.hpp.

const double* CbcModel::getCbcColLower (  )  const [inline]

Get pointer to array[getNumCols()] (for speed) of column lower bounds.

Definition at line 1108 of file CbcModel.hpp.

const double* CbcModel::getCbcColUpper (  )  const [inline]

Get pointer to array[getNumCols()] (for speed) of column upper bounds.

Definition at line 1112 of file CbcModel.hpp.

const double* CbcModel::getCbcRowLower (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of row lower bounds.

Definition at line 1116 of file CbcModel.hpp.

const double* CbcModel::getCbcRowUpper (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of row upper bounds.

Definition at line 1120 of file CbcModel.hpp.

const double* CbcModel::getCbcColSolution (  )  const [inline]

Get pointer to array[getNumCols()] (for speed) of primal solution vector.

Definition at line 1124 of file CbcModel.hpp.

const double* CbcModel::getCbcRowPrice (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of dual prices.

Definition at line 1128 of file CbcModel.hpp.

const double* CbcModel::getCbcReducedCost (  )  const [inline]

Get a pointer to array[getNumCols()] (for speed) of reduced costs.

Definition at line 1132 of file CbcModel.hpp.

const double* CbcModel::getCbcRowActivity (  )  const [inline]

Get pointer to array[getNumRows()] (for speed) of row activity levels.

Definition at line 1136 of file CbcModel.hpp.

double* CbcModel::continuousSolution (  )  const [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1145 of file CbcModel.hpp.

int* CbcModel::usedInSolution (  )  const [inline]

Array marked whenever a solution is found if non-zero.

Code marks if heuristic returns better so heuristic need only mark if it wants to on solutions which are worse than current

Definition at line 1152 of file CbcModel.hpp.

void CbcModel::incrementUsed ( const double *  solution  ) 

Increases usedInSolution for nonzeros.

void CbcModel::setBestSolution ( CBC_Message  how,
double &  objectiveValue,
const double *  solution,
int  fixVariables = 0 
)

Record a new incumbent solution and update objectiveValue.

void CbcModel::setBestObjectiveValue ( double  objectiveValue  ) 

Just update objectiveValue.

CbcEventHandler::CbcAction CbcModel::dealWithEventHandler ( CbcEventHandler::CbcEvent  event,
double  objValue,
const double *  solution 
)

Deals with event handler and solution.

double CbcModel::checkSolution ( double  cutoff,
double *  solution,
int  fixVariables,
double  originalObjValue 
)

Call this to really test if a valid solution can be feasible Solution is number columns in size.

If fixVariables true then bounds of continuous solver updated. Returns objective value (worse than cutoff if not feasible) Previously computed objective value is now passed in (in case user does not do solve)

bool CbcModel::feasibleSolution ( int &  numberIntegerInfeasibilities,
int &  numberObjectInfeasibilities 
) const

Test the current solution for feasiblility.

Scan all objects for indications of infeasibility. This is broken down into simple integer infeasibility (numberIntegerInfeasibilities) and all other reports of infeasibility (numberObjectInfeasibilities).

double* CbcModel::currentSolution (  )  const [inline]

Solution to the most recent lp relaxation.

The solver's solution to the most recent lp relaxation.

Definition at line 1190 of file CbcModel.hpp.

const double* CbcModel::testSolution (  )  const [inline]

For testing infeasibilities - will point to currentSolution_ or solver-->getColSolution().

Definition at line 1196 of file CbcModel.hpp.

void CbcModel::setTestSolution ( const double *  solution  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1199 of file CbcModel.hpp.

void CbcModel::reserveCurrentSolution ( const double *  solution = NULL  ) 

Make sure region there and optionally copy solution.

const double* CbcModel::getColSolution (  )  const [inline]

Get pointer to array[getNumCols()] of primal solution vector.

Definition at line 1206 of file CbcModel.hpp.

const double* CbcModel::getRowPrice (  )  const [inline]

Get pointer to array[getNumRows()] of dual prices.

Definition at line 1211 of file CbcModel.hpp.

const double* CbcModel::getReducedCost (  )  const [inline]

Get a pointer to array[getNumCols()] of reduced costs.

Definition at line 1216 of file CbcModel.hpp.

const double* CbcModel::getRowActivity (  )  const [inline]

Get pointer to array[getNumRows()] of row activity levels.

Definition at line 1221 of file CbcModel.hpp.

double CbcModel::getCurrentObjValue (  )  const [inline]

Get current objective function value.

Definition at line 1226 of file CbcModel.hpp.

double CbcModel::getCurrentMinimizationObjValue (  )  const [inline]

Get current minimization objective function value.

Definition at line 1230 of file CbcModel.hpp.

double CbcModel::getMinimizationObjValue (  )  const [inline]

Get best objective function value as minimization.

Definition at line 1235 of file CbcModel.hpp.

void CbcModel::setMinimizationObjValue ( double  value  )  [inline]

Set best objective function value as minimization.

Definition at line 1239 of file CbcModel.hpp.

double CbcModel::getObjValue (  )  const [inline]

Get best objective function value.

Definition at line 1244 of file CbcModel.hpp.

double CbcModel::getBestPossibleObjValue (  )  const

Get best possible objective function value.

This is better of best possible left on tree and best solution found. If called from within branch and cut may be optimistic.

void CbcModel::setObjValue ( double  value  )  [inline]

Set best objective function value.

Definition at line 1254 of file CbcModel.hpp.

double CbcModel::getSolverObjValue (  )  const [inline]

Get solver objective function value (as minimization).

Definition at line 1258 of file CbcModel.hpp.

double* CbcModel::bestSolution (  )  const [inline]

The best solution to the integer programming problem.

The best solution to the integer programming problem found during the search. If no solution is found, the method returns null.

Definition at line 1268 of file CbcModel.hpp.

void CbcModel::setBestSolution ( const double *  solution,
int  numberColumns,
double  objectiveValue,
bool  check = false 
)

User callable setBestSolution.

If check false does not check valid If true then sees if feasible and warns if objective value worse than given (so just set to COIN_DBL_MAX if you don't care). If check true then does not save solution if not feasible

int CbcModel::getSolutionCount (  )  const [inline]

Get number of solutions.

Definition at line 1281 of file CbcModel.hpp.

void CbcModel::setSolutionCount ( int  value  )  [inline]

Set number of solutions (so heuristics will be different).

Definition at line 1286 of file CbcModel.hpp.

int CbcModel::numberSavedSolutions (  )  const

Number of saved solutions (including best).

int CbcModel::maximumSavedSolutions (  )  const [inline]

Maximum number of extra saved solutions.

Definition at line 1292 of file CbcModel.hpp.

void CbcModel::setMaximumSavedSolutions ( int  value  ) 

Set maximum number of extra saved solutions.

const double* CbcModel::savedSolution ( int  which  )  const

Return a saved solution (0==best) - NULL if off end.

double CbcModel::savedSolutionObjective ( int  which  )  const

Return a saved solution objective (0==best) - COIN_DBL_MAX if off end.

int CbcModel::phase (  )  const [inline]

Current phase (so heuristics etc etc can find out).

0 - initial solve 1 - solve with cuts at root 2 - solve with cuts 3 - other e.g. strong branching 4 - trying to validate a solution 5 - at end of search

Definition at line 1310 of file CbcModel.hpp.

int CbcModel::getNumberHeuristicSolutions (  )  const [inline]

Get number of heuristic solutions.

Definition at line 1315 of file CbcModel.hpp.

void CbcModel::setNumberHeuristicSolutions ( int  value  )  [inline]

Set number of heuristic solutions.

Definition at line 1319 of file CbcModel.hpp.

void CbcModel::setObjSense ( double  s  )  [inline]

Set objective function sense (1 for min (default), -1 for max,).

Definition at line 1324 of file CbcModel.hpp.

double CbcModel::getContinuousObjective (  )  const [inline]

Value of objective at continuous.

Definition at line 1330 of file CbcModel.hpp.

void CbcModel::setContinuousObjective ( double  value  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1333 of file CbcModel.hpp.

int CbcModel::getContinuousInfeasibilities (  )  const [inline]

Number of infeasibilities at continuous.

Definition at line 1337 of file CbcModel.hpp.

void CbcModel::setContinuousInfeasibilities ( int  value  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1340 of file CbcModel.hpp.

double CbcModel::rootObjectiveAfterCuts (  )  const [inline]

Value of objective after root node cuts added.

Definition at line 1344 of file CbcModel.hpp.

double CbcModel::sumChangeObjective (  )  const [inline]

Sum of Changes to objective by first solve.

Definition at line 1348 of file CbcModel.hpp.

int CbcModel::numberGlobalViolations (  )  const [inline]

Number of times global cuts violated.

When global cut pool then this should be kept for each cut and type of cut

Definition at line 1353 of file CbcModel.hpp.

void CbcModel::clearNumberGlobalViolations (  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1356 of file CbcModel.hpp.

bool CbcModel::resolveAfterTakeOffCuts (  )  const [inline]

Whether to force a resolve after takeOffCuts.

Definition at line 1360 of file CbcModel.hpp.

void CbcModel::setResolveAfterTakeOffCuts ( bool  yesNo  )  [inline]

Holds solution at continuous (after cuts if branchAndBound called).

Definition at line 1363 of file CbcModel.hpp.

int CbcModel::maximumRows (  )  const [inline]

Maximum number of rows.

Definition at line 1367 of file CbcModel.hpp.

CoinWarmStartBasis& CbcModel::workingBasis (  )  [inline]

Work basis for temporary use.

Definition at line 1371 of file CbcModel.hpp.

int CbcModel::getStopNumberIterations (  )  const [inline]

Get number of "iterations" to stop after.

Definition at line 1375 of file CbcModel.hpp.

void CbcModel::setStopNumberIterations ( int  value  )  [inline]

Set number of "iterations" to stop after.

Definition at line 1379 of file CbcModel.hpp.

CbcCompareBase* CbcModel::nodeComparison (  )  const [inline]

Definition at line 1387 of file CbcModel.hpp.

void CbcModel::setNodeComparison ( CbcCompareBase compare  ) 
void CbcModel::setNodeComparison ( CbcCompareBase compare  ) 
CbcFeasibilityBase* CbcModel::problemFeasibility (  )  const [inline]

Definition at line 1397 of file CbcModel.hpp.

void CbcModel::setProblemFeasibility ( CbcFeasibilityBase feasibility  ) 
void CbcModel::setProblemFeasibility ( CbcFeasibilityBase feasibility  ) 
CbcTree* CbcModel::tree (  )  const [inline]

Tree method e.g. heap (which may be overridden by inheritance).

Definition at line 1407 of file CbcModel.hpp.

void CbcModel::passInTreeHandler ( CbcTree tree  ) 

For modifying tree handling (original is cloned).

void CbcModel::passInSubTreeModel ( CbcModel model  ) 

For passing in an CbcModel to do a sub Tree (with derived tree handlers).

Passed in model must exist for duration of branch and bound

CbcModel* CbcModel::subTreeModel ( OsiSolverInterface *  solver = NULL  )  const

For retrieving a copy of subtree model with given OsiSolver.

If no subtree model will use self (up to user to reset cutoff etc). If solver NULL uses current

int CbcModel::numberStoppedSubTrees (  )  const [inline]

Returns number of times any subtree stopped on nodes, time etc.

Definition at line 1422 of file CbcModel.hpp.

void CbcModel::incrementSubTreeStopped (  )  [inline]

Says a sub tree was stopped.

Definition at line 1426 of file CbcModel.hpp.

int CbcModel::typePresolve (  )  const [inline]

Whether to automatically do presolve before branch and bound (subTrees).

0 - no 1 - ordinary presolve 2 - integer presolve (dodgy)

Definition at line 1434 of file CbcModel.hpp.

void CbcModel::setTypePresolve ( int  value  )  [inline]

Tree method e.g. heap (which may be overridden by inheritance).

Definition at line 1437 of file CbcModel.hpp.

CbcBranchDecision* CbcModel::branchingMethod (  )  const [inline]

Get the current branching decision method.

Definition at line 1450 of file CbcModel.hpp.

void CbcModel::setBranchingMethod ( CbcBranchDecision method  )  [inline]

Set the branching decision method.

Definition at line 1454 of file CbcModel.hpp.

void CbcModel::setBranchingMethod ( CbcBranchDecision method  )  [inline]

Set the branching method.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1462 of file CbcModel.hpp.

CbcCutModifier* CbcModel::cutModifier (  )  const [inline]

Get the current cut modifier method.

Definition at line 1467 of file CbcModel.hpp.

void CbcModel::setCutModifier ( CbcCutModifier modifier  ) 

Set the cut modifier method.

void CbcModel::setCutModifier ( CbcCutModifier modifier  ) 

Set the cut modifier method.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int CbcModel::stateOfSearch (  )  const [inline]

State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.

Definition at line 1488 of file CbcModel.hpp.

void CbcModel::setStateOfSearch ( int  state  )  [inline]

State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.

Definition at line 1491 of file CbcModel.hpp.

int CbcModel::searchStrategy (  )  const [inline]

Strategy worked out - mainly at root node for use by CbcNode.

Definition at line 1495 of file CbcModel.hpp.

void CbcModel::setSearchStrategy ( int  value  )  [inline]

Set strategy worked out - mainly at root node for use by CbcNode.

Definition at line 1499 of file CbcModel.hpp.

int CbcModel::numberCutGenerators (  )  const [inline]

Get the number of cut generators.

Definition at line 1504 of file CbcModel.hpp.

CbcCutGenerator** CbcModel::cutGenerators (  )  const [inline]

Get the list of cut generators.

Definition at line 1508 of file CbcModel.hpp.

CbcCutGenerator* CbcModel::cutGenerator ( int  i  )  const [inline]

Get the specified cut generator.

Definition at line 1512 of file CbcModel.hpp.

CbcCutGenerator* CbcModel::virginCutGenerator ( int  i  )  const [inline]

Get the specified cut generator before any changes.

Definition at line 1516 of file CbcModel.hpp.

void CbcModel::addCutGenerator ( CglCutGenerator *  generator,
int  howOften = 1,
const char *  name = NULL,
bool  normal = true,
bool  atSolution = false,
bool  infeasible = false,
int  howOftenInSub = -100,
int  whatDepth = -1,
int  whatDepthInSub = -1 
)

Add one generator - up to user to delete generators.

howoften affects how generator is used. 0 or 1 means always, >1 means every that number of nodes. Negative values have same meaning as positive but they may be switched off (-> -100) by code if not many cuts generated at continuous. -99 is just done at root. Name is just for printout. If depth >0 overrides how often generator is called (if howOften==-1 or >0).

CbcStrategy* CbcModel::strategy (  )  const [inline]

Get the current strategy.

Definition at line 1540 of file CbcModel.hpp.

void CbcModel::setStrategy ( CbcStrategy strategy  ) 

Set the strategy. Clones.

void CbcModel::setStrategy ( CbcStrategy strategy  )  [inline]

Set the strategy. assigns.

Definition at line 1546 of file CbcModel.hpp.

CbcModel* CbcModel::parentModel (  )  const [inline]

Get the current parent model.

Definition at line 1550 of file CbcModel.hpp.

void CbcModel::setParentModel ( CbcModel parentModel  )  [inline]

Set the parent model.

Definition at line 1554 of file CbcModel.hpp.

void CbcModel::addHeuristic ( CbcHeuristic generator,
const char *  name = NULL,
int  before = -1 
)

Add one heuristic - up to user to delete.

The name is just used for print messages.

CbcHeuristic* CbcModel::heuristic ( int  i  )  const [inline]

Get the specified heuristic.

Definition at line 1569 of file CbcModel.hpp.

int CbcModel::numberHeuristics (  )  const [inline]

Get the number of heuristics.

Definition at line 1573 of file CbcModel.hpp.

CbcHeuristic* CbcModel::lastHeuristic (  )  const [inline]

Pointer to heuristic solver which found last solution (or NULL).

Definition at line 1577 of file CbcModel.hpp.

void CbcModel::setLastHeuristic ( CbcHeuristic last  )  [inline]

set last heuristic which found a solution

Definition at line 1581 of file CbcModel.hpp.

void CbcModel::passInPriorities ( const int *  priorities,
bool  ifNotSimpleIntegers 
)

Pass in branching priorities.

If ifClique then priorities are on cliques otherwise priorities are on integer variables. Other type (if exists set to default) 1 is highest priority. (well actually -INT_MAX is but that's ugly) If hotstart > 0 then branches are created to force the variable to the value given by best solution. This enables a sort of hot start. The node choice should be greatest depth and hotstart should normally be switched off after a solution.

If ifNotSimpleIntegers true then appended to normal integers

This is now deprecated except for simple usage. If user creates Cbcobjects then set priority in them

int CbcModel::priority ( int  sequence  )  const [inline]

Returns priority level for an object (or 1000 if no priorities exist).

Definition at line 1606 of file CbcModel.hpp.

void CbcModel::passInEventHandler ( const CbcEventHandler eventHandler  ) 

Set an event handler.

A clone of the handler passed as a parameter is stored in CbcModel.

CbcEventHandler* CbcModel::getEventHandler (  )  const [inline]

Retrieve a pointer to the event handler.

Definition at line 1617 of file CbcModel.hpp.

void CbcModel::setApplicationData ( void *  appData  ) 

Set application data.

This is a pointer that the application can store into and retrieve from the solver interface. This field is available for the application to optionally define and use.

void* CbcModel::getApplicationData (  )  const

Get application data.

void CbcModel::passInSolverCharacteristics ( OsiBabSolver *  solverCharacteristics  ) 

For advanced applications you may wish to modify the behavior of Cbc e.g.

if the solver is a NLP solver then you may not have an exact optimum solution at each step. Information could be built into OsiSolverInterface but this is an alternative so that that interface does not have to be changed. If something similar is useful to enough solvers then it could be migrated You can also pass in by using solver->setAuxiliaryInfo. You should do that if solver is odd - if solver is normal simplex then use this. NOTE - characteristics are not cloned

const OsiBabSolver* CbcModel::solverCharacteristics (  )  const [inline]

Get solver characteristics.

Definition at line 1650 of file CbcModel.hpp.

void CbcModel::passInMessageHandler ( CoinMessageHandler *  handler  ) 

Pass in Message handler (not deleted at end).

void CbcModel::newLanguage ( CoinMessages::Language  language  ) 

Set language.

void CbcModel::setLanguage ( CoinMessages::Language  language  )  [inline]

Pass in Message handler (not deleted at end).

Definition at line 1663 of file CbcModel.hpp.

CoinMessageHandler* CbcModel::messageHandler (  )  const [inline]

Return handler.

Definition at line 1667 of file CbcModel.hpp.

CoinMessages& CbcModel::messages (  )  [inline]

Return messages.

Definition at line 1671 of file CbcModel.hpp.

CoinMessages* CbcModel::messagesPointer (  )  [inline]

Return pointer to messages.

Definition at line 1675 of file CbcModel.hpp.

void CbcModel::setLogLevel ( int  value  ) 

Set log level.

int CbcModel::logLevel (  )  const [inline]

Get log level.

Definition at line 1681 of file CbcModel.hpp.

void CbcModel::setDefaultHandler ( bool  yesNo  )  [inline]

Set flag to say if handler_ is the default handler.

The default handler is deleted when the model is deleted. Other handlers (supplied by the client) will not be deleted.

Definition at line 1689 of file CbcModel.hpp.

void CbcModel::setSpecialOptions ( int  value  )  [inline]

Set special options 0 bit (1) - check if cuts valid (if on debugger list) 1 bit (2) - use current basis to check integer solution (rather than all slack) 2 bit (4) - don't check integer solution (by solving LP) 3 bit (8) - fast analyze 4 bit (16) - non-linear model - so no well defined CoinPackedMatrix 5 bit (32) - keep names 6 bit (64) - try for dominated columns 7 bit (128) - SOS type 1 but all declared integer 8 bit (256) - Set to say solution just found, unset by doing cuts 9 bit (512) - Try reduced model after 100 nodes 10 bit (1024) - Switch on some heuristics even if seems unlikely 11 bit (2048) - Mark as in small branch and bound 12 bit (4096) - Funny cuts so do slow way (in some places) 13 bit (8192) - Funny cuts so do slow way (in other places) 14 bit (16384) - Use Cplex! for fathoming 15 bit (32768) - Try reduced model after 0 nodes 16 bit (65536) - Original model had integer bounds 17 bit (131072) - Perturbation switched off.

Definition at line 1718 of file CbcModel.hpp.

int CbcModel::specialOptions (  )  const [inline]

Get special options.

Definition at line 1722 of file CbcModel.hpp.

bool CbcModel::normalSolver (  )  const [inline]

Says if normal solver i.e. has well defined CoinPackedMatrix.

Definition at line 1726 of file CbcModel.hpp.

void CbcModel::setMoreSpecialOptions ( int  value  )  [inline]

Set more special options at present bottom 6 bits used for shadow price mode 1024 for experimental hotstart 2048,4096 breaking out of cuts 8192 slowly increase minimum drop 16384 gomory.

Definition at line 1736 of file CbcModel.hpp.

int CbcModel::moreSpecialOptions (  )  const [inline]

Get more special options.

Definition at line 1740 of file CbcModel.hpp.

bool CbcModel::ownObjects (  )  const [inline]

Go to dantzig pivot selection if easy problem (clp only).

Now we may not own objects - just point to solver's objects

Definition at line 1748 of file CbcModel.hpp.

void CbcModel::checkModel (  ) 

Check original model before it gets messed up.

void CbcModel::assignSolver ( OsiSolverInterface *&  solver,
bool  deleteSolver = true 
)

Assign a solver to the model (model assumes ownership).

On return, solver will be NULL. If deleteSolver then current solver deleted (if model owned)

Note:
Parameter settings in the outgoing solver are not inherited by the incoming solver.
void CbcModel::setModelOwnsSolver ( bool  ourSolver  )  [inline]

Set ownership of solver.

A parameter of false tells CbcModel it does not own the solver and should not delete it. Once you claim ownership of the solver, you're responsible for eventually deleting it. Note that CbcModel clones solvers with abandon. Unless you have a deep understanding of the workings of CbcModel, the only time you want to claim ownership is when you're about to delete the CbcModel object but want the solver to continue to exist (as, for example, when branchAndBound has finished and you want to hang on to the answer).

Definition at line 1785 of file CbcModel.hpp.

bool CbcModel::modelOwnsSolver (  )  [inline]

Get ownership of solver.

A return value of true means that CbcModel owns the solver and will take responsibility for deleting it when that becomes necessary.

Definition at line 1794 of file CbcModel.hpp.

CbcModel& CbcModel::operator= ( const CbcModel rhs  ) 

Assignment operator.

OsiSolverInterface* CbcModel::solver (  )  const [inline]

Returns solver - has current state.

Definition at line 1810 of file CbcModel.hpp.

OsiSolverInterface* CbcModel::swapSolver ( OsiSolverInterface *  solver  )  [inline]

Returns current solver - sets new one.

Definition at line 1815 of file CbcModel.hpp.

OsiSolverInterface* CbcModel::continuousSolver (  )  const [inline]

Returns solver with continuous state.

Definition at line 1822 of file CbcModel.hpp.

void CbcModel::createContinuousSolver (  )  [inline]

Create solver with continuous state.

Definition at line 1827 of file CbcModel.hpp.

void CbcModel::clearContinuousSolver (  )  [inline]

Clear solver with continuous state.

Definition at line 1831 of file CbcModel.hpp.

OsiSolverInterface* CbcModel::referenceSolver (  )  const [inline]

A copy of the solver, taken at constructor or by saveReferenceSolver.

Definition at line 1837 of file CbcModel.hpp.

void CbcModel::saveReferenceSolver (  ) 

Save a copy of the current solver so can be reset to.

void CbcModel::resetToReferenceSolver (  ) 

Uses a copy of reference solver to be current solver.

Because of possible mismatches all exotic integer information is loat (apart from normal information in OsiSolverInterface) so SOS etc and priorities will have to be redone

void CbcModel::gutsOfDestructor (  ) 

Clears out as much as possible (except solver).

void CbcModel::gutsOfDestructor2 (  ) 

Clears out enough to reset CbcModel as if no branch and bound done.

void CbcModel::resetModel (  ) 

Clears out enough to reset CbcModel cutoff etc.

void CbcModel::gutsOfCopy ( const CbcModel rhs,
int  mode = 0 
)

Most of copy constructor mode - 0 copy but don't delete before 1 copy and delete before 2 copy and delete before (but use virgin generators).

void CbcModel::moveInfo ( const CbcModel rhs  ) 

Move status, nodes etc etc across.

CbcThread* CbcModel::masterThread (  )  const [inline]

To do with threads.

Get pointer to masterthread

Definition at line 1872 of file CbcModel.hpp.

CbcNodeInfo** CbcModel::walkback (  )  const [inline]

Get pointer to walkback.

Definition at line 1876 of file CbcModel.hpp.

int CbcModel::getNumberThreads (  )  const [inline]

Get number of threads.

Definition at line 1880 of file CbcModel.hpp.

void CbcModel::setNumberThreads ( int  value  )  [inline]

Set number of threads.

Definition at line 1884 of file CbcModel.hpp.

int CbcModel::getThreadMode (  )  const [inline]

Get thread mode.

Definition at line 1888 of file CbcModel.hpp.

void CbcModel::setThreadMode ( int  value  )  [inline]

Set thread mode always use numberThreads for branching 1 set then deterministic 2 set then use numberThreads for root cuts 4 set then use numberThreads in root mini branch and bound 8 set and numberThreads - do heuristics numberThreads at a time 8 set and numberThreads==0 do all heuristics at once default is 0.

Definition at line 1900 of file CbcModel.hpp.

int CbcModel::parallelMode (  )  const [inline]

Return -2 if deterministic threaded and main thread -1 if deterministic threaded and serial thread 0 if serial 1 if opportunistic threaded.

Definition at line 1909 of file CbcModel.hpp.

bool CbcModel::isLocked (  )  const

From here to end of section - code in CbcThread.cpp until class changed Returns true if locked.

void CbcModel::lockThread (  )  [inline]

To do with threads.

Get pointer to masterthread

Definition at line 1937 of file CbcModel.hpp.

void CbcModel::unlockThread (  )  [inline]

To do with threads.

Get pointer to masterthread

Definition at line 1938 of file CbcModel.hpp.

void CbcModel::setInfoInChild ( int  type,
CbcThread info 
)

Set information in a child -3 pass pointer to child thread info -2 just stop -1 delete simple child stuff 0 delete opportunistic child stuff 1 delete deterministic child stuff.

void CbcModel::moveToModel ( CbcModel baseModel,
int  mode 
)

Move/copy information from one model to another -1 - initialization 0 - from base model 1 - to base model (and reset) 2 - add in final statistics etc (and reset so can do clean destruction).

int CbcModel::splitModel ( int  numberModels,
CbcModel **  model,
int  numberNodes 
)

Split up nodes.

void CbcModel::startSplitModel ( int  numberIterations  ) 

Start threads.

void CbcModel::mergeModels ( int  numberModel,
CbcModel **  model,
int  numberNodes 
)

Merge models.

int CbcModel::getNodeCount2 (  )  const [inline]

semi-private i.e. users should not use

Get how many Nodes it took to solve the problem.

Definition at line 1968 of file CbcModel.hpp.

void CbcModel::setPointers ( const OsiSolverInterface *  solver  ) 

Set pointers for speed.

int CbcModel::reducedCostFix (  ) 

Perform reduced cost fixing.

Fixes integer variables at their current value based on reduced cost penalties. Returns number fixed

void CbcModel::synchronizeHandlers ( int  makeDefault  ) 

Makes all handlers same.

If makeDefault 1 then makes top level default and rest point to that. If 2 then each is copy

void CbcModel::saveExtraSolution ( const double *  solution,
double  objectiveValue 
)

Save a solution to saved list.

void CbcModel::saveBestSolution ( const double *  solution,
double  objectiveValue 
)

Save a solution to best and move current to saved.

void CbcModel::deleteSolutions (  ) 

Delete best and saved solutions.

int CbcModel::resolve ( OsiSolverInterface *  solver  ) 

Encapsulates solver resolve.

int CbcModel::chooseBranch ( CbcNode *&  newNode,
int  numberPassesLeft,
CbcNode oldNode,
OsiCuts &  cuts,
bool &  resolved,
CoinWarmStartBasis *  lastws,
const double *  lowerBefore,
const double *  upperBefore,
OsiSolverBranch *&  branches 
)

Encapsulates choosing a variable - anyAction -2, infeasible (-1 round again), 0 done.

int CbcModel::chooseBranch ( CbcNode newNode,
int  numberPassesLeft,
bool &  resolved 
)

semi-private i.e. users should not use

Get how many Nodes it took to solve the problem.

CoinWarmStartBasis* CbcModel::getEmptyBasis ( int  ns = 0,
int  na = 0 
) const

Return an empty basis object of the specified size.

A useful utility when constructing a basis for a subproblem from scratch. The object returned will be of the requested capacity and appropriate for the solver attached to the model.

int CbcModel::takeOffCuts ( OsiCuts &  cuts,
bool  allowResolve,
OsiCuts *  saveCuts,
int  numberNewCuts = 0,
const OsiRowCut **  newCuts = NULL 
)

Remove inactive cuts from the model.

An OsiSolverInterface is expected to maintain a valid basis, but not a valid solution, when loose cuts are deleted. Restoring a valid solution requires calling the solver to reoptimise. If it's certain the solution will not be required, set allowResolve to false to suppress reoptimisation. If saveCuts then slack cuts will be saved On input current cuts are cuts and newCuts on exit current cuts will be correct. Returns number dropped

int CbcModel::addCuts ( CbcNode node,
CoinWarmStartBasis *&  lastws,
bool  canFix 
)

Determine and install the active cuts that need to be added for the current subproblem.

The whole truth is a bit more complicated. The first action is a call to addCuts1(). addCuts() then sorts through the list, installs the tight cuts in the model, and does bookkeeping (adjusts reference counts). The basis returned from addCuts1() is adjusted accordingly.

If it turns out that the node should really be fathomed by bound, addCuts() simply treats all the cuts as loose as it does the bookkeeping.

canFix true if extra information being passed

bool CbcModel::addCuts1 ( CbcNode node,
CoinWarmStartBasis *&  lastws 
)

Traverse the tree from node to root and prep the model.

addCuts1() begins the job of prepping the model to match the current subproblem. The model is stripped of all cuts, and the search tree is traversed from node to root to determine the changes required. Appropriate bounds changes are installed, a list of cuts is collected but not installed, and an appropriate basis (minus the cuts, but big enough to accommodate them) is constructed.

Returns true if new problem similar to old

Todo:
addCuts1() is called in contexts where it's known in advance that all that's desired is to determine a list of cuts and do the bookkeeping (adjust the reference counts). The work of installing bounds and building a basis goes to waste.
void CbcModel::previousBounds ( CbcNode node,
CbcNodeInfo where,
int  iColumn,
double &  lower,
double &  upper,
int  force 
)

Returns bounds just before where - initially original bounds.

Also sets downstream nodes (lower if force 1, upper if 2)

void CbcModel::setObjectiveValue ( CbcNode thisNode,
const CbcNode parentNode 
) const

Set objective value in a node.

This is separated out so that odd solvers can use. It may look at extra information in solverCharacteriscs_ and will also use bound from parent node

void CbcModel::convertToDynamic (  ) 

If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.

Scan and convert CbcSimpleInteger objects

void CbcModel::synchronizeNumberBeforeTrust ( int  type = 0  ) 

Set numberBeforeTrust in all objects.

void CbcModel::zapIntegerInformation ( bool  leaveObjects = true  ) 

Zap integer information in problem (may leave object info).

int CbcModel::cliquePseudoCosts ( int  doStatistics  ) 

Use cliques for pseudocost information - return nonzero if infeasible.

void CbcModel::pseudoShadow ( int  type  ) 

Fill in useful estimates.

void CbcModel::fillPseudoCosts ( double *  downCosts,
double *  upCosts,
int *  priority = NULL,
int *  numberDown = NULL,
int *  numberUp = NULL,
int *  numberDownInfeasible = NULL,
int *  numberUpInfeasible = NULL 
) const

Return pseudo costs If not all integers or not pseudo costs - returns all zero Length of arrays are numberIntegers() and entries correspond to integerVariable()[i] User must allocate arrays before call.

void CbcModel::doHeuristicsAtRoot ( int  deleteHeuristicsAfterwards = 0  ) 

Do heuristics at root.

0 - don't delete 1 - delete 2 - just delete - don't even use

void CbcModel::adjustHeuristics (  ) 

Adjust heuristics based on model.

const double* CbcModel::hotstartSolution (  )  const [inline]

Get the hotstart solution.

Definition at line 2100 of file CbcModel.hpp.

const int* CbcModel::hotstartPriorities (  )  const [inline]

Get the hotstart priorities.

Definition at line 2104 of file CbcModel.hpp.

CbcCountRowCut** CbcModel::addedCuts (  )  const [inline]

Return the list of cuts initially collected for this subproblem.

Definition at line 2109 of file CbcModel.hpp.

int CbcModel::currentNumberCuts (  )  const [inline]

Number of entries in the list returned by addedCuts().

Definition at line 2113 of file CbcModel.hpp.

OsiCuts* CbcModel::globalCuts (  )  [inline]

Global cuts.

Definition at line 2117 of file CbcModel.hpp.

void CbcModel::setNextRowCut ( const OsiRowCut &  cut  ) 

Copy and set a pointer to a row cut which will be added instead of normal branching.

CbcNode* CbcModel::currentNode (  )  const [inline]

Get a pointer to current node (be careful).

Definition at line 2123 of file CbcModel.hpp.

CglTreeProbingInfo* CbcModel::probingInfo (  )  const [inline]

Get a pointer to probing info.

Definition at line 2127 of file CbcModel.hpp.

CoinThreadRandom* CbcModel::randomNumberGenerator (  )  [inline]

Thread specific random number generator.

Definition at line 2131 of file CbcModel.hpp.

void CbcModel::setNumberStrongIterations ( int  number  )  [inline]

Set the number of iterations done in strong branching.

Definition at line 2135 of file CbcModel.hpp.

int CbcModel::numberStrongIterations (  )  const [inline]

Get the number of iterations done in strong branching.

Definition at line 2139 of file CbcModel.hpp.

int CbcModel::maximumNumberIterations (  )  const [inline]

Get maximum number of iterations (designed to be used in heuristics).

Definition at line 2143 of file CbcModel.hpp.

void CbcModel::setMaximumNumberIterations ( int  value  )  [inline]

Set maximum number of iterations (designed to be used in heuristics).

Definition at line 2147 of file CbcModel.hpp.

int CbcModel::numberExtraIterations (  )  const [inline]

Number of extra iterations.

Definition at line 2173 of file CbcModel.hpp.

void CbcModel::incrementStrongInfo ( int  numberTimes,
int  numberIterations,
int  numberFixed,
bool  ifInfeasible 
)

Increment strong info.

const int* CbcModel::strongInfo (  )  const [inline]

Return strong info.

Definition at line 2180 of file CbcModel.hpp.

int* CbcModel::mutableStrongInfo (  )  [inline]

Return mutable strong info.

Definition at line 2185 of file CbcModel.hpp.

CglStored* CbcModel::storedRowCuts (  )  const [inline]

Get stored row cuts for donor/recipient CbcModel.

Definition at line 2189 of file CbcModel.hpp.

void CbcModel::setStoredRowCuts ( CglStored *  cuts  )  [inline]

Set stored row cuts for donor/recipient CbcModel.

Definition at line 2193 of file CbcModel.hpp.

bool CbcModel::allDynamic (  )  const [inline]

Says whether all dynamic integers.

Definition at line 2197 of file CbcModel.hpp.

void CbcModel::generateCpp ( FILE *  fp,
int  options 
)

Create C++ lines to get to current state.

OsiBranchingInformation CbcModel::usefulInformation (  )  const

Generate an OsiBranchingInformation object.

void CbcModel::setBestSolutionBasis ( const CoinWarmStartBasis &  bestSolutionBasis  )  [inline]

Warm start object produced by heuristic or strong branching.

If get a valid integer solution outside branch and bound then it can take a reasonable time to solve LP which produces clean solution. If this object has any size then it will be used in solve.

Definition at line 2210 of file CbcModel.hpp.

void CbcModel::redoWalkBack (  ) 

Redo walkback arrays.


Member Data Documentation

OsiSolverInterface * CbcModel::solver_ [private]

The solver associated with this model.

Definition at line 2224 of file CbcModel.hpp.

unsigned int CbcModel::ownership_ [private]

Ownership of objects and other stuff.

0x80000000 model owns solver 0x40000000 all variables CbcDynamicPseudoCost

Definition at line 2231 of file CbcModel.hpp.

OsiSolverInterface * CbcModel::continuousSolver_ [private]

A copy of the solver, taken at the continuous (root) node.

Definition at line 2234 of file CbcModel.hpp.

OsiSolverInterface * CbcModel::referenceSolver_ [private]

A copy of the solver, taken at constructor or by saveReferenceSolver.

Definition at line 2237 of file CbcModel.hpp.

CoinMessageHandler * CbcModel::handler_ [private]

Message handler.

Definition at line 2240 of file CbcModel.hpp.

bool CbcModel::defaultHandler_ [private]

Flag to say if handler_ is the default handler.

The default handler is deleted when the model is deleted. Other handlers (supplied by the client) will not be deleted.

Definition at line 2247 of file CbcModel.hpp.

CoinMessages CbcModel::messages_ [private]

Cbc messages.

Definition at line 2250 of file CbcModel.hpp.

int CbcModel::intParam_ [private]

Array for integer parameters.

Definition at line 2253 of file CbcModel.hpp.

double CbcModel::dblParam_ [private]

Array for double parameters.

Definition at line 2256 of file CbcModel.hpp.

CoinWarmStart * CbcModel::emptyWarmStart_ [mutable, private]

Pointer to an empty warm start object.

It turns out to be useful to have this available as a base from which to build custom warm start objects. This is typed as CoinWarmStart rather than CoinWarmStartBasis to allow for the possibility that a client might want to apply a solver that doesn't use a basis-based warm start. See getEmptyBasis for an example of how this field can be used.

Definition at line 2266 of file CbcModel.hpp.

double CbcModel::bestObjective_ [private]

Best objective.

Definition at line 2269 of file CbcModel.hpp.

Best possible objective.

Definition at line 2271 of file CbcModel.hpp.

Sum of Changes to objective by first solve.

Definition at line 2273 of file CbcModel.hpp.

Sum of Changes to objective by subsequent solves.

Definition at line 2275 of file CbcModel.hpp.

double * CbcModel::bestSolution_ [private]

Array holding the incumbent (best) solution.

Definition at line 2278 of file CbcModel.hpp.

double ** CbcModel::savedSolutions_ [private]

Arrays holding other solutions.

Definition at line 2280 of file CbcModel.hpp.

double * CbcModel::currentSolution_ [private]

Array holding the current solution.

This array is used more as a temporary.

Definition at line 2286 of file CbcModel.hpp.

const double * CbcModel::testSolution_ [mutable, private]

For testing infeasibilities - will point to currentSolution_ or solver-->getColSolution().

Definition at line 2290 of file CbcModel.hpp.

CoinWarmStartBasis CbcModel::bestSolutionBasis_ [private]

Warm start object produced by heuristic or strong branching.

If get a valid integer solution outside branch and bound then it can take a reasonable time to solve LP which produces clean solution. If this object has any size then it will be used in solve.

Definition at line 2297 of file CbcModel.hpp.

OsiCuts CbcModel::globalCuts_ [private]

Global cuts.

Definition at line 2299 of file CbcModel.hpp.

double CbcModel::minimumDrop_ [private]

Minimum degradation in objective value to continue cut generation.

Definition at line 2302 of file CbcModel.hpp.

Number of solutions.

Definition at line 2304 of file CbcModel.hpp.

Number of saved solutions.

Definition at line 2306 of file CbcModel.hpp.

Maximum number of saved solutions.

Definition at line 2308 of file CbcModel.hpp.

int CbcModel::stateOfSearch_ [private]

State of search 0 - no solution 1 - only heuristic solutions 2 - branched to a solution 3 - no solution but many nodes.

Definition at line 2315 of file CbcModel.hpp.

int CbcModel::whenCuts_ [private]

At which depths to do cuts.

Definition at line 2317 of file CbcModel.hpp.

double * CbcModel::hotstartSolution_ [private]

Hotstart solution.

Definition at line 2319 of file CbcModel.hpp.

Hotstart priorities.

Definition at line 2321 of file CbcModel.hpp.

Number of heuristic solutions.

Definition at line 2323 of file CbcModel.hpp.

int CbcModel::numberNodes_ [private]

Cumulative number of nodes.

Definition at line 2325 of file CbcModel.hpp.

int CbcModel::numberNodes2_ [private]

Cumulative number of nodes for statistics.

Must fix to match up

Definition at line 2329 of file CbcModel.hpp.

Cumulative number of iterations.

Definition at line 2331 of file CbcModel.hpp.

int CbcModel::numberSolves_ [private]

Cumulative number of solves.

Definition at line 2333 of file CbcModel.hpp.

int CbcModel::status_ [private]

Status of problem - 0 finished, 1 stopped, 2 difficulties.

Definition at line 2335 of file CbcModel.hpp.

Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions.

Definition at line 2346 of file CbcModel.hpp.

Number of integers in problem.

Definition at line 2348 of file CbcModel.hpp.

Number of rows at continuous.

Definition at line 2350 of file CbcModel.hpp.

Maximum number of cuts.

Definition at line 2352 of file CbcModel.hpp.

int CbcModel::phase_ [private]

Current phase (so heuristics etc etc can find out).

0 - initial solve 1 - solve with cuts at root 2 - solve with cuts 3 - other e.g. strong branching 4 - trying to validate a solution 5 - at end of search

Definition at line 2361 of file CbcModel.hpp.

Number of entries in addedCuts_.

Definition at line 2364 of file CbcModel.hpp.

int CbcModel::maximumDepth_ [private]

Current limit on search tree depth.

The allocated size of walkback_. Increased as needed.

Definition at line 2370 of file CbcModel.hpp.

Array used to assemble the path between a node and the search tree root.

The array is resized when necessary. maximumDepth_ is the current allocated size.

Definition at line 2376 of file CbcModel.hpp.

The solver associated with this model.

Definition at line 2377 of file CbcModel.hpp.

const OsiRowCut ** CbcModel::lastCut_ [private]

The solver associated with this model.

Definition at line 2378 of file CbcModel.hpp.

int CbcModel::lastDepth_ [private]

The solver associated with this model.

Definition at line 2379 of file CbcModel.hpp.

The solver associated with this model.

Definition at line 2380 of file CbcModel.hpp.

int CbcModel::maximumCuts_ [private]

The solver associated with this model.

Definition at line 2381 of file CbcModel.hpp.

int * CbcModel::lastNumberCuts_ [private]

The solver associated with this model.

Definition at line 2382 of file CbcModel.hpp.

The list of cuts initially collected for this subproblem.

When the subproblem at this node is rebuilt, a set of cuts is collected for inclusion in the constraint system. If any of these cuts are subsequently removed because they have become loose, the corresponding entry is set to NULL.

Definition at line 2391 of file CbcModel.hpp.

OsiRowCut * CbcModel::nextRowCut_ [private]

A pointer to a row cut which will be added instead of normal branching.

After use it should be set to NULL.

Definition at line 2396 of file CbcModel.hpp.

Current node so can be used elsewhere.

Definition at line 2399 of file CbcModel.hpp.

int * CbcModel::integerVariable_ [private]

Indices of integer variables.

Definition at line 2402 of file CbcModel.hpp.

char * CbcModel::integerInfo_ [private]

Whether of not integer.

Definition at line 2404 of file CbcModel.hpp.

double * CbcModel::continuousSolution_ [private]

Holds solution at continuous (after cuts).

Definition at line 2406 of file CbcModel.hpp.

int * CbcModel::usedInSolution_ [private]

Array marked whenever a solution is found if non-zero.

Definition at line 2408 of file CbcModel.hpp.

Special options 0 bit (1) - check if cuts valid (if on debugger list) 1 bit (2) - use current basis to check integer solution (rather than all slack) 2 bit (4) - don't check integer solution (by solving LP) 3 bit (8) - fast analyze 4 bit (16) - non-linear model - so no well defined CoinPackedMatrix 5 bit (32) - keep names 6 bit (64) - try for dominated columns 7 bit (128) - SOS type 1 but all declared integer 8 bit (256) - Set to say solution just found, unset by doing cuts 9 bit (512) - Try reduced model after 100 nodes 10 bit (1024) - Switch on some heuristics even if seems unlikely 11 bit (2048) - Mark as in small branch and bound 12 bit (4096) - Funny cuts so do slow way (in some places) 13 bit (8192) - Funny cuts so do slow way (in other places) 14 bit (16384) - Use Cplex! for fathoming 15 bit (32768) - Try reduced model after 0 nodes 16 bit (65536) - Original model had integer bounds 17 bit (131072) - Perturbation switched off 18 bit (262144) - donor CbcModel 19 bit (524288) - recipient CbcModel.

Definition at line 2432 of file CbcModel.hpp.

More special options at present bottom 3 bits used for shadow price mode.

Definition at line 2436 of file CbcModel.hpp.

User node comparison function.

Definition at line 2438 of file CbcModel.hpp.

User feasibility function (see CbcFeasibleBase.hpp).

Definition at line 2440 of file CbcModel.hpp.

CbcTree * CbcModel::tree_ [private]

Tree.

Definition at line 2442 of file CbcModel.hpp.

A pointer to model to be used for subtrees.

Definition at line 2444 of file CbcModel.hpp.

Number of times any subtree stopped on nodes, time etc.

Definition at line 2446 of file CbcModel.hpp.

Variable selection function.

Definition at line 2448 of file CbcModel.hpp.

Cut modifier function.

Definition at line 2450 of file CbcModel.hpp.

Strategy.

Definition at line 2452 of file CbcModel.hpp.

Parent model.

Definition at line 2454 of file CbcModel.hpp.

const double * CbcModel::cbcColLower_ [private]

Whether to automatically do presolve before branch and bound.

0 - no 1 - ordinary presolve 2 - integer presolve (dodgy) Pointer to array[getNumCols()] (for speed) of column lower bounds

Definition at line 2461 of file CbcModel.hpp.

const double * CbcModel::cbcColUpper_ [private]

Pointer to array[getNumCols()] (for speed) of column upper bounds.

Definition at line 2463 of file CbcModel.hpp.

const double * CbcModel::cbcRowLower_ [private]

Pointer to array[getNumRows()] (for speed) of row lower bounds.

Definition at line 2465 of file CbcModel.hpp.

const double * CbcModel::cbcRowUpper_ [private]

Pointer to array[getNumRows()] (for speed) of row upper bounds.

Definition at line 2467 of file CbcModel.hpp.

const double * CbcModel::cbcColSolution_ [private]

Pointer to array[getNumCols()] (for speed) of primal solution vector.

Definition at line 2469 of file CbcModel.hpp.

const double * CbcModel::cbcRowPrice_ [private]

Pointer to array[getNumRows()] (for speed) of dual prices.

Definition at line 2471 of file CbcModel.hpp.

const double * CbcModel::cbcReducedCost_ [private]

Get a pointer to array[getNumCols()] (for speed) of reduced costs.

Definition at line 2473 of file CbcModel.hpp.

const double * CbcModel::cbcRowActivity_ [private]

Pointer to array[getNumRows()] (for speed) of row activity levels.

Definition at line 2475 of file CbcModel.hpp.

void * CbcModel::appData_ [private]

Pointer to user-defined data structure.

Definition at line 2477 of file CbcModel.hpp.

int CbcModel::presolve_ [private]

Presolve for CbcTreeLocal.

Definition at line 2479 of file CbcModel.hpp.

int CbcModel::numberStrong_ [private]

Maximum number of candidates to consider for strong branching.

To disable strong branching, set this to 0.

Definition at line 2483 of file CbcModel.hpp.

The number of branches before pseudo costs believed in dynamic strong branching.

A value of 0 is off.

Definition at line 2489 of file CbcModel.hpp.

The number of variables for which to compute penalties in dynamic strong branching.

Definition at line 2493 of file CbcModel.hpp.

For threads - stop after this many "iterations".

Definition at line 2495 of file CbcModel.hpp.

Scale factor to make penalties match strong.

Should/will be computed

Definition at line 2498 of file CbcModel.hpp.

Number of analyze iterations to do.

Definition at line 2500 of file CbcModel.hpp.

double * CbcModel::analyzeResults_ [private]

Arrays with analysis results.

Definition at line 2502 of file CbcModel.hpp.

Number of nodes infeasible by normal branching (before cuts).

Definition at line 2504 of file CbcModel.hpp.

int CbcModel::problemType_ [private]

Problem type as set by user or found by analysis.

This will be extended 0 - not known 1 - Set partitioning <= 2 - Set partitioning == 3 - Set covering

Definition at line 2511 of file CbcModel.hpp.

Print frequency.

Definition at line 2513 of file CbcModel.hpp.

Number of cut generators.

Definition at line 2515 of file CbcModel.hpp.

The solver associated with this model.

Definition at line 2517 of file CbcModel.hpp.

The solver associated with this model.

Definition at line 2519 of file CbcModel.hpp.

Number of heuristics.

Definition at line 2521 of file CbcModel.hpp.

Heuristic solvers.

Definition at line 2523 of file CbcModel.hpp.

Pointer to heuristic solver which found last solution (or NULL).

Definition at line 2525 of file CbcModel.hpp.

Pointer to the event handler

Definition at line 2534 of file CbcModel.hpp.

int CbcModel::numberObjects_ [private]

Total number of objects.

Definition at line 2538 of file CbcModel.hpp.

OsiObject ** CbcModel::object_ [private]

Integer and Clique and ...

information

Note:
The code assumes that the first objects on the list will be SimpleInteger objects for each integer variable, followed by Clique objects. Portions of the code that understand Clique objects will fail if they do not immediately follow the SimpleIntegers. Large chunks of the code will fail if the first objects are not SimpleInteger. As of 2003.08, SimpleIntegers and Cliques are the only objects.

Definition at line 2550 of file CbcModel.hpp.

bool CbcModel::ownObjects_ [private]

Now we may not own objects - just point to solver's objects.

Definition at line 2552 of file CbcModel.hpp.

int * CbcModel::originalColumns_ [private]

Original columns as created by integerPresolve or preprocessing.

Definition at line 2555 of file CbcModel.hpp.

How often to scan global cuts.

Definition at line 2557 of file CbcModel.hpp.

Number of times global cuts violated.

When global cut pool then this should be kept for each cut and type of cut

Definition at line 2560 of file CbcModel.hpp.

Number of extra iterations in fast lp.

Definition at line 2562 of file CbcModel.hpp.

Number of extra nodes in fast lp.

Definition at line 2564 of file CbcModel.hpp.

Value of objective at continuous (Well actually after initial round of cuts).

Definition at line 2568 of file CbcModel.hpp.

Value of objective before root node cuts added.

Definition at line 2571 of file CbcModel.hpp.

Number of infeasibilities at continuous.

Definition at line 2573 of file CbcModel.hpp.

Maximum number of cut passes at root.

Definition at line 2575 of file CbcModel.hpp.

Maximum number of cut passes.

Definition at line 2577 of file CbcModel.hpp.

int CbcModel::preferredWay_ [private]

Preferred way of branching.

Definition at line 2579 of file CbcModel.hpp.

Current cut pass number.

Definition at line 2581 of file CbcModel.hpp.

int CbcModel::maximumWhich_ [private]

Maximum number of cuts (for whichGenerator_).

Definition at line 2583 of file CbcModel.hpp.

int CbcModel::maximumRows_ [private]

Maximum number of rows.

Definition at line 2585 of file CbcModel.hpp.

int CbcModel::currentDepth_ [private]

Current depth.

Definition at line 2587 of file CbcModel.hpp.

CoinThreadRandom CbcModel::randomNumberGenerator_ [mutable, private]

Thread specific random number generator.

Definition at line 2589 of file CbcModel.hpp.

CoinWarmStartBasis CbcModel::workingBasis_ [private]

Work basis for temporary use.

Definition at line 2591 of file CbcModel.hpp.

int * CbcModel::whichGenerator_ [private]

Which cut generator generated this cut.

Definition at line 2593 of file CbcModel.hpp.

Maximum number of statistics.

Definition at line 2595 of file CbcModel.hpp.

statistics

Definition at line 2597 of file CbcModel.hpp.

Maximum depth reached.

Definition at line 2599 of file CbcModel.hpp.

double CbcModel::numberDJFixed_ [private]

Number of reduced cost fixings.

Definition at line 2601 of file CbcModel.hpp.

CglTreeProbingInfo * CbcModel::probingInfo_ [private]

Probing info.

Definition at line 2603 of file CbcModel.hpp.

Number of fixed by analyze at root.

Definition at line 2605 of file CbcModel.hpp.

Number fixed by analyze so far.

Definition at line 2607 of file CbcModel.hpp.

bool CbcModel::stoppedOnGap_ [private]

Whether stopping on gap.

Definition at line 2609 of file CbcModel.hpp.

bool CbcModel::eventHappened_ [mutable, private]

Whether event happened.

Definition at line 2611 of file CbcModel.hpp.

Number of long strong goes.

Definition at line 2613 of file CbcModel.hpp.

Number of old active cuts.

Definition at line 2615 of file CbcModel.hpp.

int CbcModel::numberNewCuts_ [private]

Number of new cuts.

Definition at line 2617 of file CbcModel.hpp.

Strategy worked out - mainly at root node.

Definition at line 2619 of file CbcModel.hpp.

Number of iterations in strong branching.

Definition at line 2621 of file CbcModel.hpp.

int CbcModel::strongInfo_ [private]

0 - number times strong branching done, 1 - number fixed, 2 - number infeasible Second group of three is a snapshot at node [6]

Definition at line 2624 of file CbcModel.hpp.

OsiBabSolver * CbcModel::solverCharacteristics_ [private]

For advanced applications you may wish to modify the behavior of Cbc e.g.

if the solver is a NLP solver then you may not have an exact optimum solution at each step. This gives characteristics - just for one BAB. For actually saving/restoring a solution you need the actual solver one.

Definition at line 2631 of file CbcModel.hpp.

Whether to force a resolve after takeOffCuts.

Definition at line 2633 of file CbcModel.hpp.

Maximum number of iterations (designed to be used in heuristics).

Definition at line 2635 of file CbcModel.hpp.

Anything with priority >= this can be treated as continuous.

Definition at line 2637 of file CbcModel.hpp.

Number of outstanding update information items.

Definition at line 2639 of file CbcModel.hpp.

Maximum number of outstanding update information items.

Definition at line 2641 of file CbcModel.hpp.

Update items.

Definition at line 2643 of file CbcModel.hpp.

CglStored * CbcModel::storedRowCuts_ [private]

Stored row cuts for donor/recipient CbcModel.

Definition at line 2645 of file CbcModel.hpp.

int CbcModel::numberThreads_ [private]

Parallel 0 - off 1 - testing 2-99 threads other special meanings.

Definition at line 2653 of file CbcModel.hpp.

int CbcModel::threadMode_ [private]

thread mode always use numberThreads for branching 1 set then deterministic 2 set then use numberThreads for root cuts 4 set then use numberThreads in root mini branch and bound default is 0

Definition at line 2661 of file CbcModel.hpp.

Thread stuff for master.

Definition at line 2663 of file CbcModel.hpp.

Pointer to masterthread.

Definition at line 2665 of file CbcModel.hpp.


The documentation for this class was generated from the following files: