238 for (iColumn = 0; iColumn < numberColumns; ++iColumn) {
249 for (iColumn=0;iColumn<numberColumns;iColumn++) {
307 for (; i >= 0; --i) {
389 std::cout <<
"Reading in ALPS parameters ..." << std::endl;
391 std::cout <<
"Reading in ABC parameters ..." << std::endl;
437 int & numberNewCuts,
int & maximumWhich,
438 int *& whichGenerator,
const bool cutDuringRampup,
619 const double * solution,
624 double & objectiveValue,
625 const double *solution,
626 bool fixVariables =
false);
774 double integerTolerance =
776 double nearest = floor(value + 0.5);
777 if (fabs(value - nearest) <= integerTolerance)
799 int howOften=1,
const char * name=NULL,
800 bool normal=
true,
bool atSolution=
false,
801 bool infeasible=
false);
int numberHeuristics_
Number of heuristics.
int numberRowsAtContinuous() const
Number of rows in continuous (root) problem.
bool defaultHandler_
Flag to say if handler_ is the default handler.
bool setIntParam(AbcIntParam key, int value)
Set an integer parameter.
double getCurrentObjValue() const
Get current objective function value.
CoinMessages * messagesPointer()
Return pointer to messages.
virtual void setObjSense(double s)=0
Set the objective function sense.
void setSolutionCount(int value)
Set number of solutions (so heuristics will be different)
int getNumCols() const
Get number of columns.
int maximumNumberCuts_
Maximum number of cuts.
virtual const double * getReducedCost() const =0
Get a pointer to an array[getNumCols()] of reduced costs.
double dblParam_[AbcLastDblParam]
Array for double parameters.
virtual const char * getRowSense() const =0
Get a pointer to an array[getNumRows()] of row constraint senses.
const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiSolverInterface * continuousSolver_
A copy of the solver, taken at the continuous (root) node.
virtual bool setupSelf()
Do necessary work to make model usable.
Just a marker, so that a static sized array can store parameters.
CoinMessageHandler * messageHandler() const
Return handler.
int getNumElements() const
Get number of nonzero elements.
Base class for message handling.
const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
virtual const double * getRowLower() const =0
Get a pointer to an array[getNumRows()] of row lower bounds.
void setLanguage(CoinMessages::Language language)
Pass in Message handler (not deleted at end)
int getMaximumCutPasses() const
Get the maximum number of cut passes at other nodes (default 10)
int getSolutionCount() const
Get number of solutions.
CoinMessageHandler * handler_
Message handler.
bool isAbandoned() const
Are there a numerical difficulties?
virtual const double * getRowUpper() const =0
Get a pointer to an array[getNumRows()] of row upper bounds.
double * currentSolution_
Array holding the current solution.
int maximumCutPassesAtRoot_
Maximum number of cut passes at root.
void readParameters(const int argnum, const char *const *arglist)
Read in Alps and Abc parameters.
AbcBranchDecision * branchingMethod_
Variable selection function.
virtual const CoinPackedMatrix * getMatrixByRow() const =0
Get a pointer to a row-wise copy of the matrix.
virtual const double * getRightHandSide() const =0
Get a pointer to an array[getNumRows()] of row right-hand sides.
int priority(int sequence) const
Returns priority level for an object (or 1000 if no priorities exist)
bool setIntegerTolerance(double value)
Set the integrality tolerance
AbcHeuristic ** heuristic_
AbcCutGenerator ** generator_
double getInfinity() const
Get solver's value for infinity.
virtual const double * getRowActivity() const =0
Get a pointer to array[getNumRows()] of row activity levels.
int getNodeCount() const
Get how many Nodes it took to solve the problem.
bool resolve()
Reoptimise an LP relaxation Invoke the solver's resolve() method.
int status() const
Final status of problem 0 finished, 1 stopped, 2 difficulties.
virtual const double * getColUpper() const =0
Get a pointer to an array[getNumCols()] of column upper bounds.
virtual int getNumCols() const =0
Get the number of columns.
int howOftenGlobalScan_
How often to scan global cuts.
double getIntegerTolerance() const
Get the integrality tolerance
OsiCuts globalCuts_
Global cuts.
ABC_Message
This deals with Abc messages (as against Clp messages etc).
CoinWarmStartBasis * basis_
Pointer to a warm start basis.
bool setBestSolution(ABC_Message how, double &objectiveValue, const double *solution, bool fixVariables=false)
Record a new incumbent solution and update objectiveValue.
const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
double minimumDrop_
Minimum degradation in objective value to continue cut generation.
virtual const double * getObjCoefficients() const =0
Get a pointer to an array[getNumCols()] of objective function coefficients.
const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
Sparse Matrix Base Class.
int maximumDepth_
Current limit on search tree depth.
virtual const double * getRowRange() const =0
Get a pointer to an array[getNumRows()] of row ranges.
CoinMessages messages()
Return messages.
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.
double getInfeasibilityWeight() const
Get the weight per integer infeasibility
void incrementNodeCount(int s=1)
Increment the count of nodes.
virtual double getObjSense() const =0
Get the objective function sense.
The maximum number of seconds before terminating.
int status_
Status of problem - 0 finished, 1 stopped, 2 difficulties.
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...
Collections of row cuts and column cuts.
bool isContinuous(int colIndex) const
Return true if variable is continuous.
This data structure is to contain the packed form of an encodable knowledge.
void takeOffCuts()
Remove inactive cuts from the model.
int numberSolutions_
Number of solutions.
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
CoinWarmStartBasis * lastws_
Pointer to last warm basis.
The maximum number of nodes before terminating.
virtual bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
bool isProvenInfeasible() const
Is infeasiblity proven (or none better than cutoff)?
void findIntegers(bool startAgain)
Identify integer variables and create corresponding objects.
int numberNodes_
Cumulative number of nodes.
bool isInteger(int colIndex) const
Return true if column is integer.
int numberCutGenerators_
Number of cut generators.
const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
bool setMaximumSolutions(int value)
Set the maximum number of solutions desired.
int numberIntegers() const
Number of integers in problem.
virtual double getObjValue() const =0
Get the objective function value.
int getMaximumCutPassesAtRoot() const
Get the maximum number of cut passes at root node.
int numberIntegers_
Number of integers in problem.
bool feasibleSolution(int &numberIntegerInfeasibilities)
Test the current solution for feasiblility.
virtual int getIterationCount() const =0
Get the number of iterations it took to solve the problem (whatever `iteration' means to the solver)...
This class holds one node of the search tree.
void initialSolve()
Solve the initial LP relaxation Invoke the solver's initialSolve() method.
virtual int getNumRows() const =0
Get the number of rows.
Stop when the gap between the objective value of the best known solution and the best bound on the ob...
CoinWarmStartBasis * sharedBasis_
Pointer to a warm start basis.
AbcParams * AbcPar_
Abc parameters.
int numberHeuristicSolutions_
Number of heuristic solutions.
OsiSolverInterface * solver_
The solver associated with this model.
void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
virtual bool isContinuous(int colIndex) const =0
Return true if the variable is continuous.
Fathoming discipline Controls objective function comparisons for purposes of fathoming by bound or de...
virtual const double * getColLower() const =0
Get a pointer to an array[getNumCols()] of column lower bounds.
const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
virtual const CoinPackedMatrix * getMatrixByCol() const =0
Get a pointer to a column-wise copy of the matrix.
virtual CoinBigIndex getNumElements() const =0
Get the number of nonzero elements.
const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
int numberIterations_
Cumulative number of iterations.
virtual const double * getColSolution() const =0
Get a pointer to an array[getNumCols()] of primal variable values.
void setObjValue(double obj)
Set the best objective value.
bool ourSolver_
Ownership of the solver object The convention is that AbcModel owns the null solver.
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
AbcModel(const OsiSolverInterface &rhs)
const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
void addHeuristic(AbcHeuristic *generator)
Add one heuristic.
void readFromArglist(const int argnum, const char *const *arglist)
Read parameters from the command line.
This is a first attempt at a message handler.
const double * bestSolution() const
The best solution to the integer programming problem.
void setMinimumDrop(double value)
Set the minimum drop to continue cuts.
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.
double getMinimumDrop() const
Get the minimum drop to continue cuts.
Abstract Base Class for describing an interface to a solver.
int getNumberHeuristicSolutions() const
Get number of heuristic solutions.
const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
const int * integerVariable() const
Integer variables.
virtual AlpsEncoded * encode() const
The method that encodes the model into a encoded object.
int getIntParam(AbcIntParam key) const
Get an integer parameter.
bool isNodeLimitReached() const
Node limit reached?
Cut Generator Base Class.
bool setAllowableGap(double value)
Set the \link AbcModel::AbcAllowableGap allowable gap \endlink between the best known solution and t...
Just a marker, so that a static sized array can store parameters.
double * currentSolution() const
Solution to the most recent lp relaxation.
double getDblParam(AbcDblParam key) const
Get a double parameter.
OsiSolverInterface * solver() const
Returns solver - has current state.
bool isBinary(int colIndex) const
Return true if variable is binary.
const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels.
Class to hold and manipulate an array of massaged messages.
AlpsParams * AlpsPar_
The parameter set that is used in Alps.
int getNumRows() const
Get number of rows.
int * integerVariable_
Indices of integer variables.
void setBranchingMethod(AbcBranchDecision *method)
Set the branching decision method.
bool checkInteger(double value) const
The objective is assumed to worsen by this amount for each integer infeasibility. ...
int numberStrong_
Maximum number of candidates to consider for strong branching.
virtual double getInfinity() const =0
Get the solver's value for infinity.
double bestObjective_
Best objective.
The maximum number of solutions before terminating.
void setMaximumCutPasses(int value)
Set the maximum number of cut passes at other nodes (default 10) Minimum drop can also be used for f...
AbcPseudocost ** pseudoList_
virtual OsiSolverInterface * clone(bool copyData=true) const =0
Clone.
AbcBranchDecision * branchingMethod() const
Get the current branching decision method.
int maximumCutPasses_
Maximum number of cut passes.
int intParam_[AbcLastIntParam]
Array for integer parameters.
virtual void decodeToSelf(AlpsEncoded &)
The method that decodes the model from a encoded object.
int currentNumberCuts() const
Number of entries in the list returned by #addedCuts()
double getObjValue() const
Get best objective function value.
void setNumberRowsAtContinous(const int value)
Number of rows in continuous (root) problem.
int getIterationCount() const
Get how many iterations it took to solve the problem.
void setLogLevel(int value)
Set current log (detail) level.
virtual const double * getRowPrice() const =0
Get pointer to array[getNumRows()] of dual variable values.
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
int currentNumberCuts_
Number of entries in #addedCuts_.
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
void setCutoff(double value)
Set cutoff bound on the objective function. When using strict comparison, the bound is adjusted by a ...
The amount by which to tighten the objective function cutoff when a new solution is discovered...
CoinMessages messages_
Abc messages.
bool isIntegerNonBinary(int colIndex) const
Return true if variable is general integer.
void init()
Initialize member data.
virtual void readInstance(const char *dataFile)
Read in the problem data.
int getMaximumNodes() const
Get the maximum node limit .
const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
void setCurrentNumberCuts(int value)
Call this to really test if a valid solution can be feasible Solution is number columns in size...
bool setInfeasibilityWeight(double value)
Set the weight per integer infeasibility
double * bestSolution_
Array holding the incumbent (best) solution.
double getCutoff() const
Get the cutoff bound on the objective function - always as minimize.
const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
const int * priority() const
Priorities.
int * priority_
Priorities.
void newLanguage(CoinMessages::Language language)
Set language.
int * getPseudoIndices()
Number of rows in continuous (root) problem.
const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
Interface between Abc and Cut Generation Library.
void setNumberStrong(int number)
void setMaximumCutPassesAtRoot(int value)
Set the maximum number of cut passes at root node (default 20) Minimum drop can also be used for fin...
bool isSolutionLimitReached() const
Solution limit reached?
Abstract branching decision base class.
The maximum amount the value of an integer variable can vary from integer and still be considered fea...
bool isFreeBinary(int colIndex) const
Return true if variable is binary and not fixed at either bound.
bool setMaximumNodes(int value)
Set the maximum node limit .
bool isProvenOptimal() const
Is optimality proven?
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
Language
Supported languages.
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 ...
AbcPseudocost ** getPseudoList()
Number of rows in continuous (root) problem.
The default COIN simplex (basis-oriented) warm start class.
Model class for ALPS Branch and Cut.
int numberRowsAtContinuous_
Number of rows at continuous.
bool setDblParam(AbcDblParam key, double value)
Set a double parameter.
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 genera...
int getMaximumSolutions() const
Get the maximum number of solutions desired.
void reducedCostFix()
Perform reduced cost fixing Fixes integer variables at their current value based on reduced cost pen...
void assignSolver(OsiSolverInterface *&solver)
Assign a solver to the model (model assumes ownership) On return, solver will be NULL...
double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
double getAllowableGap() const
Get the \link AbcModel::AbcAllowableGap allowable gap \endlink between the best known solution and t...