- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Attributes | List of all members
AbcModel Class Reference

Model class for ALPS Branch and Cut. More...

`#include <AbcModel.h>`

Inheritance diagram for AbcModel:
[legend]
Collaboration diagram for AbcModel:
[legend]

## Public Types
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. More...
virtual void | readInstance (const char *dataFile)
| Read in the problem data. More...
void | readParameters (const int argnum, const char *const *arglist)
| Read in Alps and Abc parameters. More...
AbcParams * | AbcPar ()
OsiSolverInterface * | solver () const
| Returns solver - has current state. More...
void | assignSolver (OsiSolverInterface *&solver)
| Assign a solver to the model (model assumes ownership) On return, `solver` will be NULL. More...
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. More...
int | numberIntegers () const
| Number of integers in problem. More...
const int * | integerVariable () const
| Integer variables. More...
bool | checkInteger (double value) const
void | findIntegers (bool startAgain)
| Identify integer variables and create corresponding objects. More...
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. More...
void | reducedCostFix ()
| Perform reduced cost fixing Fixes integer variables at their current value based on reduced cost penalties. More...
void | takeOffCuts ()
| Remove inactive cuts from the model. More...
bool | setIntParam (AbcIntParam key, int value)
| Set an integer parameter. More...
bool | setDblParam (AbcDblParam key, double value)
| Set a double parameter. More...
int | getIntParam (AbcIntParam key) const
| Get an integer parameter. More...
double | getDblParam (AbcDblParam key) const
| Get a double parameter. More...
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. More...
double | getCutoff () const
| Get the cutoff bound on the objective function - always as minimize. More...
bool | setMaximumNodes (int value)
| Set the maximum node limit . More...
int | getMaximumNodes () const
| Get the maximum node limit . More...
bool | setMaximumSolutions (int value)
| Set the maximum number of solutions desired. More...
int | getMaximumSolutions () const
| Get the maximum number of solutions desired. More...
bool | setIntegerTolerance (double value)
| Set the integrality tolerance . More...
double | getIntegerTolerance () const
| Get the integrality tolerance . More...
bool | setInfeasibilityWeight (double value)
| Set the weight per integer infeasibility . More...
double | getInfeasibilityWeight () const
| Get the weight per integer infeasibility . More...
bool | setAllowableGap (double value)
| Set the allowable gap between the best known solution and the best possible solution. More...
double | getAllowableGap () const
| Get the allowable gap between the best known solution and the best possible solution. More...
void | setMinimumDrop (double value)
| Set the minimum drop to continue cuts. More...
double | getMinimumDrop () const
| Get the minimum drop to continue cuts. More...
virtual bool | setupSelf ()
| Do necessary work to make model usable. More...
int | numberStrong () const
void | setNumberStrong (int number)
const int * | priority () const
| Priorities. More...
int | priority (int sequence) const
| Returns priority level for an object (or 1000 if no priorities exist) More...
virtual AlpsEncoded * | encode () const
| The method that encodes the model into a encoded object. More...
virtual void | decodeToSelf (AlpsEncoded &)
| The method that decodes the model from a encoded object. More...
Solve methods
void | initialSolve ()
| Solve the initial LP relaxation Invoke the solver's initialSolve() method. More...
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. More...
bool | resolve ()
| Reoptimise an LP relaxation Invoke the solver's resolve() method. More...
Methods returning info on how the solution process terminated
bool | isAbandoned () const
| Are there a numerical difficulties? More...
bool | isProvenOptimal () const
| Is optimality proven? More...
bool | isProvenInfeasible () const
| Is infeasiblity proven (or none better than cutoff)? More...
bool | isNodeLimitReached () const
| Node limit reached? More...
bool | isSolutionLimitReached () const
| Solution limit reached? More...
int | getIterationCount () const
| Get how many iterations it took to solve the problem. More...
int | getNodeCount () const
| Get how many Nodes it took to solve the problem. More...
void | incrementNodeCount (int s=1)
| Increment the count of nodes. More...
int | status () const
| Final status of problem 0 finished, 1 stopped, 2 difficulties. More...
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. More...
void | setNumberRowsAtContinous (const int value)
| Number of rows in continuous (root) problem. More...
int | getNumCols () const
| Get number of columns. More...
int | getNumRows () const
| Get number of rows. More...
int | getNumElements () const
| Get number of nonzero elements. More...
const double * | getColLower () const
| Get pointer to array[getNumCols()] of column lower bounds. More...
const double * | getColUpper () const
| Get pointer to array[getNumCols()] of column upper bounds. More...
const char * | getRowSense () const
| Get pointer to array[getNumRows()] of row constraint senses. More...
const double * | getRightHandSide () const
| Get pointer to array[getNumRows()] of rows right-hand sides. More...
const double * | getRowRange () const
| Get pointer to array[getNumRows()] of row ranges. More...
const double * | getRowLower () const
| Get pointer to array[getNumRows()] of row lower bounds. More...
const double * | getRowUpper () const
| Get pointer to array[getNumRows()] of row upper bounds. More...
const double * | getObjCoefficients () const
| Get pointer to array[getNumCols()] of objective function coefficients. More...
double | getObjSense () const
| Get objective function sense (1 for min (default), -1 for max) More...
AbcPseudocost ** | getPseudoList ()
| Number of rows in continuous (root) problem. More...
int * | getPseudoIndices ()
| Number of rows in continuous (root) problem. More...
bool | isContinuous (int colIndex) const
| Return true if variable is continuous. More...
bool | isBinary (int colIndex) const
| Return true if variable is binary. More...
bool | isInteger (int colIndex) const
| Return true if column is integer. More...
bool | isIntegerNonBinary (int colIndex) const
| Return true if variable is general integer. More...
bool | isFreeBinary (int colIndex) const
| Return true if variable is binary and not fixed at either bound. More...
const CoinPackedMatrix * | getMatrixByRow () const
| Get pointer to row-wise copy of matrix. More...
const CoinPackedMatrix * | getMatrixByCol () const
| Get pointer to column-wise copy of matrix. More...
double | getInfinity () const
| Get solver's value for infinity. More...
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. More...
bool | setBestSolution (ABC_Message how, double &objectiveValue, const double *solution, bool fixVariables=false)
| Record a new incumbent solution and update objectiveValue. More...
bool | feasibleSolution (int &numberIntegerInfeasibilities)
| Test the current solution for feasiblility. More...
double * | currentSolution () const
| Solution to the most recent lp relaxation. More...
const double * | getColSolution () const
| Get pointer to array[getNumCols()] of primal solution vector. More...
const double * | getRowPrice () const
| Get pointer to array[getNumRows()] of dual prices. More...
const double * | getReducedCost () const
| Get a pointer to array[getNumCols()] of reduced costs. More...
const double * | getRowActivity () const
| Get pointer to array[getNumRows()] of row activity levels. More...
double | getCurrentObjValue () const
| Get current objective function value. More...
double | getObjValue () const
| Get best objective function value. More...
void | setObjValue (double obj)
| Set the best objective value. More...
const double * | bestSolution () const
| The best solution to the integer programming problem. More...
int | getSolutionCount () const
| Get number of solutions. More...
void | setSolutionCount (int value)
| Set number of solutions (so heuristics will be different) More...
int | getNumberHeuristicSolutions () const
| Get number of heuristic solutions. More...
void | setObjSense (double s)
| Set objective function sense (1 for min (default), -1 for max,) More...
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. More...
int | getMaximumCutPassesAtRoot () const
| Get the maximum number of cut passes at root node. More...
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. More...
int | getMaximumCutPasses () const
| Get the maximum number of cut passes at other nodes (default 10) More...
int | currentNumberCuts () const
| Number of entries in the list returned by #addedCuts() More...
void | setCurrentNumberCuts (int value)
| Call this to really test if a valid solution can be feasible Solution is number columns in size. More...
Branching Decisions
See the AbcBranchDecision class for additional information.
AbcBranchDecision * | branchingMethod () const
| Get the current branching decision method. More...
void | setBranchingMethod (AbcBranchDecision *method)
| Set the branching decision method. More...
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. More...
Message handling
void | passInMessageHandler (CoinMessageHandler *handler)
| Pass in Message handler (not deleted at end) More...
void | newLanguage (CoinMessages::Language language)
| Set language. More...
void | setLanguage (CoinMessages::Language language)
| Pass in Message handler (not deleted at end) More...
CoinMessageHandler * | messageHandler () const
| Return handler. More...
CoinMessages | messages ()
| Return messages. More...
CoinMessages * | messagesPointer ()
| Return pointer to messages. More...
Heuristics and priorities
void | addHeuristic (AbcHeuristic *generator)
| Add one heuristic. More...
Public Member Functions inherited from AlpsModel
| AlpsModel ()
| Default construtor. More...
virtual | ~AlpsModel ()
| Destructor. More...
AlpsKnowledgeBroker * | getKnowledgeBroker ()
| Get knowledge broker. More...
void | setKnowledgeBroker (AlpsKnowledgeBroker *b)
| Set knowledge broker. More...
std::string | getDataFile () const
| Get the input file. More...
void | setDataFile (std::string infile)
| Set the data file. More...
AlpsParams * | AlpsPar ()
| Access Alps Parameters. More...
void | writeParameters (std::ostream &outstream) const
| Write out parameters. More...
virtual void | preprocess ()
| Preprocessing the model. More...
virtual void | postprocess ()
| Postprocessing results. More...
virtual AlpsTreeNode * | createRoot ()
| Create the root node. More...
virtual void | modelLog ()
| Problem specific log. More...
virtual void | nodeLog (AlpsTreeNode *node, bool force)
| Node log. More...
virtual bool | fathomAllNodes ()
| Return true if all nodes on this process can be fathomed. More...
AlpsReturnStatus | encodeAlps (AlpsEncoded *encoded) const
| Pack Alps portion of node into an encoded object. More...
AlpsReturnStatus | decodeAlps (AlpsEncoded &encoded)
| Unpack Alps portion of node from an encoded object. More...
virtual void | registerKnowledge ()
| Register knowledge class. More...
virtual void | sendGeneratedKnowledge ()
| Send generated knowledge. More...
virtual void | receiveGeneratedKnowledge ()
| Receive generated knowledge. More...
virtual AlpsEncoded * | packSharedKnowlege ()
| Pack knowledge to be shared with others into an encoded object. More...
virtual void | unpackSharedKnowledge (AlpsEncoded &)
| Unpack and store shared knowledge from an encoded object. More...
Public Member Functions inherited from AlpsKnowledge
| AlpsKnowledge ()
virtual | ~AlpsKnowledge ()
KnowledgeType | getType ()
void | setType (KnowledgeType t)
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded)
| Pack into a encode object. More...
virtual AlpsKnowledge * | decode (AlpsEncoded &encoded) const
| This method should decode and return a pointer to a brand new object, i.e., the method must create a new object on the heap from the decoded data instead of filling up the object for which the method was invoked. More...
AlpsEncoded * | getEncoded () const
| Get/set encoded. More...
void | setEncoded (AlpsEncoded *e)

## Private Attributes
CoinMessageHandler * | handler_
| Message handler. More...
bool | defaultHandler_
| Flag to say if handler_ is the default handler. More...
CoinMessages | messages_
| Abc messages. More...
int | intParam_ [AbcLastIntParam]
| Array for integer parameters. More...
double | dblParam_ [AbcLastDblParam]
| Array for double parameters. More...
OsiSolverInterface * | solver_
| The solver associated with this model. More...
bool | ourSolver_
| Ownership of the solver object The convention is that AbcModel owns the null solver. More...
OsiSolverInterface * | continuousSolver_
| A copy of the solver, taken at the continuous (root) node. More...
CoinWarmStartBasis * | basis_
| Pointer to a warm start basis. More...
CoinWarmStartBasis * | lastws_
| Pointer to last warm basis. More...
double | minimumDrop_
| Minimum degradation in objective value to continue cut generation. More...
double | bestObjective_
| Best objective. More...
double * | bestSolution_
| Array holding the incumbent (best) solution. More...
double * | currentSolution_
| Array holding the current solution. More...
OsiCuts | globalCuts_
| Global cuts. More...
int | numberNodes_
| Cumulative number of nodes. More...
int | numberIterations_
| Cumulative number of iterations. More...
int | status_
| Status of problem - 0 finished, 1 stopped, 2 difficulties. More...
int | currentNumberCuts_
| Number of entries in #addedCuts_. More...
int | maximumNumberCuts_
| Maximum number of cuts. More...
int | howOftenGlobalScan_
| How often to scan global cuts. More...
int | maximumDepth_
| Current limit on search tree depth. More...
int | numberStrong_
| Maximum number of candidates to consider for strong branching. More...
int | numberCutGenerators_
| Number of cut generators. More...
AbcCutGenerator ** | generator_
int | numberHeuristics_
| Number of heuristics. More...
AbcHeuristic ** | heuristic_
int | maximumCutPassesAtRoot_
| Maximum number of cut passes at root. More...
int | maximumCutPasses_
| Maximum number of cut passes. More...
AbcBranchDecision * | branchingMethod_
| Variable selection function. More...
int | numberSolutions_
| Number of solutions. More...
int | numberHeuristicSolutions_
| Number of heuristic solutions. More...
int * | priority_
| Priorities. More...
AbcPseudocost ** | pseudoList_
int * | pseudoIndices_
AbcParams * | AbcPar_
| Abc parameters. More...
Shared problem data
int | numberRowsAtContinuous_
| Number of rows at continuous. More...
int | numberIntegers_
| Number of integers in problem. More...
int * | integerVariable_
| Indices of integer variables. More...
CoinWarmStartBasis * | sharedBasis_
| Pointer to a warm start basis. More...

## Additional Inherited Members
Protected Attributes inherited from AlpsModel
AlpsKnowledgeBroker * | broker_
| Knowledge broker. More...
std::string | dataFile_
| Data file. More...
AlpsParams * | AlpsPar_
| The parameter set that is used in Alps. More...
Protected Attributes inherited from AlpsKnowledge
KnowledgeType | type_

## Detailed Description

Model class for ALPS Branch and Cut.

Definition at line 55 of file AbcModel.h.

## Member Enumeration Documentation

enum AbcModel::AbcIntParam

Enumerator
AbcMaxNumNode | 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. 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.
AbcLastIntParam | Just a marker, so that a static sized array can store parameters.

Definition at line 58 of file AbcModel.h.

enum AbcModel::AbcDblParam

Enumerator
AbcIntegerTolerance | 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. This is an absolute value. Conversion from a percentage is left to the client.
AbcMaximumSeconds | The maximum number of seconds before terminating. A double should be adequate!
AbcLastDblParam | Just a marker, so that a static sized array can store parameters.

Definition at line 75 of file AbcModel.h.

## Constructor & Destructor Documentation

AbcModel::AbcModel | ( |  | ) |
| inline

Definition at line 222 of file AbcModel.h.

AbcModel::AbcModel | ( | const OsiSolverInterface & | rhs | ) |
| inline

Definition at line 227 of file AbcModel.h.

AbcModel::~AbcModel | ( |  | ) |
| inline

Definition at line 258 of file AbcModel.h.

## Member Function Documentation

void AbcModel::init | ( |  | ) |
| inline

Initialize member data.

Definition at line 329 of file AbcModel.h.

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.

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.

AbcParams* AbcModel::AbcPar | ( |  | ) |
| inline

Definition at line 395 of file AbcModel.h.

OsiSolverInterface* AbcModel::solver | ( |  | ) | const
| inline

Returns solver - has current state.

Definition at line 398 of file AbcModel.h.

void AbcModel::assignSolver | ( | OsiSolverInterface *& | solver | ) |

Assign a solver to the model (model assumes ownership) On return, `solver` will be NULL.

Note
  Parameter settings in the outgoing solver are not inherited by the incoming solver.

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.

const int* AbcModel::integerVariable | ( |  | ) | const
| inline

Integer variables.

Definition at line 418 of file AbcModel.h.

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.

int AbcModel::getNodeCount | ( |  | ) | const
| inline

Get how many Nodes it took to solve the problem.

Definition at line 464 of file AbcModel.h.

void AbcModel::incrementNodeCount | ( | int | s = `1` | ) |
| inline

Increment the count of nodes.

Definition at line 467 of file AbcModel.h.

int AbcModel::status | ( |  | ) | const
| inline

Final status of problem 0 finished, 1 stopped, 2 difficulties.

Definition at line 473 of file AbcModel.h.

int AbcModel::numberRowsAtContinuous | ( |  | ) | const
| inline

Number of rows in continuous (root) problem.

Definition at line 491 of file AbcModel.h.

void AbcModel::setNumberRowsAtContinous | ( | const int | value | ) |
| inline

Number of rows in continuous (root) problem.

Definition at line 494 of file AbcModel.h.

int AbcModel::getNumCols | ( |  | ) | const
| inline

Get number of columns.

Definition at line 501 of file AbcModel.h.

int AbcModel::getNumRows | ( |  | ) | const
| inline

Get number of rows.

Definition at line 505 of file AbcModel.h.

int AbcModel::getNumElements | ( |  | ) | const
| inline

Get number of nonzero elements.

Definition at line 509 of file AbcModel.h.

const double* AbcModel::getColLower | ( |  | ) | const
| inline

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

Definition at line 513 of file AbcModel.h.

const double* AbcModel::getColUpper | ( |  | ) | const
| inline

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

Definition at line 517 of file AbcModel.h.

const char* AbcModel::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 529 of file AbcModel.h.

const double* AbcModel::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 540 of file AbcModel.h.

const double* AbcModel::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 551 of file AbcModel.h.

const double* AbcModel::getRowLower | ( |  | ) | const
| inline

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

Definition at line 555 of file AbcModel.h.

const double* AbcModel::getRowUpper | ( |  | ) | const
| inline

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

Definition at line 559 of file AbcModel.h.

const double* AbcModel::getObjCoefficients | ( |  | ) | const
| inline

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

Definition at line 563 of file AbcModel.h.

double AbcModel::getObjSense | ( |  | ) | const
| inline

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

Definition at line 567 of file AbcModel.h.

AbcPseudocost** AbcModel::getPseudoList | ( |  | ) |
| inline

Number of rows in continuous (root) problem.

Definition at line 570 of file AbcModel.h.

int* AbcModel::getPseudoIndices | ( |  | ) |
| inline

Number of rows in continuous (root) problem.

Definition at line 573 of file AbcModel.h.

bool AbcModel::isContinuous | ( | int | colIndex | ) | const
| inline

Return true if variable is continuous.

Definition at line 576 of file AbcModel.h.

bool AbcModel::isBinary | ( | int | colIndex | ) | const
| inline

Return true if variable is binary.

Definition at line 580 of file AbcModel.h.

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.

bool AbcModel::isIntegerNonBinary | ( | int | colIndex | ) | const
| inline

Return true if variable is general integer.

Definition at line 591 of file AbcModel.h.

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.

const CoinPackedMatrix* AbcModel::getMatrixByRow | ( |  | ) | const
| inline

Get pointer to row-wise copy of matrix.

Definition at line 599 of file AbcModel.h.

const CoinPackedMatrix* AbcModel::getMatrixByCol | ( |  | ) | const
| inline

Get pointer to column-wise copy of matrix.

Definition at line 603 of file AbcModel.h.

double AbcModel::getInfinity | ( |  | ) | const
| inline

Get solver's value for infinity.

Definition at line 607 of file AbcModel.h.

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.

const double* AbcModel::getColSolution | ( |  | ) | const
| inline

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

Definition at line 643 of file AbcModel.h.

const double* AbcModel::getRowPrice | ( |  | ) | const
| inline

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

Definition at line 647 of file AbcModel.h.

const double* AbcModel::getReducedCost | ( |  | ) | const
| inline

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

Definition at line 651 of file AbcModel.h.

const double* AbcModel::getRowActivity | ( |  | ) | const
| inline

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

Definition at line 655 of file AbcModel.h.

double AbcModel::getCurrentObjValue | ( |  | ) | const
| inline

Get current objective function value.

Definition at line 659 of file AbcModel.h.

double AbcModel::getObjValue | ( |  | ) | const
| inline

Get best objective function value.

Definition at line 663 of file AbcModel.h.

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.

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.

int AbcModel::getSolutionCount | ( |  | ) | const
| inline

Get number of solutions.

Definition at line 680 of file AbcModel.h.

void AbcModel::setSolutionCount | ( | int | value | ) |
| inline

Set number of solutions (so heuristics will be different)

Definition at line 684 of file AbcModel.h.

int AbcModel::getNumberHeuristicSolutions | ( |  | ) | const
| inline

Get number of heuristic solutions.

Definition at line 688 of file AbcModel.h.

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.

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.

int AbcModel::getMaximumCutPassesAtRoot | ( |  | ) | const
| inline

Get the maximum number of cut passes at root node.

Definition at line 699 of file AbcModel.h.

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.

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.

int AbcModel::currentNumberCuts | ( |  | ) | const
| inline

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

Definition at line 710 of file AbcModel.h.

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.

AbcBranchDecision* AbcModel::branchingMethod | ( |  | ) | const
| inline

Get the current branching decision method.

Definition at line 727 of file AbcModel.h.

void AbcModel::setBranchingMethod | ( | AbcBranchDecision * | method | ) |
| inline

Set the branching decision method.

Definition at line 730 of file AbcModel.h.

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.

void AbcModel::passInMessageHandler | ( | CoinMessageHandler * | handler | ) |
| inline

Pass in Message handler (not deleted at end)

Definition at line 744 of file AbcModel.h.

void AbcModel::newLanguage | ( | CoinMessages::Language | language | ) |
| inline

Set language.

Definition at line 755 of file AbcModel.h.

void AbcModel::setLanguage | ( | CoinMessages::Language | language | ) |
| inline

Pass in Message handler (not deleted at end)

Definition at line 757 of file AbcModel.h.

CoinMessageHandler* AbcModel::messageHandler | ( |  | ) | const
| inline

Return handler.

Definition at line 760 of file AbcModel.h.

CoinMessages AbcModel::messages | ( |  | ) |
| inline

Return messages.

Definition at line 763 of file AbcModel.h.

CoinMessages* AbcModel::messagesPointer | ( |  | ) |
| inline

Return pointer to messages.

Definition at line 766 of file AbcModel.h.

bool AbcModel::checkInteger | ( | double | value | ) | const
| inline

Definition at line 772 of file AbcModel.h.

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.

bool AbcModel::setDblParam | ( | AbcDblParam | key,
|  | double | value
| ) |  |
| inline

Set a double parameter.

Definition at line 834 of file AbcModel.h.

int AbcModel::getIntParam | ( | AbcIntParam | key | ) | const
| inline

Get an integer parameter.

Definition at line 840 of file AbcModel.h.

double AbcModel::getDblParam | ( | AbcDblParam | key | ) | const
| inline

Get a double parameter.

Definition at line 845 of file AbcModel.h.

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.

bool AbcModel::setMaximumNodes | ( | int | value | ) |
| inline

Set the maximum node limit .

Definition at line 864 of file AbcModel.h.

int AbcModel::getMaximumNodes | ( |  | ) | const
| inline

Get the maximum node limit .

Definition at line 868 of file AbcModel.h.

bool AbcModel::setMaximumSolutions | ( | int | value | ) |
| inline

Set the maximum number of solutions desired.

Definition at line 875 of file AbcModel.h.

int AbcModel::getMaximumSolutions | ( |  | ) | const
| inline

Get the maximum number of solutions desired.

Definition at line 882 of file AbcModel.h.

bool AbcModel::setIntegerTolerance | ( | double | value | ) |
| inline

Set the integrality tolerance .

Definition at line 889 of file AbcModel.h.

double AbcModel::getIntegerTolerance | ( |  | ) | const
| inline

Get the integrality tolerance .

Definition at line 895 of file AbcModel.h.

bool AbcModel::setInfeasibilityWeight | ( | double | value | ) |
| inline

Set the weight per integer infeasibility .

Definition at line 903 of file AbcModel.h.

double AbcModel::getInfeasibilityWeight | ( |  | ) | const
| inline

Get the weight per integer infeasibility .

Definition at line 910 of file AbcModel.h.

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.

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.

void AbcModel::setMinimumDrop | ( | double | value | ) |
| inline

Set the minimum drop to continue cuts.

Definition at line 928 of file AbcModel.h.

double AbcModel::getMinimumDrop | ( |  | ) | const
| inline

Get the minimum drop to continue cuts.

Definition at line 931 of file AbcModel.h.

virtual bool AbcModel::setupSelf | ( |  | ) |
| virtual

Do necessary work to make model usable.

Return success or not.

Reimplemented from AlpsModel.

int AbcModel::numberStrong | ( |  | ) | const
| inline

Definition at line 939 of file AbcModel.h.

void AbcModel::setNumberStrong | ( | int | number | ) |
| inline

Definition at line 942 of file AbcModel.h.

const int* AbcModel::priority | ( |  | ) | const
| inline

Priorities.

Definition at line 951 of file AbcModel.h.

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.

virtual AlpsEncoded* AbcModel::encode | ( |  | ) | const
| virtual

The method that encodes the model into a encoded object.

Reimplemented from AlpsKnowledge.

virtual void AbcModel::decodeToSelf | ( | AlpsEncoded & |  | ) |
| virtual

The method that decodes the model from a encoded object.

Reimplemented from AlpsModel.

## Member Data Documentation

int AbcModel::numberRowsAtContinuous_
| private

Number of rows at continuous.

Definition at line 105 of file AbcModel.h.

int AbcModel::numberIntegers_
| private

Number of integers in problem.

Definition at line 107 of file AbcModel.h.

int* AbcModel::integerVariable_
| private

Indices of integer variables.

Definition at line 109 of file AbcModel.h.

CoinWarmStartBasis* AbcModel::sharedBasis_
| private

Pointer to a warm start basis.

Definition at line 111 of file AbcModel.h.

CoinMessageHandler* AbcModel::handler_
| private

Message handler.

Definition at line 115 of file AbcModel.h.

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.

CoinMessages AbcModel::messages_
| private

Abc messages.

Definition at line 124 of file AbcModel.h.

int AbcModel::intParam_[AbcLastIntParam]
| private

Array for integer parameters.

Definition at line 127 of file AbcModel.h.

double AbcModel::dblParam_[AbcLastDblParam]
| private

Array for double parameters.

Definition at line 130 of file AbcModel.h.

OsiSolverInterface* AbcModel::solver_
| private

The solver associated with this model.

Definition at line 133 of file AbcModel.h.

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.

OsiSolverInterface* AbcModel::continuousSolver_
| private

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

Definition at line 142 of file AbcModel.h.

CoinWarmStartBasis* AbcModel::basis_
| private

Pointer to a warm start basis.

Definition at line 145 of file AbcModel.h.

CoinWarmStartBasis* AbcModel::lastws_
| private

Pointer to last warm basis.

Definition at line 148 of file AbcModel.h.

double AbcModel::minimumDrop_
| private

Minimum degradation in objective value to continue cut generation.

Definition at line 151 of file AbcModel.h.

double AbcModel::bestObjective_
| private

Best objective.

Definition at line 154 of file AbcModel.h.

double* AbcModel::bestSolution_
| private

Array holding the incumbent (best) solution.

Definition at line 157 of file AbcModel.h.

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.

OsiCuts AbcModel::globalCuts_
| private

Global cuts.

Definition at line 165 of file AbcModel.h.

int AbcModel::numberNodes_
| private

Cumulative number of nodes.

Definition at line 168 of file AbcModel.h.

int AbcModel::numberIterations_
| private

Cumulative number of iterations.

Definition at line 170 of file AbcModel.h.

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.

int AbcModel::maximumNumberCuts_
| private

Maximum number of cuts.

Definition at line 176 of file AbcModel.h.

int AbcModel::howOftenGlobalScan_
| private

How often to scan global cuts.

Definition at line 178 of file AbcModel.h.

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.

int AbcModel::numberCutGenerators_
| private

Number of cut generators.

Definition at line 192 of file AbcModel.h.

AbcCutGenerator** AbcModel::generator_
| private

Definition at line 194 of file AbcModel.h.

int AbcModel::numberHeuristics_
| private

Number of heuristics.

Definition at line 196 of file AbcModel.h.

AbcHeuristic** AbcModel::heuristic_
| private

Definition at line 198 of file AbcModel.h.

int AbcModel::maximumCutPassesAtRoot_
| private

Maximum number of cut passes at root.

Definition at line 201 of file AbcModel.h.

int AbcModel::maximumCutPasses_
| private

Maximum number of cut passes.

Definition at line 203 of file AbcModel.h.

AbcBranchDecision* AbcModel::branchingMethod_
| private

Variable selection function.

Definition at line 206 of file AbcModel.h.

int AbcModel::numberSolutions_
| private

Number of solutions.

Definition at line 208 of file AbcModel.h.

int AbcModel::numberHeuristicSolutions_
| private

Number of heuristic solutions.

Definition at line 210 of file AbcModel.h.

int* AbcModel::priority_
| private

Priorities.

Definition at line 212 of file AbcModel.h.

AbcPseudocost** AbcModel::pseudoList_
| private

Definition at line 214 of file AbcModel.h.

int* AbcModel::pseudoIndices_
| private

Definition at line 216 of file AbcModel.h.

AbcParams* AbcModel::AbcPar_
| private

Abc parameters.

Definition at line 219 of file AbcModel.h.

The documentation for this class was generated from the following file:

- /tmp/CHiPPS-Blis-0.94.3/Alps/examples/Abc/AbcModel.h