#include <ClpSimplex.hpp>
Inheritance diagram for ClpSimplex:
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. | |
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 (float incomingInfeasibility, float allowedInfeasibility) |
For advanced use. | |
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). | |
most useful gets and sets | |
double | largeValue () const |
Large bound value (for complementarity etc). | |
void | setLargeValue (double value) |
Large bound value (for complementarity etc). | |
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. | |
int * | pivotVariable () const |
Basic variables pivoting on which rows. | |
bool | automaticScaling () const |
If automatic scaling on. | |
void | setAutomaticScaling (bool onOff) |
Large bound value (for complementarity etc). | |
double | currentDualTolerance () const |
Current dual tolerance. | |
void | setCurrentDualTolerance (double value) |
Large bound value (for complementarity etc). | |
double | currentPrimalTolerance () const |
Current primal tolerance. | |
void | setCurrentPrimalTolerance (double value) |
Large bound value (for complementarity etc). | |
int | numberRefinements () const |
How many iterative refinements to do. | |
void | setNumberRefinements (int value) |
Large bound value (for complementarity etc). | |
double | alpha () const |
Alpha (pivot element) for use by classes e.g. steepestedge. | |
void | setAlpha (double value) |
Large bound value (for complementarity etc). | |
double | dualIn () const |
Reduced cost of last incoming for use by classes e.g. steepestedge. | |
int | pivotRow () const |
Pivot Row for use by classes e.g. steepestedge. | |
void | setPivotRow (int value) |
Large bound value (for complementarity etc). | |
double | valueIncomingDual () const |
value of incoming variable (in Dual) | |
double | columnPrimalInfeasibility () const |
Worst column primal infeasibility. | |
int | columnPrimalSequence () const |
Sequence of worst (-1 if feasible). | |
double | rowPrimalInfeasibility () const |
Worst row primal infeasibility. | |
int | rowPrimalSequence () const |
Sequence of worst (-1 if feasible). | |
double | columnDualInfeasibility () const |
Worst column dual infeasibility (note - these may not be as meaningful if the problem is primal infeasible. | |
int | columnDualSequence () const |
Sequence of worst (-1 if feasible). | |
double | rowDualInfeasibility () const |
Worst row dual infeasibility. | |
int | rowDualSequence () const |
Sequence of worst (-1 if feasible). | |
double | primalToleranceToGetOptimal () const |
Primal tolerance needed to make dual feasible (<largeTolerance). | |
double | remainingDualInfeasibility () const |
Remaining largest dual infeasibility. | |
double | largestSolutionError () const |
Largest difference between input primal solution and computed. | |
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 | |
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. | |
double | columnPrimalInfeasibility_ |
Worst column primal infeasibility. | |
double | rowPrimalInfeasibility_ |
Worst row primal infeasibility. | |
int | columnPrimalSequence_ |
Sequence of worst (-1 if feasible). | |
int | rowPrimalSequence_ |
Sequence of worst (-1 if feasible). | |
double | columnDualInfeasibility_ |
Worst column dual infeasibility. | |
double | rowDualInfeasibility_ |
Worst row dual infeasibility. | |
int | columnDualSequence_ |
Sequence of worst (-1 if feasible). | |
int | rowDualSequence_ |
Sequence of worst (-1 if feasible). | |
double | primalToleranceToGetOptimal_ |
Primal tolerance needed to make dual feasible (<largeTolerance). | |
double | remainingDualInfeasibility_ |
Remaining largest dual infeasibility. | |
double | largeValue_ |
Large bound value (for complementarity etc). | |
double | largestPrimalError_ |
Largest error on Ax-b. | |
double | largestDualError_ |
Largest error on basic duals. | |
double | largestSolutionError_ |
Largest difference between input primal solution and computed. | |
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 * | 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 clude. | |
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. | |
ClpSimplex * | auxiliaryModel_ |
Auxiliary model. | |
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. | |
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. | |
unsigned int | specialOptions_ |
For advanced options See get and set for meaning. | |
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. | |
float | incomingInfeasibility_ |
For advanced use. | |
float | allowedInfeasibility_ |
Spare int array for passing information [0]!=0 switches on. | |
int | automaticScale_ |
Automatic scaling of objective and rhs and bounds. | |
ClpSimplexProgress * | progress_ |
For dealing with all issues of cycling etc. | |
class | OsiClpSolverInterface |
Allow OsiClp certain perks. | |
Public Types | |
isFree = 0x00 | |
basic = 0x01 | |
atUpperBound = 0x02 | |
atLowerBound = 0x03 | |
superBasic = 0x04 | |
isFixed = 0x05 | |
noFake = 0x00 | |
bothFake = 0x01 | |
upperFake = 0x02 | |
lowerFake = 0x03 | |
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, bothFake = 0x01, upperFake = 0x02, lowerFake = 0x03 } |
Public Member Functions | |
Constructors and destructor and copy | |
ClpSimplex () | |
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 (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 | auxiliaryModel (int options) |
If you are re-using the same matrix again and again then the setup time to do scaling may be significant. | |
void | deleteAuxiliaryModel () |
Switch off e.g. if people using presolve. | |
bool | usingAuxiliaryModel () const |
See if we have auxiliary model. | |
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) |
Default constructor. | |
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. | |
void | borrowModel (ClpModel &otherModel) |
Borrow model. | |
void | borrowModel (ClpSimplex &otherModel) |
Default constructor. | |
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. | |
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 | dual (int ifValuesPass=0, int startFinishOptions=0) |
Dual algorithm - see ClpSimplexDual.hpp for method. | |
int | dualDebug (int ifValuesPass=0, int startFinishOptions=0) |
General solve algorithm which can do presolve. | |
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 | 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 | cleanup (int cleanupScaling) |
When scaling is on it is possible that the scaled problem is feasible but the unscaled is not. | |
int | dualRanging (int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease) |
Dual ranging. | |
int | primalRanging (int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease) |
Primal ranging. | |
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. | |
int | tightenPrimalBounds (double factor=0.0, int doTight=0) |
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. | |
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. | |
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 | dualPivotResult () |
Pivot out a variable and choose an incoing one. | |
int | startup (int ifValuesPass, int startFinishOptions=0) |
Common bits of coding for dual and primal. | |
void | finish (int startFinishOptions=0) |
Pivot in a variable and out a variable. | |
bool | statusOfProblem (bool initial=false) |
Factorizes and returns true if optimal. | |
void | defaultFactorizationFrequency () |
If user left factorization frequency then compute. | |
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) |
If problem is primal feasible. | |
int | factorizationFrequency () const |
Factorization frequency. | |
void | setFactorizationFrequency (int value) |
If problem is primal feasible. | |
double | dualBound () const |
Dual bound. | |
void | setDualBound (double value) |
If problem is primal feasible. | |
double | infeasibilityCost () const |
Infeasibility cost. | |
void | setInfeasibilityCost (double value) |
If problem is primal feasible. | |
int | perturbation () const |
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. | |
void | setPerturbation (int value) |
If problem is primal feasible. | |
int | algorithm () const |
Current (or last) algorithm. | |
void | setAlgorithm (int value) |
Set algorithm. | |
double | sumDualInfeasibilities () const |
Sum of dual infeasibilities. | |
void | setSumDualInfeasibilities (double value) |
If problem is primal feasible. | |
double | sumOfRelaxedDualInfeasibilities () const |
Sum of relaxed dual infeasibilities. | |
void | setSumOfRelaxedDualInfeasibilities (double value) |
If problem is primal feasible. | |
int | numberDualInfeasibilities () const |
Number of dual infeasibilities. | |
void | setNumberDualInfeasibilities (int value) |
If problem is primal feasible. | |
double | sumPrimalInfeasibilities () const |
Sum of primal infeasibilities. | |
void | setSumPrimalInfeasibilities (double value) |
If problem is primal feasible. | |
double | sumOfRelaxedPrimalInfeasibilities () const |
Sum of relaxed primal infeasibilities. | |
void | setSumOfRelaxedPrimalInfeasibilities (double value) |
If problem is primal feasible. | |
int | numberPrimalInfeasibilities () const |
Number of primal infeasibilities. | |
void | setNumberPrimalInfeasibilities (int value) |
If problem is primal feasible. | |
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=false) |
Just check solution (for external use) - sets sum of infeasibilities etc. | |
void | checkSolutionInternal () |
Just check solution (for internal use) - sets sum of infeasibilities etc. | |
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). | |
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 |
Return row or column sections - not as much needed as it once was. | |
double * | lowerRegion (int section) const |
Return row or column sections - not as much needed as it once was. | |
double * | upperRegion (int section) const |
Return row or column sections - not as much needed as it once was. | |
double * | costRegion (int section) const |
Return row or column sections - not as much needed as it once was. | |
double * | solutionRegion () const |
Return region as single array. | |
double * | djRegion () const |
Return row or column sections - not as much needed as it once was. | |
double * | lowerRegion () const |
Return row or column sections - not as much needed as it once was. | |
double * | upperRegion () const |
Return row or column sections - not as much needed as it once was. | |
double * | costRegion () const |
Return row or column sections - not as much needed as it once was. | |
Status | getStatus (int sequence) const |
Return row or column sections - not as much needed as it once was. | |
void | setStatus (int sequence, Status status) |
Return row or column sections - not as much needed as it once was. | |
void | setInitialDenseFactorization (bool onOff) |
Normally the first factorization does sparse coding because the factorization could be singular. | |
bool | initialDenseFactorization () const |
Return row or column sections - not as much needed as it once was. | |
int | sequenceIn () const |
Return sequence In or Out. | |
int | sequenceOut () const |
Return row or column sections - not as much needed as it once was. | |
void | setSequenceIn (int sequence) |
Set sequenceIn or Out. | |
void | setSequenceOut (int sequence) |
Return row or column sections - not as much needed as it once was. | |
int | directionIn () const |
Return direction In or Out. | |
int | directionOut () const |
Return row or column sections - not as much needed as it once was. | |
void | setDirectionIn (int direction) |
Set directionIn or Out. | |
void | setDirectionOut (int direction) |
Return row or column sections - not as much needed as it once was. | |
double | valueOut () const |
Value 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) |
Return row or column sections - not as much needed as it once was. | |
double & | reducedCostAddress (int sequence) |
Return row or column sections - not as much needed as it once was. | |
double | lower (int sequence) |
Return row or column sections - not as much needed as it once was. | |
double & | lowerAddress (int sequence) |
Return address of row or column lower bound. | |
double | upper (int sequence) |
Return row or column sections - not as much needed as it once was. | |
double & | upperAddress (int sequence) |
Return address of row or column upper bound. | |
double | cost (int sequence) |
Return row or column sections - not as much needed as it once was. | |
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). | |
ClpNonLinearCost * | nonLinearCost () const |
Return pointer to details of costs. | |
status methods | |
void | setFakeBound (int sequence, FakeBound fakeBound) |
FakeBound | getFakeBound (int sequence) const |
void | setRowStatus (int sequence, Status status) |
Status | getRowStatus (int sequence) const |
void | setColumnStatus (int sequence, Status status) |
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 | 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. | |
int | progressFlag () const |
Progress flag - at present 0 bit says artificials out. | |
void | forceFactorization (int value) |
Force re-factorization early. | |
double | rawObjectiveValue () const |
Raw objective value (so always minimize in primal). | |
void | computeObjectiveValue () |
Compute objective value from solution and put in objectiveValue_. | |
int | numberExtraRows () const |
Number of extra rows. | |
int | maximumBasic () const |
Maximum number of basic variables - can be more than number of rows if GUB. | |
void | generateCpp (FILE *fp, bool defaultFactor=false) |
Create C++ lines to get to current state. | |
unsigned int | specialOptions () const |
void | setSpecialOptions (unsigned int value) |
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 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 . | |
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, 2 bit does column bounds, 4 bit does objective(s). | |
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. | |
Friends | |
void | ClpSimplexUnitTest (const std::string &mpsDir, const std::string &netlibDir) |
A function that tests the methods in the ClpSimplex class. |
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
This file also includes (at end) a very simple class ClpSimplexProgress which is where anti-looping stuff should migrate to
Definition at line 54 of file ClpSimplex.hpp.
enum ClpSimplex::Status |
enums for status of various sorts.
First 4 match CoinWarmStartBasis, isFixed means fixed at lower bound and out of basis
Definition at line 63 of file ClpSimplex.hpp.
ClpSimplex::ClpSimplex | ( | ) |
Default constructor.
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::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::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::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 | ( | ) |
Destructor.
void ClpSimplex::originalModel | ( | ClpSimplex * | miniModel | ) |
This copies back stuff from miniModel and then deletes miniModel.
Only to be used with mini constructor
void ClpSimplex::auxiliaryModel | ( | int | options | ) |
If you are re-using the same matrix again and again then the setup time to do scaling may be significant.
Also you may not want to initialize all values or return all values (especially if infeasible). While an auxiliary model exists it will be faster. If options -1 then model is switched off. Otherwise switched on with following options. 1 - rhs is constant 2 - bounds are constant 4 - objective is constant 8 - solution in by basis and no djs etc in 16 - no duals out (but reduced costs) 32 - no output if infeasible
void ClpSimplex::deleteAuxiliaryModel | ( | ) |
Switch off e.g. if people using presolve.
bool ClpSimplex::usingAuxiliaryModel | ( | ) | const [inline] |
See if we have auxiliary model.
Definition at line 130 of file ClpSimplex.hpp.
References auxiliaryModel_.
ClpSimplex& ClpSimplex::operator= | ( | const ClpSimplex & | rhs | ) |
Assignment operator. This copies the data.
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 Reimplemented from ClpModel.
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 | |||
) |
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).
Reimplemented from ClpModel.
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 | |||
) |
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
Reimplemented from ClpModel.
int ClpSimplex::readMps | ( | const char * | filename, | |
bool | keepNames = false , |
|||
bool | ignoreErrors = false | |||
) |
int ClpSimplex::readGMPL | ( | const char * | filename, | |
const char * | dataName, | |||
bool | keepNames = false | |||
) |
void ClpSimplex::borrowModel | ( | ClpModel & | otherModel | ) |
void ClpSimplex::borrowModel | ( | ClpSimplex & | otherModel | ) |
Default constructor.
void ClpSimplex::passInEventHandler | ( | const ClpEventHandler * | eventHandler | ) |
void ClpSimplex::getbackSolution | ( | const ClpSimplex & | smallModel, | |
const int * | whichRow, | |||
const int * | whichColumn | |||
) |
Puts solution back into small model.
int ClpSimplex::initialSolve | ( | ClpSolve & | options | ) |
General solve algorithm which can do presolve.
See ClpSolve.hpp for options
int ClpSimplex::initialSolve | ( | ) |
Default initial solve.
int ClpSimplex::initialDualSolve | ( | ) |
Dual initial solve.
int ClpSimplex::initialPrimalSolve | ( | ) |
Primal initial solve.
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
Reimplemented in ClpSimplexDual.
int ClpSimplex::dualDebug | ( | int | ifValuesPass = 0 , |
|
int | startFinishOptions = 0 | |||
) |
General solve algorithm which can do presolve.
See ClpSolve.hpp for options
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
Reimplemented in ClpSimplexPrimal.
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
int ClpSimplex::barrier | ( | bool | crossover = true |
) |
Solves using barrier (assumes you have good cholesky factor code).
Does crossover to simplex if asked
int ClpSimplex::reducedGradient | ( | int | phase = 0 |
) |
Solves non-linear using reduced gradient.
Phase = 0 get feasible, =1 use solution
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
int ClpSimplex::dualRanging | ( | int | numberCheck, | |
const int * | which, | |||
double * | costIncrease, | |||
int * | sequenceIncrease, | |||
double * | costDecrease, | |||
int * | sequenceDecrease | |||
) |
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 information for variable 7.
Returns non-zero if infeasible unbounded etc
Reimplemented in ClpSimplexOther.
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. 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 information for variable 7.
Returns non-zero if infeasible unbounded etc
Reimplemented in ClpSimplexOther.
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
Returns non-zero on I/O error
Reimplemented in ClpSimplexOther.
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.
Reimplemented in ClpSimplexOther.
CoinWarmStartBasis* ClpSimplex::getBasis | ( | ) | const |
Returns a basis (to be deleted by user).
void ClpSimplex::setFactorization | ( | ClpFactorization & | factorization | ) |
Passes in factorization.
int ClpSimplex::tightenPrimalBounds | ( | double | factor = 0.0 , |
|
int | doTight = 0 | |||
) |
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)
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
void ClpSimplex::setDualRowPivotAlgorithm | ( | ClpDualRowPivot & | choice | ) |
Sets row pivot choice algorithm in dual.
void ClpSimplex::setPrimalColumnPivotAlgorithm | ( | ClpPrimalColumnPivot & | choice | ) |
Sets column pivot choice algorithm in primal.
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
Reimplemented in ClpSimplexDual.
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.
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
int ClpSimplex::dualPivotResult | ( | ) |
Pivot out a variable and choose an incoing one.
Assumes dual feasible - will not go through a reduced cost. Returns step length in theta Returns ray in ray_ (or NULL if no pivot) Return codes as before but -1 means no acceptable pivot
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
void ClpSimplex::finish | ( | int | startFinishOptions = 0 |
) |
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.
bool ClpSimplex::statusOfProblem | ( | bool | initial = false |
) |
Factorizes and returns true if optimal.
Used by user
void ClpSimplex::defaultFactorizationFrequency | ( | ) |
If user left factorization frequency then compute.
bool ClpSimplex::primalFeasible | ( | ) | const [inline] |
If problem is primal feasible.
Definition at line 418 of file ClpSimplex.hpp.
References numberPrimalInfeasibilities_.
bool ClpSimplex::dualFeasible | ( | ) | const [inline] |
If problem is dual feasible.
Definition at line 421 of file ClpSimplex.hpp.
References numberDualInfeasibilities_.
ClpFactorization* ClpSimplex::factorization | ( | ) | const [inline] |
bool ClpSimplex::sparseFactorization | ( | ) | const |
Sparsity on or off.
void ClpSimplex::setSparseFactorization | ( | bool | value | ) |
If problem is primal feasible.
int ClpSimplex::factorizationFrequency | ( | ) | const |
Factorization frequency.
void ClpSimplex::setFactorizationFrequency | ( | int | value | ) |
If problem is primal feasible.
double ClpSimplex::dualBound | ( | ) | const [inline] |
void ClpSimplex::setDualBound | ( | double | value | ) |
If problem is primal feasible.
double ClpSimplex::infeasibilityCost | ( | ) | const [inline] |
void ClpSimplex::setInfeasibilityCost | ( | double | value | ) |
If problem is primal feasible.
int ClpSimplex::perturbation | ( | ) | const [inline] |
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 456 of file ClpSimplex.hpp.
References perturbation_.
void ClpSimplex::setPerturbation | ( | int | value | ) |
If problem is primal feasible.
int ClpSimplex::algorithm | ( | ) | const [inline] |
void ClpSimplex::setAlgorithm | ( | int | value | ) | [inline] |
double ClpSimplex::sumDualInfeasibilities | ( | ) | const [inline] |
Sum of dual infeasibilities.
Definition at line 466 of file ClpSimplex.hpp.
References sumDualInfeasibilities_.
void ClpSimplex::setSumDualInfeasibilities | ( | double | value | ) | [inline] |
If problem is primal feasible.
Definition at line 468 of file ClpSimplex.hpp.
References sumDualInfeasibilities_.
double ClpSimplex::sumOfRelaxedDualInfeasibilities | ( | ) | const [inline] |
Sum of relaxed dual infeasibilities.
Definition at line 471 of file ClpSimplex.hpp.
References sumOfRelaxedDualInfeasibilities_.
void ClpSimplex::setSumOfRelaxedDualInfeasibilities | ( | double | value | ) | [inline] |
If problem is primal feasible.
Definition at line 473 of file ClpSimplex.hpp.
References sumOfRelaxedDualInfeasibilities_.
int ClpSimplex::numberDualInfeasibilities | ( | ) | const [inline] |
Number of dual infeasibilities.
Definition at line 476 of file ClpSimplex.hpp.
References numberDualInfeasibilities_.
void ClpSimplex::setNumberDualInfeasibilities | ( | int | value | ) | [inline] |
If problem is primal feasible.
Definition at line 478 of file ClpSimplex.hpp.
References numberDualInfeasibilities_.
double ClpSimplex::sumPrimalInfeasibilities | ( | ) | const [inline] |
Sum of primal infeasibilities.
Definition at line 481 of file ClpSimplex.hpp.
References sumPrimalInfeasibilities_.
void ClpSimplex::setSumPrimalInfeasibilities | ( | double | value | ) | [inline] |
If problem is primal feasible.
Definition at line 483 of file ClpSimplex.hpp.
References sumPrimalInfeasibilities_.
double ClpSimplex::sumOfRelaxedPrimalInfeasibilities | ( | ) | const [inline] |
Sum of relaxed primal infeasibilities.
Definition at line 486 of file ClpSimplex.hpp.
References sumOfRelaxedPrimalInfeasibilities_.
void ClpSimplex::setSumOfRelaxedPrimalInfeasibilities | ( | double | value | ) | [inline] |
If problem is primal feasible.
Definition at line 488 of file ClpSimplex.hpp.
References sumOfRelaxedPrimalInfeasibilities_.
int ClpSimplex::numberPrimalInfeasibilities | ( | ) | const [inline] |
Number of primal infeasibilities.
Definition at line 491 of file ClpSimplex.hpp.
References numberPrimalInfeasibilities_.
void ClpSimplex::setNumberPrimalInfeasibilities | ( | int | value | ) | [inline] |
If problem is primal feasible.
Definition at line 493 of file ClpSimplex.hpp.
References numberPrimalInfeasibilities_.
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.
int ClpSimplex::restoreModel | ( | const char * | fileName | ) |
Restore model from file, returns 0 if success, deletes current model.
void ClpSimplex::checkSolution | ( | int | setToBounds = false |
) |
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.
void ClpSimplex::checkSolutionInternal | ( | ) |
Just check solution (for internal use) - sets sum of infeasibilities etc.
CoinIndexedVector* ClpSimplex::rowArray | ( | int | index | ) | const [inline] |
Useful row length arrays (0,1,2,3,4,5).
Definition at line 518 of file ClpSimplex.hpp.
References rowArray_.
CoinIndexedVector* ClpSimplex::columnArray | ( | int | index | ) | const [inline] |
Useful column length arrays (0,1,2,3,4,5).
Definition at line 521 of file ClpSimplex.hpp.
References columnArray_.
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
int ClpSimplex::getSolution | ( | ) |
Given an existing factorization computes and checks primal and dual solutions.
Uses current problem arrays for bounds. Returns feasibility states
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
void ClpSimplex::returnModel | ( | ClpSimplex & | otherModel | ) |
Return model - updates any scalars.
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.
ClpDataSave ClpSimplex::saveData | ( | ) |
Save data.
void ClpSimplex::restoreData | ( | ClpDataSave | saved | ) |
Restore data.
void ClpSimplex::cleanStatus | ( | ) |
Clean up status.
int ClpSimplex::factorize | ( | ) |
Factorizes using current basis. For external use.
void ClpSimplex::computeDuals | ( | double * | givenDjs | ) |
Computes duals from scratch.
If givenDjs then allows for nonzero basic djs
void ClpSimplex::computePrimals | ( | const double * | rowActivities, | |
const double * | columnActivities | |||
) |
Computes primals from scratch.
void ClpSimplex::add | ( | double * | array, | |
int | column, | |||
double | multiplier | |||
) | const |
Adds multiple of a column into an array.
void ClpSimplex::unpack | ( | CoinIndexedVector * | rowArray | ) | const |
Unpacks one column of the matrix into indexed array Uses sequenceIn_ Also applies scaling if needed.
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.
void ClpSimplex::unpackPacked | ( | CoinIndexedVector * | rowArray | ) |
Unpacks one column of the matrix into indexed array as packed vector Uses sequenceIn_ Also applies scaling if needed.
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.
int ClpSimplex::housekeeping | ( | double | objectiveChange | ) | [protected] |
This does basis housekeeping and does values for in/out variables.
Can also decide to re-factorize
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).
void ClpSimplex::checkDualSolution | ( | ) | [protected] |
This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Dual).
void ClpSimplex::checkBothSolutions | ( | ) | [protected] |
This sets sum and number of infeasibilities (Dual and Primal).
void ClpSimplex::setValuesPassAction | ( | float | incomingInfeasibility, | |
float | 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
double ClpSimplex::columnPrimalInfeasibility | ( | ) | const [inline, private] |
Worst column primal infeasibility.
Definition at line 632 of file ClpSimplex.hpp.
References columnPrimalInfeasibility_.
int ClpSimplex::columnPrimalSequence | ( | ) | const [inline, private] |
Sequence of worst (-1 if feasible).
Definition at line 635 of file ClpSimplex.hpp.
References columnPrimalSequence_.
double ClpSimplex::rowPrimalInfeasibility | ( | ) | const [inline, private] |
Worst row primal infeasibility.
Definition at line 638 of file ClpSimplex.hpp.
References rowPrimalInfeasibility_.
int ClpSimplex::rowPrimalSequence | ( | ) | const [inline, private] |
Sequence of worst (-1 if feasible).
Definition at line 641 of file ClpSimplex.hpp.
References rowPrimalSequence_.
double ClpSimplex::columnDualInfeasibility | ( | ) | const [inline, private] |
Worst column dual infeasibility (note - these may not be as meaningful if the problem is primal infeasible.
Definition at line 645 of file ClpSimplex.hpp.
References columnDualInfeasibility_.
int ClpSimplex::columnDualSequence | ( | ) | const [inline, private] |
Sequence of worst (-1 if feasible).
Definition at line 648 of file ClpSimplex.hpp.
References columnDualSequence_.
double ClpSimplex::rowDualInfeasibility | ( | ) | const [inline, private] |
Worst row dual infeasibility.
Definition at line 651 of file ClpSimplex.hpp.
References rowDualInfeasibility_.
int ClpSimplex::rowDualSequence | ( | ) | const [inline, private] |
Sequence of worst (-1 if feasible).
Definition at line 654 of file ClpSimplex.hpp.
References rowDualSequence_.
double ClpSimplex::primalToleranceToGetOptimal | ( | ) | const [inline, private] |
Primal tolerance needed to make dual feasible (<largeTolerance).
Definition at line 657 of file ClpSimplex.hpp.
References primalToleranceToGetOptimal_.
double ClpSimplex::remainingDualInfeasibility | ( | ) | const [inline, private] |
Remaining largest dual infeasibility.
Definition at line 660 of file ClpSimplex.hpp.
References remainingDualInfeasibility_.
double ClpSimplex::largestSolutionError | ( | ) | const [inline, private] |
Largest difference between input primal solution and computed.
Definition at line 663 of file ClpSimplex.hpp.
References largestSolutionError_.
double ClpSimplex::largeValue | ( | ) | const [inline] |
Large bound value (for complementarity etc).
Definition at line 667 of file ClpSimplex.hpp.
References largeValue_.
void ClpSimplex::setLargeValue | ( | double | value | ) |
Large bound value (for complementarity etc).
double ClpSimplex::largestPrimalError | ( | ) | const [inline] |
Largest error on Ax-b.
Definition at line 671 of file ClpSimplex.hpp.
References largestPrimalError_.
double ClpSimplex::largestDualError | ( | ) | const [inline] |
Largest error on basic duals.
Definition at line 674 of file ClpSimplex.hpp.
References largestDualError_.
void ClpSimplex::setLargestPrimalError | ( | double | value | ) | [inline] |
Largest error on Ax-b.
Definition at line 677 of file ClpSimplex.hpp.
References largestPrimalError_.
void ClpSimplex::setLargestDualError | ( | double | value | ) | [inline] |
Largest error on basic duals.
Definition at line 680 of file ClpSimplex.hpp.
References largestDualError_.
int* ClpSimplex::pivotVariable | ( | ) | const [inline] |
Basic variables pivoting on which rows.
Definition at line 683 of file ClpSimplex.hpp.
References pivotVariable_.
bool ClpSimplex::automaticScaling | ( | ) | const [inline] |
void ClpSimplex::setAutomaticScaling | ( | bool | onOff | ) | [inline] |
Large bound value (for complementarity etc).
Definition at line 688 of file ClpSimplex.hpp.
References automaticScale_.
double ClpSimplex::currentDualTolerance | ( | ) | const [inline] |
void ClpSimplex::setCurrentDualTolerance | ( | double | value | ) | [inline] |
Large bound value (for complementarity etc).
Definition at line 693 of file ClpSimplex.hpp.
References dualTolerance_.
double ClpSimplex::currentPrimalTolerance | ( | ) | const [inline] |
Current primal tolerance.
Definition at line 696 of file ClpSimplex.hpp.
References primalTolerance_.
void ClpSimplex::setCurrentPrimalTolerance | ( | double | value | ) | [inline] |
Large bound value (for complementarity etc).
Definition at line 698 of file ClpSimplex.hpp.
References primalTolerance_.
int ClpSimplex::numberRefinements | ( | ) | const [inline] |
How many iterative refinements to do.
Definition at line 701 of file ClpSimplex.hpp.
References numberRefinements_.
void ClpSimplex::setNumberRefinements | ( | int | value | ) |
Large bound value (for complementarity etc).
double ClpSimplex::alpha | ( | ) | const [inline] |
Alpha (pivot element) for use by classes e.g. steepestedge.
Definition at line 705 of file ClpSimplex.hpp.
References alpha_.
void ClpSimplex::setAlpha | ( | double | value | ) | [inline] |
Large bound value (for complementarity etc).
Definition at line 706 of file ClpSimplex.hpp.
References alpha_.
double ClpSimplex::dualIn | ( | ) | const [inline] |
Reduced cost of last incoming for use by classes e.g. steepestedge.
Definition at line 708 of file ClpSimplex.hpp.
References dualIn_.
int ClpSimplex::pivotRow | ( | ) | const [inline] |
Pivot Row for use by classes e.g. steepestedge.
Definition at line 710 of file ClpSimplex.hpp.
References pivotRow_.
void ClpSimplex::setPivotRow | ( | int | value | ) | [inline] |
Large bound value (for complementarity etc).
Definition at line 711 of file ClpSimplex.hpp.
References pivotRow_.
double ClpSimplex::valueIncomingDual | ( | ) | const |
value of incoming variable (in Dual)
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
void ClpSimplex::gutsOfDelete | ( | int | type | ) | [protected] |
Does most of deletion (0 = all, 1 = most, 2 most + factorization).
void ClpSimplex::gutsOfCopy | ( | const ClpSimplex & | rhs | ) | [protected] |
Does most of copying.
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, 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_
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
bool ClpSimplex::sanityCheck | ( | ) | [protected] |
Sanity check on input rim data (after scaling) - returns true if okay.
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 754 of file ClpSimplex.hpp.
References columnActivityWork_, and rowActivityWork_.
double* ClpSimplex::djRegion | ( | 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 756 of file ClpSimplex.hpp.
References reducedCostWork_, and rowReducedCost_.
double* ClpSimplex::lowerRegion | ( | 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 758 of file ClpSimplex.hpp.
References columnLowerWork_, and rowLowerWork_.
Referenced by ClpNonLinearCost::changeInCost().
double* ClpSimplex::upperRegion | ( | 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 760 of file ClpSimplex.hpp.
References columnUpperWork_, and rowUpperWork_.
Referenced by ClpNonLinearCost::changeInCost().
double* ClpSimplex::costRegion | ( | 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 762 of file ClpSimplex.hpp.
References objectiveWork_, and rowObjectiveWork_.
double* ClpSimplex::solutionRegion | ( | ) | const [inline] |
double* ClpSimplex::djRegion | ( | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 767 of file ClpSimplex.hpp.
References dj_.
double* ClpSimplex::lowerRegion | ( | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 769 of file ClpSimplex.hpp.
References lower_.
double* ClpSimplex::upperRegion | ( | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 771 of file ClpSimplex.hpp.
References upper_.
double* ClpSimplex::costRegion | ( | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 773 of file ClpSimplex.hpp.
References cost_.
Status ClpSimplex::getStatus | ( | int | sequence | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 775 of file ClpSimplex.hpp.
References ClpModel::status_.
void ClpSimplex::setStatus | ( | int | sequence, | |
Status | status | |||
) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 777 of file ClpSimplex.hpp.
References ClpModel::status_.
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
bool ClpSimplex::initialDenseFactorization | ( | ) | const |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
int ClpSimplex::sequenceIn | ( | ) | const [inline] |
int ClpSimplex::sequenceOut | ( | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 792 of file ClpSimplex.hpp.
References sequenceOut_.
void ClpSimplex::setSequenceIn | ( | int | sequence | ) | [inline] |
void ClpSimplex::setSequenceOut | ( | int | sequence | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 797 of file ClpSimplex.hpp.
References sequenceOut_.
int ClpSimplex::directionIn | ( | ) | const [inline] |
int ClpSimplex::directionOut | ( | ) | const [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 802 of file ClpSimplex.hpp.
References directionOut_.
void ClpSimplex::setDirectionIn | ( | int | direction | ) | [inline] |
void ClpSimplex::setDirectionOut | ( | int | direction | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 807 of file ClpSimplex.hpp.
References directionOut_.
double ClpSimplex::valueOut | ( | ) | const [inline] |
int ClpSimplex::isColumn | ( | int | sequence | ) | const [inline] |
Returns 1 if sequence indicates column.
Definition at line 813 of file ClpSimplex.hpp.
References ClpModel::numberColumns_.
int ClpSimplex::sequenceWithin | ( | int | sequence | ) | const [inline] |
Returns sequence number within section.
Definition at line 816 of file ClpSimplex.hpp.
References ClpModel::numberColumns_.
double ClpSimplex::solution | ( | int | sequence | ) | [inline] |
double& ClpSimplex::solutionAddress | ( | int | sequence | ) | [inline] |
Return address of row or column values.
Definition at line 822 of file ClpSimplex.hpp.
References solution_.
double ClpSimplex::reducedCost | ( | int | sequence | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 824 of file ClpSimplex.hpp.
References dj_.
double& ClpSimplex::reducedCostAddress | ( | int | sequence | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 826 of file ClpSimplex.hpp.
References dj_.
double ClpSimplex::lower | ( | int | sequence | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 828 of file ClpSimplex.hpp.
References lower_.
double& ClpSimplex::lowerAddress | ( | int | sequence | ) | [inline] |
Return address of row or column lower bound.
Definition at line 831 of file ClpSimplex.hpp.
References lower_.
double ClpSimplex::upper | ( | int | sequence | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 833 of file ClpSimplex.hpp.
References upper_.
double& ClpSimplex::upperAddress | ( | int | sequence | ) | [inline] |
Return address of row or column upper bound.
Definition at line 836 of file ClpSimplex.hpp.
References upper_.
double ClpSimplex::cost | ( | int | sequence | ) | [inline] |
Return row or column sections - not as much needed as it once was.
These just map into single arrays
Definition at line 838 of file ClpSimplex.hpp.
References cost_.
double& ClpSimplex::costAddress | ( | int | sequence | ) | [inline] |
Return address of row or column cost.
Definition at line 841 of file ClpSimplex.hpp.
References cost_.
double ClpSimplex::originalLower | ( | int | iSequence | ) | const [inline] |
Return original lower bound.
Definition at line 844 of file ClpSimplex.hpp.
References ClpModel::columnLower_, ClpModel::numberColumns_, and ClpModel::rowLower_.
double ClpSimplex::originalUpper | ( | int | iSequence | ) | const [inline] |
Return original lower bound.
Definition at line 848 of file ClpSimplex.hpp.
References ClpModel::columnUpper_, ClpModel::numberColumns_, and ClpModel::rowUpper_.
double ClpSimplex::theta | ( | ) | const [inline] |
ClpNonLinearCost* ClpSimplex::nonLinearCost | ( | ) | const [inline] |
Return pointer to details of costs.
Definition at line 855 of file ClpSimplex.hpp.
References nonLinearCost_.
void ClpSimplex::setFakeBound | ( | int | sequence, | |
FakeBound | fakeBound | |||
) | [inline] |
FakeBound ClpSimplex::getFakeBound | ( | int | sequence | ) | const [inline] |
void ClpSimplex::setRowStatus | ( | int | sequence, | |
Status | status | |||
) | [inline] |
Definition at line 868 of file ClpSimplex.hpp.
References ClpModel::numberColumns_, and ClpModel::status_.
Status ClpSimplex::getRowStatus | ( | int | sequence | ) | const [inline] |
Definition at line 874 of file ClpSimplex.hpp.
References ClpModel::numberColumns_, and ClpModel::status_.
void ClpSimplex::setColumnStatus | ( | int | sequence, | |
Status | status | |||
) | [inline] |
Status ClpSimplex::getColumnStatus | ( | int | sequence | ) | const [inline] |
void ClpSimplex::setPivoted | ( | int | sequence | ) | [inline] |
void ClpSimplex::clearPivoted | ( | int | sequence | ) | [inline] |
bool ClpSimplex::pivoted | ( | int | sequence | ) | const [inline] |
void ClpSimplex::setFlagged | ( | int | sequence | ) |
To flag a variable (not inline to allow for column generation).
void ClpSimplex::clearFlagged | ( | int | sequence | ) | [inline] |
bool ClpSimplex::flagged | ( | int | sequence | ) | const [inline] |
void ClpSimplex::setActive | ( | int | iRow | ) | [inline] |
To say row active in primal pivot row choice.
Definition at line 899 of file ClpSimplex.hpp.
References ClpModel::status_.
void ClpSimplex::clearActive | ( | int | iRow | ) | [inline] |
bool ClpSimplex::active | ( | int | iRow | ) | const [inline] |
void ClpSimplex::createStatus | ( | ) |
Set up status array (can be used by OsiClp).
Also can be used to set up all slack basis
void ClpSimplex::allSlackBasis | ( | bool | resetSolution = false |
) |
Sets up all slack basis and resets solution to as it was after initial load or readMps.
int ClpSimplex::lastBadIteration | ( | ) | const [inline] |
So we know when to be cautious.
Definition at line 917 of file ClpSimplex.hpp.
References lastBadIteration_.
int ClpSimplex::progressFlag | ( | ) | const [inline] |
Progress flag - at present 0 bit says artificials out.
Definition at line 920 of file ClpSimplex.hpp.
References progressFlag_.
void ClpSimplex::forceFactorization | ( | int | value | ) | [inline] |
Force re-factorization early.
Definition at line 923 of file ClpSimplex.hpp.
References forceFactorization_.
double ClpSimplex::rawObjectiveValue | ( | ) | const [inline] |
Raw objective value (so always minimize in primal).
Reimplemented from ClpModel.
Definition at line 926 of file ClpSimplex.hpp.
References ClpModel::objectiveValue_.
void ClpSimplex::computeObjectiveValue | ( | ) |
Compute objective value from solution and put in objectiveValue_.
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 933 of file ClpSimplex.hpp.
References numberExtraRows_.
int ClpSimplex::maximumBasic | ( | ) | const [inline] |
Maximum number of basic variables - can be more than number of rows if GUB.
Definition at line 937 of file ClpSimplex.hpp.
References maximumBasic_.
void ClpSimplex::generateCpp | ( | FILE * | fp, | |
bool | defaultFactor = false | |||
) |
Create C++ lines to get to current state.
unsigned int ClpSimplex::specialOptions | ( | ) | const [inline] |
void ClpSimplex::setSpecialOptions | ( | unsigned int | value | ) | [inline] |
void ClpSimplex::getBInvARow | ( | int | row, | |
double * | z, | |||
double * | slack = NULL | |||
) |
Get a row of the tableau (slack part in slack if not NULL).
void ClpSimplex::getBInvRow | ( | int | row, | |
double * | z | |||
) |
Get a row of the basis inverse.
void ClpSimplex::getBInvACol | ( | int | col, | |
double * | vec | |||
) |
Get a column of the tableau.
void ClpSimplex::getBInvCol | ( | int | col, | |
double * | vec | |||
) |
Get a column of the basis inverse.
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()).
void ClpSimplex::setObjectiveCoefficient | ( | int | elementIndex, | |
double | elementValue | |||
) |
void ClpSimplex::setObjCoeff | ( | int | elementIndex, | |
double | elementValue | |||
) | [inline] |
Set an objective function coefficient.
Reimplemented from ClpModel.
Definition at line 1003 of file ClpSimplex.hpp.
References setObjectiveCoefficient().
void ClpSimplex::setColumnLower | ( | int | elementIndex, | |
double | elementValue | |||
) |
Set a single column lower bound
Use -DBL_MAX for -infinity.
Reimplemented from ClpModel.
Referenced by setColLower().
void ClpSimplex::setColumnUpper | ( | int | elementIndex, | |
double | elementValue | |||
) |
Set a single column upper bound
Use DBL_MAX for infinity.
Reimplemented from ClpModel.
Referenced by setColUpper().
void ClpSimplex::setColumnBounds | ( | int | elementIndex, | |
double | lower, | |||
double | upper | |||
) |
Set a single column lower and upper bound.
Reimplemented from ClpModel.
Referenced by setColBounds().
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.
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 |
Reimplemented from ClpModel.
Referenced by setColSetBounds().
void ClpSimplex::setColLower | ( | int | elementIndex, | |
double | elementValue | |||
) | [inline] |
Set a single column lower bound
Use -DBL_MAX for -infinity.
Reimplemented from ClpModel.
Definition at line 1032 of file ClpSimplex.hpp.
References setColumnLower().
void ClpSimplex::setColUpper | ( | int | elementIndex, | |
double | elementValue | |||
) | [inline] |
Set a single column upper bound
Use DBL_MAX for infinity.
Reimplemented from ClpModel.
Definition at line 1036 of file ClpSimplex.hpp.
References setColumnUpper().
void ClpSimplex::setColBounds | ( | int | elementIndex, | |
double | lower, | |||
double | upper | |||
) | [inline] |
Set a single column lower and upper bound.
Reimplemented from ClpModel.
Definition at line 1040 of file ClpSimplex.hpp.
References setColumnBounds().
void ClpSimplex::setColSetBounds | ( | const int * | indexFirst, | |
const int * | indexLast, | |||
const double * | boundList | |||
) | [inline] |
Set the bounds on a number of columns simultaneously
.
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 |
Reimplemented from ClpModel.
Definition at line 1050 of file ClpSimplex.hpp.
References setColumnSetBounds().
void ClpSimplex::setRowLower | ( | int | elementIndex, | |
double | elementValue | |||
) |
void ClpSimplex::setRowUpper | ( | int | elementIndex, | |
double | elementValue | |||
) |
void ClpSimplex::setRowBounds | ( | int | elementIndex, | |
double | lower, | |||
double | upper | |||
) |
void ClpSimplex::setRowSetBounds | ( | const int * | indexFirst, | |
const int * | indexLast, | |||
const double * | boundList | |||
) |
Set the bounds on a number of rows simultaneously
.
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 |
Reimplemented from ClpModel.
friend class OsiClpSolverInterface [friend] |
void ClpSimplexUnitTest | ( | const std::string & | mpsDir, | |
const std::string & | netlibDir | |||
) | [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
double ClpSimplex::columnPrimalInfeasibility_ [protected] |
Worst column primal infeasibility.
Definition at line 1089 of file ClpSimplex.hpp.
Referenced by columnPrimalInfeasibility().
double ClpSimplex::rowPrimalInfeasibility_ [protected] |
Worst row primal infeasibility.
Definition at line 1091 of file ClpSimplex.hpp.
Referenced by rowPrimalInfeasibility().
int ClpSimplex::columnPrimalSequence_ [protected] |
Sequence of worst (-1 if feasible).
Definition at line 1093 of file ClpSimplex.hpp.
Referenced by columnPrimalSequence().
int ClpSimplex::rowPrimalSequence_ [protected] |
Sequence of worst (-1 if feasible).
Definition at line 1095 of file ClpSimplex.hpp.
Referenced by rowPrimalSequence().
double ClpSimplex::columnDualInfeasibility_ [protected] |
Worst column dual infeasibility.
Definition at line 1097 of file ClpSimplex.hpp.
Referenced by columnDualInfeasibility().
double ClpSimplex::rowDualInfeasibility_ [protected] |
Worst row dual infeasibility.
Definition at line 1099 of file ClpSimplex.hpp.
Referenced by rowDualInfeasibility().
int ClpSimplex::columnDualSequence_ [protected] |
Sequence of worst (-1 if feasible).
Definition at line 1101 of file ClpSimplex.hpp.
Referenced by columnDualSequence().
int ClpSimplex::rowDualSequence_ [protected] |
Sequence of worst (-1 if feasible).
Definition at line 1103 of file ClpSimplex.hpp.
Referenced by rowDualSequence().
double ClpSimplex::primalToleranceToGetOptimal_ [protected] |
Primal tolerance needed to make dual feasible (<largeTolerance).
Definition at line 1105 of file ClpSimplex.hpp.
Referenced by primalToleranceToGetOptimal().
double ClpSimplex::remainingDualInfeasibility_ [protected] |
Remaining largest dual infeasibility.
Definition at line 1107 of file ClpSimplex.hpp.
Referenced by remainingDualInfeasibility().
double ClpSimplex::largeValue_ [protected] |
Large bound value (for complementarity etc).
Definition at line 1109 of file ClpSimplex.hpp.
Referenced by largeValue().
double ClpSimplex::largestPrimalError_ [protected] |
Largest error on Ax-b.
Definition at line 1111 of file ClpSimplex.hpp.
Referenced by largestPrimalError(), and setLargestPrimalError().
double ClpSimplex::largestDualError_ [protected] |
Largest error on basic duals.
Definition at line 1113 of file ClpSimplex.hpp.
Referenced by largestDualError(), and setLargestDualError().
double ClpSimplex::largestSolutionError_ [protected] |
Largest difference between input primal solution and computed.
Definition at line 1115 of file ClpSimplex.hpp.
Referenced by largestSolutionError().
double ClpSimplex::dualBound_ [protected] |
double ClpSimplex::alpha_ [protected] |
Alpha (pivot element).
Definition at line 1119 of file ClpSimplex.hpp.
Referenced by alpha(), and setAlpha().
double ClpSimplex::theta_ [protected] |
double ClpSimplex::lowerIn_ [protected] |
double ClpSimplex::valueIn_ [protected] |
double ClpSimplex::upperIn_ [protected] |
double ClpSimplex::dualIn_ [protected] |
Reduced cost of In variable.
Definition at line 1129 of file ClpSimplex.hpp.
Referenced by dualIn().
double ClpSimplex::lowerOut_ [protected] |
double ClpSimplex::valueOut_ [protected] |
double ClpSimplex::upperOut_ [protected] |
double ClpSimplex::dualOut_ [protected] |
double ClpSimplex::dualTolerance_ [protected] |
Current dual tolerance for algorithm.
Definition at line 1139 of file ClpSimplex.hpp.
Referenced by currentDualTolerance(), and setCurrentDualTolerance().
double ClpSimplex::primalTolerance_ [protected] |
Current primal tolerance for algorithm.
Definition at line 1141 of file ClpSimplex.hpp.
Referenced by currentPrimalTolerance(), and setCurrentPrimalTolerance().
double ClpSimplex::sumDualInfeasibilities_ [protected] |
Sum of dual infeasibilities.
Definition at line 1143 of file ClpSimplex.hpp.
Referenced by setSumDualInfeasibilities(), and sumDualInfeasibilities().
double ClpSimplex::sumPrimalInfeasibilities_ [protected] |
Sum of primal infeasibilities.
Definition at line 1145 of file ClpSimplex.hpp.
Referenced by setSumPrimalInfeasibilities(), and sumPrimalInfeasibilities().
double ClpSimplex::infeasibilityCost_ [protected] |
Weight assigned to being infeasible in primal.
Definition at line 1147 of file ClpSimplex.hpp.
Referenced by infeasibilityCost().
double ClpSimplex::sumOfRelaxedDualInfeasibilities_ [protected] |
Sum of Dual infeasibilities using tolerance based on error in duals.
Definition at line 1149 of file ClpSimplex.hpp.
Referenced by setSumOfRelaxedDualInfeasibilities(), and sumOfRelaxedDualInfeasibilities().
double ClpSimplex::sumOfRelaxedPrimalInfeasibilities_ [protected] |
Sum of Primal infeasibilities using tolerance based on error in primals.
Definition at line 1151 of file ClpSimplex.hpp.
Referenced by setSumOfRelaxedPrimalInfeasibilities(), and sumOfRelaxedPrimalInfeasibilities().
double ClpSimplex::acceptablePivot_ [protected] |
double* ClpSimplex::lower_ [protected] |
Working copy of lower bounds (Owner of arrays below).
Definition at line 1155 of file ClpSimplex.hpp.
Referenced by lower(), lowerAddress(), and lowerRegion().
double* ClpSimplex::rowLowerWork_ [protected] |
Row lower bounds - working copy.
Definition at line 1157 of file ClpSimplex.hpp.
Referenced by lowerRegion().
double* ClpSimplex::columnLowerWork_ [protected] |
Column lower bounds - working copy.
Definition at line 1159 of file ClpSimplex.hpp.
Referenced by lowerRegion().
double* ClpSimplex::upper_ [protected] |
Working copy of upper bounds (Owner of arrays below).
Definition at line 1161 of file ClpSimplex.hpp.
Referenced by upper(), upperAddress(), and upperRegion().
double* ClpSimplex::rowUpperWork_ [protected] |
Row upper bounds - working copy.
Definition at line 1163 of file ClpSimplex.hpp.
Referenced by upperRegion().
double* ClpSimplex::columnUpperWork_ [protected] |
Column upper bounds - working copy.
Definition at line 1165 of file ClpSimplex.hpp.
Referenced by upperRegion().
double* ClpSimplex::cost_ [protected] |
Working copy of objective (Owner of arrays below).
Definition at line 1167 of file ClpSimplex.hpp.
Referenced by cost(), costAddress(), and costRegion().
double* ClpSimplex::rowObjectiveWork_ [protected] |
Row objective - working copy.
Definition at line 1169 of file ClpSimplex.hpp.
Referenced by costRegion().
double* ClpSimplex::objectiveWork_ [protected] |
Column objective - working copy.
Definition at line 1171 of file ClpSimplex.hpp.
Referenced by costRegion().
CoinIndexedVector* ClpSimplex::rowArray_[6] [protected] |
CoinIndexedVector* ClpSimplex::columnArray_[6] [protected] |
Useful column length arrays.
Definition at line 1175 of file ClpSimplex.hpp.
Referenced by columnArray().
int ClpSimplex::sequenceIn_ [protected] |
Sequence of In variable.
Definition at line 1177 of file ClpSimplex.hpp.
Referenced by sequenceIn(), and setSequenceIn().
int ClpSimplex::directionIn_ [protected] |
Direction of In, 1 going up, -1 going down, 0 not a clude.
Definition at line 1179 of file ClpSimplex.hpp.
Referenced by directionIn(), and setDirectionIn().
int ClpSimplex::sequenceOut_ [protected] |
Sequence of Out variable.
Definition at line 1181 of file ClpSimplex.hpp.
Referenced by sequenceOut(), and setSequenceOut().
int ClpSimplex::directionOut_ [protected] |
Direction of Out, 1 to upper bound, -1 to lower bound, 0 - superbasic.
Definition at line 1183 of file ClpSimplex.hpp.
Referenced by directionOut(), and setDirectionOut().
int ClpSimplex::pivotRow_ [protected] |
Pivot Row.
Definition at line 1185 of file ClpSimplex.hpp.
Referenced by pivotRow(), and setPivotRow().
int ClpSimplex::lastGoodIteration_ [protected] |
Last good iteration (immediately after a re-factorization).
Definition at line 1187 of file ClpSimplex.hpp.
double* ClpSimplex::dj_ [protected] |
Working copy of reduced costs (Owner of arrays below).
Definition at line 1189 of file ClpSimplex.hpp.
Referenced by djRegion(), reducedCost(), and reducedCostAddress().
double* ClpSimplex::rowReducedCost_ [protected] |
Reduced costs of slacks not same as duals (or - duals).
Definition at line 1191 of file ClpSimplex.hpp.
Referenced by djRegion().
double* ClpSimplex::reducedCostWork_ [protected] |
Possible scaled reduced costs.
Definition at line 1193 of file ClpSimplex.hpp.
Referenced by djRegion().
double* ClpSimplex::solution_ [protected] |
Working copy of primal solution (Owner of arrays below).
Definition at line 1195 of file ClpSimplex.hpp.
Referenced by solution(), solutionAddress(), and solutionRegion().
double* ClpSimplex::rowActivityWork_ [protected] |
Row activities - working copy.
Definition at line 1197 of file ClpSimplex.hpp.
Referenced by solutionRegion().
double* ClpSimplex::columnActivityWork_ [protected] |
Column activities - working copy.
Definition at line 1199 of file ClpSimplex.hpp.
Referenced by solutionRegion().
ClpSimplex* ClpSimplex::auxiliaryModel_ [protected] |
Auxiliary model.
Definition at line 1201 of file ClpSimplex.hpp.
Referenced by usingAuxiliaryModel().
int ClpSimplex::numberDualInfeasibilities_ [protected] |
Number of dual infeasibilities.
Definition at line 1203 of file ClpSimplex.hpp.
Referenced by dualFeasible(), numberDualInfeasibilities(), and setNumberDualInfeasibilities().
int ClpSimplex::numberDualInfeasibilitiesWithoutFree_ [protected] |
int ClpSimplex::numberPrimalInfeasibilities_ [protected] |
Number of primal infeasibilities.
Definition at line 1207 of file ClpSimplex.hpp.
Referenced by numberPrimalInfeasibilities(), primalFeasible(), and setNumberPrimalInfeasibilities().
int ClpSimplex::numberRefinements_ [protected] |
How many iterative refinements to do.
Definition at line 1209 of file ClpSimplex.hpp.
Referenced by numberRefinements().
ClpDualRowPivot* ClpSimplex::dualRowPivot_ [protected] |
ClpPrimalColumnPivot* ClpSimplex::primalColumnPivot_ [protected] |
int* ClpSimplex::pivotVariable_ [protected] |
Basic variables pivoting on which rows.
Definition at line 1215 of file ClpSimplex.hpp.
Referenced by pivotVariable().
ClpFactorization* ClpSimplex::factorization_ [protected] |
double* ClpSimplex::savedSolution_ [protected] |
int ClpSimplex::numberTimesOptimal_ [protected] |
Number of times code has tentatively thought optimal.
Definition at line 1221 of file ClpSimplex.hpp.
int ClpSimplex::changeMade_ [protected] |
If change has been made (first attempt at stopping looping).
Definition at line 1223 of file ClpSimplex.hpp.
int ClpSimplex::algorithm_ [protected] |
Algorithm >0 == Primal, <0 == Dual.
Definition at line 1225 of file ClpSimplex.hpp.
Referenced by algorithm(), and setAlgorithm().
int ClpSimplex::forceFactorization_ [protected] |
Now for some reliability aids This forces re-factorization early.
Definition at line 1228 of file ClpSimplex.hpp.
Referenced by forceFactorization().
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 1236 of file ClpSimplex.hpp.
Referenced by perturbation().
unsigned char* ClpSimplex::saveStatus_ [protected] |
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 1243 of file ClpSimplex.hpp.
Referenced by nonLinearCost().
unsigned int ClpSimplex::specialOptions_ [protected] |
For advanced options See get and set for meaning.
Definition at line 1247 of file ClpSimplex.hpp.
Referenced by setSpecialOptions(), and specialOptions().
int ClpSimplex::lastBadIteration_ [protected] |
So we know when to be cautious.
Definition at line 1249 of file ClpSimplex.hpp.
Referenced by lastBadIteration().
int ClpSimplex::lastFlaggedIteration_ [protected] |
int ClpSimplex::numberFake_ [protected] |
Can be used for count of fake bounds (dual) or fake costs (primal).
Definition at line 1253 of file ClpSimplex.hpp.
int ClpSimplex::numberChanged_ [protected] |
Can be used for count of changed costs (dual) or changed bounds (primal).
Definition at line 1255 of file ClpSimplex.hpp.
int ClpSimplex::progressFlag_ [protected] |
Progress flag - at present 0 bit says artificials out, 1 free in.
Definition at line 1257 of file ClpSimplex.hpp.
Referenced by progressFlag().
int ClpSimplex::firstFree_ [protected] |
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 1263 of file ClpSimplex.hpp.
Referenced by numberExtraRows().
int ClpSimplex::maximumBasic_ [protected] |
Maximum number of basic variables - can be more than number of rows if GUB.
Definition at line 1266 of file ClpSimplex.hpp.
Referenced by maximumBasic().
float 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 1276 of file ClpSimplex.hpp.
float ClpSimplex::allowedInfeasibility_ [protected] |
Spare int array for passing information [0]!=0 switches on.
Definition at line 1277 of file ClpSimplex.hpp.
int ClpSimplex::automaticScale_ [protected] |
Automatic scaling of objective and rhs and bounds.
Definition at line 1279 of file ClpSimplex.hpp.
Referenced by automaticScaling(), and setAutomaticScaling().
ClpSimplexProgress* ClpSimplex::progress_ [protected] |
int ClpSimplex::spareIntArray_[4] [mutable] |
Spare int array for passing information [0]!=0 switches on.
Definition at line 1284 of file ClpSimplex.hpp.
double ClpSimplex::spareDoubleArray_[4] [mutable] |
Spare double array for passing information [0]!=0 switches on.
Definition at line 1286 of file ClpSimplex.hpp.