Loading...
Searching...
No Matches
ClpSimplex Class Reference

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

`#include <ClpSimplex.hpp>`

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

## Public Types

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 }

## Public Member Functions

Constructors and destructor and copy
| 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.
Functions most useful to user
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.
Needed for functionality of OsiSimplexInterface
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.
most useful gets and sets
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)
public methods
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.
status methods
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.
Basis handling
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()).
Changing bounds on variables and constraints
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.
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.

## Protected Member Functions

protected methods
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.
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.

## Friends

void | ClpSimplexUnitTest (const std::string &mpsDir)
| A function that tests the methods in the ClpSimplex class.

## data. Many arrays have a row part and a column part.

There is a single array with both - columns then rows and then normally two arrays pointing to rows and columns. The single array is the owner of memory
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.
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.
class | OsiClpSolverInterface
| Allow OsiClp certain perks.
class | OsiCLPSolverInterface
| And OsiCLP.

## Functions less likely to be useful to casual user

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.
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.

## Additional Inherited Members

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 simplex method.

It inherits from ClpModel and all its arrays are created at algorithm time. Originally I tried to work with model arrays but for simplicity of coding I changed to single arrays with structural variables then row variables. Some coding is still based on old style and needs cleaning up.

For a description of algorithms:

for dual see ClpSimplexDual.hpp and at top of ClpSimplexDual.cpp for primal see ClpSimplexPrimal.hpp and at top of ClpSimplexPrimal.cpp

There is an algorithm data member. + for primal variations and - for dual variations

Definition at line 106 of file ClpSimplex.hpp.

## Member Enumeration Documentation

## Status

enum ClpSimplex::Status

enums for status of various sorts.

First 4 match CoinWarmStartBasis, isFixed means fixed at lower bound and out of basis

Enumerator
isFree |
basic |
atUpperBound |
atLowerBound |
superBasic |
isFixed |

Definition at line 114 of file ClpSimplex.hpp.

## FakeBound

enum ClpSimplex::FakeBound

Enumerator
noFake |
lowerFake |
upperFake |
bothFake |

Definition at line 123 of file ClpSimplex.hpp.

## Constructor & Destructor Documentation

## ClpSimplex() [1/6]

ClpSimplex::ClpSimplex | ( | bool | emptyMessages = false | ) |

Default constructor.

## ClpSimplex() [2/6]

ClpSimplex::ClpSimplex | ( | const ClpSimplex & | rhs,
|  | int | scalingMode = -1 )

Copy constructor.

May scale depending on mode -1 leave mode as is 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later)

## ClpSimplex() [3/6]

ClpSimplex::ClpSimplex | ( | const ClpModel & | rhs,
|  | int | scalingMode = -1 )

Copy constructor from model.

May scale depending on mode -1 leave mode as is 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later)

## ClpSimplex() [4/6]

ClpSimplex::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.

A subset of whole model is created from the row and column lists given. The new order is given by list order and duplicates are allowed. Name and integer information can be dropped Can optionally modify rhs to take into account variables NOT in list in this case duplicates are not allowed (also see getbackSolution)

## ClpSimplex() [5/6]

ClpSimplex::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.

A subset of whole model is created from the row and column lists given. The new order is given by list order and duplicates are allowed. Name and integer information can be dropped Can optionally modify rhs to take into account variables NOT in list in this case duplicates are not allowed (also see getbackSolution)

## ClpSimplex() [6/6]

ClpSimplex::ClpSimplex | ( | ClpSimplex * | wholeModel,
|  | int | numberColumns,
|  | const int * | whichColumns )

This constructor modifies original ClpSimplex and stores original stuff in created ClpSimplex.

It is only to be used in conjunction with originalModel

## ~ClpSimplex()

ClpSimplex::~ClpSimplex | ( |  | ) |

Destructor.

## Member Function Documentation

## originalModel()

void ClpSimplex::originalModel | ( | ClpSimplex * | miniModel | ) |

This copies back stuff from miniModel and then deletes miniModel.

Only to be used with mini constructor

## setPersistenceFlag()

void ClpSimplex::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.

## makeBaseModel()

void ClpSimplex::makeBaseModel | ( |  | ) |

Save a copy of model with certain state - normally without cuts.

## deleteBaseModel()

void ClpSimplex::deleteBaseModel | ( |  | ) |

Switch off base model.

## baseModel()

ClpSimplex * ClpSimplex::baseModel | ( |  | ) | const

inline

See if we have base model.

Definition at line 208 of file ClpSimplex.hpp.

## setToBaseModel()

void ClpSimplex::setToBaseModel | ( | ClpSimplex * | model = NULL | ) |

Reset to base model (just size and arrays needed) If model NULL use internal copy.

## operator=()

ClpSimplex & ClpSimplex::operator= | ( | const ClpSimplex & | rhs | ) |

Assignment operator. This copies the data.

## loadProblem() [1/6]

void ClpSimplex::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).

If a pointer is 0 then the following values are the default:

- `colub`: all columns have upper bound infinity
- `collb`: all columns have lower bound 0
- `rowub`: all rows have upper bound infinity
- `rowlb`: all rows have lower bound -infinity
- `obj`: all variables have 0 objective coefficient

## loadProblem() [2/6]

void ClpSimplex::loadProblem | ( | const CoinPackedMatrix & | matrix,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj,
|  | const double * | rowlb,
|  | const double * | rowub,
|  | const double * | rowObjective = NULL )

## loadProblem() [3/6]

void ClpSimplex::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).

## loadProblem() [4/6]

void ClpSimplex::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.

## loadProblem() [5/6]

int ClpSimplex::loadProblem | ( | CoinModel & | modelObject,
|  | bool | keepSolution = false )

This loads a model from a coinModel object - returns number of errors.

If keepSolution true and size is same as current then keeps current status and solution

## readMps()

int ClpSimplex::readMps | ( | const char * | filename,
|  | bool | keepNames = false,
|  | bool | ignoreErrors = false )

Read an mps file from the given filename.

## readGMPL()

int ClpSimplex::readGMPL | ( | const char * | filename,
|  | const char * | dataName,
|  | bool | keepNames = false )

Read GMPL files from the given filenames.

## readLp()

int ClpSimplex::readLp | ( | const char * | filename,
|  | const double | epsilon = 1e-5 )

Read file in LP format from file with name filename.

See class CoinLpIO for description of this format.

## writeLp()

void ClpSimplex::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.

If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants.

## borrowModel() [1/2]

void ClpSimplex::borrowModel | ( | ClpModel & | otherModel | ) |

Borrow model.

This is so we dont have to copy large amounts of data around. It assumes a derived class wants to overwrite an empty model with a real one - while it does an algorithm. This is same as ClpModel one, but sets scaling on etc.

## borrowModel() [2/2]

void ClpSimplex::borrowModel | ( | ClpSimplex & | otherModel | ) |

## passInEventHandler()

void ClpSimplex::passInEventHandler | ( | const ClpEventHandler * | eventHandler | ) |

Pass in Event handler (cloned and deleted at end).

## getbackSolution()

void ClpSimplex::getbackSolution | ( | const ClpSimplex & | smallModel,
|  | const int * | whichRow,
|  | const int * | whichColumn )

Puts solution back into small model.

## loadNonLinear()

int ClpSimplex::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.

## initialSolve() [1/2]

int ClpSimplex::initialSolve | ( | ClpSolve & | options | ) |

General solve algorithm which can do presolve.

See ClpSolve.hpp for options

## initialSolve() [2/2]

int ClpSimplex::initialSolve | ( |  | ) |

Default initial solve.

## initialDualSolve()

int ClpSimplex::initialDualSolve | ( |  | ) |

Dual initial solve.

## initialPrimalSolve()

int ClpSimplex::initialPrimalSolve | ( |  | ) |

Primal initial solve.

## initialBarrierSolve()

int ClpSimplex::initialBarrierSolve | ( |  | ) |

Barrier initial solve.

## initialBarrierNoCrossSolve()

int ClpSimplex::initialBarrierNoCrossSolve | ( |  | ) |

Barrier initial solve, not to be followed by crossover.

## dual()

int ClpSimplex::dual | ( | int | ifValuesPass = 0,
|  | int | startFinishOptions = 0 )

Dual algorithm - see ClpSimplexDual.hpp for method.

ifValuesPass==2 just does values pass and then stops.

startFinishOptions - bits 1 - do not delete work areas and factorization at end 2 - use old factorization if same number of rows 4 - skip as much initialization of work areas as possible (based on whatsChanged in clpmodel.hpp) ** work in progress maybe other bits later

## dualDebug()

int ClpSimplex::dualDebug | ( | int | ifValuesPass = 0,
|  | int | startFinishOptions = 0 )

## primal()

int ClpSimplex::primal | ( | int | ifValuesPass = 0,
|  | int | startFinishOptions = 0 )

Primal algorithm - see ClpSimplexPrimal.hpp for method.

ifValuesPass==2 just does values pass and then stops.

startFinishOptions - bits 1 - do not delete work areas and factorization at end 2 - use old factorization if same number of rows 4 - skip as much initialization of work areas as possible (based on whatsChanged in clpmodel.hpp) ** work in progress maybe other bits later

## nonlinearSLP() [1/2]

int ClpSimplex::nonlinearSLP | ( | int | numberPasses,
|  | double | deltaTolerance )

Solves nonlinear problem using SLP - may be used as crash for other algorithms when number of iterations small.

Also exits if all problematical variables are changing less than deltaTolerance

## nonlinearSLP() [2/2]

int ClpSimplex::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.

Also exits if all problematical variables are changing less than deltaTolerance

## barrier()

int ClpSimplex::barrier | ( | bool | crossover = true | ) |

Solves using barrier (assumes you have good cholesky factor code).

Does crossover to simplex if asked

## reducedGradient()

int ClpSimplex::reducedGradient | ( | int | phase = 0 | ) |

Solves non-linear using reduced gradient.

Phase = 0 get feasible, =1 use solution

## solve()

int ClpSimplex::solve | ( | CoinStructuredModel * | model | ) |

Solve using structure of model and maybe in parallel.

## loadProblem() [6/6]

int ClpSimplex::loadProblem | ( | CoinStructuredModel & | modelObject,
|  | bool | originalOrder = true,
|  | bool | keepSolution = false )

This loads a model from a CoinStructuredModel object - returns number of errors.

If originalOrder then keep to order stored in blocks, otherwise first column/rows correspond to first block - etc. If keepSolution true and size is same as current then keeps current status and solution

## cleanup()

int ClpSimplex::cleanup | ( | int | cleanupScaling | ) |

When scaling is on it is possible that the scaled problem is feasible but the unscaled is not.

Clp returns a secondary status code to that effect. This option allows for a cleanup. If you use it I would suggest 1. This only affects actions when scaled optimal 0 - no action 1 - clean up using dual if primal infeasibility 2 - clean up using dual if dual infeasibility 3 - clean up using dual if primal or dual infeasibility 11,12,13 - as 1,2,3 but use primal

return code as dual/primal

## cleanPrimalSolution()

int ClpSimplex::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.

If still feasible then the solution is replaced.

This is designed for the case where values should be integral, but Clp may have values at e.g. 1.0e-13 Returns 0 if successful, n if n rhs violated The dual version may be written if this gets used.

## dualRanging()

int ClpSimplex::dualRanging | ( | int | numberCheck,
|  | const int * | which,
|  | double * | costIncrease,
|  | int * | sequenceIncrease,
|  | double * | costDecrease,
|  | int * | sequenceDecrease,
|  | double * | valueIncrease = NULL,
|  | double * | valueDecrease = NULL )

Dual ranging.

This computes increase/decrease in cost for each given variable and corresponding sequence numbers which would change basis. Sequence numbers are 0..numberColumns and numberColumns.. for artificials/slacks. For non-basic variables the information is trivial to compute and the change in cost is just minus the reduced cost and the sequence number will be that of the non-basic variables. For basic variables a ratio test is between the reduced costs for non-basic variables and the row of the tableau corresponding to the basic variable. The increase/decrease value is always >= 0.0

Up to user to provide correct length arrays where each array is of length numberCheck. which contains list of variables for which information is desired. All other arrays will be filled in by function. If fifth entry in which is variable 7 then fifth entry in output arrays will be information for variable 7.

If valueIncrease/Decrease not NULL (both must be NULL or both non NULL) then these are filled with the value of variable if such a change in cost were made (the existing bounds are ignored)

Returns non-zero if infeasible unbounded etc

## primalRanging()

int ClpSimplex::primalRanging | ( | int | numberCheck,
|  | const int * | which,
|  | double * | valueIncrease,
|  | int * | sequenceIncrease,
|  | double * | valueDecrease,
|  | int * | sequenceDecrease )

Primal ranging.

This computes increase/decrease in value for each given variable and corresponding sequence numbers which would change basis. Sequence numbers are 0..numberColumns and numberColumns.. for artificials/slacks. This should only be used for non-basic variabls as otherwise information is pretty useless For basic variables the sequence number will be that of the basic variables.

Up to user to provide correct length arrays where each array is of length numberCheck. which contains list of variables for which information is desired. All other arrays will be filled in by function. If fifth entry in which is variable 7 then fifth entry in output arrays will be information for variable 7.

Returns non-zero if infeasible unbounded etc

## modifyCoefficientsAndPivot()

int ClpSimplex::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.

All at same status will be done (basis may go singular). User can tell which others have been done (i.e. if status matches). If called from outside will change status and return 0. If called from event handler returns non-zero if user has to take action. indices>=numberColumns are slacks (obviously no coefficients) status array is (char) Status enum

## outDuplicateRows()

int ClpSimplex::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).

On exit whichRows has rows to delete - return code is number can be deleted or -1 if would be infeasible. If tolerance is -1.0 use primalTolerance for equality rows and infeasibility If cleanUp not zero then spend more time trying to leave more stable row and make row bounds exact multiple of cleanUp if close enough

## moveTowardsPrimalFeasible()

double ClpSimplex::moveTowardsPrimalFeasible | ( |  | ) |

Try simple crash like techniques to get closer to primal feasibility returns final sum of infeasibilities.

## removeSuperBasicSlacks()

void ClpSimplex::removeSuperBasicSlacks | ( | int | threshold = 0 | ) |

Try simple crash like techniques to remove super basic slacks but only if > threshold.

## miniPresolve()

ClpSimplex * 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.

## miniPostsolve()

void ClpSimplex::miniPostsolve | ( | const ClpSimplex * | presolvedModel,
|  | void * | info )

After mini presolve.

## miniSolve()

void ClpSimplex::miniSolve | ( | char * | rowType,
|  | char * | columnType,
|  | int | algorithm,
|  | int | startUp )

mini presolve and solve

## writeBasis()

int ClpSimplex::writeBasis | ( | const char * | filename,
|  | bool | writeValues = false,
|  | int | formatType = 0 ) const

Write the basis in MPS format to the specified file.

If writeValues true writes values of structurals (and adds VALUES to end of NAME card)

Row and column names may be null. formatType is

- 0 - normal
- 1 - extra accuracy
- 2 - IEEE hex (later)

Returns non-zero on I/O error

## readBasis()

int ClpSimplex::readBasis | ( | const char * | filename | ) |

Read a basis from the given filename, returns -1 on file error, 0 if no values, 1 if values.

## getBasis()

CoinWarmStartBasis * ClpSimplex::getBasis | ( |  | ) | const

Returns a basis (to be deleted by user).

## setFactorization()

void ClpSimplex::setFactorization | ( | ClpFactorization & | factorization | ) |

Passes in factorization.

## swapFactorization()

ClpFactorization * ClpSimplex::swapFactorization | ( | ClpFactorization * | factorization | ) |

## copyFactorization()

void ClpSimplex::copyFactorization | ( | ClpFactorization & | factorization | ) |

Copies in factorization to existing one.

## tightenPrimalBounds()

int ClpSimplex::tightenPrimalBounds | ( | double | factor = 0.0,
|  | int | doTight = 0,
|  | bool | tightIntegers = false )

Tightens primal bounds to make dual faster.

Unless fixed or doTight>10, bounds are slightly looser than they could be. This is to make dual go faster and is probably not needed with a presolve. Returns non-zero if problem infeasible.

Fudge for branch and bound - put bounds on columns of factor * largest value (at continuous) - should improve stability in branch and bound on infeasible branches (0.0 is off)

## crash()

int ClpSimplex::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.

if gap between bounds <="gap" variables can be flipped ( If pivot -1 then can be made super basic!)

If "pivot" is -1 No pivoting - always primal 0 No pivoting (so will just be choice of algorithm) 1 Simple pivoting e.g. gub 2 Mini iterations

## setDualRowPivotAlgorithm()

void ClpSimplex::setDualRowPivotAlgorithm | ( | ClpDualRowPivot & | choice | ) |

Sets row pivot choice algorithm in dual.

## setPrimalColumnPivotAlgorithm()

void ClpSimplex::setPrimalColumnPivotAlgorithm | ( | ClpPrimalColumnPivot & | choice | ) |

Sets column pivot choice algorithm in primal.

## markHotStart()

void ClpSimplex::markHotStart | ( | void *& | saveStuff | ) |

Create a hotstart point of the optimization process.

## solveFromHotStart()

void ClpSimplex::solveFromHotStart | ( | void * | saveStuff | ) |

Optimize starting from the hotstart.

## unmarkHotStart()

void ClpSimplex::unmarkHotStart | ( | void * | saveStuff | ) |

Delete the snapshot.

## strongBranching()

int ClpSimplex::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

## fathom()

int ClpSimplex::fathom | ( | void * | stuff | ) |

Fathom - 1 if solution.

## fathomMany()

int ClpSimplex::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.

Values for N and array are in stuff (nNodes_ also in stuff)

## doubleCheck()

double ClpSimplex::doubleCheck | ( |  | ) |

Double checks OK.

## startFastDual2()

int ClpSimplex::startFastDual2 | ( | ClpNodeStuff * | stuff | ) |

Starts Fast dual2.

## fastDual2()

int ClpSimplex::fastDual2 | ( | ClpNodeStuff * | stuff | ) |

Like Fast dual.

## stopFastDual2()

void ClpSimplex::stopFastDual2 | ( | ClpNodeStuff * | stuff | ) |

Stops Fast dual2.

## fastCrunch()

ClpSimplex * 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.

## pivot()

int ClpSimplex::pivot | ( |  | ) |

Pivot in a variable and out a variable.

Returns 0 if okay, 1 if inaccuracy forced re-factorization, -1 if would be singular. Also updates primal/dual infeasibilities. Assumes sequenceIn_ and pivotRow_ set and also directionIn and Out.

## primalPivotResult()

int ClpSimplex::primalPivotResult | ( |  | ) |

Pivot in a variable and choose an outgoing one.

Assumes primal feasible - will not go through a bound. Returns step length in theta Returns ray in ray_ (or NULL if no pivot) Return codes as before but -1 means no acceptable pivot

## dualPivotResultPart1()

int ClpSimplex::dualPivotResultPart1 | ( |  | ) |

Pivot out a variable and choose an incoing 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

## pivotResultPart2()

int ClpSimplex::pivotResultPart2 | ( | int | algorithm,
|  | int | state )

Do actual pivot state is 0 if need tableau column, 1 if in rowArray_[1].

## startup()

int ClpSimplex::startup | ( | int | ifValuesPass,
|  | int | startFinishOptions = 0 )

Common bits of coding for dual and primal.

Return 0 if okay, 1 if bad matrix, 2 if very bad factorization

startFinishOptions - bits 1 - do not delete work areas and factorization at end 2 - use old factorization if same number of rows 4 - skip as much initialization of work areas as possible (based on whatsChanged in clpmodel.hpp) ** work in progress maybe other bits later

## finish()

void ClpSimplex::finish | ( | int | startFinishOptions = 0 | ) |

## statusOfProblem()

bool ClpSimplex::statusOfProblem | ( | bool | initial = false | ) |

Factorizes and returns true if optimal.

Used by user

## defaultFactorizationFrequency()

void ClpSimplex::defaultFactorizationFrequency | ( |  | ) |

If user left factorization frequency then compute.

## copyEnabledStuff()

void ClpSimplex::copyEnabledStuff | ( | const ClpSimplex * | rhs | ) |

Copy across enabled stuff from one solver to another.

## primalFeasible()

bool ClpSimplex::primalFeasible | ( |  | ) | const

inline

If problem is primal feasible.

Definition at line 666 of file ClpSimplex.hpp.

## dualFeasible()

bool ClpSimplex::dualFeasible | ( |  | ) | const

inline

If problem is dual feasible.

Definition at line 671 of file ClpSimplex.hpp.

## factorization()

ClpFactorization * ClpSimplex::factorization | ( |  | ) | const

inline

factorization

Definition at line 676 of file ClpSimplex.hpp.

## sparseFactorization()

bool ClpSimplex::sparseFactorization | ( |  | ) | const

Sparsity on or off.

## setSparseFactorization()

void ClpSimplex::setSparseFactorization | ( | bool | value | ) |

## factorizationFrequency()

int ClpSimplex::factorizationFrequency | ( |  | ) | const

Factorization frequency.

## setFactorizationFrequency()

void ClpSimplex::setFactorizationFrequency | ( | int | value | ) |

## dualBound()

double ClpSimplex::dualBound | ( |  | ) | const

inline

Dual bound.

Definition at line 687 of file ClpSimplex.hpp.

## setDualBound()

void ClpSimplex::setDualBound | ( | double | value | ) |

## infeasibilityCost()

double ClpSimplex::infeasibilityCost | ( |  | ) | const

inline

Infeasibility cost.

Definition at line 693 of file ClpSimplex.hpp.

## setInfeasibilityCost()

void ClpSimplex::setInfeasibilityCost | ( | double | value | ) |

## perturbation()

int ClpSimplex::perturbation | ( |  | ) | const

inline

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.

Perturbation: 50 - switch on perturbation 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 others are for playing

Definition at line 714 of file ClpSimplex.hpp.

## setPerturbation()

void ClpSimplex::setPerturbation | ( | int | value | ) |

## algorithm()

int ClpSimplex::algorithm | ( |  | ) | const

inline

Current (or last) algorithm.

Definition at line 720 of file ClpSimplex.hpp.

## setAlgorithm()

void ClpSimplex::setAlgorithm | ( | int | value | ) |

inline

Set algorithm.

Definition at line 725 of file ClpSimplex.hpp.

## isObjectiveLimitTestValid()

bool ClpSimplex::isObjectiveLimitTestValid | ( |  | ) | const

Return true if the objective limit test can be relied upon.

## sumDualInfeasibilities()

double ClpSimplex::sumDualInfeasibilities | ( |  | ) | const

inline

Sum of dual infeasibilities.

Definition at line 732 of file ClpSimplex.hpp.

## setSumDualInfeasibilities()

void ClpSimplex::setSumDualInfeasibilities | ( | double | value | ) |

inline

Definition at line 736 of file ClpSimplex.hpp.

## sumOfRelaxedDualInfeasibilities()

double ClpSimplex::sumOfRelaxedDualInfeasibilities | ( |  | ) | const

inline

Sum of relaxed dual infeasibilities.

Definition at line 741 of file ClpSimplex.hpp.

## setSumOfRelaxedDualInfeasibilities()

void ClpSimplex::setSumOfRelaxedDualInfeasibilities | ( | double | value | ) |

inline

Definition at line 745 of file ClpSimplex.hpp.

## numberDualInfeasibilities()

int ClpSimplex::numberDualInfeasibilities | ( |  | ) | const

inline

Number of dual infeasibilities.

Definition at line 750 of file ClpSimplex.hpp.

## setNumberDualInfeasibilities()

void ClpSimplex::setNumberDualInfeasibilities | ( | int | value | ) |

inline

Definition at line 754 of file ClpSimplex.hpp.

## numberDualInfeasibilitiesWithoutFree()

int ClpSimplex::numberDualInfeasibilitiesWithoutFree | ( |  | ) | const

inline

Number of dual infeasibilities (without free).

Definition at line 759 of file ClpSimplex.hpp.

## sumPrimalInfeasibilities()

double ClpSimplex::sumPrimalInfeasibilities | ( |  | ) | const

inline

Sum of primal infeasibilities.

Definition at line 764 of file ClpSimplex.hpp.

## setSumPrimalInfeasibilities()

void ClpSimplex::setSumPrimalInfeasibilities | ( | double | value | ) |

inline

Definition at line 768 of file ClpSimplex.hpp.

## sumOfRelaxedPrimalInfeasibilities()

double ClpSimplex::sumOfRelaxedPrimalInfeasibilities | ( |  | ) | const

inline

Sum of relaxed primal infeasibilities.

Definition at line 773 of file ClpSimplex.hpp.

## setSumOfRelaxedPrimalInfeasibilities()

void ClpSimplex::setSumOfRelaxedPrimalInfeasibilities | ( | double | value | ) |

inline

Definition at line 777 of file ClpSimplex.hpp.

## numberPrimalInfeasibilities()

int ClpSimplex::numberPrimalInfeasibilities | ( |  | ) | const

inline

Number of primal infeasibilities.

Definition at line 782 of file ClpSimplex.hpp.

## setNumberPrimalInfeasibilities()

void ClpSimplex::setNumberPrimalInfeasibilities | ( | int | value | ) |

inline

Definition at line 786 of file ClpSimplex.hpp.

## saveModel()

int ClpSimplex::saveModel | ( | const char * | fileName | ) |

Save model to file, returns 0 if success.

This is designed for use outside algorithms so does not save iterating arrays etc. It does not save any messaging information. Does not save scaling values. It does not know about all types of virtual functions.

## restoreModel()

int ClpSimplex::restoreModel | ( | const char * | fileName | ) |

Restore model from file, returns 0 if success, deletes current model.

## checkSolution()

void ClpSimplex::checkSolution | ( | int | setToBounds = 0 | ) |

Just check solution (for external use) - sets sum of infeasibilities etc.

If setToBounds 0 then primal column values not changed and used to compute primal row activity values. If 1 or 2 then status used - so all nonbasic variables set to indicated bound and if any values changed (or ==2) basic values re-computed.

## checkSolutionInternal()

void ClpSimplex::checkSolutionInternal | ( |  | ) |

Just check solution (for internal use) - sets sum of infeasibilities etc.

## checkUnscaledSolution()

void ClpSimplex::checkUnscaledSolution | ( |  | ) |

Check unscaled primal solution but allow for rounding error.

## rowArray()

CoinIndexedVector * ClpSimplex::rowArray | ( | int | index | ) | const

inline

Useful row length arrays (0,1,2,3,4,5).

Definition at line 815 of file ClpSimplex.hpp.

## columnArray()

CoinIndexedVector * ClpSimplex::columnArray | ( | int | index | ) | const

inline

Useful column length arrays (0,1,2,3,4,5).

Definition at line 820 of file ClpSimplex.hpp.

## getSolution() [1/2]

int ClpSimplex::getSolution | ( | const double * | rowActivities,
|  | const double * | columnActivities )

Given an existing factorization computes and checks primal and dual solutions.

Uses input arrays for variables at bounds. Returns feasibility states

## getSolution() [2/2]

int ClpSimplex::getSolution | ( |  | ) |

Given an existing factorization computes and checks primal and dual solutions.

Uses current problem arrays for bounds. Returns feasibility states

## createPiecewiseLinearCosts()

int ClpSimplex::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.

Returns nonzero if bad data e.g. lowers not monotonic

## dualRowPivot()

ClpDualRowPivot * ClpSimplex::dualRowPivot | ( |  | ) | const

inline

dual row pivot choice

Definition at line 847 of file ClpSimplex.hpp.

## primalColumnPivot()

ClpPrimalColumnPivot * ClpSimplex::primalColumnPivot | ( |  | ) | const

inline

primal column pivot choice

Definition at line 852 of file ClpSimplex.hpp.

## goodAccuracy()

bool ClpSimplex::goodAccuracy | ( |  | ) | const

inline

Returns true if model looks OK.

Definition at line 857 of file ClpSimplex.hpp.

## returnModel()

void ClpSimplex::returnModel | ( | ClpSimplex & | otherModel | ) |

Return model - updates any scalars.

## internalFactorize()

int ClpSimplex::internalFactorize | ( | int | solveType | ) |

Factorizes using current basis.

solveType - 1 iterating, 0 initial, -1 external If 10 added then in primal values pass Return codes are as from ClpFactorization unless initial factorization when total number of singularities is returned. Special case is numberRows_+1 -> all slack basis.

## saveData()

ClpDataSave ClpSimplex::saveData | ( |  | ) |

Save data.

## restoreData()

void ClpSimplex::restoreData | ( | ClpDataSave | saved | ) |

Restore data.

## cleanStatus()

void ClpSimplex::cleanStatus | ( |  | ) |

Clean up status.

## factorize()

int ClpSimplex::factorize | ( |  | ) |

Factorizes using current basis. For external use.

## computeDuals()

void ClpSimplex::computeDuals | ( | double * | givenDjs | ) |

Computes duals from scratch.

If givenDjs then allows for nonzero basic djs

## computePrimals()

void ClpSimplex::computePrimals | ( | const double * | rowActivities,
|  | const double * | columnActivities )

Computes primals from scratch.

## add()

void ClpSimplex::add | ( | double * | array,
|  | int | column,
|  | double | multiplier ) const

Adds multiple of a column into an array.

## unpack() [1/2]

void ClpSimplex::unpack | ( | CoinIndexedVector * | rowArray | ) | const

Unpacks one column of the matrix into indexed array Uses sequenceIn_ Also applies scaling if needed.

## unpack() [2/2]

void ClpSimplex::unpack | ( | CoinIndexedVector * | rowArray,
|  | int | sequence ) const

Unpacks one column of the matrix into indexed array Slack if sequence>= numberColumns Also applies scaling if needed.

## unpackPacked() [1/2]

void ClpSimplex::unpackPacked | ( | CoinIndexedVector * | rowArray | ) |

Unpacks one column of the matrix into indexed array as packed vector Uses sequenceIn_ Also applies scaling if needed.

## unpackPacked() [2/2]

void ClpSimplex::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.

## housekeeping()

int ClpSimplex::housekeeping | ( | double | objectiveChange | ) |

protected

This does basis housekeeping and does values for in/out variables.

Can also decide to re-factorize

## checkPrimalSolution()

void ClpSimplex::checkPrimalSolution | ( | const double * | rowActivities = NULL,
|  | const double * | columnActivies = NULL )

protected

This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Primal).

## checkDualSolution()

void ClpSimplex::checkDualSolution | ( |  | ) |

protected

This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Dual).

## checkBothSolutions()

void ClpSimplex::checkBothSolutions | ( |  | ) |

protected

This sets sum and number of infeasibilities (Dual and Primal).

## scaleObjective()

double ClpSimplex::scaleObjective | ( | double | value | ) |

protected

If input negative scales objective so maximum <= -value and returns scale factor used.

If positive unscales and also redoes dual stuff

## solveDW()

int ClpSimplex::solveDW | ( | CoinStructuredModel * | model,
|  | ClpSolve & | options )

protected

Solve using Dantzig-Wolfe decomposition and maybe in parallel.

## solveBenders()

int ClpSimplex::solveBenders | ( | CoinStructuredModel * | model,
|  | ClpSolve & | options )

protected

Solve using Benders decomposition and maybe in parallel.

## setValuesPassAction()

void ClpSimplex::setValuesPassAction | ( | double | incomingInfeasibility,
|  | double | allowedInfeasibility )

For advanced use.

When doing iterative solves things can get nasty so on values pass if incoming solution has largest infeasibility < incomingInfeasibility throw out variables from basis until largest infeasibility < allowedInfeasibility or incoming largest infeasibility. If allowedInfeasibility>= incomingInfeasibility this is always possible altough you may end up with an all slack basis.

Defaults are 1.0,10.0

## cleanFactorization()

int ClpSimplex::cleanFactorization | ( | int | ifValuesPass | ) |

Get a clean factorization - i.e.

throw out singularities may do more later

## alphaAccuracy()

double ClpSimplex::alphaAccuracy | ( |  | ) | const

inline

Initial value for alpha accuracy calculation (-1.0 off).

Definition at line 962 of file ClpSimplex.hpp.

## setAlphaAccuracy()

void ClpSimplex::setAlphaAccuracy | ( | double | value | ) |

inline

Definition at line 966 of file ClpSimplex.hpp.

## setDisasterHandler()

void ClpSimplex::setDisasterHandler | ( | ClpDisasterHandler * | handler | ) |

inline

Objective value.

Set disaster handler

Definition at line 977 of file ClpSimplex.hpp.

## disasterHandler()

ClpDisasterHandler * ClpSimplex::disasterHandler | ( |  | ) | const

inline

Get disaster handler.

Definition at line 982 of file ClpSimplex.hpp.

## largeValue()

double ClpSimplex::largeValue | ( |  | ) | const

inline

Large bound value (for complementarity etc).

Definition at line 987 of file ClpSimplex.hpp.

## setLargeValue()

void ClpSimplex::setLargeValue | ( | double | value | ) |

## largestPrimalError()

double ClpSimplex::largestPrimalError | ( |  | ) | const

inline

Largest error on Ax-b.

Definition at line 993 of file ClpSimplex.hpp.

## largestDualError()

double ClpSimplex::largestDualError | ( |  | ) | const

inline

Largest error on basic duals.

Definition at line 998 of file ClpSimplex.hpp.

## setLargestPrimalError()

void ClpSimplex::setLargestPrimalError | ( | double | value | ) |

inline

Largest error on Ax-b.

Definition at line 1003 of file ClpSimplex.hpp.

## setLargestDualError()

void ClpSimplex::setLargestDualError | ( | double | value | ) |

inline

Largest error on basic duals.

Definition at line 1008 of file ClpSimplex.hpp.

## zeroTolerance()

double ClpSimplex::zeroTolerance | ( |  | ) | const

inline

Get zero tolerance.

Definition at line 1013 of file ClpSimplex.hpp.

## setZeroTolerance()

void ClpSimplex::setZeroTolerance | ( | double | value | ) |

inline

Set zero tolerance.

Definition at line 1018 of file ClpSimplex.hpp.

## pivotVariable()

int * ClpSimplex::pivotVariable | ( |  | ) | const

inline

Basic variables pivoting on which rows.

Definition at line 1023 of file ClpSimplex.hpp.

## automaticScaling()

bool ClpSimplex::automaticScaling | ( |  | ) | const

inline

If automatic scaling on.

Definition at line 1028 of file ClpSimplex.hpp.

## setAutomaticScaling()

void ClpSimplex::setAutomaticScaling | ( | bool | onOff | ) |

inline

Definition at line 1032 of file ClpSimplex.hpp.

## currentDualTolerance()

double ClpSimplex::currentDualTolerance | ( |  | ) | const

inline

Current dual tolerance.

Definition at line 1037 of file ClpSimplex.hpp.

## setCurrentDualTolerance()

void ClpSimplex::setCurrentDualTolerance | ( | double | value | ) |

inline

Definition at line 1041 of file ClpSimplex.hpp.

## currentPrimalTolerance()

double ClpSimplex::currentPrimalTolerance | ( |  | ) | const

inline

Current primal tolerance.

Definition at line 1046 of file ClpSimplex.hpp.

## setCurrentPrimalTolerance()

void ClpSimplex::setCurrentPrimalTolerance | ( | double | value | ) |

inline

Definition at line 1050 of file ClpSimplex.hpp.

## numberRefinements()

int ClpSimplex::numberRefinements | ( |  | ) | const

inline

How many iterative refinements to do.

Definition at line 1055 of file ClpSimplex.hpp.

## setNumberRefinements()

void ClpSimplex::setNumberRefinements | ( | int | value | ) |

## alpha()

double ClpSimplex::alpha | ( |  | ) | const

inline

Alpha (pivot element) for use by classes e.g. steepestedge.

Definition at line 1061 of file ClpSimplex.hpp.

## setAlpha()

void ClpSimplex::setAlpha | ( | double | value | ) |

inline

Definition at line 1065 of file ClpSimplex.hpp.

## dualIn()

double ClpSimplex::dualIn | ( |  | ) | const

inline

Reduced cost of last incoming for use by classes e.g. steepestedge.

Definition at line 1070 of file ClpSimplex.hpp.

## setDualIn()

void ClpSimplex::setDualIn | ( | double | value | ) |

inline

Set reduced cost of last incoming to force error.

Definition at line 1075 of file ClpSimplex.hpp.

## pivotRow()

int ClpSimplex::pivotRow | ( |  | ) | const

inline

Pivot Row for use by classes e.g. steepestedge.

Definition at line 1080 of file ClpSimplex.hpp.

## setPivotRow()

void ClpSimplex::setPivotRow | ( | int | value | ) |

inline

Definition at line 1084 of file ClpSimplex.hpp.

## valueIncomingDual()

double ClpSimplex::valueIncomingDual | ( |  | ) | const

value of incoming variable (in Dual)

## gutsOfSolution()

int ClpSimplex::gutsOfSolution | ( | double * | givenDuals,
|  | const double * | givenPrimals,
|  | bool | valuesPass = false )

protected

May change basis and then returns number changed.

Computation of solutions may be overriden by given pi and solution

## gutsOfDelete()

void ClpSimplex::gutsOfDelete | ( | int | type | ) |

protected

Does most of deletion (0 = all, 1 = most, 2 most + factorization).

## gutsOfCopy()

void ClpSimplex::gutsOfCopy | ( | const ClpSimplex & | rhs | ) |

protected

Does most of copying.

## createRim()

bool ClpSimplex::createRim | ( | int | what,
|  | bool | makeRowCopy = false,
|  | int | startFinishOptions = 0 )

protected

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).

8 bit does solution scaling in 16 bit does rowArray and columnArray indexed vectors and makes row copy if wanted, also sets columnStart_ etc Also creates scaling arrays if needed. It does scaling if needed. 16 also moves solutions etc in to work arrays On 16 returns false if problem "bad" i.e. matrix or bounds bad If startFinishOptions is -1 then called by user in getSolution so do arrays but keep pivotVariable_

## createRim1()

void ClpSimplex::createRim1 | ( | bool | initial | ) |

protected

Does rows and columns.

## createRim4()

void ClpSimplex::createRim4 | ( | bool | initial | ) |

protected

Does objective.

## createRim5()

void ClpSimplex::createRim5 | ( | bool | initial | ) |

protected

Does rows and columns and objective.

## deleteRim()

void ClpSimplex::deleteRim | ( | int | getRidOfFactorizationData = 2 | ) |

protected

releases above arrays and does solution scaling out.

May also get rid of factorization data - 0 get rid of nothing, 1 get rid of arrays, 2 also factorization

## sanityCheck()

bool ClpSimplex::sanityCheck | ( |  | ) |

protected

Sanity check on input rim data (after scaling) - returns true if okay.

## solutionRegion() [1/2]

double * ClpSimplex::solutionRegion | ( | int | section | ) | const

inline

Return row or column sections - not as much needed as it once was.

These just map into single arrays

Definition at line 1138 of file ClpSimplex.hpp.

## djRegion() [1/2]

double * ClpSimplex::djRegion | ( | int | section | ) | const

inline

Definition at line 1145 of file ClpSimplex.hpp.

## lowerRegion() [1/2]

double * ClpSimplex::lowerRegion | ( | int | section | ) | const

inline

Definition at line 1152 of file ClpSimplex.hpp.

## upperRegion() [1/2]

double * ClpSimplex::upperRegion | ( | int | section | ) | const

inline

Definition at line 1159 of file ClpSimplex.hpp.

## costRegion() [1/2]

double * ClpSimplex::costRegion | ( | int | section | ) | const

inline

Definition at line 1166 of file ClpSimplex.hpp.

## solutionRegion() [2/2]

double * ClpSimplex::solutionRegion | ( |  | ) | const

inline

Return region as single array.

Definition at line 1174 of file ClpSimplex.hpp.

## djRegion() [2/2]

double * ClpSimplex::djRegion | ( |  | ) | const

inline

Definition at line 1178 of file ClpSimplex.hpp.

## lowerRegion() [2/2]

double * ClpSimplex::lowerRegion | ( |  | ) | const

inline

Definition at line 1182 of file ClpSimplex.hpp.

## upperRegion() [2/2]

double * ClpSimplex::upperRegion | ( |  | ) | const

inline

Definition at line 1186 of file ClpSimplex.hpp.

## costRegion() [2/2]

double * ClpSimplex::costRegion | ( |  | ) | const

inline

Definition at line 1190 of file ClpSimplex.hpp.

## getStatus()

Status ClpSimplex::getStatus | ( | int | sequence | ) | const

inline

Definition at line 1194 of file ClpSimplex.hpp.

## setStatus()

void ClpSimplex::setStatus | ( | int | sequence,
|  | Status | newstatus )

inline

Definition at line 1198 of file ClpSimplex.hpp.

## startPermanentArrays()

bool ClpSimplex::startPermanentArrays | ( |  | ) |

Start or reset using maximumRows_ and Columns_ - true if change.

## setInitialDenseFactorization()

void ClpSimplex::setInitialDenseFactorization | ( | bool | onOff | ) |

Normally the first factorization does sparse coding because the factorization could be singular.

This allows initial dense factorization when it is known to be safe

## initialDenseFactorization()

bool ClpSimplex::initialDenseFactorization | ( |  | ) | const

## sequenceIn()

int ClpSimplex::sequenceIn | ( |  | ) | const

inline

Return sequence In or Out.

Definition at line 1213 of file ClpSimplex.hpp.

## sequenceOut()

int ClpSimplex::sequenceOut | ( |  | ) | const

inline

Definition at line 1217 of file ClpSimplex.hpp.

## setSequenceIn()

void ClpSimplex::setSequenceIn | ( | int | sequence | ) |

inline

Set sequenceIn or Out.

Definition at line 1222 of file ClpSimplex.hpp.

## setSequenceOut()

void ClpSimplex::setSequenceOut | ( | int | sequence | ) |

inline

Definition at line 1226 of file ClpSimplex.hpp.

## directionIn()

int ClpSimplex::directionIn | ( |  | ) | const

inline

Return direction In or Out.

Definition at line 1231 of file ClpSimplex.hpp.

## directionOut()

int ClpSimplex::directionOut | ( |  | ) | const

inline

Definition at line 1235 of file ClpSimplex.hpp.

## setDirectionIn()

void ClpSimplex::setDirectionIn | ( | int | direction | ) |

inline

Set directionIn or Out.

Definition at line 1240 of file ClpSimplex.hpp.

## setDirectionOut()

void ClpSimplex::setDirectionOut | ( | int | direction | ) |

inline

Definition at line 1244 of file ClpSimplex.hpp.

## valueOut()

double ClpSimplex::valueOut | ( |  | ) | const

inline

Value of Out variable.

Definition at line 1249 of file ClpSimplex.hpp.

## lowerOut()

double ClpSimplex::lowerOut | ( |  | ) | const

inline

Lower of out variable.

Definition at line 1254 of file ClpSimplex.hpp.

## upperOut()

double ClpSimplex::upperOut | ( |  | ) | const

inline

Upper of out variable.

Definition at line 1259 of file ClpSimplex.hpp.

## setValueOut()

void ClpSimplex::setValueOut | ( | double | value | ) |

inline

Set value of out variable.

Definition at line 1264 of file ClpSimplex.hpp.

## dualOut()

double ClpSimplex::dualOut | ( |  | ) | const

inline

Dual value of Out variable.

Definition at line 1269 of file ClpSimplex.hpp.

## setDualOut()

void ClpSimplex::setDualOut | ( | double | value | ) |

inline

Set dual value of out variable.

Definition at line 1274 of file ClpSimplex.hpp.

## setLowerOut()

void ClpSimplex::setLowerOut | ( | double | value | ) |

inline

Set lower of out variable.

Definition at line 1279 of file ClpSimplex.hpp.

## setUpperOut()

void ClpSimplex::setUpperOut | ( | double | value | ) |

inline

Set upper of out variable.

Definition at line 1284 of file ClpSimplex.hpp.

## setTheta()

void ClpSimplex::setTheta | ( | double | value | ) |

inline

Set theta of out variable.

Definition at line 1289 of file ClpSimplex.hpp.

## isColumn()

int ClpSimplex::isColumn | ( | int | sequence | ) | const

inline

Returns 1 if sequence indicates column.

Definition at line 1294 of file ClpSimplex.hpp.

## sequenceWithin()

int ClpSimplex::sequenceWithin | ( | int | sequence | ) | const

inline

Returns sequence number within section.

Definition at line 1299 of file ClpSimplex.hpp.

## solution()

double ClpSimplex::solution | ( | int | sequence | ) |

inline

Return row or column values.

Definition at line 1304 of file ClpSimplex.hpp.

## solutionAddress()

double & ClpSimplex::solutionAddress | ( | int | sequence | ) |

inline

Return address of row or column values.

Definition at line 1309 of file ClpSimplex.hpp.

## reducedCost()

double ClpSimplex::reducedCost | ( | int | sequence | ) |

inline

Definition at line 1313 of file ClpSimplex.hpp.

## reducedCostAddress()

double & ClpSimplex::reducedCostAddress | ( | int | sequence | ) |

inline

Definition at line 1317 of file ClpSimplex.hpp.

## lower()

double ClpSimplex::lower | ( | int | sequence | ) |

inline

Definition at line 1321 of file ClpSimplex.hpp.

## lowerAddress()

double & ClpSimplex::lowerAddress | ( | int | sequence | ) |

inline

Return address of row or column lower bound.

Definition at line 1326 of file ClpSimplex.hpp.

## upper()

double ClpSimplex::upper | ( | int | sequence | ) |

inline

Definition at line 1330 of file ClpSimplex.hpp.

## upperAddress()

double & ClpSimplex::upperAddress | ( | int | sequence | ) |

inline

Return address of row or column upper bound.

Definition at line 1335 of file ClpSimplex.hpp.

## cost()

double ClpSimplex::cost | ( | int | sequence | ) |

inline

Definition at line 1339 of file ClpSimplex.hpp.

## costAddress()

double & ClpSimplex::costAddress | ( | int | sequence | ) |

inline

Return address of row or column cost.

Definition at line 1344 of file ClpSimplex.hpp.

## originalLower()

double ClpSimplex::originalLower | ( | int | iSequence | ) | const

inline

Return original lower bound.

Definition at line 1349 of file ClpSimplex.hpp.

## originalUpper()

double ClpSimplex::originalUpper | ( | int | iSequence | ) | const

inline

Return original lower bound.

Definition at line 1357 of file ClpSimplex.hpp.

## theta()

double ClpSimplex::theta | ( |  | ) | const

inline

Theta (pivot change).

Definition at line 1365 of file ClpSimplex.hpp.

## lowerIn()

double ClpSimplex::lowerIn | ( |  | ) | const

inline

Lower Bound on In variable.

Definition at line 1370 of file ClpSimplex.hpp.

## valueIn()

double ClpSimplex::valueIn | ( |  | ) | const

inline

Value of In variable.

Definition at line 1375 of file ClpSimplex.hpp.

## upperIn()

double ClpSimplex::upperIn | ( |  | ) | const

inline

Upper Bound on In variable.

Definition at line 1380 of file ClpSimplex.hpp.

## bestPossibleImprovement()

double ClpSimplex::bestPossibleImprovement | ( |  | ) | const

inline

Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (dual).

Definition at line 1386 of file ClpSimplex.hpp.

## nonLinearCost()

ClpNonLinearCost * ClpSimplex::nonLinearCost | ( |  | ) | const

inline

Return pointer to details of costs.

Definition at line 1391 of file ClpSimplex.hpp.

## setNonLinearCost()

void ClpSimplex::setNonLinearCost | ( | ClpNonLinearCost & | nonLinearCost | ) |

Set pointer to details of costs.

## moreSpecialOptions()

int ClpSimplex::moreSpecialOptions | ( |  | ) | const

inline

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!

64 bit - give up easily in dual (and say infeasible) 128 bit - no objective, 0-1 and in B&B 256 bit - in primal from dual or vice versa 512 bit - alternative use of solveType_ 1024 bit - don't do row copy of factorization 2048 bit - perturb in complete fathoming 4096 bit - try more for complete fathoming 8192 bit - don't even think of using primal if user asks for dual (and vv) 16384 bit - in initialSolve so be more flexible 32768 bit - don't swap algorithms from dual if small infeasibility 65536 bit - perturb in postsolve cleanup (even if < 10000 rows) 131072 bit (*3) initial stateDualColumn 524288 bit - stop when primal feasible 1048576 bit - stop when primal feasible after n-1000000 iterations 2097152 bit - no primal in fastDual2 if feasible 4194304 bit - tolerances have been changed by code 8388608 bit - tolerances are dynamic (at first) 16777216 bit - if factorization kept can still declare optimal at once

Definition at line 1423 of file ClpSimplex.hpp.

## vectorMode()

int ClpSimplex::vectorMode | ( |  | ) | const

inline

Get vector mode.

Definition at line 1428 of file ClpSimplex.hpp.

## setMoreSpecialOptions()

void ClpSimplex::setMoreSpecialOptions | ( | int | value | ) |

inline

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!

64 bit - give up easily in dual (and say infeasible) 128 bit - no objective, 0-1 and in B&B 256 bit - in primal from dual or vice versa 512 bit - alternative use of solveType_ 1024 bit - don't do row copy of factorization 2048 bit - perturb in complete fathoming 4096 bit - try more for complete fathoming 8192 bit - don't even think of using primal if user asks for dual (and vv) 16384 bit - in initialSolve so be more flexible 32768 bit - don't swap algorithms from dual if small infeasibility 65536 bit - perturb in postsolve cleanup (even if < 10000 rows) 131072 bit (*3) initial stateDualColumn 524288 bit - stop when primal feasible 1048576 bit - don't perturb even if long time 2097152 bit - no primal in fastDual2 if feasible 4194304 bit - tolerances have been changed by code 8388608 bit - tolerances are dynamic (at first) 16777216 bit - if factorization kept can still declare optimal at once

Definition at line 1458 of file ClpSimplex.hpp.

## setVectorMode()

void ClpSimplex::setVectorMode | ( | int | value | ) |

inline

Set vector mode.

Definition at line 1463 of file ClpSimplex.hpp.

## setFakeBound()

void ClpSimplex::setFakeBound | ( | int | sequence,
|  | FakeBound | fakeBound )

inline

Definition at line 1470 of file ClpSimplex.hpp.

## getFakeBound()

FakeBound ClpSimplex::getFakeBound | ( | int | sequence | ) | const

inline

Definition at line 1476 of file ClpSimplex.hpp.

## setRowStatus()

void ClpSimplex::setRowStatus | ( | int | sequence,
|  | Status | newstatus )

inline

Definition at line 1480 of file ClpSimplex.hpp.

## getRowStatus()

Status ClpSimplex::getRowStatus | ( | int | sequence | ) | const

inline

Definition at line 1486 of file ClpSimplex.hpp.

## setColumnStatus()

void ClpSimplex::setColumnStatus | ( | int | sequence,
|  | Status | newstatus )

inline

Definition at line 1490 of file ClpSimplex.hpp.

## getColumnStatus()

Status ClpSimplex::getColumnStatus | ( | int | sequence | ) | const

inline

Definition at line 1496 of file ClpSimplex.hpp.

## setPivoted()

void ClpSimplex::setPivoted | ( | int | sequence | ) |

inline

Definition at line 1500 of file ClpSimplex.hpp.

## clearPivoted()

void ClpSimplex::clearPivoted | ( | int | sequence | ) |

inline

Definition at line 1504 of file ClpSimplex.hpp.

## pivoted()

bool ClpSimplex::pivoted | ( | int | sequence | ) | const

inline

Definition at line 1508 of file ClpSimplex.hpp.

## setFlagged()

void ClpSimplex::setFlagged | ( | int | sequence | ) |

To flag a variable (not inline to allow for column generation).

## clearFlagged()

void ClpSimplex::clearFlagged | ( | int | sequence | ) |

inline

Definition at line 1514 of file ClpSimplex.hpp.

## flagged()

bool ClpSimplex::flagged | ( | int | sequence | ) | const

inline

Definition at line 1518 of file ClpSimplex.hpp.

## setActive()

void ClpSimplex::setActive | ( | int | iRow | ) |

inline

To say row active in primal pivot row choice.

Definition at line 1523 of file ClpSimplex.hpp.

## clearActive()

void ClpSimplex::clearActive | ( | int | iRow | ) |

inline

Definition at line 1527 of file ClpSimplex.hpp.

## active()

bool ClpSimplex::active | ( | int | iRow | ) | const

inline

Definition at line 1531 of file ClpSimplex.hpp.

## setPerturbed()

void ClpSimplex::setPerturbed | ( | int | iSequence | ) |

inline

To say perturbed.

Definition at line 1536 of file ClpSimplex.hpp.

## clearPerturbed()

void ClpSimplex::clearPerturbed | ( | int | iSequence | ) |

inline

Definition at line 1540 of file ClpSimplex.hpp.

## perturbed()

bool ClpSimplex::perturbed | ( | int | iSequence | ) | const

inline

Definition at line 1544 of file ClpSimplex.hpp.

## createStatus()

void ClpSimplex::createStatus | ( |  | ) |

Set up status array (can be used by OsiClp).

Also can be used to set up all slack basis

## allSlackBasis()

void ClpSimplex::allSlackBasis | ( | bool | resetSolution = false | ) |

Sets up all slack basis and resets solution to as it was after initial load or readMps.

## lastBadIteration()

int ClpSimplex::lastBadIteration | ( |  | ) | const

inline

So we know when to be cautious.

Definition at line 1556 of file ClpSimplex.hpp.

## setLastBadIteration()

void ClpSimplex::setLastBadIteration | ( | int | value | ) |

inline

Set so we know when to be cautious.

Definition at line 1561 of file ClpSimplex.hpp.

## progressFlag()

int ClpSimplex::progressFlag | ( |  | ) | const

inline

Progress flag - at present 0 bit says artificials out.

Definition at line 1566 of file ClpSimplex.hpp.

## progress()

ClpSimplexProgress * ClpSimplex::progress | ( |  | ) |

inline

For dealing with all issues of cycling etc.

Definition at line 1571 of file ClpSimplex.hpp.

## forceFactorization() [1/2]

int ClpSimplex::forceFactorization | ( |  | ) | const

inline

Force re-factorization early value.

Definition at line 1576 of file ClpSimplex.hpp.

## forceFactorization() [2/2]

void ClpSimplex::forceFactorization | ( | int | value | ) |

inline

Force re-factorization early.

Definition at line 1581 of file ClpSimplex.hpp.

## rawObjectiveValue()

double ClpSimplex::rawObjectiveValue | ( |  | ) | const

inline

Raw objective value (so always minimize in primal).

Definition at line 1586 of file ClpSimplex.hpp.

## computeObjectiveValue()

void ClpSimplex::computeObjectiveValue | ( | bool | useWorkingSolution = false | ) |

Compute objective value from solution and put in objectiveValue_.

## computeInternalObjectiveValue()

double ClpSimplex::computeInternalObjectiveValue | ( |  | ) |

Compute minimization objective value from internal solution without perturbation.

## infeasibilityRay()

double * ClpSimplex::infeasibilityRay | ( | bool | fullRay = false | ) | const

Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays.

## numberExtraRows()

int ClpSimplex::numberExtraRows | ( |  | ) | const

inline

Number of extra rows.

These are ones which will be dynamically created each iteration. This is for GUB but may have other uses.

Definition at line 1600 of file ClpSimplex.hpp.

## maximumBasic()

int ClpSimplex::maximumBasic | ( |  | ) | const

inline

Maximum number of basic variables - can be more than number of rows if GUB.

Definition at line 1606 of file ClpSimplex.hpp.

## baseIteration()

int ClpSimplex::baseIteration | ( |  | ) | const

inline

Iteration when we entered dual or primal.

Definition at line 1611 of file ClpSimplex.hpp.

## generateCpp()

void ClpSimplex::generateCpp | ( | FILE * | fp,
|  | bool | defaultFactor = false )

Create C++ lines to get to current state.

## getEmptyFactorization()

ClpFactorization * ClpSimplex::getEmptyFactorization | ( |  | ) |

Gets clean and emptyish factorization.

## setEmptyFactorization()

void ClpSimplex::setEmptyFactorization | ( |  | ) |

May delete or may make clean and emptyish factorization.

## moveInfo()

void ClpSimplex::moveInfo | ( | const ClpSimplex & | rhs,
|  | bool | justStatus = false )

Move status and solution across.

## getBInvARow()

void ClpSimplex::getBInvARow | ( | int | row,
|  | double * | z,
|  | double * | slack = NULL )

Get a row of the tableau (slack part in slack if not NULL).

## getBInvRow()

void ClpSimplex::getBInvRow | ( | int | row,
|  | double * | z )

Get a row of the basis inverse.

## getBInvACol()

void ClpSimplex::getBInvACol | ( | int | col,
|  | double * | vec )

Get a column of the tableau.

## getBInvCol()

void ClpSimplex::getBInvCol | ( | int | col,
|  | double * | vec )

Get a column of the basis inverse.

## getBasics()

void ClpSimplex::getBasics | ( | int * | index | ) |

Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()).

## setObjectiveCoefficient()

void ClpSimplex::setObjectiveCoefficient | ( | int | elementIndex,
|  | double | elementValue )

Set an objective function coefficient.

## setObjCoeff()

void ClpSimplex::setObjCoeff | ( | int | elementIndex,
|  | double | elementValue )

inline

Set an objective function coefficient.

Definition at line 1654 of file ClpSimplex.hpp.

## setColumnLower()

void ClpSimplex::setColumnLower | ( | int | elementIndex,
|  | double | elementValue )

Set a single column lower bound
Use -DBL_MAX for -infinity.

## setColumnUpper()

void ClpSimplex::setColumnUpper | ( | int | elementIndex,
|  | double | elementValue )

Set a single column upper bound
Use DBL_MAX for infinity.

## setColumnBounds()

void ClpSimplex::setColumnBounds | ( | int | elementIndex,
|  | double | lower,
|  | double | upper )

Set a single column lower and upper bound.

## setColumnSetBounds()

void ClpSimplex::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.

Parameters

  indexFirst,indexLast | pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes
  boundList | the new lower/upper bound pairs for the variables

## setColLower()

void ClpSimplex::setColLower | ( | int | elementIndex,
|  | double | elementValue )

inline

Set a single column lower bound
Use -DBL_MAX for -infinity.

Definition at line 1685 of file ClpSimplex.hpp.

## setColUpper()

void ClpSimplex::setColUpper | ( | int | elementIndex,
|  | double | elementValue )

inline

Set a single column upper bound
Use DBL_MAX for infinity.

Definition at line 1691 of file ClpSimplex.hpp.

## setColBounds()

void ClpSimplex::setColBounds | ( | int | elementIndex,
|  | double | newlower,
|  | double | newupper )

inline

Set a single column lower and upper bound.

Definition at line 1697 of file ClpSimplex.hpp.

## setColSetBounds()

void ClpSimplex::setColSetBounds | ( | const int * | indexFirst,
|  | const int * | indexLast,
|  | const double * | boundList )

inline

Set the bounds on a number of columns simultaneously
.

Parameters

  indexFirst,indexLast | pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes
  boundList | the new lower/upper bound pairs for the variables

Definition at line 1709 of file ClpSimplex.hpp.

## setRowLower()

void ClpSimplex::setRowLower | ( | int | elementIndex,
|  | double | elementValue )

Set a single row lower bound
Use -DBL_MAX for -infinity.

## setRowUpper()

void ClpSimplex::setRowUpper | ( | int | elementIndex,
|  | double | elementValue )

Set a single row upper bound
Use DBL_MAX for infinity.

## setRowBounds()

void ClpSimplex::setRowBounds | ( | int | elementIndex,
|  | double | lower,
|  | double | upper )

Set a single row lower and upper bound.

## setRowSetBounds()

void ClpSimplex::setRowSetBounds | ( | const int * | indexFirst,
|  | const int * | indexLast,
|  | const double * | boundList )

Set the bounds on a number of rows simultaneously
.

Parameters

  indexFirst,indexLast | pointers to the beginning and after the end of the array of the indices of the constraints whose either bound changes
  boundList | the new lower/upper bound pairs for the constraints

## resize()

void ClpSimplex::resize | ( | int | newNumberRows,
|  | int | newNumberColumns )

Resizes rim part of model.

## Friends And Related Symbol Documentation

## OsiClpSolverInterface

friend class OsiClpSolverInterface

friend

Allow OsiClp certain perks.

Definition at line 1972 of file ClpSimplex.hpp.

## OsiCLPSolverInterface

friend class OsiCLPSolverInterface

friend

And OsiCLP.

Definition at line 1974 of file ClpSimplex.hpp.

## ClpSimplexUnitTest

void ClpSimplexUnitTest | ( | const std::string & | mpsDir | ) |

friend

A function that tests the methods in the ClpSimplex class.

The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.

It also does some testing of ClpFactorization class

## Member Data Documentation

## bestPossibleImprovement_

double ClpSimplex::bestPossibleImprovement_

protected

Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (dual).

Definition at line 1752 of file ClpSimplex.hpp.

## zeroTolerance_

double ClpSimplex::zeroTolerance_

protected

Zero tolerance.

Definition at line 1754 of file ClpSimplex.hpp.

## columnPrimalSequence_

int ClpSimplex::columnPrimalSequence_

protected

Sequence of worst (-1 if feasible).

Definition at line 1756 of file ClpSimplex.hpp.

## rowPrimalSequence_

int ClpSimplex::rowPrimalSequence_

protected

Sequence of worst (-1 if feasible).

Definition at line 1758 of file ClpSimplex.hpp.

## bestObjectiveValue_

double ClpSimplex::bestObjectiveValue_

protected

"Best" objective value

Definition at line 1760 of file ClpSimplex.hpp.

## moreSpecialOptions_

int ClpSimplex::moreSpecialOptions_

protected

More special options - see set for details.

Definition at line 1762 of file ClpSimplex.hpp.

## baseIteration_

int ClpSimplex::baseIteration_

protected

Iteration when we entered dual or primal.

Definition at line 1764 of file ClpSimplex.hpp.

## vectorMode_

int ClpSimplex::vectorMode_

protected

Vector mode - try and use vector instructions.

Definition at line 1766 of file ClpSimplex.hpp.

## primalToleranceToGetOptimal_

double ClpSimplex::primalToleranceToGetOptimal_

protected

Primal tolerance needed to make dual feasible (<largeTolerance).

Definition at line 1768 of file ClpSimplex.hpp.

## largeValue_

double ClpSimplex::largeValue_

protected

Large bound value (for complementarity etc).

Definition at line 1770 of file ClpSimplex.hpp.

## largestPrimalError_

double ClpSimplex::largestPrimalError_

protected

Largest error on Ax-b.

Definition at line 1772 of file ClpSimplex.hpp.

## largestDualError_

double ClpSimplex::largestDualError_

protected

Largest error on basic duals.

Definition at line 1774 of file ClpSimplex.hpp.

## alphaAccuracy_

double ClpSimplex::alphaAccuracy_

protected

For computing whether to re-factorize.

Definition at line 1776 of file ClpSimplex.hpp.

## dualBound_

double ClpSimplex::dualBound_

protected

Dual bound.

Definition at line 1778 of file ClpSimplex.hpp.

## alpha_

double ClpSimplex::alpha_

protected

Alpha (pivot element).

Definition at line 1780 of file ClpSimplex.hpp.

## theta_

double ClpSimplex::theta_

protected

Theta (pivot change).

Definition at line 1782 of file ClpSimplex.hpp.

## lowerIn_

double ClpSimplex::lowerIn_

protected

Lower Bound on In variable.

Definition at line 1784 of file ClpSimplex.hpp.

## valueIn_

double ClpSimplex::valueIn_

protected

Value of In variable.

Definition at line 1786 of file ClpSimplex.hpp.

## upperIn_

double ClpSimplex::upperIn_

protected

Upper Bound on In variable.

Definition at line 1788 of file ClpSimplex.hpp.

## dualIn_

double ClpSimplex::dualIn_

protected

Reduced cost of In variable.

Definition at line 1790 of file ClpSimplex.hpp.

## lowerOut_

double ClpSimplex::lowerOut_

protected

Lower Bound on Out variable.

Definition at line 1792 of file ClpSimplex.hpp.

## valueOut_

double ClpSimplex::valueOut_

protected

Value of Out variable.

Definition at line 1794 of file ClpSimplex.hpp.

## upperOut_

double ClpSimplex::upperOut_

protected

Upper Bound on Out variable.

Definition at line 1796 of file ClpSimplex.hpp.

## dualOut_

double ClpSimplex::dualOut_

protected

Infeasibility (dual) or ? (primal) of Out variable.

Definition at line 1798 of file ClpSimplex.hpp.

## dualTolerance_

double ClpSimplex::dualTolerance_

protected

Current dual tolerance for algorithm.

Definition at line 1800 of file ClpSimplex.hpp.

## primalTolerance_

double ClpSimplex::primalTolerance_

protected

Current primal tolerance for algorithm.

Definition at line 1802 of file ClpSimplex.hpp.

## sumDualInfeasibilities_

double ClpSimplex::sumDualInfeasibilities_

protected

Sum of dual infeasibilities.

Definition at line 1804 of file ClpSimplex.hpp.

## sumPrimalInfeasibilities_

double ClpSimplex::sumPrimalInfeasibilities_

protected

Sum of primal infeasibilities.

Definition at line 1806 of file ClpSimplex.hpp.

## infeasibilityCost_

double ClpSimplex::infeasibilityCost_

protected

Weight assigned to being infeasible in primal.

Definition at line 1808 of file ClpSimplex.hpp.

## sumOfRelaxedDualInfeasibilities_

double ClpSimplex::sumOfRelaxedDualInfeasibilities_

protected

Sum of Dual infeasibilities using tolerance based on error in duals.

Definition at line 1810 of file ClpSimplex.hpp.

## sumOfRelaxedPrimalInfeasibilities_

double ClpSimplex::sumOfRelaxedPrimalInfeasibilities_

protected

Sum of Primal infeasibilities using tolerance based on error in primals.

Definition at line 1812 of file ClpSimplex.hpp.

## acceptablePivot_

double ClpSimplex::acceptablePivot_

protected

Acceptable pivot value just after factorization.

Definition at line 1814 of file ClpSimplex.hpp.

## minimumPrimalTolerance_

double ClpSimplex::minimumPrimalTolerance_

protected

Minimum primal tolerance.

Definition at line 1816 of file ClpSimplex.hpp.

## averageInfeasibility_

double ClpSimplex::averageInfeasibility_[CLP_INFEAS_SAVE]

protected

Definition at line 1819 of file ClpSimplex.hpp.

## lower_

double* ClpSimplex::lower_

protected

Working copy of lower bounds (Owner of arrays below).

Definition at line 1821 of file ClpSimplex.hpp.

## rowLowerWork_

double* ClpSimplex::rowLowerWork_

protected

Row lower bounds - working copy.

Definition at line 1823 of file ClpSimplex.hpp.

## columnLowerWork_

double* ClpSimplex::columnLowerWork_

protected

Column lower bounds - working copy.

Definition at line 1825 of file ClpSimplex.hpp.

## upper_

double* ClpSimplex::upper_

protected

Working copy of upper bounds (Owner of arrays below).

Definition at line 1827 of file ClpSimplex.hpp.

## rowUpperWork_

double* ClpSimplex::rowUpperWork_

protected

Row upper bounds - working copy.

Definition at line 1829 of file ClpSimplex.hpp.

## columnUpperWork_

double* ClpSimplex::columnUpperWork_

protected

Column upper bounds - working copy.

Definition at line 1831 of file ClpSimplex.hpp.

## cost_

double* ClpSimplex::cost_

protected

Working copy of objective (Owner of arrays below).

Definition at line 1833 of file ClpSimplex.hpp.

## rowObjectiveWork_

double* ClpSimplex::rowObjectiveWork_

protected

Row objective - working copy.

Definition at line 1835 of file ClpSimplex.hpp.

## objectiveWork_

double* ClpSimplex::objectiveWork_

protected

Column objective - working copy.

Definition at line 1837 of file ClpSimplex.hpp.

## rowArray_

CoinIndexedVector* ClpSimplex::rowArray_[6]

protected

Useful row length arrays.

Definition at line 1839 of file ClpSimplex.hpp.

## columnArray_

CoinIndexedVector* ClpSimplex::columnArray_[6]

protected

Useful column length arrays.

Definition at line 1841 of file ClpSimplex.hpp.

## sequenceIn_

int ClpSimplex::sequenceIn_

protected

Sequence of In variable.

Definition at line 1843 of file ClpSimplex.hpp.

## directionIn_

int ClpSimplex::directionIn_

protected

Direction of In, 1 going up, -1 going down, 0 not a clue.

Definition at line 1845 of file ClpSimplex.hpp.

## sequenceOut_

int ClpSimplex::sequenceOut_

protected

Sequence of Out variable.

Definition at line 1847 of file ClpSimplex.hpp.

## directionOut_

int ClpSimplex::directionOut_

protected

Direction of Out, 1 to upper bound, -1 to lower bound, 0 - superbasic.

Definition at line 1849 of file ClpSimplex.hpp.

## pivotRow_

int ClpSimplex::pivotRow_

protected

Pivot Row.

Definition at line 1851 of file ClpSimplex.hpp.

## lastGoodIteration_

int ClpSimplex::lastGoodIteration_

protected

Last good iteration (immediately after a re-factorization).

Definition at line 1853 of file ClpSimplex.hpp.

## dj_

double* ClpSimplex::dj_

protected

Working copy of reduced costs (Owner of arrays below).

Definition at line 1855 of file ClpSimplex.hpp.

## rowReducedCost_

double* ClpSimplex::rowReducedCost_

protected

Reduced costs of slacks not same as duals (or - duals).

Definition at line 1857 of file ClpSimplex.hpp.

## reducedCostWork_

double* ClpSimplex::reducedCostWork_

protected

Possible scaled reduced costs.

Definition at line 1859 of file ClpSimplex.hpp.

## solution_

double* ClpSimplex::solution_

protected

Working copy of primal solution (Owner of arrays below).

Definition at line 1861 of file ClpSimplex.hpp.

## rowActivityWork_

double* ClpSimplex::rowActivityWork_

protected

Row activities - working copy.

Definition at line 1863 of file ClpSimplex.hpp.

## columnActivityWork_

double* ClpSimplex::columnActivityWork_

protected

Column activities - working copy.

Definition at line 1865 of file ClpSimplex.hpp.

## numberDualInfeasibilities_

int ClpSimplex::numberDualInfeasibilities_

protected

Number of dual infeasibilities.

Definition at line 1867 of file ClpSimplex.hpp.

## numberDualInfeasibilitiesWithoutFree_

int ClpSimplex::numberDualInfeasibilitiesWithoutFree_

protected

Number of dual infeasibilities (without free).

Definition at line 1869 of file ClpSimplex.hpp.

## numberPrimalInfeasibilities_

int ClpSimplex::numberPrimalInfeasibilities_

protected

Number of primal infeasibilities.

Definition at line 1871 of file ClpSimplex.hpp.

## numberRefinements_

int ClpSimplex::numberRefinements_

protected

How many iterative refinements to do.

Definition at line 1873 of file ClpSimplex.hpp.

## dualRowPivot_

ClpDualRowPivot* ClpSimplex::dualRowPivot_

protected

dual row pivot choice

Definition at line 1875 of file ClpSimplex.hpp.

## primalColumnPivot_

ClpPrimalColumnPivot* ClpSimplex::primalColumnPivot_

protected

primal column pivot choice

Definition at line 1877 of file ClpSimplex.hpp.

## pivotVariable_

int* ClpSimplex::pivotVariable_

protected

Basic variables pivoting on which rows.

Definition at line 1879 of file ClpSimplex.hpp.

## factorization_

ClpFactorization* ClpSimplex::factorization_

protected

factorization

Definition at line 1881 of file ClpSimplex.hpp.

## savedSolution_

double* ClpSimplex::savedSolution_

protected

Saved version of solution.

Definition at line 1883 of file ClpSimplex.hpp.

## numberTimesOptimal_

int ClpSimplex::numberTimesOptimal_

protected

Number of times code has tentatively thought optimal.

Definition at line 1885 of file ClpSimplex.hpp.

## disasterArea_

ClpDisasterHandler* ClpSimplex::disasterArea_

protected

Disaster handler.

Definition at line 1887 of file ClpSimplex.hpp.

## changeMade_

int ClpSimplex::changeMade_

protected

If change has been made (first attempt at stopping looping).

Definition at line 1889 of file ClpSimplex.hpp.

## algorithm_

int ClpSimplex::algorithm_

protected

Algorithm >0 == Primal, <0 == Dual.

Definition at line 1891 of file ClpSimplex.hpp.

## forceFactorization_

int ClpSimplex::forceFactorization_

protected

Now for some reliability aids This forces re-factorization early.

Definition at line 1894 of file ClpSimplex.hpp.

## perturbation_

int ClpSimplex::perturbation_

protected

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.

Definition at line 1902 of file ClpSimplex.hpp.

## saveStatus_

unsigned char* ClpSimplex::saveStatus_

protected

Saved status regions.

Definition at line 1904 of file ClpSimplex.hpp.

## nonLinearCost_

ClpNonLinearCost* ClpSimplex::nonLinearCost_

protected

Very wasteful way of dealing with infeasibilities in primal.

However it will allow non-linearities and use of dual analysis. If it doesn't work it can easily be replaced.

Definition at line 1909 of file ClpSimplex.hpp.

## lastBadIteration_

int ClpSimplex::lastBadIteration_

protected

So we know when to be cautious.

Definition at line 1911 of file ClpSimplex.hpp.

## lastFlaggedIteration_

int ClpSimplex::lastFlaggedIteration_

protected

So we know when to open up again.

Definition at line 1913 of file ClpSimplex.hpp.

## numberFake_

int ClpSimplex::numberFake_

protected

Can be used for count of fake bounds (dual) or fake costs (primal).

Definition at line 1915 of file ClpSimplex.hpp.

## numberChanged_

int ClpSimplex::numberChanged_

protected

Can be used for count of changed costs (dual) or changed bounds (primal).

Definition at line 1917 of file ClpSimplex.hpp.

## progressFlag_

int ClpSimplex::progressFlag_

protected

Progress flag - at present 0 bit says artificials out, 1 free in.

Definition at line 1919 of file ClpSimplex.hpp.

## firstFree_

int ClpSimplex::firstFree_

protected

First free/super-basic variable (-1 if none).

Definition at line 1921 of file ClpSimplex.hpp.

## numberExtraRows_

int ClpSimplex::numberExtraRows_

protected

Number of extra rows.

These are ones which will be dynamically created each iteration. This is for GUB but may have other uses.

Definition at line 1925 of file ClpSimplex.hpp.

## maximumBasic_

int ClpSimplex::maximumBasic_

protected

Maximum number of basic variables - can be more than number of rows if GUB.

Definition at line 1928 of file ClpSimplex.hpp.

## dontFactorizePivots_

int ClpSimplex::dontFactorizePivots_

protected

If may skip final factorize then allow up to this pivots (default 20).

Definition at line 1930 of file ClpSimplex.hpp.

## incomingInfeasibility_

double ClpSimplex::incomingInfeasibility_

protected

For advanced use.

When doing iterative solves things can get nasty so on values pass if incoming solution has largest infeasibility < incomingInfeasibility throw out variables from basis until largest infeasibility < allowedInfeasibility. if allowedInfeasibility>= incomingInfeasibility this is always possible altough you may end up with an all slack basis.

Defaults are 1.0,10.0

Definition at line 1940 of file ClpSimplex.hpp.

## allowedInfeasibility_

double ClpSimplex::allowedInfeasibility_

protected

Definition at line 1941 of file ClpSimplex.hpp.

## automaticScale_

int ClpSimplex::automaticScale_

protected

Automatic scaling of objective and rhs and bounds.

Definition at line 1943 of file ClpSimplex.hpp.

## maximumPerturbationSize_

int ClpSimplex::maximumPerturbationSize_

protected

Maximum perturbation array size (take out when code rewritten).

Definition at line 1945 of file ClpSimplex.hpp.

## perturbationArray_

double* ClpSimplex::perturbationArray_

protected

Perturbation array (maximumPerturbationSize_).

Definition at line 1947 of file ClpSimplex.hpp.

## baseModel_

ClpSimplex* ClpSimplex::baseModel_

protected

A copy of model with certain state - normally without cuts.

Definition at line 1949 of file ClpSimplex.hpp.

## progress_

ClpSimplexProgress ClpSimplex::progress_

protected

For dealing with all issues of cycling etc.

Definition at line 1951 of file ClpSimplex.hpp.

## numberDegeneratePivots_

int ClpSimplex::numberDegeneratePivots_

protected

Number of degenerate pivots since last perturbed.

Definition at line 1962 of file ClpSimplex.hpp.

## spareIntArray_

int ClpSimplex::spareIntArray_[4]

mutable

Spare int array for passing information [0]!=0 switches on.

Definition at line 1966 of file ClpSimplex.hpp.

## spareDoubleArray_

double ClpSimplex::spareDoubleArray_[4]

mutable

Spare double array for passing information [0]!=0 switches on.

Definition at line 1968 of file ClpSimplex.hpp.

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

- Clp/src/ClpSimplex.hpp