#include <AbcModel.h>
Inheritance diagram for AbcModel:
Public Types | |
AbcMaxNumNode = 0 | |
The maximum number of nodes before terminating. | |
AbcMaxNumSol | |
The maximum number of solutions before terminating. | |
AbcFathomDiscipline | |
Fathoming discipline Controls objective function comparisons for purposes of fathoming by bound or determining monotonic variables. | |
AbcLastIntParam | |
Just a marker, so that a static sized array can store parameters. | |
AbcIntegerTolerance = 0 | |
The maximum amount the value of an integer variable can vary from integer and still be considered feasible. | |
AbcInfeasibilityWeight | |
The objective is assumed to worsen by this amount for each integer infeasibility. | |
AbcCutoffIncrement | |
The amount by which to tighten the objective function cutoff when a new solution is discovered. | |
AbcAllowableGap | |
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. | |
AbcMaximumSeconds | |
The maximum number of seconds before terminating. | |
AbcLastDblParam | |
Just a marker, so that a static sized array can store parameters. | |
enum | AbcIntParam { AbcMaxNumNode = 0, AbcMaxNumSol, AbcFathomDiscipline, AbcLastIntParam } |
enum | AbcDblParam { AbcIntegerTolerance = 0, AbcInfeasibilityWeight, AbcCutoffIncrement, AbcAllowableGap, AbcMaximumSeconds, AbcLastDblParam } |
Public Member Functions | |
AbcModel () | |
AbcModel (const OsiSolverInterface &rhs) | |
~AbcModel () | |
void | init () |
Initialize member data. | |
virtual void | readInstance (const char *dataFile) |
Read in the problem data. | |
void | readParameters (const int argnum, const char *const *arglist) |
Read in Alps and Abc parameters. | |
AbcParams * | AbcPar () |
OsiSolverInterface * | solver () const |
Returns solver - has current state. | |
void | assignSolver (OsiSolverInterface *&solver) |
Assign a solver to the model (model assumes ownership) On return, solver will be NULL. | |
CoinWarmStartBasis * | 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. | |
int | numberIntegers () const |
Number of integers in problem. | |
const int * | integerVariable () const |
Integer variables. | |
bool | checkInteger (double value) const |
void | findIntegers (bool startAgain) |
Identify integer variables and create corresponding objects. | |
void | addCutGenerator (CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false) |
Add one generator - up to user to delete generators. | |
void | reducedCostFix () |
Perform reduced cost fixing Fixes integer variables at their current value based on reduced cost penalties. | |
void | takeOffCuts () |
Remove inactive cuts from the model. | |
bool | setIntParam (AbcIntParam key, int value) |
Set an integer parameter. | |
bool | setDblParam (AbcDblParam key, double value) |
Set a double parameter. | |
int | getIntParam (AbcIntParam key) const |
Get an integer parameter. | |
double | getDblParam (AbcDblParam key) const |
Get a double parameter. | |
void | 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 | 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 | 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. | |
void | setMinimumDrop (double value) |
Set the minimum drop to continue cuts. | |
double | getMinimumDrop () const |
Get the minimum drop to continue cuts. | |
virtual bool | setupSelf () |
Do necessary work to make model usable. | |
int | numberStrong () const |
void | setNumberStrong (int number) |
const int * | priority () const |
Priorities. | |
int | priority (int sequence) const |
Returns priority level for an object (or 1000 if no priorities exist). | |
virtual AlpsEncoded * | encode () const |
The method that encodes the model into a encoded object. | |
virtual void | decodeToSelf (AlpsEncoded &) |
The method that decodes the model from a encoded object. | |
Solve methods | |
void | initialSolve () |
Solve the initial LP relaxation Invoke the solver's initialSolve() method. | |
bool | solveWithCuts (OsiCuts &cuts, int numberTries, AbcTreeNode *node, int &numberOldActiveCuts, int &numberNewCuts, int &maximumWhich, int *&whichGenerator, const bool cutDuringRampup, int &found) |
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. | |
bool | resolve () |
Reoptimise an LP relaxation Invoke the solver's resolve() method. | |
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 | isNodeLimitReached () const |
Node limit reached? | |
bool | isSolutionLimitReached () const |
Solution limit reached? | |
int | getIterationCount () const |
Get 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 s=1) |
Increment the count of nodes. | |
int | status () const |
Final status of problem 0 finished, 1 stopped, 2 difficulties. | |
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. | |
void | setNumberRowsAtContinous (const int value) |
Number of rows in continuous (root) problem. | |
int | getNumCols () const |
Get number of columns. | |
int | getNumRows () const |
Get number of rows. | |
int | getNumElements () const |
Get number of nonzero elements. | |
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). | |
AbcPseudocost ** | getPseudoList () |
Number of rows in continuous (root) problem. | |
int * | getPseudoIndices () |
Number of rows in continuous (root) problem. | |
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. | |
Methods related to querying the solution | |
double | checkSolution (double cutoff, const double *solution, bool fixVariables) |
Call this to really test if a valid solution can be feasible Solution is number columns in size. | |
bool | setBestSolution (ABC_Message how, double &objectiveValue, const double *solution, bool fixVariables=false) |
Record a new incumbent solution and update objectiveValue. | |
bool | feasibleSolution (int &numberIntegerInfeasibilities) |
Test the current solution for feasiblility. | |
double * | currentSolution () const |
Solution to the most recent lp relaxation. | |
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 | getObjValue () const |
Get best objective function value. | |
void | setObjValue (double obj) |
Set the best objective value. | |
const double * | bestSolution () const |
The best solution to the integer programming problem. | |
int | getSolutionCount () const |
Get number of solutions. | |
void | setSolutionCount (int value) |
Set number of solutions (so heuristics will be different). | |
int | getNumberHeuristicSolutions () const |
Get number of heuristic solutions. | |
void | setObjSense (double s) |
Set objective function sense (1 for min (default), -1 for max,). | |
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 | currentNumberCuts () const |
Number of entries in the list returned by addedCuts(). | |
void | setCurrentNumberCuts (int value) |
Call this to really test if a valid solution can be feasible Solution is number columns in size. | |
Branching Decisions | |
AbcBranchDecision * | branchingMethod () const |
Get the current branching decision method. | |
void | setBranchingMethod (AbcBranchDecision *method) |
Set the branching decision method. | |
void | setBranchingMethod (AbcBranchDecision &method) |
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. | |
Message handling | |
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. | |
Heuristics and priorities | |
void | addHeuristic (AbcHeuristic *generator) |
Add one heuristic. | |
Private Attributes | |
CoinMessageHandler * | handler_ |
Message handler. | |
bool | defaultHandler_ |
Flag to say if handler_ is the default handler. | |
CoinMessages | messages_ |
Abc messages. | |
int | intParam_ [AbcLastIntParam] |
Array for integer parameters. | |
double | dblParam_ [AbcLastDblParam] |
Array for double parameters. | |
OsiSolverInterface * | solver_ |
The solver associated with this model. | |
bool | ourSolver_ |
Ownership of the solver object The convention is that AbcModel owns the null solver. | |
OsiSolverInterface * | continuousSolver_ |
A copy of the solver, taken at the continuous (root) node. | |
CoinWarmStartBasis * | basis_ |
Pointer to a warm start basis. | |
CoinWarmStartBasis * | lastws_ |
Pointer to last warm basis. | |
double | minimumDrop_ |
Minimum degradation in objective value to continue cut generation. | |
double | bestObjective_ |
Best objective. | |
double * | bestSolution_ |
Array holding the incumbent (best) solution. | |
double * | currentSolution_ |
Array holding the current solution. | |
OsiCuts | globalCuts_ |
Global cuts. | |
int | numberNodes_ |
Cumulative number of nodes. | |
int | numberIterations_ |
Cumulative number of iterations. | |
int | status_ |
Status of problem - 0 finished, 1 stopped, 2 difficulties. | |
int | currentNumberCuts_ |
Number of entries in addedCuts_. | |
int | maximumNumberCuts_ |
Maximum number of cuts. | |
int | howOftenGlobalScan_ |
How often to scan global cuts. | |
int | maximumDepth_ |
Current limit on search tree depth. | |
int | numberStrong_ |
Maximum number of candidates to consider for strong branching. | |
int | numberCutGenerators_ |
Number of cut generators. | |
AbcCutGenerator ** | generator_ |
int | numberHeuristics_ |
Number of heuristics. | |
AbcHeuristic ** | heuristic_ |
int | maximumCutPassesAtRoot_ |
Maximum number of cut passes at root. | |
int | maximumCutPasses_ |
Maximum number of cut passes. | |
AbcBranchDecision * | branchingMethod_ |
Variable selection function. | |
int | numberSolutions_ |
Number of solutions. | |
int | numberHeuristicSolutions_ |
Number of heuristic solutions. | |
int * | priority_ |
Priorities. | |
AbcPseudocost ** | pseudoList_ |
int * | pseudoIndices_ |
AbcParams * | AbcPar_ |
Abc parameters. | |
Shared problem data | |
int | numberRowsAtContinuous_ |
Number of rows at continuous. | |
int | numberIntegers_ |
Number of integers in problem. | |
int * | integerVariable_ |
Indices of integer variables. | |
CoinWarmStartBasis * | sharedBasis_ |
Pointer to a warm start basis. |
Definition at line 55 of file AbcModel.h.
Definition at line 58 of file AbcModel.h.
Definition at line 75 of file AbcModel.h.
AbcModel::AbcModel | ( | ) | [inline] |
AbcModel::AbcModel | ( | const OsiSolverInterface & | rhs | ) | [inline] |
Definition at line 227 of file AbcModel.h.
References OsiSolverInterface::clone(), continuousSolver_, currentSolution_, OsiSolverInterface::getNumCols(), init(), integerVariable_, OsiSolverInterface::isInteger(), numberIntegers_, ourSolver_, and solver_.
AbcModel::~AbcModel | ( | ) | [inline] |
Definition at line 258 of file AbcModel.h.
References AbcPar_, basis_, bestSolution_, continuousSolver_, currentSolution_, generator_, getNumCols(), handler_, heuristic_, integerVariable_, numberCutGenerators_, ourSolver_, priority_, pseudoIndices_, pseudoList_, sharedBasis_, and solver_.
void AbcModel::init | ( | ) | [inline] |
Initialize member data.
Definition at line 329 of file AbcModel.h.
References AbcAllowableGap, AbcCutoffIncrement, AbcFathomDiscipline, AbcInfeasibilityWeight, AbcIntegerTolerance, AbcMaximumSeconds, AbcMaxNumNode, AbcMaxNumSol, AbcPar_, basis_, bestObjective_, bestSolution_, branchingMethod_, continuousSolver_, currentNumberCuts_, currentSolution_, dblParam_, defaultHandler_, generator_, handler_, heuristic_, howOftenGlobalScan_, integerVariable_, intParam_, maximumCutPasses_, maximumCutPassesAtRoot_, maximumNumberCuts_, messages_, minimumDrop_, numberCutGenerators_, numberHeuristics_, numberHeuristicSolutions_, numberIntegers_, numberIterations_, numberNodes_, numberRowsAtContinuous_, numberSolutions_, numberStrong_, ourSolver_, priority_, pseudoIndices_, pseudoList_, CoinMessageHandler::setLogLevel(), sharedBasis_, solver_, and status_.
Referenced by AbcModel().
virtual void AbcModel::readInstance | ( | const char * | dataFile | ) | [inline, virtual] |
Read in the problem data.
Reimplemented from AlpsModel.
Definition at line 382 of file AbcModel.h.
References OsiSolverInterface::readMps(), and solver().
void AbcModel::readParameters | ( | const int | argnum, | |
const char *const * | arglist | |||
) | [inline, virtual] |
Read in Alps and Abc parameters.
Reimplemented from AlpsModel.
Definition at line 388 of file AbcModel.h.
References AbcPar_, AlpsModel::AlpsPar_, and AlpsParameterSet::readFromArglist().
AbcParams* AbcModel::AbcPar | ( | ) | [inline] |
OsiSolverInterface* AbcModel::solver | ( | ) | const [inline] |
Returns solver - has current state.
Definition at line 398 of file AbcModel.h.
References solver_.
Referenced by AbcNodeDesc::AbcNodeDesc(), and readInstance().
void AbcModel::assignSolver | ( | OsiSolverInterface *& | solver | ) |
Assign a solver to the model (model assumes ownership) On return, solver
will be NULL.
CoinWarmStartBasis* AbcModel::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 AbcModel::numberIntegers | ( | ) | const [inline] |
Number of integers in problem.
Definition at line 414 of file AbcModel.h.
References numberIntegers_.
const int* AbcModel::integerVariable | ( | ) | const [inline] |
void AbcModel::initialSolve | ( | ) |
Solve the initial LP relaxation Invoke the solver's initialSolve() method.
bool AbcModel::solveWithCuts | ( | OsiCuts & | cuts, | |
int | numberTries, | |||
AbcTreeNode * | node, | |||
int & | numberOldActiveCuts, | |||
int & | numberNewCuts, | |||
int & | maximumWhich, | |||
int *& | whichGenerator, | |||
const bool | cutDuringRampup, | |||
int & | found | |||
) |
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.
bool AbcModel::resolve | ( | ) |
Reoptimise an LP relaxation Invoke the solver's resolve() method.
bool AbcModel::isAbandoned | ( | ) | const |
Are there a numerical difficulties?
bool AbcModel::isProvenOptimal | ( | ) | const |
Is optimality proven?
bool AbcModel::isProvenInfeasible | ( | ) | const |
Is infeasiblity proven (or none better than cutoff)?
bool AbcModel::isNodeLimitReached | ( | ) | const |
Node limit reached?
bool AbcModel::isSolutionLimitReached | ( | ) | const |
Solution limit reached?
int AbcModel::getIterationCount | ( | ) | const [inline] |
Get how many iterations it took to solve the problem.
Definition at line 461 of file AbcModel.h.
References OsiSolverInterface::getIterationCount(), and solver_.
int AbcModel::getNodeCount | ( | ) | const [inline] |
Get how many Nodes it took to solve the problem.
Definition at line 464 of file AbcModel.h.
References numberNodes_.
void AbcModel::incrementNodeCount | ( | int | s = 1 |
) | [inline] |
int AbcModel::status | ( | ) | const [inline] |
Final status of problem 0 finished, 1 stopped, 2 difficulties.
Definition at line 473 of file AbcModel.h.
References status_.
int AbcModel::numberRowsAtContinuous | ( | ) | const [inline] |
Number of rows in continuous (root) problem.
Definition at line 491 of file AbcModel.h.
References numberRowsAtContinuous_.
void AbcModel::setNumberRowsAtContinous | ( | const int | value | ) | [inline] |
Number of rows in continuous (root) problem.
Definition at line 494 of file AbcModel.h.
References numberRowsAtContinuous_.
int AbcModel::getNumCols | ( | ) | const [inline] |
Get number of columns.
Definition at line 501 of file AbcModel.h.
References OsiSolverInterface::getNumCols(), and solver_.
Referenced by AbcNodeDesc::lowerBounds(), AbcNodeDesc::setLowerBound(), AbcNodeDesc::setUpperBound(), AbcNodeDesc::upperBounds(), and ~AbcModel().
int AbcModel::getNumRows | ( | ) | const [inline] |
Get number of rows.
Definition at line 505 of file AbcModel.h.
References OsiSolverInterface::getNumRows(), and solver_.
int AbcModel::getNumElements | ( | ) | const [inline] |
Get number of nonzero elements.
Definition at line 509 of file AbcModel.h.
References OsiSolverInterface::getNumElements(), and solver_.
const double* AbcModel::getColLower | ( | ) | const [inline] |
Get pointer to array[getNumCols()] of column lower bounds.
Definition at line 513 of file AbcModel.h.
References OsiSolverInterface::getColLower(), and solver_.
Referenced by AbcNodeDesc::lowerBounds().
const double* AbcModel::getColUpper | ( | ) | const [inline] |
Get pointer to array[getNumCols()] of column upper bounds.
Definition at line 517 of file AbcModel.h.
References OsiSolverInterface::getColUpper(), and solver_.
Referenced by AbcNodeDesc::upperBounds().
const char* AbcModel::getRowSense | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of row constraint senses.
Definition at line 529 of file AbcModel.h.
References OsiSolverInterface::getRowSense(), and solver_.
const double* AbcModel::getRightHandSide | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of rows right-hand sides.
Definition at line 540 of file AbcModel.h.
References OsiSolverInterface::getRightHandSide(), and solver_.
const double* AbcModel::getRowRange | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of row ranges.
Definition at line 551 of file AbcModel.h.
References OsiSolverInterface::getRowRange(), and solver_.
const double* AbcModel::getRowLower | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of row lower bounds.
Definition at line 555 of file AbcModel.h.
References OsiSolverInterface::getRowLower(), and solver_.
const double* AbcModel::getRowUpper | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of row upper bounds.
Definition at line 559 of file AbcModel.h.
References OsiSolverInterface::getRowUpper(), and solver_.
const double* AbcModel::getObjCoefficients | ( | ) | const [inline] |
Get pointer to array[getNumCols()] of objective function coefficients.
Definition at line 563 of file AbcModel.h.
References OsiSolverInterface::getObjCoefficients(), and solver_.
double AbcModel::getObjSense | ( | ) | const [inline] |
Get objective function sense (1 for min (default), -1 for max).
Definition at line 567 of file AbcModel.h.
References OsiSolverInterface::getObjSense(), and solver_.
AbcPseudocost** AbcModel::getPseudoList | ( | ) | [inline] |
Number of rows in continuous (root) problem.
Definition at line 570 of file AbcModel.h.
References pseudoList_.
int* AbcModel::getPseudoIndices | ( | ) | [inline] |
Number of rows in continuous (root) problem.
Definition at line 573 of file AbcModel.h.
References pseudoIndices_.
bool AbcModel::isContinuous | ( | int | colIndex | ) | const [inline] |
Return true if variable is continuous.
Definition at line 576 of file AbcModel.h.
References OsiSolverInterface::isContinuous(), and solver_.
bool AbcModel::isBinary | ( | int | colIndex | ) | const [inline] |
Return true if variable is binary.
Definition at line 580 of file AbcModel.h.
References OsiSolverInterface::isBinary(), and solver_.
bool AbcModel::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 587 of file AbcModel.h.
References OsiSolverInterface::isInteger(), and solver_.
bool AbcModel::isIntegerNonBinary | ( | int | colIndex | ) | const [inline] |
Return true if variable is general integer.
Definition at line 591 of file AbcModel.h.
References OsiSolverInterface::isIntegerNonBinary(), and solver_.
bool AbcModel::isFreeBinary | ( | int | colIndex | ) | const [inline] |
Return true if variable is binary and not fixed at either bound.
Definition at line 595 of file AbcModel.h.
References OsiSolverInterface::isFreeBinary(), and solver_.
const CoinPackedMatrix* AbcModel::getMatrixByRow | ( | ) | const [inline] |
Get pointer to row-wise copy of matrix.
Definition at line 599 of file AbcModel.h.
References OsiSolverInterface::getMatrixByRow(), and solver_.
const CoinPackedMatrix* AbcModel::getMatrixByCol | ( | ) | const [inline] |
Get pointer to column-wise copy of matrix.
Definition at line 603 of file AbcModel.h.
References OsiSolverInterface::getMatrixByCol(), and solver_.
double AbcModel::getInfinity | ( | ) | const [inline] |
Get solver's value for infinity.
Definition at line 607 of file AbcModel.h.
References OsiSolverInterface::getInfinity(), and solver_.
double AbcModel::checkSolution | ( | double | cutoff, | |
const double * | solution, | |||
bool | fixVariables | |||
) |
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)
bool AbcModel::setBestSolution | ( | ABC_Message | how, | |
double & | objectiveValue, | |||
const double * | solution, | |||
bool | fixVariables = false | |||
) |
Record a new incumbent solution and update objectiveValue.
bool AbcModel::feasibleSolution | ( | int & | numberIntegerInfeasibilities | ) |
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 ().
double* AbcModel::currentSolution | ( | ) | const [inline] |
Solution to the most recent lp relaxation.
The solver's solution to the most recent lp relaxation.
Definition at line 639 of file AbcModel.h.
References currentSolution_.
const double* AbcModel::getColSolution | ( | ) | const [inline] |
Get pointer to array[getNumCols()] of primal solution vector.
Definition at line 643 of file AbcModel.h.
References OsiSolverInterface::getColSolution(), and solver_.
const double* AbcModel::getRowPrice | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of dual prices.
Definition at line 647 of file AbcModel.h.
References OsiSolverInterface::getRowPrice(), and solver_.
const double* AbcModel::getReducedCost | ( | ) | const [inline] |
Get a pointer to array[getNumCols()] of reduced costs.
Definition at line 651 of file AbcModel.h.
References OsiSolverInterface::getReducedCost(), and solver_.
const double* AbcModel::getRowActivity | ( | ) | const [inline] |
Get pointer to array[getNumRows()] of row activity levels.
Definition at line 655 of file AbcModel.h.
References OsiSolverInterface::getRowActivity(), and solver_.
double AbcModel::getCurrentObjValue | ( | ) | const [inline] |
Get current objective function value.
Definition at line 659 of file AbcModel.h.
References OsiSolverInterface::getObjValue(), and solver_.
double AbcModel::getObjValue | ( | ) | const [inline] |
Get best objective function value.
Definition at line 663 of file AbcModel.h.
References bestObjective_.
void AbcModel::setObjValue | ( | double | obj | ) | [inline] |
Set the best objective value.
It is not necessary the value from the bestSolution_. It can be get from other processes.
Definition at line 668 of file AbcModel.h.
References bestObjective_.
const double* AbcModel::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 676 of file AbcModel.h.
References bestSolution_.
int AbcModel::getSolutionCount | ( | ) | const [inline] |
void AbcModel::setSolutionCount | ( | int | value | ) | [inline] |
Set number of solutions (so heuristics will be different).
Definition at line 684 of file AbcModel.h.
References numberSolutions_.
int AbcModel::getNumberHeuristicSolutions | ( | ) | const [inline] |
Get number of heuristic solutions.
Definition at line 688 of file AbcModel.h.
References numberHeuristicSolutions_.
void AbcModel::setObjSense | ( | double | s | ) | [inline] |
Set objective function sense (1 for min (default), -1 for max,).
Definition at line 692 of file AbcModel.h.
References OsiSolverInterface::setObjSense(), and solver_.
void AbcModel::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 696 of file AbcModel.h.
References maximumCutPassesAtRoot_.
int AbcModel::getMaximumCutPassesAtRoot | ( | ) | const [inline] |
Get the maximum number of cut passes at root node.
Definition at line 699 of file AbcModel.h.
References maximumCutPassesAtRoot_.
void AbcModel::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 704 of file AbcModel.h.
References maximumCutPasses_.
int AbcModel::getMaximumCutPasses | ( | ) | const [inline] |
Get the maximum number of cut passes at other nodes (default 10).
Definition at line 707 of file AbcModel.h.
References maximumCutPasses_.
int AbcModel::currentNumberCuts | ( | ) | const [inline] |
Number of entries in the list returned by addedCuts().
Definition at line 710 of file AbcModel.h.
References currentNumberCuts_.
void AbcModel::setCurrentNumberCuts | ( | int | value | ) | [inline] |
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)
Definition at line 712 of file AbcModel.h.
References currentNumberCuts_.
AbcBranchDecision* AbcModel::branchingMethod | ( | ) | const [inline] |
Get the current branching decision method.
Definition at line 727 of file AbcModel.h.
References branchingMethod_.
void AbcModel::setBranchingMethod | ( | AbcBranchDecision * | method | ) | [inline] |
Set the branching decision method.
Definition at line 730 of file AbcModel.h.
References branchingMethod_.
void AbcModel::setBranchingMethod | ( | AbcBranchDecision & | 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 735 of file AbcModel.h.
References branchingMethod_.
void AbcModel::passInMessageHandler | ( | CoinMessageHandler * | handler | ) | [inline] |
Pass in Message handler (not deleted at end).
Definition at line 744 of file AbcModel.h.
References defaultHandler_, and handler_.
void AbcModel::newLanguage | ( | CoinMessages::Language | language | ) | [inline] |
Set language.
Definition at line 755 of file AbcModel.h.
References messages_.
Referenced by setLanguage().
void AbcModel::setLanguage | ( | CoinMessages::Language | language | ) | [inline] |
Pass in Message handler (not deleted at end).
Definition at line 757 of file AbcModel.h.
References newLanguage().
CoinMessageHandler* AbcModel::messageHandler | ( | ) | const [inline] |
CoinMessages AbcModel::messages | ( | ) | [inline] |
CoinMessages* AbcModel::messagesPointer | ( | ) | [inline] |
bool AbcModel::checkInteger | ( | double | value | ) | const [inline] |
Definition at line 772 of file AbcModel.h.
References AbcIntegerTolerance, flopc::floor(), and getDblParam().
void AbcModel::findIntegers | ( | bool | startAgain | ) |
Identify integer variables and create corresponding objects.
Record integer variables and create an integer object for each one. If startAgain
is true, a new scan is forced, overwriting any existing integer variable information.
void AbcModel::addCutGenerator | ( | CglCutGenerator * | generator, | |
int | howOften = 1 , |
|||
const char * | name = NULL , |
|||
bool | normal = true , |
|||
bool | atSolution = false , |
|||
bool | infeasible = false | |||
) |
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
void AbcModel::addHeuristic | ( | AbcHeuristic * | generator | ) |
Add one heuristic.
void AbcModel::reducedCostFix | ( | ) |
Perform reduced cost fixing Fixes integer variables at their current value based on reduced cost penalties.
void AbcModel::takeOffCuts | ( | ) |
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.
bool AbcModel::setIntParam | ( | AbcIntParam | key, | |
int | value | |||
) | [inline] |
Set an integer parameter.
Definition at line 828 of file AbcModel.h.
References intParam_.
Referenced by setMaximumNodes(), and setMaximumSolutions().
bool AbcModel::setDblParam | ( | AbcDblParam | key, | |
double | value | |||
) | [inline] |
Set a double parameter.
Definition at line 834 of file AbcModel.h.
References dblParam_.
Referenced by setAllowableGap(), setInfeasibilityWeight(), and setIntegerTolerance().
int AbcModel::getIntParam | ( | AbcIntParam | key | ) | const [inline] |
Get an integer parameter.
Definition at line 840 of file AbcModel.h.
References intParam_.
Referenced by getMaximumNodes(), and getMaximumSolutions().
double AbcModel::getDblParam | ( | AbcDblParam | key | ) | const [inline] |
Get a double parameter.
Definition at line 845 of file AbcModel.h.
References dblParam_.
Referenced by checkInteger(), getAllowableGap(), getInfeasibilityWeight(), and getIntegerTolerance().
void AbcModel::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 AbcModel::getCutoff | ( | ) | const [inline] |
Get the cutoff bound on the objective function - always as minimize.
Definition at line 856 of file AbcModel.h.
References OsiSolverInterface::getDblParam(), OsiSolverInterface::getObjSense(), OsiDualObjectiveLimit, and solver_.
bool AbcModel::setMaximumNodes | ( | int | value | ) | [inline] |
Set the maximum node limit .
Definition at line 864 of file AbcModel.h.
References AbcMaxNumNode, and setIntParam().
int AbcModel::getMaximumNodes | ( | ) | const [inline] |
Get the maximum node limit .
Definition at line 868 of file AbcModel.h.
References AbcMaxNumNode, and getIntParam().
bool AbcModel::setMaximumSolutions | ( | int | value | ) | [inline] |
Set the maximum number of solutions desired.
Definition at line 875 of file AbcModel.h.
References AbcMaxNumSol, and setIntParam().
int AbcModel::getMaximumSolutions | ( | ) | const [inline] |
Get the maximum number of solutions desired.
Definition at line 882 of file AbcModel.h.
References AbcMaxNumSol, and getIntParam().
bool AbcModel::setIntegerTolerance | ( | double | value | ) | [inline] |
Set the integrality tolerance .
Definition at line 889 of file AbcModel.h.
References AbcIntegerTolerance, and setDblParam().
double AbcModel::getIntegerTolerance | ( | ) | const [inline] |
Get the integrality tolerance .
Definition at line 895 of file AbcModel.h.
References AbcIntegerTolerance, and getDblParam().
bool AbcModel::setInfeasibilityWeight | ( | double | value | ) | [inline] |
Set the weight per integer infeasibility .
Definition at line 903 of file AbcModel.h.
References AbcInfeasibilityWeight, and setDblParam().
double AbcModel::getInfeasibilityWeight | ( | ) | const [inline] |
Get the weight per integer infeasibility .
Definition at line 910 of file AbcModel.h.
References AbcInfeasibilityWeight, and getDblParam().
bool AbcModel::setAllowableGap | ( | double | value | ) | [inline] |
Set the allowable gap between the best known solution and the best possible solution.
Definition at line 917 of file AbcModel.h.
References AbcAllowableGap, and setDblParam().
double AbcModel::getAllowableGap | ( | ) | const [inline] |
Get the allowable gap between the best known solution and the best possible solution.
Definition at line 923 of file AbcModel.h.
References AbcAllowableGap, and getDblParam().
void AbcModel::setMinimumDrop | ( | double | value | ) | [inline] |
Set the minimum drop to continue cuts.
Definition at line 928 of file AbcModel.h.
References minimumDrop_.
double AbcModel::getMinimumDrop | ( | ) | const [inline] |
Get the minimum drop to continue cuts.
Definition at line 931 of file AbcModel.h.
References minimumDrop_.
virtual bool AbcModel::setupSelf | ( | ) | [virtual] |
int AbcModel::numberStrong | ( | ) | const [inline] |
void AbcModel::setNumberStrong | ( | int | number | ) | [inline] |
const int* AbcModel::priority | ( | ) | const [inline] |
int AbcModel::priority | ( | int | sequence | ) | const [inline] |
Returns priority level for an object (or 1000 if no priorities exist).
Definition at line 954 of file AbcModel.h.
References priority_.
virtual AlpsEncoded* AbcModel::encode | ( | ) | const [virtual] |
virtual void AbcModel::decodeToSelf | ( | AlpsEncoded & | ) | [virtual] |
int AbcModel::numberRowsAtContinuous_ [private] |
Number of rows at continuous.
Definition at line 105 of file AbcModel.h.
Referenced by init(), numberRowsAtContinuous(), and setNumberRowsAtContinous().
int AbcModel::numberIntegers_ [private] |
Number of integers in problem.
Definition at line 107 of file AbcModel.h.
Referenced by AbcModel(), init(), and numberIntegers().
int* AbcModel::integerVariable_ [private] |
Indices of integer variables.
Definition at line 109 of file AbcModel.h.
Referenced by AbcModel(), init(), integerVariable(), and ~AbcModel().
CoinWarmStartBasis* AbcModel::sharedBasis_ [private] |
Pointer to a warm start basis.
Definition at line 111 of file AbcModel.h.
Referenced by init(), and ~AbcModel().
CoinMessageHandler* AbcModel::handler_ [private] |
Message handler.
Definition at line 115 of file AbcModel.h.
Referenced by init(), messageHandler(), passInMessageHandler(), and ~AbcModel().
bool AbcModel::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 121 of file AbcModel.h.
Referenced by init(), and passInMessageHandler().
CoinMessages AbcModel::messages_ [private] |
Abc messages.
Definition at line 124 of file AbcModel.h.
Referenced by init(), messages(), messagesPointer(), and newLanguage().
int AbcModel::intParam_[AbcLastIntParam] [private] |
Array for integer parameters.
Definition at line 127 of file AbcModel.h.
Referenced by getIntParam(), init(), and setIntParam().
double AbcModel::dblParam_[AbcLastDblParam] [private] |
Array for double parameters.
Definition at line 130 of file AbcModel.h.
Referenced by getDblParam(), init(), and setDblParam().
OsiSolverInterface* AbcModel::solver_ [private] |
The solver associated with this model.
Definition at line 133 of file AbcModel.h.
Referenced by AbcModel(), getColLower(), getColSolution(), getColUpper(), getCurrentObjValue(), getCutoff(), getInfinity(), getIterationCount(), getMatrixByCol(), getMatrixByRow(), getNumCols(), getNumElements(), getNumRows(), getObjCoefficients(), getObjSense(), getReducedCost(), getRightHandSide(), getRowActivity(), getRowLower(), getRowPrice(), getRowRange(), getRowSense(), getRowUpper(), init(), isBinary(), isContinuous(), isFreeBinary(), isInteger(), isIntegerNonBinary(), setObjSense(), solver(), and ~AbcModel().
bool AbcModel::ourSolver_ [private] |
Ownership of the solver object The convention is that AbcModel owns the null solver.
Currently there is no public method to give AbcModel a solver without giving ownership, but the hook is here.
Definition at line 139 of file AbcModel.h.
Referenced by AbcModel(), init(), and ~AbcModel().
OsiSolverInterface* AbcModel::continuousSolver_ [private] |
A copy of the solver, taken at the continuous (root) node.
Definition at line 142 of file AbcModel.h.
Referenced by AbcModel(), init(), and ~AbcModel().
CoinWarmStartBasis* AbcModel::basis_ [private] |
Pointer to a warm start basis.
Definition at line 145 of file AbcModel.h.
Referenced by init(), and ~AbcModel().
CoinWarmStartBasis* AbcModel::lastws_ [private] |
double AbcModel::minimumDrop_ [private] |
Minimum degradation in objective value to continue cut generation.
Definition at line 151 of file AbcModel.h.
Referenced by getMinimumDrop(), init(), and setMinimumDrop().
double AbcModel::bestObjective_ [private] |
Best objective.
Definition at line 154 of file AbcModel.h.
Referenced by getObjValue(), init(), and setObjValue().
double* AbcModel::bestSolution_ [private] |
Array holding the incumbent (best) solution.
Definition at line 157 of file AbcModel.h.
Referenced by bestSolution(), init(), and ~AbcModel().
double* AbcModel::currentSolution_ [private] |
Array holding the current solution.
This array is used more as a temporary.
Definition at line 162 of file AbcModel.h.
Referenced by AbcModel(), currentSolution(), init(), and ~AbcModel().
OsiCuts AbcModel::globalCuts_ [private] |
int AbcModel::numberNodes_ [private] |
Cumulative number of nodes.
Definition at line 168 of file AbcModel.h.
Referenced by getNodeCount(), incrementNodeCount(), and init().
int AbcModel::numberIterations_ [private] |
int AbcModel::status_ [private] |
Status of problem - 0 finished, 1 stopped, 2 difficulties.
Definition at line 172 of file AbcModel.h.
int AbcModel::currentNumberCuts_ [private] |
Number of entries in addedCuts_.
Definition at line 174 of file AbcModel.h.
Referenced by currentNumberCuts(), init(), and setCurrentNumberCuts().
int AbcModel::maximumNumberCuts_ [private] |
int AbcModel::howOftenGlobalScan_ [private] |
int AbcModel::maximumDepth_ [private] |
Current limit on search tree depth.
The allocated size of walkback_. Increased as needed.
Definition at line 184 of file AbcModel.h.
int AbcModel::numberStrong_ [private] |
Maximum number of candidates to consider for strong branching.
To disable storng branching and use pseudocost branching, set this to 0.
Definition at line 190 of file AbcModel.h.
Referenced by init(), numberStrong(), and setNumberStrong().
int AbcModel::numberCutGenerators_ [private] |
Number of cut generators.
Definition at line 192 of file AbcModel.h.
Referenced by init(), and ~AbcModel().
AbcCutGenerator** AbcModel::generator_ [private] |
int AbcModel::numberHeuristics_ [private] |
AbcHeuristic** AbcModel::heuristic_ [private] |
int AbcModel::maximumCutPassesAtRoot_ [private] |
Maximum number of cut passes at root.
Definition at line 201 of file AbcModel.h.
Referenced by getMaximumCutPassesAtRoot(), init(), and setMaximumCutPassesAtRoot().
int AbcModel::maximumCutPasses_ [private] |
Maximum number of cut passes.
Definition at line 203 of file AbcModel.h.
Referenced by getMaximumCutPasses(), init(), and setMaximumCutPasses().
AbcBranchDecision* AbcModel::branchingMethod_ [private] |
Variable selection function.
Definition at line 206 of file AbcModel.h.
Referenced by branchingMethod(), init(), and setBranchingMethod().
int AbcModel::numberSolutions_ [private] |
Number of solutions.
Definition at line 208 of file AbcModel.h.
Referenced by getSolutionCount(), init(), and setSolutionCount().
int AbcModel::numberHeuristicSolutions_ [private] |
Number of heuristic solutions.
Definition at line 210 of file AbcModel.h.
Referenced by getNumberHeuristicSolutions(), and init().
int* AbcModel::priority_ [private] |
Priorities.
Definition at line 212 of file AbcModel.h.
Referenced by init(), priority(), and ~AbcModel().
AbcPseudocost** AbcModel::pseudoList_ [private] |
int* AbcModel::pseudoIndices_ [private] |
Definition at line 216 of file AbcModel.h.
Referenced by getPseudoIndices(), init(), and ~AbcModel().
AbcParams* AbcModel::AbcPar_ [private] |
Abc parameters.
Definition at line 219 of file AbcModel.h.
Referenced by AbcPar(), init(), readParameters(), and ~AbcModel().