Loading...
Searching...
No Matches
AbcSimplexDual Class Reference

This solves LPs using the dual simplex method. More...

`#include <AbcSimplexDual.hpp>`

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

## Public Member Functions

Description of algorithm
int | dual ()
| Dual algorithm.
int | strongBranching (int numberVariables, const int *variables, double *newLower, double *newUpper, double **outputSolution, int *outputStatus, int *outputIterations, bool stopOnFirstInfeasible=true, bool alwaysFinish=false, int startFinishOptions=0)
| For strong branching.
AbcSimplexFactorization * | setupForStrongBranching (char *arrays, int numberRows, int numberColumns, bool solveLp=false)
| This does first part of StrongBranching.
void | cleanupAfterStrongBranching (AbcSimplexFactorization *factorization)
| This cleans up after strong branching.
Functions used in dual
int | whileIteratingSerial ()
| This has the flow between re-factorizations Broken out for clarity and will be used by strong branching.
void | whileIterating2 ()
int | whileIteratingParallel (int numberIterations)
int | whileIterating3 ()
void | updatePrimalSolution ()
int | noPivotRow ()
int | noPivotColumn ()
void | dualPivotColumn ()
void | createDualPricingVectorSerial ()
| Create dual pricing vector.
int | getTableauColumnFlipAndStartReplaceSerial ()
void | getTableauColumnPart1Serial ()
void | getTableauColumnPart2 ()
int | checkReplace ()
void | replaceColumnPart3 ()
void | checkReplacePart1 ()
void | checkReplacePart1a ()
void | checkReplacePart1b ()
void | updateDualsInDual ()
| The duals are updated.
int | flipBounds ()
| The duals are updated by the given arrays.
void | flipBack (int number)
| Undo a flip.
void | dualColumn1 (bool doAll=false)
| Array has tableau row (row section) Puts candidates for rows in list Returns guess at upper theta (infinite if no pivot) and may set sequenceIn_ if free Can do all (if tableauRow created).
double | dualColumn1A ()
| Array has tableau row (row section) Just does slack part Returns guess at upper theta (infinite if no pivot) and may set sequenceIn_ if free.
double | dualColumn1B ()
| Do all given tableau row.
void | dualColumn2 ()
| Chooses incoming Puts flipped ones in list If necessary will modify costs.
void | dualColumn2Most (dualColumnResult &result)
void | dualColumn2First (dualColumnResult &result)
void | dualColumn2 (dualColumnResult &result)
| Chooses part of incoming Puts flipped ones in list If necessary will modify costs.
void | checkPossibleCleanup (CoinIndexedVector *array)
| This sees what is best thing to do in branch and bound cleanup If sequenceIn_ < 0 then can't do anything.
void | dualPivotRow ()
| Chooses dual pivot row Would be faster with separate region to scan and will have this (with square of infeasibility) when steepest For easy problems we can just choose one of the first rows we look at.
int | changeBounds (int initialize, double &changeCost)
| Checks if any fake bounds active - if so returns number and modifies updatedDualBound_ and everything.
bool | changeBound (int iSequence)
| As changeBounds but just changes new bounds for a single variable.
void | originalBound (int iSequence)
| Restores bound to original bound.
int | checkUnbounded (CoinIndexedVector &ray, double changeCost)
| Checks if tentative optimal actually means unbounded in dual Returns -3 if not, 2 if is unbounded.
void | statusOfProblemInDual (int type)
| Refactorizes if necessary Checks if finished.
int | whatNext ()
| Fast iterations.
bool | checkCutoff (bool computeObjective)
| see if cutoff reached
int | bounceTolerances (int type)
| Does something about fake tolerances.
void | perturb (double factor)
| Perturbs problem.
void | perturbB (double factor, int type)
| Perturbs problem B.
int | makeNonFreeVariablesDualFeasible (bool changeCosts=false)
| Make non free variables dual feasible by moving to a bound.
int | fastDual (bool alwaysFinish=false)
int | numberAtFakeBound ()
| Checks number of variables at fake bounds.
int | pivotResultPart1 ()
| Pivot in a variable and choose an outgoing one.
int | nextSuperBasic ()
| Get next free , -1 if none.
void | startupSolve ()
| Startup part of dual.
void | finishSolve ()
| Ending part of dual.
void | gutsOfDual ()
int | resetFakeBounds (int type)
Public Member Functions inherited from AbcSimplex
| AbcSimplex (bool emptyMessages=false)
| Default constructor.
| AbcSimplex (const AbcSimplex &rhs)
| Copy constructor.
| AbcSimplex (const ClpSimplex &rhs)
| Copy constructor from model.
| AbcSimplex (const ClpSimplex *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true, bool fixOthers=false)
| Subproblem constructor.
| AbcSimplex (const AbcSimplex *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true, bool fixOthers=false)
| Subproblem constructor.
| AbcSimplex (AbcSimplex *wholeModel, int numberColumns, const int *whichColumns)
| This constructor modifies original AbcSimplex and stores original stuff in created AbcSimplex.
void | originalModel (AbcSimplex *miniModel)
| This copies back stuff from miniModel and then deletes miniModel.
| AbcSimplex (const ClpSimplex *clpSimplex)
| This constructor copies from ClpSimplex.
void | putBackSolution (ClpSimplex *simplex)
| Put back solution into ClpSimplex.
void | makeBaseModel ()
| Array persistence flag If 0 then as now (delete/new) 1 then only do arrays if bigger needed 2 as 1 but give a bit extra if bigger needed.
void | deleteBaseModel ()
| Switch off base model.
AbcSimplex * | baseModel () const
| See if we have base model.
void | setToBaseModel (AbcSimplex *model=NULL)
| Reset to base model (just size and arrays needed) If model NULL use internal copy.
AbcSimplex & | operator= (const AbcSimplex &rhs)
| Assignment operator. This copies the data.
| ~AbcSimplex ()
| Destructor.
int | dual ()
| Dual algorithm - see AbcSimplexDual.hpp for method.
int | doAbcDual ()
int | primal (int ifValuesPass)
| Primal algorithm - see AbcSimplexPrimal.hpp for method.
int | doAbcPrimal (int ifValuesPass)
CoinWarmStartBasis * | getBasis () const
| Returns a basis (to be deleted by user).
void | setFactorization (AbcSimplexFactorization &factorization)
| Passes in factorization.
AbcSimplexFactorization * | swapFactorization (AbcSimplexFactorization *factorization)
| Swaps factorization.
AbcSimplexFactorization * | getEmptyFactorization ()
| Gets clean and emptyish factorization.
int | tightenPrimalBounds ()
| Tightens primal bounds to make dual faster.
void | setDualRowPivotAlgorithm (AbcDualRowPivot &choice)
| Sets row pivot choice algorithm in dual.
void | setPrimalColumnPivotAlgorithm (AbcPrimalColumnPivot &choice)
| Sets column pivot choice algorithm in primal.
void | defaultFactorizationFrequency ()
| If user left factorization frequency then compute.
AbcSimplexFactorization * | factorization () const
| factorization
int | factorizationFrequency () const
| Factorization frequency.
void | setFactorizationFrequency (int value)
int | maximumAbcNumberRows () const
| Maximum rows.
int | maximumNumberTotal () const
| Maximum Total.
int | maximumTotal () const
bool | isObjectiveLimitTestValid () const
| Return true if the objective limit test can be relied upon.
int | numberTotal () const
| Number of variables (includes spare rows).
int | numberTotalWithoutFixed () const
| Number of variables without fixed to zero (includes spare rows).
CoinPartitionedVector * | usefulArray (int index)
| Useful arrays (0,1,2,3,4,5,6,7).
CoinPartitionedVector * | usefulArray (int index) const
double | clpObjectiveValue () const
| Objective value.
int * | pivotVariable () const
| Basic variables pivoting on which rows may be same as toExternal but may be as at invert.
int | stateOfProblem () const
| State of problem.
void | setStateOfProblem (int value)
| State of problem.
double * | scaleFromExternal () const
| Points from external to internal.
double * | scaleToExternal () const
| Scale from primal internal to external (in external order) Or other way for dual.
double * | rowScale2 () const
| corresponds to rowScale etc
double * | inverseRowScale2 () const
double * | inverseColumnScale2 () const
double * | columnScale2 () const
int | arrayForDualColumn () const
double | upperTheta () const
| upper theta from dual column
int | arrayForReplaceColumn () const
int | arrayForFlipBounds () const
int | arrayForFlipRhs () const
int | arrayForBtran () const
int | arrayForFtran () const
int | arrayForTableauRow () const
double | valueIncomingDual () const
| value of incoming variable (in Dual)
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 (constraint matrix times the solution vector.
int | getSolution ()
| Given an existing factorization computes and checks primal and dual solutions.
void | setClpSimplexObjectiveValue ()
| Sets objectiveValue_ from rawObjectiveValue_.
void | setupDualValuesPass (const double *fakeDuals, const double *fakePrimals, int type)
| Sets dual values pass djs using unscaled duals type 1 - values pass type 2 - just use as infeasibility weights type 3 - as 2 but crash.
double | minimizationObjectiveValue () const
| Gets objective value with all offsets but as for minimization.
double | currentDualTolerance () const
| Current dualTolerance (will end up as dualTolerance_).
void | setCurrentDualTolerance (double value)
AbcNonLinearCost * | abcNonLinearCost () const
| Return pointer to details of costs.
double * | perturbationSaved () const
| Perturbation (fixed) - is just scaled random numbers.
double | acceptablePivot () const
| Acceptable pivot for this iteration.
int | ordinaryVariables () const
| Set to 1 if no free or super basic.
int | numberOrdinary () const
| Number of ordinary (lo/up) in tableau row.
void | setNumberOrdinary (int number)
| Set number of ordinary (lo/up) in tableau row.
double | currentDualBound () const
| Current dualBound (will end up as dualBound_).
AbcDualRowPivot * | dualRowPivot () const
| dual row pivot choice
AbcPrimalColumnPivot * | primalColumnPivot () const
| primal column pivot choice
AbcMatrix * | abcMatrix () const
| Abc Matrix.
int | internalFactorize (int solveType)
| Factorizes using current basis.
void | permuteIn ()
| Permutes in from ClpModel data - assumes scale factors done and AbcMatrix exists but is in original order (including slacks).
void | permuteBasis ()
| deals with new basis and puts in abcPivotVariable_
void | permuteOut (int whatsWanted)
| Permutes out - bit settings same as stateOfProblem.
ClpDataSave | saveData ()
| Save data.
void | restoreData (ClpDataSave saved)
| Restore data.
void | cleanStatus (bool valuesPass=false)
| Clean up status - make sure no superbasic etc.
int | computeDuals (double *givenDjs, CoinIndexedVector *array1, CoinIndexedVector *array2)
| Computes duals from scratch.
int | computePrimals (CoinIndexedVector *array1, CoinIndexedVector *array2)
| Computes primals from scratch. Returns number of refinements.
void | computeObjective ()
| Computes nonbasic cost and total cost.
void | setMultipleSequenceIn (int sequenceIn[4])
| set multiple sequence in
void | unpack (CoinIndexedVector &rowArray) const
| Unpacks one column of the matrix into indexed array Uses sequenceIn_.
void | unpack (CoinIndexedVector &rowArray, int sequence) const
| Unpacks one column of the matrix into indexed array.
int | housekeeping ()
| This does basis housekeeping and does values for in/out variables.
void | checkPrimalSolution (bool justBasic)
| This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Primal).
void | checkDualSolution ()
| This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Dual).
void | checkDualSolutionPlusFake ()
| This sets largest infeasibility and most infeasible and sum and number of infeasibilities AND sumFakeInfeasibilites_ (Dual).
void | checkBothSolutions ()
| This sets sum and number of infeasibilities (Dual and Primal).
int | gutsOfSolution (int type)
| Computes solutions - 1 do duals, 2 do primals, 3 both (returns number of refinements).
int | gutsOfPrimalSolution (int type)
| Computes solutions - 1 do duals, 2 do primals, 3 both (returns number of refinements).
void | saveGoodStatus ()
| Saves good status etc.
void | restoreGoodStatus (int type)
| Restores previous good status and says trouble.
void | refreshCosts ()
| After modifying first copy refreshes second copy and marks as updated.
void | refreshLower (unsigned int type=~(ROW_LOWER_SAME|COLUMN_UPPER_SAME))
void | refreshUpper (unsigned int type=~(ROW_LOWER_SAME|COLUMN_LOWER_SAME))
void | setupPointers (int maxRows, int maxColumns)
| Sets up all extra pointers.
void | copyFromSaved (int type=31)
| Copies all saved versions to working versions and may do something for perturbation.
void | fillPerturbation (int start, int number)
| fills in perturbationSaved_ from start with 0.5+random
void | checkArrays (int ignoreEmpty=0) const
| For debug - prints summary of arrays which are out of kilter.
void | checkDjs (int type=1) const
| For debug - summarizes dj situation (1 recomputes duals first, 2 checks duals as well).
void | checkSolutionBasic () const
| For debug - checks solutionBasic.
void | checkMoveBack (bool checkDuals)
| For debug - moves solution back to external and computes stuff (always checks djs).
void | setValuesPassAction (double incomingInfeasibility, double allowedInfeasibility)
| For advanced use.
int | cleanFactorization (int ifValuesPass)
| Get a clean factorization - i.e.
void | moveStatusToClp (ClpSimplex *clpModel)
| Move status and solution to ClpSimplex.
void | moveStatusFromClp (ClpSimplex *clpModel)
| Move status and solution from ClpSimplex.
int | gutsOfSolution (double *givenDuals, const double *givenPrimals, bool valuesPass=false)
| May change basis and then returns number changed.
void | gutsOfDelete (int type)
| Does most of deletion for arrays etc(0 just null arrays, 1 delete first).
void | gutsOfCopy (const AbcSimplex &rhs)
| Does most of copying.
void | gutsOfInitialize (int numberRows, int numberColumns, bool doMore)
| Initializes arrays.
void | gutsOfResize (int numberRows, int numberColumns)
| resizes arrays
void | translate (int type)
| Translates ClpModel to AbcSimplex See DO_ bits in stateOfProblem_ for type e.g.
void | moveToBasic (int which=15)
| Moves basic stuff to basic area.
double * | solutionRegion () const
| Return region.
double * | djRegion () const
double * | lowerRegion () const
double * | upperRegion () const
double * | costRegion () const
double * | solutionRegion (int which) const
| Return region.
double * | djRegion (int which) const
double * | lowerRegion (int which) const
double * | upperRegion (int which) const
double * | costRegion (int which) const
double * | solutionBasic () const
| Return region.
double * | djBasic () const
double * | lowerBasic () const
double * | upperBasic () const
double * | costBasic () const
double * | abcPerturbation () const
| Perturbation.
double * | fakeDjs () const
| Fake djs.
unsigned char * | internalStatus () const
AbcSimplex::Status | getInternalStatus (int sequence) const
AbcSimplex::Status | getInternalColumnStatus (int sequence) const
void | setInternalStatus (int sequence, AbcSimplex::Status newstatus)
void | setInternalColumnStatus (int sequence, AbcSimplex::Status newstatus)
void | setInitialDenseFactorization (bool onOff)
| Normally the first factorization does sparse coding because the factorization could be singular.
bool | initialDenseFactorization () const
int | sequenceIn () const
| Return sequence In or Out.
int | sequenceOut () const
void | setSequenceIn (int sequence)
| Set sequenceIn or Out.
void | setSequenceOut (int sequence)
int | isColumn (int sequence) const
| Returns 1 if sequence indicates column.
int | sequenceWithin (int sequence) const
| Returns sequence number within section.
int | lastPivotRow () const
| Current/last pivot row (set after END of choosing pivot row in dual).
int | firstFree () const
| First Free_.
int | lastFirstFree () const
| Last firstFree_.
int | freeSequenceIn () const
| Free chosen vector.
double | currentAcceptablePivot () const
| Acceptable pivot for this iteration.
int | fakeSuperBasic (int iSequence)
| Returns 1 if fake superbasic 0 if free or true superbasic -1 if was fake but has cleaned itself up (sets status) -2 if wasn't fake.
double | solution (int sequence)
| Return row or column values.
double & | solutionAddress (int sequence)
| Return address of row or column values.
double | reducedCost (int sequence)
double & | reducedCostAddress (int sequence)
double | lower (int sequence)
double & | lowerAddress (int sequence)
| Return address of row or column lower bound.
double | upper (int sequence)
double & | upperAddress (int sequence)
| Return address of row or column upper bound.
double | cost (int sequence)
double & | costAddress (int sequence)
| Return address of row or column cost.
double | originalLower (int iSequence) const
| Return original lower bound.
double | originalUpper (int iSequence) const
| Return original lower bound.
AbcSimplexProgress * | abcProgress ()
| For dealing with all issues of cycling etc.
void | clearArraysPublic (int which)
| Clears an array and says available (-1 does all) when no possibility of going parallel.
int | getAvailableArrayPublic () const
| Returns first available empty array (and sets flag) when no possibility of going parallel.
void | clearArrays (int which)
| Clears an array and says available (-1 does all).
void | clearArrays (CoinPartitionedVector *which)
| Clears an array and says available.
int | getAvailableArray () const
| Returns first available empty array (and sets flag).
void | setUsedArray (int which) const
| Say array going to be used.
void | setAvailableArray (int which) const
| Say array going available.
void | swapPrimalStuff ()
| Swaps primal stuff.
void | swapDualStuff (int lastSequenceOut, int lastDirectionOut)
| Swaps dual stuff.
void | setObjectiveCoefficient (int elementIndex, double elementValue)
| Set an objective function coefficient.
void | setObjCoeff (int elementIndex, double elementValue)
| Set an objective function coefficient.
void | setColumnLower (int elementIndex, double elementValue)
| Set a single column lower bound Use -DBL_MAX for -infinity.
void | setColumnUpper (int elementIndex, double elementValue)
| Set a single column upper bound Use DBL_MAX for infinity.
void | setColumnBounds (int elementIndex, double lower, double upper)
| Set a single column lower and upper bound.
void | setColumnSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of columns simultaneously The default implementation just invokes setColLower() and setColUpper() over and over again.
void | setColLower (int elementIndex, double elementValue)
| Set a single column lower bound Use -DBL_MAX for -infinity.
void | setColUpper (int elementIndex, double elementValue)
| Set a single column upper bound Use DBL_MAX for infinity.
void | setColBounds (int elementIndex, double newlower, double newupper)
| Set a single column lower and upper bound.
void | setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of columns simultaneously .
void | setRowLower (int elementIndex, double elementValue)
| Set a single row lower bound Use -DBL_MAX for -infinity.
void | setRowUpper (int elementIndex, double elementValue)
| Set a single row upper bound Use DBL_MAX for infinity.
void | setRowBounds (int elementIndex, double lower, double upper)
| Set a single row lower and upper bound.
void | setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of rows simultaneously .
void | resize (int newNumberRows, int newNumberColumns)
| Resizes rim part of model.
void | swap (int pivotRow, int nonBasicPosition)
| Swaps two variables.
void | setFlagged (int sequence)
| To flag a variable.
void | clearFlagged (int sequence)
bool | flagged (int sequence) const
void | createStatus ()
| Set up status array (can be used by OsiAbc).
void | crash (int type)
| Does sort of crash.
void | putStuffInBasis (int type)
| Puts more stuff in basis 1 bit set - do even if basis exists 2 bit set - don't bother staying triangular.
void | allSlackBasis ()
| Sets up all slack basis and resets solution to as it was after initial load or readMps.
void | checkConsistentPivots () const
| For debug - check pivotVariable consistent.
void | printStuff () const
| Print stuff.
int | startup (int ifValuesPass)
| Common bits of coding for dual and primal.
double | rawObjectiveValue () const
| Raw objective value (so always minimize in primal).
void | computeObjectiveValue (bool useWorkingSolution=false)
| Compute objective value from solution and put in objectiveValue_.
double | computeInternalObjectiveValue ()
| Compute minimization objective value from internal solution without perturbation.
void | moveInfo (const AbcSimplex &rhs, bool justStatus=false)
| Move status and solution across.
Public Member Functions inherited from ClpSimplex
| ClpSimplex (bool emptyMessages=false)
| Default constructor.
| ClpSimplex (const ClpSimplex &rhs, int scalingMode=-1)
| Copy constructor.
| ClpSimplex (const ClpModel &rhs, int scalingMode=-1)
| Copy constructor from model.
| ClpSimplex (const ClpModel *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true, bool fixOthers=false)
| Subproblem constructor.
| ClpSimplex (const ClpSimplex *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true, bool fixOthers=false)
| Subproblem constructor.
| ClpSimplex (ClpSimplex *wholeModel, int numberColumns, const int *whichColumns)
| This constructor modifies original ClpSimplex and stores original stuff in created ClpSimplex.
void | originalModel (ClpSimplex *miniModel)
| This copies back stuff from miniModel and then deletes miniModel.
void | setPersistenceFlag (int value)
| Array persistence flag If 0 then as now (delete/new) 1 then only do arrays if bigger needed 2 as 1 but give a bit extra if bigger needed.
void | makeBaseModel ()
| Save a copy of model with certain state - normally without cuts.
void | deleteBaseModel ()
| Switch off base model.
ClpSimplex * | baseModel () const
| See if we have base model.
void | setToBaseModel (ClpSimplex *model=NULL)
| Reset to base model (just size and arrays needed) If model NULL use internal copy.
ClpSimplex & | operator= (const ClpSimplex &rhs)
| Assignment operator. This copies the data.
| ~ClpSimplex ()
| Destructor.
void | loadProblem (const ClpMatrixBase &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| Loads a problem (the constraints on the rows are given by lower and upper bounds).
void | loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| Just like the other loadProblem() method except that the matrix is given in a standard column major ordered format (without gaps).
void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const int *length, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| This one is for after presolve to save memory.
int | loadProblem (CoinModel &modelObject, bool keepSolution=false)
| This loads a model from a coinModel object - returns number of errors.
int | readMps (const char *filename, bool keepNames=false, bool ignoreErrors=false)
| Read an mps file from the given filename.
int | readGMPL (const char *filename, const char *dataName, bool keepNames=false)
| Read GMPL files from the given filenames.
int | readLp (const char *filename, const double epsilon=1e-5)
| Read file in LP format from file with name filename.
void | writeLp (const char *filename, const char *extension="lp", double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
| Write the problem into an Lp file of the given filename.
void | borrowModel (ClpModel &otherModel)
| Borrow model.
void | borrowModel (ClpSimplex &otherModel)
void | passInEventHandler (const ClpEventHandler *eventHandler)
| Pass in Event handler (cloned and deleted at end).
void | getbackSolution (const ClpSimplex &smallModel, const int *whichRow, const int *whichColumn)
| Puts solution back into small model.
int | loadNonLinear (void *info, int &numberConstraints, ClpConstraint **&constraints)
| Load nonlinear part of problem from AMPL info Returns 0 if linear 1 if quadratic objective 2 if quadratic constraints 3 if nonlinear objective 4 if nonlinear constraints -1 on failure.
int | initialSolve (ClpSolve &options)
| General solve algorithm which can do presolve.
int | initialSolve ()
| Default initial solve.
int | initialDualSolve ()
| Dual initial solve.
int | initialPrimalSolve ()
| Primal initial solve.
int | initialBarrierSolve ()
| Barrier initial solve.
int | initialBarrierNoCrossSolve ()
| Barrier initial solve, not to be followed by crossover.
int | dual (int ifValuesPass=0, int startFinishOptions=0)
| Dual algorithm - see ClpSimplexDual.hpp for method.
int | dualDebug (int ifValuesPass=0, int startFinishOptions=0)
int | primal (int ifValuesPass=0, int startFinishOptions=0)
| Primal algorithm - see ClpSimplexPrimal.hpp for method.
int | nonlinearSLP (int numberPasses, double deltaTolerance)
| Solves nonlinear problem using SLP - may be used as crash for other algorithms when number of iterations small.
int | nonlinearSLP (int numberConstraints, ClpConstraint **constraints, int numberPasses, double deltaTolerance)
| Solves problem with nonlinear constraints using SLP - may be used as crash for other algorithms when number of iterations small.
int | barrier (bool crossover=true)
| Solves using barrier (assumes you have good cholesky factor code).
int | reducedGradient (int phase=0)
| Solves non-linear using reduced gradient.
int | solve (CoinStructuredModel *model)
| Solve using structure of model and maybe in parallel.
int | loadProblem (CoinStructuredModel &modelObject, bool originalOrder=true, bool keepSolution=false)
| This loads a model from a CoinStructuredModel object - returns number of errors.
int | cleanup (int cleanupScaling)
| When scaling is on it is possible that the scaled problem is feasible but the unscaled is not.
int | cleanPrimalSolution (double exactMultiple)
| Clean primal solution If you expect solution to only have exact multiples of "exactMultiple" then this tries moving solution values to nearest multiple.
int | dualRanging (int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease, double *valueIncrease=NULL, double *valueDecrease=NULL)
| Dual ranging.
int | primalRanging (int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease)
| Primal ranging.
int | modifyCoefficientsAndPivot (int number, const int *which, const CoinBigIndex *start, const int *row, const double *newCoefficient, const unsigned char *newStatus=NULL, const double *newLower=NULL, const double *newUpper=NULL, const double *newObjective=NULL)
| Modifies coefficients etc and if necessary pivots in and out.
int | outDuplicateRows (int numberLook, int *whichRows, bool noOverlaps=false, double tolerance=-1.0, double cleanUp=0.0)
| Take out duplicate rows (includes scaled rows and intersections).
double | moveTowardsPrimalFeasible ()
| Try simple crash like techniques to get closer to primal feasibility returns final sum of infeasibilities.
void | removeSuperBasicSlacks (int threshold=0)
| Try simple crash like techniques to remove super basic slacks but only if > threshold.
ClpSimplex * | miniPresolve (char *rowType, char *columnType, void **info)

Mini presolve (faster) Char arrays must be numberRows and numberColumns long on entry second part must be filled in as follows - 0 - possible >0 - take out and do something (depending on value - TBD) -1 row/column can't vanish but can have entries removed/changed -2 don't touch at all on exit <=0 ones will be in presolved problem struct will be created and will be long enough (information on length etc in first entry) user must delete struct.

void | miniPostsolve (const ClpSimplex *presolvedModel, void *info)
| After mini presolve.
void | miniSolve (char *rowType, char *columnType, int algorithm, int startUp)
| mini presolve and solve
int | writeBasis (const char *filename, bool writeValues=false, int formatType=0) const
| Write the basis in MPS format to the specified file.
int | readBasis (const char *filename)
| Read a basis from the given filename, returns -1 on file error, 0 if no values, 1 if values.
CoinWarmStartBasis * | getBasis () const
| Returns a basis (to be deleted by user).
void | setFactorization (ClpFactorization &factorization)
| Passes in factorization.
ClpFactorization * | swapFactorization (ClpFactorization *factorization)
void | copyFactorization (ClpFactorization &factorization)
| Copies in factorization to existing one.
int | tightenPrimalBounds (double factor=0.0, int doTight=0, bool tightIntegers=false)
| Tightens primal bounds to make dual faster.
int | crash (double gap, int pivot)
| Crash - at present just aimed at dual, returns -2 if dual preferred and crash basis created -1 if dual preferred and all slack basis preferred 0 if basis going in was not all slack 1 if primal preferred and all slack basis preferred 2 if primal preferred and crash basis created.
void | setDualRowPivotAlgorithm (ClpDualRowPivot &choice)
| Sets row pivot choice algorithm in dual.
void | setPrimalColumnPivotAlgorithm (ClpPrimalColumnPivot &choice)
| Sets column pivot choice algorithm in primal.
void | markHotStart (void *&saveStuff)
| Create a hotstart point of the optimization process.
void | solveFromHotStart (void *saveStuff)
| Optimize starting from the hotstart.
void | unmarkHotStart (void *saveStuff)
| Delete the snapshot.
int | strongBranching (int numberVariables, const int *variables, double *newLower, double *newUpper, double **outputSolution, int *outputStatus, int *outputIterations, bool stopOnFirstInfeasible=true, bool alwaysFinish=false, int startFinishOptions=0)
| For strong branching.
int | fathom (void *stuff)
| Fathom - 1 if solution.
int | fathomMany (void *stuff)
| Do up to N deep - returns -1 - no solution nNodes_ valid nodes >= if solution and that node gives solution ClpNode array is 2**N long.
double | doubleCheck ()
| Double checks OK.
int | startFastDual2 (ClpNodeStuff *stuff)
| Starts Fast dual2.
int | fastDual2 (ClpNodeStuff *stuff)
| Like Fast dual.
void | stopFastDual2 (ClpNodeStuff *stuff)
| Stops Fast dual2.
ClpSimplex * | fastCrunch (ClpNodeStuff *stuff, int mode)
| Deals with crunch aspects mode 0 - in 1 - out with solution 2 - out without solution returns small model or NULL.
int | pivot ()
| Pivot in a variable and out a variable.
int | primalPivotResult ()
| Pivot in a variable and choose an outgoing one.
int | dualPivotResultPart1 ()
| Pivot out a variable and choose an incoing one.
int | pivotResultPart2 (int algorithm, int state)
| Do actual pivot state is 0 if need tableau column, 1 if in rowArray_[1].
int | startup (int ifValuesPass, int startFinishOptions=0)
| Common bits of coding for dual and primal.
void | finish (int startFinishOptions=0)
bool | statusOfProblem (bool initial=false)
| Factorizes and returns true if optimal.
void | defaultFactorizationFrequency ()
| If user left factorization frequency then compute.
void | copyEnabledStuff (const ClpSimplex *rhs)
| Copy across enabled stuff from one solver to another.
bool | primalFeasible () const
| If problem is primal feasible.
bool | dualFeasible () const
| If problem is dual feasible.
ClpFactorization * | factorization () const
| factorization
bool | sparseFactorization () const
| Sparsity on or off.
void | setSparseFactorization (bool value)
int | factorizationFrequency () const
| Factorization frequency.
void | setFactorizationFrequency (int value)
double | dualBound () const
| Dual bound.
void | setDualBound (double value)
double | infeasibilityCost () const
| Infeasibility cost.
void | setInfeasibilityCost (double value)
int | perturbation () const
| Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - verbose above that 8,16,32 etc just for selective debug.
void | setPerturbation (int value)
int | algorithm () const
| Current (or last) algorithm.
void | setAlgorithm (int value)
| Set algorithm.
bool | isObjectiveLimitTestValid () const
| Return true if the objective limit test can be relied upon.
double | sumDualInfeasibilities () const
| Sum of dual infeasibilities.
void | setSumDualInfeasibilities (double value)
double | sumOfRelaxedDualInfeasibilities () const
| Sum of relaxed dual infeasibilities.
void | setSumOfRelaxedDualInfeasibilities (double value)
int | numberDualInfeasibilities () const
| Number of dual infeasibilities.
void | setNumberDualInfeasibilities (int value)
int | numberDualInfeasibilitiesWithoutFree () const
| Number of dual infeasibilities (without free).
double | sumPrimalInfeasibilities () const
| Sum of primal infeasibilities.
void | setSumPrimalInfeasibilities (double value)
double | sumOfRelaxedPrimalInfeasibilities () const
| Sum of relaxed primal infeasibilities.
void | setSumOfRelaxedPrimalInfeasibilities (double value)
int | numberPrimalInfeasibilities () const
| Number of primal infeasibilities.
void | setNumberPrimalInfeasibilities (int value)
int | saveModel (const char *fileName)
| Save model to file, returns 0 if success.
int | restoreModel (const char *fileName)
| Restore model from file, returns 0 if success, deletes current model.
void | checkSolution (int setToBounds=0)
| Just check solution (for external use) - sets sum of infeasibilities etc.
void | checkSolutionInternal ()
| Just check solution (for internal use) - sets sum of infeasibilities etc.
void | checkUnscaledSolution ()
| Check unscaled primal solution but allow for rounding error.
CoinIndexedVector * | rowArray (int index) const
| Useful row length arrays (0,1,2,3,4,5).
CoinIndexedVector * | columnArray (int index) const
| Useful column length arrays (0,1,2,3,4,5).
double | alphaAccuracy () const
| Initial value for alpha accuracy calculation (-1.0 off).
void | setAlphaAccuracy (double value)
void | setDisasterHandler (ClpDisasterHandler *handler)
| Objective value.
ClpDisasterHandler * | disasterHandler () const
| Get disaster handler.
double | largeValue () const
| Large bound value (for complementarity etc).
void | setLargeValue (double value)
double | largestPrimalError () const
| Largest error on Ax-b.
double | largestDualError () const
| Largest error on basic duals.
void | setLargestPrimalError (double value)
| Largest error on Ax-b.
void | setLargestDualError (double value)
| Largest error on basic duals.
double | zeroTolerance () const
| Get zero tolerance.
void | setZeroTolerance (double value)
| Set zero tolerance.
int * | pivotVariable () const
| Basic variables pivoting on which rows.
bool | automaticScaling () const
| If automatic scaling on.
void | setAutomaticScaling (bool onOff)
double | currentDualTolerance () const
| Current dual tolerance.
void | setCurrentDualTolerance (double value)
double | currentPrimalTolerance () const
| Current primal tolerance.
void | setCurrentPrimalTolerance (double value)
int | numberRefinements () const
| How many iterative refinements to do.
void | setNumberRefinements (int value)
double | alpha () const
| Alpha (pivot element) for use by classes e.g. steepestedge.
void | setAlpha (double value)
double | dualIn () const
| Reduced cost of last incoming for use by classes e.g. steepestedge.
void | setDualIn (double value)
| Set reduced cost of last incoming to force error.
int | pivotRow () const
| Pivot Row for use by classes e.g. steepestedge.
void | setPivotRow (int value)
double | valueIncomingDual () const
| value of incoming variable (in Dual)
double * | solutionRegion (int section) const
| Return row or column sections - not as much needed as it once was.
double * | djRegion (int section) const
double * | lowerRegion (int section) const
double * | upperRegion (int section) const
double * | costRegion (int section) const
double * | solutionRegion () const
| Return region as single array.
double * | djRegion () const
double * | lowerRegion () const
double * | upperRegion () const
double * | costRegion () const
Status | getStatus (int sequence) const
void | setStatus (int sequence, Status newstatus)
bool | startPermanentArrays ()
| Start or reset using maximumRows_ and Columns_ - true if change.
void | setInitialDenseFactorization (bool onOff)
| Normally the first factorization does sparse coding because the factorization could be singular.
bool | initialDenseFactorization () const
int | sequenceIn () const
| Return sequence In or Out.
int | sequenceOut () const
void | setSequenceIn (int sequence)
| Set sequenceIn or Out.
void | setSequenceOut (int sequence)
int | directionIn () const
| Return direction In or Out.
int | directionOut () const
void | setDirectionIn (int direction)
| Set directionIn or Out.
void | setDirectionOut (int direction)
double | valueOut () const
| Value of Out variable.
double | lowerOut () const
| Lower of out variable.
double | upperOut () const
| Upper of out variable.
void | setValueOut (double value)
| Set value of out variable.
double | dualOut () const
| Dual value of Out variable.
void | setDualOut (double value)
| Set dual value of out variable.
void | setLowerOut (double value)
| Set lower of out variable.
void | setUpperOut (double value)
| Set upper of out variable.
void | setTheta (double value)
| Set theta of out variable.
int | isColumn (int sequence) const
| Returns 1 if sequence indicates column.
int | sequenceWithin (int sequence) const
| Returns sequence number within section.
double | solution (int sequence)
| Return row or column values.
double & | solutionAddress (int sequence)
| Return address of row or column values.
double | reducedCost (int sequence)
double & | reducedCostAddress (int sequence)
double | lower (int sequence)
double & | lowerAddress (int sequence)
| Return address of row or column lower bound.
double | upper (int sequence)
double & | upperAddress (int sequence)
| Return address of row or column upper bound.
double | cost (int sequence)
double & | costAddress (int sequence)
| Return address of row or column cost.
double | originalLower (int iSequence) const
| Return original lower bound.
double | originalUpper (int iSequence) const
| Return original lower bound.
double | theta () const
| Theta (pivot change).
double | lowerIn () const
| Lower Bound on In variable.
double | valueIn () const
| Value of In variable.
double | upperIn () const
| Upper Bound on In variable.
double | bestPossibleImprovement () const
| Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (dual).
ClpNonLinearCost * | nonLinearCost () const
| Return pointer to details of costs.
void | setNonLinearCost (ClpNonLinearCost &nonLinearCost)
| Set pointer to details of costs.
int | moreSpecialOptions () const
| Return more special options 1 bit - if presolve says infeasible in ClpSolve return 2 bit - if presolved problem infeasible return 4 bit - keep arrays like upper_ around 8 bit - no free or superBasic variables 16 bit - if checking replaceColumn accuracy before updating 32 bit - say optimal if primal feasible!
int | vectorMode () const
| Get vector mode.
void | setMoreSpecialOptions (int value)
| Set more special options 1 bit - if presolve says infeasible in ClpSolve return 2 bit - if presolved problem infeasible return 4 bit - keep arrays like upper_ around 8 bit - no free or superBasic variables 16 bit - if checking replaceColumn accuracy before updating 32 bit - say optimal if primal feasible!
void | setVectorMode (int value)
| Set vector mode.
void | setFakeBound (int sequence, FakeBound fakeBound)
FakeBound | getFakeBound (int sequence) const
void | setRowStatus (int sequence, Status newstatus)
Status | getRowStatus (int sequence) const
void | setColumnStatus (int sequence, Status newstatus)
Status | getColumnStatus (int sequence) const
void | setPivoted (int sequence)
void | clearPivoted (int sequence)
bool | pivoted (int sequence) const
void | setFlagged (int sequence)
| To flag a variable (not inline to allow for column generation).
void | clearFlagged (int sequence)
bool | flagged (int sequence) const
void | setActive (int iRow)
| To say row active in primal pivot row choice.
void | clearActive (int iRow)
bool | active (int iRow) const
void | setPerturbed (int iSequence)
| To say perturbed.
void | clearPerturbed (int iSequence)
bool | perturbed (int iSequence) const
void | createStatus ()
| Set up status array (can be used by OsiClp).
void | allSlackBasis (bool resetSolution=false)
| Sets up all slack basis and resets solution to as it was after initial load or readMps.
int | lastBadIteration () const
| So we know when to be cautious.
void | setLastBadIteration (int value)
| Set so we know when to be cautious.
int | progressFlag () const
| Progress flag - at present 0 bit says artificials out.
ClpSimplexProgress * | progress ()
| For dealing with all issues of cycling etc.
int | forceFactorization () const
| Force re-factorization early value.
void | forceFactorization (int value)
| Force re-factorization early.
double | rawObjectiveValue () const
| Raw objective value (so always minimize in primal).
void | computeObjectiveValue (bool useWorkingSolution=false)
| Compute objective value from solution and put in objectiveValue_.
double | computeInternalObjectiveValue ()
| Compute minimization objective value from internal solution without perturbation.
double * | infeasibilityRay (bool fullRay=false) const
| Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays.
int | numberExtraRows () const
| Number of extra rows.
int | maximumBasic () const
| Maximum number of basic variables - can be more than number of rows if GUB.
int | baseIteration () const
| Iteration when we entered dual or primal.
void | generateCpp (FILE *fp, bool defaultFactor=false)
| Create C++ lines to get to current state.
ClpFactorization * | getEmptyFactorization ()
| Gets clean and emptyish factorization.
void | setEmptyFactorization ()
| May delete or may make clean and emptyish factorization.
void | moveInfo (const ClpSimplex &rhs, bool justStatus=false)
| Move status and solution across.
void | getBInvARow (int row, double *z, double *slack=NULL)
| Get a row of the tableau (slack part in slack if not NULL).
void | getBInvRow (int row, double *z)
| Get a row of the basis inverse.
void | getBInvACol (int col, double *vec)
| Get a column of the tableau.
void | getBInvCol (int col, double *vec)
| Get a column of the basis inverse.
void | getBasics (int *index)
| Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()).
void | setObjectiveCoefficient (int elementIndex, double elementValue)
| Set an objective function coefficient.
void | setObjCoeff (int elementIndex, double elementValue)
| Set an objective function coefficient.
void | setColumnLower (int elementIndex, double elementValue)
| Set a single column lower bound Use -DBL_MAX for -infinity.
void | setColumnUpper (int elementIndex, double elementValue)
| Set a single column upper bound Use DBL_MAX for infinity.
void | setColumnBounds (int elementIndex, double lower, double upper)
| Set a single column lower and upper bound.
void | setColumnSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of columns simultaneously The default implementation just invokes setColLower() and setColUpper() over and over again.
void | setColLower (int elementIndex, double elementValue)
| Set a single column lower bound Use -DBL_MAX for -infinity.
void | setColUpper (int elementIndex, double elementValue)
| Set a single column upper bound Use DBL_MAX for infinity.
void | setColBounds (int elementIndex, double newlower, double newupper)
| Set a single column lower and upper bound.
void | setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of columns simultaneously .
void | setRowLower (int elementIndex, double elementValue)
| Set a single row lower bound Use -DBL_MAX for -infinity.
void | setRowUpper (int elementIndex, double elementValue)
| Set a single row upper bound Use DBL_MAX for infinity.
void | setRowBounds (int elementIndex, double lower, double upper)
| Set a single row lower and upper bound.
void | setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of rows simultaneously .
void | resize (int newNumberRows, int newNumberColumns)
| Resizes rim part of model.
int | getSolution (const double *rowActivities, const double *columnActivities)
| Given an existing factorization computes and checks primal and dual solutions.
int | getSolution ()
| Given an existing factorization computes and checks primal and dual solutions.
int | createPiecewiseLinearCosts (const int *starts, const double *lower, const double *gradient)
| Constructs a non linear cost from list of non-linearities (columns only) First lower of each column is taken as real lower Last lower is taken as real upper and cost ignored.
ClpDualRowPivot * | dualRowPivot () const
| dual row pivot choice
ClpPrimalColumnPivot * | primalColumnPivot () const
| primal column pivot choice
bool | goodAccuracy () const
| Returns true if model looks OK.
void | returnModel (ClpSimplex &otherModel)
| Return model - updates any scalars.
int | internalFactorize (int solveType)
| Factorizes using current basis.
ClpDataSave | saveData ()
| Save data.
void | restoreData (ClpDataSave saved)
| Restore data.
void | cleanStatus ()
| Clean up status.
int | factorize ()
| Factorizes using current basis. For external use.
void | computeDuals (double *givenDjs)
| Computes duals from scratch.
void | computePrimals (const double *rowActivities, const double *columnActivities)
| Computes primals from scratch.
void | add (double *array, int column, double multiplier) const
| Adds multiple of a column into an array.
void | unpack (CoinIndexedVector *rowArray) const
| Unpacks one column of the matrix into indexed array Uses sequenceIn_ Also applies scaling if needed.
void | unpack (CoinIndexedVector *rowArray, int sequence) const
| Unpacks one column of the matrix into indexed array Slack if sequence>= numberColumns Also applies scaling if needed.
void | unpackPacked (CoinIndexedVector *rowArray)
| Unpacks one column of the matrix into indexed array as packed vector Uses sequenceIn_ Also applies scaling if needed.
void | unpackPacked (CoinIndexedVector *rowArray, int sequence)
| Unpacks one column of the matrix into indexed array as packed vector Slack if sequence>= numberColumns Also applies scaling if needed.
void | setValuesPassAction (double incomingInfeasibility, double allowedInfeasibility)
| For advanced use.
int | cleanFactorization (int ifValuesPass)
| Get a clean factorization - i.e.
Public Member Functions inherited from ClpModel
| ClpModel (bool emptyMessages=false)
| Default constructor.
| ClpModel (const ClpModel &rhs, int scalingMode=-1)
| Copy constructor.
ClpModel & | operator= (const ClpModel &rhs)
| Assignment operator. This copies the data.
| ClpModel (const ClpModel *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true)
| Subproblem constructor.
| ~ClpModel ()
| Destructor.
int | numberRows () const
| Number of rows.
int | getNumRows () const
int | getNumCols () const
| Number of columns.
int | numberColumns () const
double | primalTolerance () const
| Primal tolerance to use.
void | setPrimalTolerance (double value)
double | dualTolerance () const
| Dual tolerance to use.
void | setDualTolerance (double value)
double | primalObjectiveLimit () const
| Primal objective limit.
void | setPrimalObjectiveLimit (double value)
double | dualObjectiveLimit () const
| Dual objective limit.
void | setDualObjectiveLimit (double value)
double | objectiveOffset () const
| Objective offset.
void | setObjectiveOffset (double value)
double | presolveTolerance () const
| Presolve tolerance to use.
const std::string & | problemName () const
int | numberIterations () const
| Number of iterations.
int | getIterationCount () const
void | setNumberIterations (int numberIterationsNew)
int | solveType () const
| Solve type - 1 simplex, 2 simplex interface, 3 Interior.
void | setSolveType (int type)
int | maximumIterations () const
| Maximum number of iterations.
void | setMaximumIterations (int value)
double | maximumSeconds () const
| Maximum time in seconds (from when set called).
void | setMaximumSeconds (double value)
void | setMaximumWallSeconds (double value)
bool | hitMaximumIterations () const
| Returns true if hit maximum iterations (or time).
int | status () const
| Status of problem: -1 - unknown e.g.
int | problemStatus () const
void | setProblemStatus (int problemStatusNew)
| Set problem status.
int | secondaryStatus () const

Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reached OR (probably primal infeasible but can't prove it - main status was 4) 2 - scaled problem optimal - unscaled problem has primal infeasibilities 3 - scaled problem optimal - unscaled problem has dual infeasibilities 4 - scaled problem optimal - unscaled problem has primal and dual infeasibilities 5 - giving up in primal with flagged variables 6 - failed due to empty problem check 7 - postSolve says not optimal 8 - failed due to bad element check 9 - status was 3 and stopped on time 10 - status was 3 but stopped as primal feasible 11 - status was 1/2 from presolve found infeasible or unbounded 100 up - translation of enum from ClpEventHandler.

void | setSecondaryStatus (int newstatus)
bool | isAbandoned () const
| Are there a numerical difficulties?
bool | isProvenOptimal () const
| Is optimality proven?
bool | isProvenPrimalInfeasible () const
| Is primal infeasiblity proven?
bool | isProvenDualInfeasible () const
| Is dual infeasiblity proven?
bool | isPrimalObjectiveLimitReached () const
| Is the given primal objective limit reached?
bool | isDualObjectiveLimitReached () const
| Is the given dual objective limit reached?
bool | isIterationLimitReached () const
| Iteration limit reached?
double | optimizationDirection () const
| Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
double | getObjSense () const
void | setOptimizationDirection (double value)
double * | primalRowSolution () const
| Primal row solution.
const double * | getRowActivity () const
double * | primalColumnSolution () const
| Primal column solution.
const double * | getColSolution () const
void | setColSolution (const double *input)
double * | dualRowSolution () const
| Dual row solution.
const double * | getRowPrice () const
double * | dualColumnSolution () const
| Reduced costs.
const double * | getReducedCost () const
double * | rowLower () const
| Row lower.
const double * | getRowLower () const
double * | rowUpper () const
| Row upper.
const double * | getRowUpper () const
void | setObjectiveCoefficient (int elementIndex, double elementValue)
| Set an objective function coefficient.
void | setObjCoeff (int elementIndex, double elementValue)
| Set an objective function coefficient.
void | setColumnLower (int elementIndex, double elementValue)
| Set a single column lower bound Use -DBL_MAX for -infinity.
void | setColumnUpper (int elementIndex, double elementValue)
| Set a single column upper bound Use DBL_MAX for infinity.
void | setColumnBounds (int elementIndex, double lower, double upper)
| Set a single column lower and upper bound.
void | setColumnSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of columns simultaneously The default implementation just invokes setColLower() and setColUpper() over and over again.
void | setColLower (int elementIndex, double elementValue)
| Set a single column lower bound Use -DBL_MAX for -infinity.
void | setColUpper (int elementIndex, double elementValue)
| Set a single column upper bound Use DBL_MAX for infinity.
void | setColBounds (int elementIndex, double lower, double upper)
| Set a single column lower and upper bound.
void | setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of columns simultaneously .
void | setRowLower (int elementIndex, double elementValue)
| Set a single row lower bound Use -DBL_MAX for -infinity.
void | setRowUpper (int elementIndex, double elementValue)
| Set a single row upper bound Use DBL_MAX for infinity.
void | setRowBounds (int elementIndex, double lower, double upper)
| Set a single row lower and upper bound.
void | setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
| Set the bounds on a number of rows simultaneously .
const double * | rowScale () const
| Scaling.
const double * | columnScale () const
const double * | inverseRowScale () const
const double * | inverseColumnScale () const
double * | mutableRowScale () const
double * | mutableColumnScale () const
double * | mutableInverseRowScale () const
double * | mutableInverseColumnScale () const
double * | swapRowScale (double *newScale)
void | setRowScale (double *scale)
void | setColumnScale (double *scale)
double | objectiveScale () const
| Scaling of objective.
void | setObjectiveScale (double value)
double | rhsScale () const
| Scaling of rhs and bounds.
void | setRhsScale (double value)
void | scaling (int mode=1)
| Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab.
void | unscale ()
| If we constructed a "really" scaled model then this reverses the operation.
int | scalingFlag () const
| Gets scalingFlag.
double * | objective () const
| Objective.
double * | objective (const double *solution, double &offset, bool refresh=true) const
const double * | getObjCoefficients () const
double * | rowObjective () const
| Row Objective.
const double * | getRowObjCoefficients () const
double * | columnLower () const
| Column Lower.
const double * | getColLower () const
double * | columnUpper () const
| Column Upper.
const double * | getColUpper () const
CoinPackedMatrix * | matrix () const
| Matrix (if not ClpPackedmatrix be careful about memory leak.
CoinBigIndex | getNumElements () const
| Number of elements in matrix.
double | getSmallElementValue () const
| Small element value - elements less than this set to zero, default is 1.0e-20.
void | setSmallElementValue (double value)
ClpMatrixBase * | rowCopy () const
| Row Matrix.
void | setNewRowCopy (ClpMatrixBase *newCopy)
| Set new row matrix.
ClpMatrixBase * | clpMatrix () const
| Clp Matrix.
ClpPackedMatrix * | clpScaledMatrix () const
| Scaled ClpPackedMatrix.
void | setClpScaledMatrix (ClpPackedMatrix *scaledMatrix)
| Sets pointer to scaled ClpPackedMatrix.
ClpPackedMatrix * | swapScaledMatrix (ClpPackedMatrix *scaledMatrix)
| Swaps pointer to scaled ClpPackedMatrix.
void | replaceMatrix (ClpMatrixBase *matrix, bool deleteCurrent=false)
| Replace Clp Matrix (current is not deleted unless told to and new is used) So up to user to delete current.
void | replaceMatrix (CoinPackedMatrix *newmatrix, bool deleteCurrent=false)
| Replace Clp Matrix (current is not deleted unless told to and new is used) So up to user to delete current.
double | objectiveValue () const
| Objective value.
void | setObjectiveValue (double value)
double | getObjValue () const
char * | integerInformation () const
| Integer information.
double * | infeasibilityRay (bool fullRay=false) const
| Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays.
double * | unboundedRay () const
double * | ray () const
| For advanced users - no need to delete - sign not changed.
bool | rayExists () const
| just test if infeasibility or unbounded Ray exists
void | deleteRay ()
| just delete ray if exists
const double * | internalRay () const
| Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
bool | statusExists () const
| See if status (i.e. basis) array exists (partly for OsiClp).
unsigned char * | statusArray () const
| Return address of status (i.e. basis) array (char[numberRows+numberColumns]).
unsigned char * | statusCopy () const
| Return copy of status (i.e.
void | copyinStatus (const unsigned char *statusArray)
| Copy in status (basis) vector.
void | setUserPointer (void *pointer)
| User pointer for whatever reason.
void * | getUserPointer () const
void | setTrustedUserPointer (ClpTrustedData *pointer)
| Trusted user pointer.
ClpTrustedData * | getTrustedUserPointer () const
int | whatsChanged () const
| What has changed in model (only for masochistic users).
void | setWhatsChanged (int value)
int | numberThreads () const
| Number of threads (not really being used).
void | setNumberThreads (int value)
void | passInMessageHandler (CoinMessageHandler *handler)
| Pass in Message handler (not deleted at end).
CoinMessageHandler * | pushMessageHandler (CoinMessageHandler *handler, bool &oldDefault)
| Pass in Message handler (not deleted at end) and return current.
void | popMessageHandler (CoinMessageHandler *oldHandler, bool oldDefault)
| back to previous message handler
void | newLanguage (CoinMessages::Language language)
| Set language.
void | setLanguage (CoinMessages::Language language)
void | setDefaultMessageHandler ()
| Overrides message handler with a default one.
CoinMessageHandler * | messageHandler () const
| Return handler.
CoinMessages | messages () const
| Return messages.
CoinMessages * | messagesPointer ()
| Return pointer to messages.
CoinMessages | coinMessages () const
| Return Coin messages.
CoinMessages * | coinMessagesPointer ()
| Return pointer to Coin messages.
void | setLogLevel (int value)
| Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - verbose above that 8,16,32 etc just for selective debug.
int | logLevel () const
bool | defaultHandler () const
| Return true if default handler.
void | passInEventHandler (const ClpEventHandler *eventHandler)
| Pass in Event handler (cloned and deleted at end).
ClpEventHandler * | eventHandler () const
| Event handler.
CoinThreadRandom * | randomNumberGenerator ()
| Thread specific random number generator.
CoinThreadRandom & | mutableRandomNumberGenerator ()
| Thread specific random number generator.
void | setRandomSeed (int value)
| Set seed for thread specific random number generator.
int | lengthNames () const
| length of names (0 means no names0
void | setLengthNames (int value)
| length of names (0 means no names0
const std::vector< std::string > * | rowNames () const
| Row names.
const std::string & | rowName (int iRow) const
std::string | getRowName (int iRow) const
| Return name or Rnnnnnnn.
const std::vector< std::string > * | columnNames () const
| Column names.
const std::string & | columnName (int iColumn) const
std::string | getColumnName (int iColumn) const
| Return name or Cnnnnnnn.
ClpObjective * | objectiveAsObject () const
| Objective methods.
void | setObjective (ClpObjective *objective)
void | setObjectivePointer (ClpObjective *newobjective)
int | emptyProblem (int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
| Solve a problem with no elements - return status and dual and primal infeasibilites.
void | times (double scalar, const double *x, double *y) const
| Return `y + A * x * scalar` in `y`.
void | transposeTimes (double scalar, const double *x, double *y) const
| Return `y + x * scalar * A` in `y`.
bool | setIntParam (ClpIntParam key, int value)
| Set an integer parameter.
bool | setDblParam (ClpDblParam key, double value)
| Set an double parameter.
bool | setStrParam (ClpStrParam key, const std::string &value)
| Set an string parameter.
bool | getIntParam (ClpIntParam key, int &value) const
bool | getDblParam (ClpDblParam key, double &value) const
bool | getStrParam (ClpStrParam key, std::string &value) const
void | generateCpp (FILE *fp)
| Create C++ lines to get to current state.
unsigned int | specialOptions () const
| For advanced options 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves 4 - Force outgoing variables to exact bound (primal) 8 - Safe to use dense initial factorization 16 -Just use basic variables for operation if column generation 32 -Create ray even in BAB 64 -Treat problem as feasible until last minute (i.e.
void | setSpecialOptions (unsigned int value)
bool | inCbcBranchAndBound () const
void | loadProblem (const ClpMatrixBase &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| Loads a problem (the constraints on the rows are given by lower and upper bounds).
void | loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| Just like the other loadProblem() method except that the matrix is given in a standard column major ordered format (without gaps).
int | loadProblem (CoinModel &modelObject, bool tryPlusMinusOne=false)
| This loads a model from a coinModel object - returns number of errors.
void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const int *length, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| This one is for after presolve to save memory.
void | loadQuadraticObjective (const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
| Load up quadratic objective.
void | loadQuadraticObjective (const CoinPackedMatrix &matrix)
void | deleteQuadraticObjective ()
| Get rid of quadratic objective.
void | setRowObjective (const double *rowObjective)
| This just loads up a row objective.
int | readMps (const char *filename, bool keepNames=false, bool ignoreErrors=false)
| Read an mps file from the given filename.
int | readGMPL (const char *filename, const char *dataName, bool keepNames=false)
| Read GMPL files from the given filenames.
void | copyInIntegerInformation (const char *information)
| Copy in integer informations.
void | deleteIntegerInformation ()
| Drop integer informations.
void | setContinuous (int index)
| Set the index-th variable to be a continuous variable.
void | setInteger (int index)
| Set the index-th variable to be an integer variable.
bool | isInteger (int index) const
| Return true if the index-th variable is an integer variable.
void | resize (int newNumberRows, int newNumberColumns)
| Resizes rim part of model.
void | deleteRows (int number, const int *which)
| Deletes rows.
void | addRow (int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
| Add one row.
void | addRows (int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
| Add rows.
void | addRows (int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *rowLengths, const int *columns, const double *elements)
| Add rows.
void | addRows (int number, const double *rowLower, const double *rowUpper, const CoinPackedVectorBase *const *rows)
int | addRows (const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
| Add rows from a build object.
int | addRows (CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
| Add rows from a model object.
void | deleteColumns (int number, const int *which)
| Deletes columns.
void | deleteRowsAndColumns (int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
| Deletes rows AND columns (keeps old sizes).
void | addColumn (int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objective=0.0)
| Add one column.
void | addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
| Add columns.
void | addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *columnLengths, const int *rows, const double *elements)
void | addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinPackedVectorBase *const *columns)
int | addColumns (const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
| Add columns from a build object If tryPlusMinusOne then will try adding as +-1 matrix if no matrix exists.
int | addColumns (CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
| Add columns from a model object.
void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
| Modify one element of a matrix.
void | chgRowLower (const double *rowLower)
| Change row lower bounds.
void | chgRowUpper (const double *rowUpper)
| Change row upper bounds.
void | chgColumnLower (const double *columnLower)
| Change column lower bounds.
void | chgColumnUpper (const double *columnUpper)
| Change column upper bounds.
void | chgObjCoefficients (const double *objIn)
| Change objective coefficients.
void | borrowModel (ClpModel &otherModel)
| Borrow model.
void | returnModel (ClpModel &otherModel)
| Return model - nulls all arrays so can be deleted safely also updates any scalars.
void | createEmptyMatrix ()
| Create empty ClpPackedMatrix.
CoinBigIndex | cleanMatrix (double threshold=1.0e-20)
| Really clean up matrix (if ClpPackedMatrix).
void | copy (const ClpMatrixBase *from, ClpMatrixBase *&to)
| Copy contents - resizing if necessary - otherwise re-use memory.
void | dropNames ()
| Drops names - makes lengthnames 0 and names empty.
void | copyNames (const std::vector< std::string > &rowNames, const std::vector< std::string > &columnNames)
| Copies in names.
void | copyRowNames (const std::vector< std::string > &rowNames, int first, int last)
| Copies in Row names - modifies names first .. last-1.
void | copyColumnNames (const std::vector< std::string > &columnNames, int first, int last)
| Copies in Column names - modifies names first .. last-1.
void | copyRowNames (const char *const *rowNames, int first, int last)
| Copies in Row names - modifies names first .. last-1.
void | copyColumnNames (const char *const *columnNames, int first, int last)
| Copies in Column names - modifies names first .. last-1.
void | setRowName (int rowIndex, std::string &name)
| Set name of row.
void | setColumnName (int colIndex, std::string &name)
| Set name of col.
int | findNetwork (char *rotate, double fractionNeeded=0.75)
| Find a network subset.
CoinModel * | createCoinModel () const
| This creates a coinModel object.
int | writeMps (const char *filename, int formatType=0, int numberAcross=2, double objSense=0.0) const
| Write the problem in MPS format to the specified file.

## Additional Inherited Members

Public Types inherited from AbcSimplex
enum | Status { atLowerBound = 0x00 , atUpperBound = 0x01 , isFree = 0x04 , superBasic = 0x05 , basic = 0x06 , isFixed = 0x07 }
| enums for status of various sorts. More...
enum | FakeBound { noFake = 0x00 , lowerFake = 0x01 , upperFake = 0x02 , bothFake = 0x03 }
Public Types inherited from ClpSimplex
enum | Status { isFree = 0x00 , basic = 0x01 , atUpperBound = 0x02 , atLowerBound = 0x03 , superBasic = 0x04 , isFixed = 0x05 }
| enums for status of various sorts. More...
enum | FakeBound { noFake = 0x00 , lowerFake = 0x01 , upperFake = 0x02 , bothFake = 0x03 }
int | stateOfIteration_
| Where we are in iteration.
int | arrayForDualColumn_
int | arrayForReplaceColumn_
int | arrayForFlipBounds_
int | arrayForFlipRhs_
int | arrayForBtran_
int | arrayForFtran_
int | arrayForTableauRow_
int | spareIntArray_ [4]
| Spare int array for passing information [0]!=0 switches on.
double | spareDoubleArray_ [4]
| Spare double array for passing information [0]!=0 switches on.
void | swap (int pivotRow, int nonBasicPosition, Status newStatus)
| Swaps two variables and does status.
void | setFakeBound (int sequence, FakeBound fakeBound)
FakeBound | getFakeBound (int sequence) const
bool | atFakeBound (int sequence) const
void | setPivoted (int sequence)
void | clearPivoted (int sequence)
bool | pivoted (int sequence) const
void | setActive (int iRow)
| To say row active in primal pivot row choice.
void | clearActive (int iRow)
bool | active (int iRow) const
Protected Member Functions inherited from ClpSimplex
int | gutsOfSolution (double *givenDuals, const double *givenPrimals, bool valuesPass=false)
| May change basis and then returns number changed.
void | gutsOfDelete (int type)
| Does most of deletion (0 = all, 1 = most, 2 most + factorization).
void | gutsOfCopy (const ClpSimplex &rhs)
| Does most of copying.
bool | createRim (int what, bool makeRowCopy=false, int startFinishOptions=0)
| puts in format I like (rowLower,rowUpper) also see StandardMatrix 1 bit does rows (now and columns), (2 bit does column bounds), 4 bit does objective(s).
void | createRim1 (bool initial)
| Does rows and columns.
void | createRim4 (bool initial)
| Does objective.
void | createRim5 (bool initial)
| Does rows and columns and objective.
void | deleteRim (int getRidOfFactorizationData=2)
| releases above arrays and does solution scaling out.
bool | sanityCheck ()
| Sanity check on input rim data (after scaling) - returns true if okay.
int | housekeeping (double objectiveChange)
| This does basis housekeeping and does values for in/out variables.
void | checkPrimalSolution (const double *rowActivities=NULL, const double *columnActivies=NULL)
| This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Primal).
void | checkDualSolution ()
| This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Dual).
void | checkBothSolutions ()
| This sets sum and number of infeasibilities (Dual and Primal).
double | scaleObjective (double value)
| If input negative scales objective so maximum <= -value and returns scale factor used.
int | solveDW (CoinStructuredModel *model, ClpSolve &options)
| Solve using Dantzig-Wolfe decomposition and maybe in parallel.
int | solveBenders (CoinStructuredModel *model, ClpSolve &options)
| Solve using Benders decomposition and maybe in parallel.
Protected Member Functions inherited from ClpModel
void | gutsOfDelete (int type)
| Does most of deletion (0 = all, 1 = most).
void | gutsOfCopy (const ClpModel &rhs, int trueCopy=1)
| Does most of copying If trueCopy 0 then just points to arrays If -1 leaves as much as possible.
void | getRowBound (int iRow, double &lower, double &upper) const
| gets lower and upper bounds on rows
void | gutsOfLoadModel (int numberRows, int numberColumns, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
| puts in format I like - 4 array matrix - may make row copy
void | gutsOfScaling ()
| Does much of scaling.
double | rawObjectiveValue () const
| Objective value - always minimize.
bool | permanentArrays () const
| If we are using maximumRows_ and Columns_.
void | startPermanentArrays ()
| Start using maximumRows_ and Columns_.
void | stopPermanentArrays ()
| Stop using maximumRows_ and Columns_.
const char *const * | rowNamesAsChar () const
| Create row names as char **.
const char *const * | columnNamesAsChar () const
| Create column names as char **.
void | deleteNamesAsChar (const char *const *names, int number) const
| Delete char * version of names.
void | onStopped ()
| On stopped - sets secondary status.
double | sumNonBasicCosts_
| Sum of nonbasic costs.
double | rawObjectiveValue_
| Sum of costs (raw objective value).
double | objectiveOffset_
| Objective offset (from offset_).
double | perturbationFactor_
| Perturbation factor If <0.0 then virtual if 0.0 none if >0.0 use this as factor.
double | currentDualTolerance_
| Current dualTolerance (will end up as dualTolerance_).
double | currentDualBound_
| Current dualBound (will end up as dualBound_).
double | largestGap_
| Largest gap.
double | lastDualBound_
| Last dual bound.
double | sumFakeInfeasibilities_
| Sum of infeasibilities when using fake perturbation tolerance.
double | lastPrimalError_
| Last primal error.
double | lastDualError_
| Last dual error.
double | currentAcceptablePivot_
| Acceptable pivot for this iteration.
double | movement_
| Movement of variable.
double | objectiveChange_
| Objective change.
double | btranAlpha_
| Btran alpha.
double | ftAlpha_
| FT alpha.
double | minimumThetaMovement_
| Minimum theta movement.
double | initialSumInfeasibilities_
| Initial sum of infeasibilities.
int | lastFirstFree_
| Last firstFree_.
int | freeSequenceIn_
| Free chosen vector.
int | maximumAbcNumberRows_
| Maximum number rows.
int | maximumAbcNumberColumns_
| Maximum number columns.
int | maximumNumberTotal_
| Maximum numberTotal.
int | numberFlagged_
| Current number of variables flagged.
int | normalDualColumnIteration_
| Iteration at which to do relaxed dualColumn.
int | stateDualColumn_
| State of dual waffle -2 - in initial large tolerance phase -1 - in medium tolerance phase n - in correct tolerance phase and thought optimal n times.
int | numberTotal_
| Number of variables (includes spare rows).
int | numberTotalWithoutFixed_
| Number of variables without fixed to zero (includes spare rows).
int | startAtLowerOther_
| Start of variables at lower bound with upper.
int | startAtUpperNoOther_
| Start of variables at upper bound with no lower.
int | startAtUpperOther_
| Start of variables at upper bound with lower.
int | startOther_
| Start of superBasic, free or awkward bounds variables.
int | startFixed_
| Start of fixed variables.
int | stateOfProblem_
int | numberOrdinary_
| Number of ordinary (lo/up) in tableau row.
int | ordinaryVariables_
| Set to 1 if no free or super basic.
int | numberFreeNonBasic_
| Number of free nonbasic variables.
int | lastCleaned_
| Last time cleaned up.
int | lastPivotRow_
| Current/last pivot row (set after END of choosing pivot row in dual).
int | swappedAlgorithm_
| Nonzero (probably 10) if swapped algorithms.
int | initialNumberInfeasibilities_
| Initial number of infeasibilities.
double * | scaleFromExternal_
| Points from external to internal.
double * | scaleToExternal_
| Scale from primal internal to external (in external order) Or other way for dual.
double * | columnUseScale_
| use this instead of columnScale
double * | inverseColumnUseScale_
| use this instead of inverseColumnScale
double * | offset_
| Primal offset (in external order) So internal value is (external-offset)*scaleFromExternal.
double * | offsetRhs_
| Offset for accumulated offsets*matrix.
double * | tempArray_
| Useful array of numberTotal length.
unsigned char * | internalStatus_
| Working status ?
unsigned char * | internalStatusSaved_
| Saved status.
double * | abcPerturbation_
| Perturbation (fixed) - is just scaled random numbers If perturbationFactor_<0 then virtual perturbation.
double * | perturbationSaved_
| saved perturbation
double * | perturbationBasic_
| basic perturbation
AbcMatrix * | abcMatrix_
| Working matrix.
double * | abcLower_
| Working scaled copy of lower bounds has original scaled copy at end.
double * | abcUpper_
| Working scaled copy of upper bounds has original scaled copy at end.
double * | abcCost_
| Working scaled copy of objective ?
double * | abcSolution_
| Working scaled primal solution may have saved from last factorization at end.
double * | abcDj_
| Working scaled dual solution may have saved from last factorization at end.
double * | lowerSaved_
| Saved scaled copy of lower bounds.
double * | upperSaved_
| Saved scaled copy of upper bounds.
double * | costSaved_
| Saved scaled copy of objective.
double * | solutionSaved_
| Saved scaled primal solution.
double * | djSaved_
| Saved scaled dual solution.
double * | lowerBasic_
| Working scaled copy of basic lower bounds.
double * | upperBasic_
| Working scaled copy of basic upper bounds.
double * | costBasic_
| Working scaled copy of basic objective.
double * | solutionBasic_
| Working scaled basic primal solution.
double * | djBasic_
| Working scaled basic dual solution (want it to be zero).
AbcDualRowPivot * | abcDualRowPivot_
| dual row pivot choice
AbcPrimalColumnPivot * | abcPrimalColumnPivot_
| primal column pivot choice
int * | abcPivotVariable_
| Basic variables pivoting on which rows followed by atLo/atUp then free/superbasic then fixed.
int * | reversePivotVariable_
| Reverse abcPivotVariable_ for moving around.
AbcSimplexFactorization * | abcFactorization_
| factorization
AbcSimplex * | abcBaseModel_
| Saved version of solution.
ClpSimplex * | clpModel_
| A copy of model as ClpSimplex with certain state.
AbcNonLinearCost * | abcNonLinearCost_
| Very wasteful way of dealing with infeasibilities in primal.
CoinPartitionedVector | usefulArray_ [ABC_NUMBER_USEFUL]
AbcSimplexProgress | abcProgress_
| For dealing with all issues of cycling etc.
ClpDataSave | saveData_
| For saving stuff at beginning.
double | upperTheta_
| upper theta from dual column
int | multipleSequenceIn_ [4]
| Multiple sequence in.
int | numberFlipped_
int | numberDisasters_
double | bestPossibleImprovement_
| Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (dual).
double | zeroTolerance_
| Zero tolerance.
int | columnPrimalSequence_
| Sequence of worst (-1 if feasible).
int | rowPrimalSequence_
| Sequence of worst (-1 if feasible).
double | bestObjectiveValue_
| "Best" objective value
int | moreSpecialOptions_
| More special options - see set for details.
int | baseIteration_
| Iteration when we entered dual or primal.
int | vectorMode_
| Vector mode - try and use vector instructions.
double | primalToleranceToGetOptimal_
| Primal tolerance needed to make dual feasible (<largeTolerance).
double | largeValue_
| Large bound value (for complementarity etc).
double | largestPrimalError_
| Largest error on Ax-b.
double | largestDualError_
| Largest error on basic duals.
double | alphaAccuracy_
| For computing whether to re-factorize.
double | dualBound_
| Dual bound.
double | alpha_
| Alpha (pivot element).
double | theta_
| Theta (pivot change).
double | lowerIn_
| Lower Bound on In variable.
double | valueIn_
| Value of In variable.
double | upperIn_
| Upper Bound on In variable.
double | dualIn_
| Reduced cost of In variable.
double | lowerOut_
| Lower Bound on Out variable.
double | valueOut_
| Value of Out variable.
double | upperOut_
| Upper Bound on Out variable.
double | dualOut_
| Infeasibility (dual) or ? (primal) of Out variable.
double | dualTolerance_
| Current dual tolerance for algorithm.
double | primalTolerance_
| Current primal tolerance for algorithm.
double | sumDualInfeasibilities_
| Sum of dual infeasibilities.
double | sumPrimalInfeasibilities_
| Sum of primal infeasibilities.
double | infeasibilityCost_
| Weight assigned to being infeasible in primal.
double | sumOfRelaxedDualInfeasibilities_
| Sum of Dual infeasibilities using tolerance based on error in duals.
double | sumOfRelaxedPrimalInfeasibilities_
| Sum of Primal infeasibilities using tolerance based on error in primals.
double | acceptablePivot_
| Acceptable pivot value just after factorization.
double | minimumPrimalTolerance_
| Minimum primal tolerance.
double | averageInfeasibility_ [CLP_INFEAS_SAVE]
double * | lower_
| Working copy of lower bounds (Owner of arrays below).
double * | rowLowerWork_
| Row lower bounds - working copy.
double * | columnLowerWork_
| Column lower bounds - working copy.
double * | upper_
| Working copy of upper bounds (Owner of arrays below).
double * | rowUpperWork_
| Row upper bounds - working copy.
double * | columnUpperWork_
| Column upper bounds - working copy.
double * | cost_
| Working copy of objective (Owner of arrays below).
double * | rowObjectiveWork_
| Row objective - working copy.
double * | objectiveWork_
| Column objective - working copy.
CoinIndexedVector * | rowArray_ [6]
| Useful row length arrays.
CoinIndexedVector * | columnArray_ [6]
| Useful column length arrays.
int | sequenceIn_
| Sequence of In variable.
int | directionIn_
| Direction of In, 1 going up, -1 going down, 0 not a clue.
int | sequenceOut_
| Sequence of Out variable.
int | directionOut_
| Direction of Out, 1 to upper bound, -1 to lower bound, 0 - superbasic.
int | pivotRow_
| Pivot Row.
int | lastGoodIteration_
| Last good iteration (immediately after a re-factorization).
double * | dj_
| Working copy of reduced costs (Owner of arrays below).
double * | rowReducedCost_
| Reduced costs of slacks not same as duals (or - duals).
double * | reducedCostWork_
| Possible scaled reduced costs.
double * | solution_
| Working copy of primal solution (Owner of arrays below).
double * | rowActivityWork_
| Row activities - working copy.
double * | columnActivityWork_
| Column activities - working copy.
int | numberDualInfeasibilities_
| Number of dual infeasibilities.
int | numberDualInfeasibilitiesWithoutFree_
| Number of dual infeasibilities (without free).
int | numberPrimalInfeasibilities_
| Number of primal infeasibilities.
int | numberRefinements_
| How many iterative refinements to do.
ClpDualRowPivot * | dualRowPivot_
| dual row pivot choice
ClpPrimalColumnPivot * | primalColumnPivot_
| primal column pivot choice
int * | pivotVariable_
| Basic variables pivoting on which rows.
ClpFactorization * | factorization_
| factorization
double * | savedSolution_
| Saved version of solution.
int | numberTimesOptimal_
| Number of times code has tentatively thought optimal.
ClpDisasterHandler * | disasterArea_
| Disaster handler.
int | changeMade_
| If change has been made (first attempt at stopping looping).
int | algorithm_
| Algorithm >0 == Primal, <0 == Dual.
int | forceFactorization_
| Now for some reliability aids This forces re-factorization early.
int | perturbation_
| Perturbation: -50 to +50 - perturb by this power of ten (-6 sounds good) 100 - auto perturb if takes too long (1.0e-6 largest nonzero) 101 - we are perturbed 102 - don't try perturbing again default is 100.
unsigned char * | saveStatus_
| Saved status regions.
ClpNonLinearCost * | nonLinearCost_
| Very wasteful way of dealing with infeasibilities in primal.
int | lastBadIteration_
| So we know when to be cautious.
int | lastFlaggedIteration_
| So we know when to open up again.
int | numberFake_
| Can be used for count of fake bounds (dual) or fake costs (primal).
int | numberChanged_
| Can be used for count of changed costs (dual) or changed bounds (primal).
int | progressFlag_
| Progress flag - at present 0 bit says artificials out, 1 free in.
int | firstFree_
| First free/super-basic variable (-1 if none).
int | numberExtraRows_
| Number of extra rows.
int | maximumBasic_
| Maximum number of basic variables - can be more than number of rows if GUB.
int | dontFactorizePivots_
| If may skip final factorize then allow up to this pivots (default 20).
double | incomingInfeasibility_
| For advanced use.
double | allowedInfeasibility_
int | automaticScale_
| Automatic scaling of objective and rhs and bounds.
int | maximumPerturbationSize_
| Maximum perturbation array size (take out when code rewritten).
double * | perturbationArray_
| Perturbation array (maximumPerturbationSize_).
ClpSimplex * | baseModel_
| A copy of model with certain state - normally without cuts.
ClpSimplexProgress | progress_
| For dealing with all issues of cycling etc.
int | numberDegeneratePivots_
| Number of degenerate pivots since last perturbed.
Protected Attributes inherited from ClpModel
double | optimizationDirection_
| Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
double | dblParam_ [ClpLastDblParam]
| Array of double parameters.
double | objectiveValue_
| Objective value.
double | smallElement_
| Small element value.
double | objectiveScale_
| Scaling of objective.
double | rhsScale_
| Scaling of rhs and bounds.
int | numberRows_
| Number of rows.
int | numberColumns_
| Number of columns.
double * | rowActivity_
| Row activities.
double * | columnActivity_
| Column activities.
double * | dual_
| Duals.
double * | reducedCost_
| Reduced costs.
double * | rowLower_
| Row lower.
double * | rowUpper_
| Row upper.
ClpObjective * | objective_
| Objective.
double * | rowObjective_
| Row Objective (? sign) - may be NULL.
double * | columnLower_
| Column Lower.
double * | columnUpper_
| Column Upper.
ClpMatrixBase * | matrix_
| Packed matrix.
ClpMatrixBase * | rowCopy_
| Row copy if wanted.
ClpPackedMatrix * | scaledMatrix_
| Scaled packed matrix.
double * | ray_
| Infeasible/unbounded ray.
double * | rowScale_
| Row scale factors for matrix.
double * | columnScale_
| Column scale factors.
double * | inverseRowScale_
| Inverse row scale factors for matrix (end of rowScale_).
double * | inverseColumnScale_
| Inverse column scale factors for matrix (end of columnScale_).
int | scalingFlag_
| Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows.
unsigned char * | status_
| Status (i.e.
char * | integerType_
| Integer information.
void * | userPointer_
| User pointer for whatever reason.
ClpTrustedData * | trustedUserPointer_
| Trusted user pointer e.g. for heuristics.
int | intParam_ [ClpLastIntParam]
| Array of integer parameters.
int | numberIterations_
| Number of iterations.
int | solveType_
| Solve type - 1 simplex, 2 simplex interface, 3 Interior.
unsigned int | whatsChanged_
int | problemStatus_
| Status of problem.
int | secondaryStatus_
| Secondary status of problem.
int | lengthNames_
| length of names (0 means no names)
int | numberThreads_
| Number of threads (not very operational).
unsigned int | specialOptions_
| For advanced options See get and set for meaning.
CoinMessageHandler * | handler_
| Message handler.
bool | defaultHandler_
| Flag to say if default handler (so delete).
CoinThreadRandom | randomNumberGenerator_
| Thread specific random number generator.
ClpEventHandler * | eventHandler_
| Event handler.
std::vector< std::string > | rowNames_
| Row names.
std::vector< std::string > | columnNames_
| Column names.
CoinMessages | messages_
| Messages.
CoinMessages | coinMessages_
| Coin messages.
int | maximumColumns_
| Maximum number of columns in model.
int | maximumRows_
| Maximum number of rows in model.
int | maximumInternalColumns_
| Maximum number of columns (internal arrays) in model.
int | maximumInternalRows_
| Maximum number of rows (internal arrays) in model.
CoinPackedMatrix | baseMatrix_
| Base packed matrix.
CoinPackedMatrix | baseRowCopy_
| Base row copy.
double * | savedRowScale_
| Saved row scale factors for matrix.
double * | savedColumnScale_
| Saved column scale factors.
std::string | strParam_ [ClpLastStrParam]
| Array of string parameters.

## Detailed Description

This solves LPs using the dual simplex method.

It inherits from AbcSimplex. It has no data of its own and is never created - only cast from a AbcSimplex object at algorithm time.

Definition at line 49 of file AbcSimplexDual.hpp.

## Member Function Documentation

## dual()

int AbcSimplexDual::dual | ( |  | ) |

Dual algorithm.

Method

It tries to be a single phase approach with a weight of 1.0 being given to getting optimal and a weight of updatedDualBound_ being given to getting dual feasible. In this version I have used the idea that this weight can be thought of as a fake bound. If the distance between the lower and upper bounds on a variable is less than the feasibility weight then we are always better off flipping to other bound to make dual feasible. If the distance is greater then we make up a fake bound updatedDualBound_ away from one bound. If we end up optimal or primal infeasible, we check to see if bounds okay. If so we have finished, if not we increase updatedDualBound_ and continue (after checking if unbounded). I am undecided about free variables - there is coding but I am not sure about it. At present I put them in basis anyway.

The code is designed to take advantage of sparsity so arrays are seldom zeroed out from scratch or gone over in their entirety. The only exception is a full scan to find outgoing variable for Dantzig row choice. For steepest edge we keep an updated list of infeasibilities (actually squares). On easy problems we don't need full scan - just pick first reasonable.

One problem is how to tackle degeneracy and accuracy. At present I am using the modification of costs which I put in OSL and some of what I think is the dual analog of Gill et al. I am still not sure of the exact details.

The flow of dual is three while loops as follows:

while (not finished) {

while (not clean solution) {

Factorize and/or clean up solution by flipping variables so dual feasible. If looks finished check fake dual bounds. Repeat until status is iterating (-1) or finished (0,1,2)

}

while (status==-1) {

Iterate until no pivot in or out or time to re-factorize.

Flow is:

choose pivot row (outgoing variable). if none then we are primal feasible so looks as if done but we need to break and check bounds etc.

Get pivot row in tableau

Choose incoming column. If we don't find one then we look primal infeasible so break and check bounds etc. (Also the pivot tolerance is larger after any iterations so that may be reason)

If we do find incoming column, we may have to adjust costs to keep going forwards (anti-degeneracy). Check pivot will be stable and if unstable throw away iteration and break to re-factorize. If minor error re-factorize after iteration.

Update everything (this may involve flipping variables to stay dual feasible.

}

}

TODO's (or maybe not)

At present we never check we are going forwards. I overdid that in OSL so will try and make a last resort.

Needs partial scan pivot out option.

May need other anti-degeneracy measures, especially if we try and use loose tolerances as a way to solve in fewer iterations.

I like idea of dynamic scaling. This gives opportunity to decouple different implications of scaling for accuracy, iteration count and feasibility tolerance.

for use of exotic parameter startFinishoptions see Abcsimplex.hpp

## strongBranching()

int AbcSimplexDual::strongBranching | ( | int | numberVariables,
|  | const int * | variables,
|  | double * | newLower,
|  | double * | newUpper,
|  | double ** | outputSolution,
|  | int * | outputStatus,
|  | int * | outputIterations,
|  | bool | stopOnFirstInfeasible = true,
|  | bool | alwaysFinish = false,
|  | int | startFinishOptions = 0 )

For strong branching.

On input lower and upper are new bounds while on output they are change in objective function values (>1.0e50 infeasible). Return code is 0 if nothing interesting, -1 if infeasible both ways and +1 if infeasible one way (check values to see which one(s)) Solutions are filled in as well - even down, odd up - also status and number of iterations

## setupForStrongBranching()

AbcSimplexFactorization * AbcSimplexDual::setupForStrongBranching | ( | char * | arrays,
|  | int | numberRows,
|  | int | numberColumns,
|  | bool | solveLp = false )

This does first part of StrongBranching.

## cleanupAfterStrongBranching()

void AbcSimplexDual::cleanupAfterStrongBranching | ( | AbcSimplexFactorization * | factorization | ) |

This cleans up after strong branching.

## whileIteratingSerial()

int AbcSimplexDual::whileIteratingSerial | ( |  | ) |

This has the flow between re-factorizations Broken out for clarity and will be used by strong branching.

Reasons to come out: -1 iterations etc -2 inaccuracy -3 slight inaccuracy (and done iterations) +0 looks optimal (might be unbounded - but we will investigate) +1 looks infeasible +3 max iterations

If givenPi not NULL then in values pass (copy from ClpSimplexDual)

## whileIterating2()

void AbcSimplexDual::whileIterating2 | ( |  | ) |

## whileIteratingParallel()

int AbcSimplexDual::whileIteratingParallel | ( | int | numberIterations | ) |

## whileIterating3()

int AbcSimplexDual::whileIterating3 | ( |  | ) |

## updatePrimalSolution()

void AbcSimplexDual::updatePrimalSolution | ( |  | ) |

## noPivotRow()

int AbcSimplexDual::noPivotRow | ( |  | ) |

## noPivotColumn()

int AbcSimplexDual::noPivotColumn | ( |  | ) |

## dualPivotColumn()

void AbcSimplexDual::dualPivotColumn | ( |  | ) |

## createDualPricingVectorSerial()

void AbcSimplexDual::createDualPricingVectorSerial | ( |  | ) |

Create dual pricing vector.

## getTableauColumnFlipAndStartReplaceSerial()

int AbcSimplexDual::getTableauColumnFlipAndStartReplaceSerial | ( |  | ) |

## getTableauColumnPart1Serial()

void AbcSimplexDual::getTableauColumnPart1Serial | ( |  | ) |

## getTableauColumnPart2()

void AbcSimplexDual::getTableauColumnPart2 | ( |  | ) |

## checkReplace()

int AbcSimplexDual::checkReplace | ( |  | ) |

## replaceColumnPart3()

void AbcSimplexDual::replaceColumnPart3 | ( |  | ) |

## checkReplacePart1()

void AbcSimplexDual::checkReplacePart1 | ( |  | ) |

## checkReplacePart1a()

void AbcSimplexDual::checkReplacePart1a | ( |  | ) |

## checkReplacePart1b()

void AbcSimplexDual::checkReplacePart1b | ( |  | ) |

## updateDualsInDual()

void AbcSimplexDual::updateDualsInDual | ( |  | ) |

The duals are updated.

## flipBounds()

int AbcSimplexDual::flipBounds | ( |  | ) |

The duals are updated by the given arrays.

This is in values pass - so no changes to primal is made While dualColumn gets flips this does actual flipping. returns number flipped

## flipBack()

void AbcSimplexDual::flipBack | ( | int | number | ) |

Undo a flip.

## dualColumn1()

void AbcSimplexDual::dualColumn1 | ( | bool | doAll = false | ) |

Array has tableau row (row section) Puts candidates for rows in list Returns guess at upper theta (infinite if no pivot) and may set sequenceIn_ if free Can do all (if tableauRow created).

## dualColumn1A()

double AbcSimplexDual::dualColumn1A | ( |  | ) |

Array has tableau row (row section) Just does slack part Returns guess at upper theta (infinite if no pivot) and may set sequenceIn_ if free.

## dualColumn1B()

double AbcSimplexDual::dualColumn1B | ( |  | ) |

Do all given tableau row.

## dualColumn2() [1/2]

void AbcSimplexDual::dualColumn2 | ( |  | ) |

Chooses incoming Puts flipped ones in list If necessary will modify costs.

## dualColumn2Most()

void AbcSimplexDual::dualColumn2Most | ( | dualColumnResult & | result | ) |

## dualColumn2First()

void AbcSimplexDual::dualColumn2First | ( | dualColumnResult & | result | ) |

## dualColumn2() [2/2]

void AbcSimplexDual::dualColumn2 | ( | dualColumnResult & | result | ) |

Chooses part of incoming Puts flipped ones in list If necessary will modify costs.

## checkPossibleCleanup()

void AbcSimplexDual::checkPossibleCleanup | ( | CoinIndexedVector * | array | ) |

This sees what is best thing to do in branch and bound cleanup If sequenceIn_ < 0 then can't do anything.

## dualPivotRow()

void AbcSimplexDual::dualPivotRow | ( |  | ) |

Chooses dual pivot row Would be faster with separate region to scan and will have this (with square of infeasibility) when steepest For easy problems we can just choose one of the first rows we look at.

## changeBounds()

int AbcSimplexDual::changeBounds | ( | int | initialize,
|  | double & | changeCost )

Checks if any fake bounds active - if so returns number and modifies updatedDualBound_ and everything.

Free variables will be left as free Returns number of bounds changed if >=0 Returns -1 if not initialize and no effect fills cost of change vector

## changeBound()

bool AbcSimplexDual::changeBound | ( | int | iSequence | ) |

As changeBounds but just changes new bounds for a single variable.

Returns true if change

## originalBound()

void AbcSimplexDual::originalBound | ( | int | iSequence | ) |

Restores bound to original bound.

## checkUnbounded()

int AbcSimplexDual::checkUnbounded | ( | CoinIndexedVector & | ray,
|  | double | changeCost )

Checks if tentative optimal actually means unbounded in dual Returns -3 if not, 2 if is unbounded.

## statusOfProblemInDual()

void AbcSimplexDual::statusOfProblemInDual | ( | int | type | ) |

Refactorizes if necessary Checks if finished.

Updates status. lastCleaned refers to iteration at which some objective/feasibility cleaning too place.

type - 0 initial so set up save arrays etc

- 1 normal -if good update save
- 2 restoring from saved

## whatNext()

int AbcSimplexDual::whatNext | ( |  | ) |

Fast iterations.

Misses out a lot of initialization. Normally stops on maximum iterations, first re-factorization or tentative optimum. If looks interesting then continues as normal. Returns 0 if finished properly, 1 otherwise. Gets tableau column - does flips and checks what to do next Knows tableau column in 1, flips in 2 and gets an array for flips (as serial here)

## checkCutoff()

bool AbcSimplexDual::checkCutoff | ( | bool | computeObjective | ) |

see if cutoff reached

## bounceTolerances()

int AbcSimplexDual::bounceTolerances | ( | int | type | ) |

Does something about fake tolerances.

## perturb()

void AbcSimplexDual::perturb | ( | double | factor | ) |

Perturbs problem.

## perturbB()

void AbcSimplexDual::perturbB | ( | double | factor,
|  | int | type )

Perturbs problem B.

## makeNonFreeVariablesDualFeasible()

int AbcSimplexDual::makeNonFreeVariablesDualFeasible | ( | bool | changeCosts = false | ) |

Make non free variables dual feasible by moving to a bound.

## fastDual()

int AbcSimplexDual::fastDual | ( | bool | alwaysFinish = false | ) |

## numberAtFakeBound()

int AbcSimplexDual::numberAtFakeBound | ( |  | ) |

Checks number of variables at fake bounds.

This is used by fastDual so can exit gracefully before end

## pivotResultPart1()

int AbcSimplexDual::pivotResultPart1 | ( |  | ) |

Pivot in a variable and choose an outgoing one.

Assumes dual feasible - will not go through a reduced cost. Returns step length in theta Return codes as before but -1 means no acceptable pivot

## nextSuperBasic()

int AbcSimplexDual::nextSuperBasic | ( |  | ) |

Get next free , -1 if none.

## startupSolve()

void AbcSimplexDual::startupSolve | ( |  | ) |

Startup part of dual.

## finishSolve()

void AbcSimplexDual::finishSolve | ( |  | ) |

Ending part of dual.

## gutsOfDual()

void AbcSimplexDual::gutsOfDual | ( |  | ) |

## resetFakeBounds()

int AbcSimplexDual::resetFakeBounds | ( | int | type | ) |

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

- Clp/src/AbcSimplexDual.hpp