Logo Search packages:      
Sourcecode: rsymphony version File versions  Download package

ClpSimplexPrimal Class Reference

#include <ClpSimplexPrimal.hpp>

Inheritance diagram for ClpSimplexPrimal:

ClpSimplex ClpSimplexNonlinear

List of all members.

Detailed Description

This solves LPs using the primal simplex method

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

Definition at line 23 of file ClpSimplexPrimal.hpp.

Functions less likely to be useful to casual user

void add (double *array, int column, double multiplier) const
void cleanStatus ()
 Clean up status.
void computeDuals (double *givenDjs)
void computePrimals (const double *rowActivities, const double *columnActivities)
 Computes primals from scratch.
int createPiecewiseLinearCosts (const int *starts, const double *lower, const double *gradient)
ClpDualRowPivotdualRowPivot () const
 dual row pivot choice
int factorize ()
 Factorizes using current basis. For external use.
int getSolution ()
int getSolution (const double *rowActivities, const double *columnActivities)
bool goodAccuracy () const
 Returns true if model looks OK.
int internalFactorize (int solveType)
void restoreData (ClpDataSave saved)
 Restore data.
void returnModel (ClpSimplex &otherModel)
ClpDataSave saveData ()
 Save data.
void setValuesPassAction (double incomingInfeasibility, double allowedInfeasibility)
void unpack (CoinIndexedVector *rowArray, int sequence) const
void unpack (CoinIndexedVector *rowArray) const
void unpackPacked (CoinIndexedVector *rowArray, int sequence)
void unpackPacked (CoinIndexedVector *rowArray)
void checkBothSolutions ()
void checkDualSolution ()
void checkPrimalSolution (const double *rowActivities=NULL, const double *columnActivies=NULL)
int housekeeping (double objectiveChange)
double scaleObjective (double value)
int solveBenders (CoinStructuredModel *model)
 Solve using Benders decomposition and maybe in parallel.
int solveDW (CoinStructuredModel *model)
 Solve using Dantzig-Wolfe decomposition and maybe in parallel.

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

There is a single array with both - columns then rows and then normally two arrays pointing to rows and columns. The single array is the owner of memory

double acceptablePivot_
 Acceptable pivot value just after factorization.
int algorithm_
 Algorithm >0 == Primal, <0 == Dual.
double allowedInfeasibility_
double alpha_
 Alpha (pivot element).
double alphaAccuracy_
 For computing whether to re-factorize.
int automaticScale_
 Automatic scaling of objective and rhs and bounds.
int baseIteration_
 Iteration when we entered dual or primal.
 A copy of model with certain state - normally without cuts.
double bestObjectiveValue_
 "Best" objective value
double bestPossibleImprovement_
int changeMade_
 If change has been made (first attempt at stopping looping).
double * columnActivityWork_
 Column activities - working copy.
CoinIndexedVectorcolumnArray_ [6]
 Useful column length arrays.
double * columnLowerWork_
 Column lower bounds - working copy.
int columnPrimalSequence_
 Sequence of worst (-1 if feasible).
double * columnUpperWork_
 Column upper bounds - working copy.
double * cost_
 Working copy of objective (Owner of arrays below).
int directionIn_
 Direction of In, 1 going up, -1 going down, 0 not a clude.
int directionOut_
 Direction of Out, 1 to upper bound, -1 to lower bound, 0 - superbasic.
 Disaster handler.
double * dj_
 Working copy of reduced costs (Owner of arrays below).
int dontFactorizePivots_
 If may skip final factorize then allow up to this pivots (default 20).
double dualBound_
 Dual bound.
double dualIn_
 Reduced cost of In variable.
double dualOut_
 Infeasibility (dual) or ? (primal) of Out variable.
 dual row pivot choice
double dualTolerance_
 Current dual tolerance for algorithm.
int firstFree_
 First free/super-basic variable (-1 if none).
int forceFactorization_
double incomingInfeasibility_
double infeasibilityCost_
 Weight assigned to being infeasible in primal.
double largestDualError_
 Largest error on basic duals.
double largestPrimalError_
 Largest error on Ax-b.
double largeValue_
 Large bound value (for complementarity etc).
int lastBadIteration_
 So we know when to be cautious.
int lastFlaggedIteration_
 So we know when to open up again.
int lastGoodIteration_
 Last good iteration (immediately after a re-factorization).
double * lower_
 Working copy of lower bounds (Owner of arrays below).
double lowerIn_
 Lower Bound on In variable.
double lowerOut_
 Lower Bound on Out variable.
int maximumBasic_
int maximumPerturbationSize_
 Maximum perturbation array size (take out when code rewritten).
int moreSpecialOptions_
 More special options - see set for details.
ClpNonLinearCost * nonLinearCost_
int numberChanged_
 Can be used for count of changed costs (dual) or changed bounds (primal).
int numberDualInfeasibilities_
 Number of dual infeasibilities.
int numberDualInfeasibilitiesWithoutFree_
 Number of dual infeasibilities (without free).
int numberExtraRows_
int numberFake_
 Can be used for count of fake bounds (dual) or fake costs (primal).
int numberPrimalInfeasibilities_
 Number of primal infeasibilities.
int numberRefinements_
 How many iterative refinements to do.
int numberTimesOptimal_
 Number of times code has tentatively thought optimal.
double * objectiveWork_
 Column objective - working copy.
int perturbation_
double * perturbationArray_
 Perturbation array (maximumPerturbationSize_).
int pivotRow_
 Pivot Row.
int * pivotVariable_
 Basic variables pivoting on which rows.
 primal column pivot choice
double primalTolerance_
 Current primal tolerance for algorithm.
double primalToleranceToGetOptimal_
 Primal tolerance needed to make dual feasible (<largeTolerance).
ClpSimplexProgress progress_
 For dealing with all issues of cycling etc.
int progressFlag_
 Progress flag - at present 0 bit says artificials out, 1 free in.
double * reducedCostWork_
 Possible scaled reduced costs.
double * rowActivityWork_
 Row activities - working copy.
CoinIndexedVectorrowArray_ [6]
 Useful row length arrays.
double * rowLowerWork_
 Row lower bounds - working copy.
double * rowObjectiveWork_
 Row objective - working copy.
int rowPrimalSequence_
 Sequence of worst (-1 if feasible).
double * rowReducedCost_
 Reduced costs of slacks not same as duals (or - duals).
double * rowUpperWork_
 Row upper bounds - working copy.
double * savedSolution_
 Saved version of solution.
unsigned char * saveStatus_
 Saved status regions.
int sequenceIn_
 Sequence of In variable.
int sequenceOut_
 Sequence of Out variable.
double * solution_
 Working copy of primal solution (Owner of arrays below).
double sumDualInfeasibilities_
 Sum of dual infeasibilities.
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 sumPrimalInfeasibilities_
 Sum of primal infeasibilities.
double theta_
 Theta (pivot change).
double * upper_
 Working copy of upper bounds (Owner of arrays below).
double upperIn_
 Upper Bound on In variable.
double upperOut_
 Upper Bound on Out variable.
double valueIn_
 Value of In variable.
double valueOut_
 Value of Out variable.
double zeroTolerance_
 Zero tolerance.
double spareDoubleArray_ [4]
 Spare double array for passing information [0]!=0 switches on.
int spareIntArray_ [4]
 Spare int array for passing information [0]!=0 switches on.
class OsiClpSolverInterface
 Allow OsiClp certain perks.

Public Types

enum  FakeBound { noFake = 0x00, lowerFake = 0x01, upperFake = 0x02, bothFake = 0x03 }
enum  Status {
  isFree = 0x00, basic = 0x01, atUpperBound = 0x02, atLowerBound = 0x03,
  superBasic = 0x04, isFixed = 0x05

Public Member Functions

ClpMatrixBaseclpMatrix () const
 Clp Matrix.
ClpPackedMatrix * clpScaledMatrix () const
 Scaled ClpPackedMatrix.
double * columnLower () const
 Column Lower.
const double * columnScale () const
double * columnUpper () const
 Column Upper.
void copyinStatus (const unsigned char *statusArray)
 Copy in status (basis) vector.
const double * getColLower () const
const double * getColUpper () const
int getNumElements () const
 Number of elements in matrix.
const double * getObjCoefficients () const
double getObjValue () const
const double * getRowObjCoefficients () const
double getSmallElementValue () const
ClpTrustedDatagetTrustedUserPointer () const
void * getUserPointer () const
double * infeasibilityRay () const
char * integerInformation () const
 Integer information.
const double * inverseColumnScale () const
const double * inverseRowScale () const
CoinPackedMatrixmatrix () const
 Matrix (if not ClpPackedmatrix be careful about memory leak.
double * mutableColumnScale () const
double * mutableInverseColumnScale () const
double * mutableInverseRowScale () const
double * mutableRowScale () const
int numberThreads () const
 Number of threads (not really being used).
double * objective (const double *solution, double &offset, bool refresh=true) const
double * objective () const
double objectiveScale () const
 Scaling of objective.
double objectiveValue () const
 Objective value.
void replaceMatrix (CoinPackedMatrix *newmatrix, bool deleteCurrent=false)
void replaceMatrix (ClpMatrixBase *matrix, bool deleteCurrent=false)
double rhsScale () const
 Scaling of rhs and bounds.
ClpMatrixBaserowCopy () const
 Row Matrix.
double * rowObjective () const
 Row Objective.
const double * rowScale () const
void scaling (int mode=1)
 Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab.
int scalingFlag () const
 Gets scalingFlag.
void setClpScaledMatrix (ClpPackedMatrix *scaledMatrix)
 Sets pointer to scaled ClpPackedMatrix.
void setColumnScale (double *scale)
void setNewRowCopy (ClpMatrixBase *newCopy)
 Set new row matrix.
void setNumberThreads (int value)
void setObjectiveScale (double value)
void setObjectiveValue (double value)
void setRhsScale (double value)
void setRowScale (double *scale)
void setSmallElementValue (double value)
void setTrustedUserPointer (ClpTrustedData *pointer)
 Trusted user pointer.
void setUserPointer (void *pointer)
 User pointer for whatever reason.
void setWhatsChanged (int value)
unsigned char * statusArray () const
 Return address of status (i.e. basis) array (char[numberRows+numberColumns]).
unsigned char * statusCopy () const
bool statusExists () const
 See if status (i.e. basis) array exists (partly for OsiClp).
double * unboundedRay () const
void unscale ()
int whatsChanged () const
 What has changed in model (only for masochistic users).
status methods
bool active (int iRow) const
void allSlackBasis (bool resetSolution=false)
int baseIteration () const
 Iteration when we entered dual or primal.
void clearActive (int iRow)
void clearFlagged (int sequence)
void clearPivoted (int sequence)
double computeInternalObjectiveValue ()
 Compute minimization objective value from internal solution without perturbation.
void computeObjectiveValue (bool useWorkingSolution=false)
 Compute objective value from solution and put in objectiveValue_.
void createStatus ()
bool flagged (int sequence) const
void forceFactorization (int value)
 Force re-factorization early.
void generateCpp (FILE *fp, bool defaultFactor=false)
 Create C++ lines to get to current state.
Status getColumnStatus (int sequence) const
ClpFactorizationgetEmptyFactorization ()
 Gets clean and emptyish factorization.
FakeBound getFakeBound (int sequence) const
Status getRowStatus (int sequence) const
int lastBadIteration () const
 So we know when to be cautious.
int maximumBasic () const
void moveInfo (const ClpSimplex &rhs, bool justStatus=false)
 Move status and solution across.
int numberExtraRows () const
bool pivoted (int sequence) const
int progressFlag () const
 Progress flag - at present 0 bit says artificials out.
double rawObjectiveValue () const
 Raw objective value (so always minimize in primal).
void setActive (int iRow)
 To say row active in primal pivot row choice.
void setColumnStatus (int sequence, Status newstatus)
void setEmptyFactorization ()
 May delete or may make clean and emptyish factorization.
void setFakeBound (int sequence, FakeBound fakeBound)
void setFlagged (int sequence)
 To flag a variable (not inline to allow for column generation).
void setPivoted (int sequence)
void setRowStatus (int sequence, Status newstatus)
Load model - loads some stuff and initializes others
void addColumn (int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objective=0.0)
 Add one column.
int addColumns (CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
int addColumns (const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
void addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinPackedVectorBase *const *columns)
void addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *columnLengths, const int *rows, const double *elements)
void addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
 Add columns.
void addRow (int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
 Add one row.
int addRows (CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
int addRows (const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
void addRows (int number, const double *rowLower, const double *rowUpper, const CoinPackedVectorBase *const *rows)
void addRows (int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *rowLengths, const int *columns, const double *elements)
 Add rows.
void addRows (int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
 Add rows.
void chgColumnLower (const double *columnLower)
void chgColumnUpper (const double *columnUpper)
void chgObjCoefficients (const double *objIn)
void chgRowLower (const double *rowLower)
void chgRowUpper (const double *rowUpper)
int cleanMatrix (double threshold=1.0e-20)
void copy (const ClpMatrixBase *from, ClpMatrixBase *&to)
 Copy contents - resizing if necessary - otherwise re-use memory.
void copyColumnNames (const char *const *columnNames, int first, int last)
 Copies in Column names - modifies names first .. last-1.
void copyColumnNames (const std::vector< std::string > &columnNames, int first, int last)
 Copies in Column names - modifies names first .. last-1.
void copyInIntegerInformation (const char *information)
 Copy in integer informations.
void copyNames (std::vector< std::string > &rowNames, std::vector< std::string > &columnNames)
 Copies in names.
void copyRowNames (const char *const *rowNames, int first, int last)
 Copies in Row names - modifies names first .. last-1.
void copyRowNames (const std::vector< std::string > &rowNames, int first, int last)
 Copies in Row names - modifies names first .. last-1.
CoinModelcreateCoinModel () const
void createEmptyMatrix ()
 Create empty ClpPackedMatrix.
void deleteColumns (int number, const int *which)
 Deletes columns.
void deleteIntegerInformation ()
 Drop integer informations.
void deleteQuadraticObjective ()
 Get rid of quadratic objective.
void deleteRows (int number, const int *which)
 Deletes rows.
void dropNames ()
 Drops names - makes lengthnames 0 and names empty.
int findNetwork (char *rotate, double fractionNeeded=0.75)
bool isInteger (int index) const
void loadQuadraticObjective (const CoinPackedMatrix &matrix)
void loadQuadraticObjective (const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
void modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
 Modify one element of a matrix.
void returnModel (ClpModel &otherModel)
void setColumnName (int colIndex, std::string &name)
 Set name of col.
void setContinuous (int index)
void setInteger (int index)
void setRowName (int rowIndex, std::string &name)
 Set name of row.
void setRowObjective (const double *rowObjective)
 This just loads up a row objective.
int writeMps (const char *filename, int formatType=0, int numberAcross=2, double objSense=0.0) const
most useful gets and sets
int algorithm () const
 Current (or last) algorithm.
void checkSolution (int setToBounds=0)
void checkSolutionInternal ()
CoinIndexedVectorcolumnArray (int index) const
 Useful column length arrays (0,1,2,3,4,5).
double dualBound () const
 Dual bound.
bool dualFeasible () const
 If problem is dual feasible.
ClpFactorizationfactorization () const
int factorizationFrequency () const
 Factorization frequency.
double infeasibilityCost () const
 Infeasibility cost.
bool isObjectiveLimitTestValid () const
 Return true if the objective limit test can be relied upon.
int numberDualInfeasibilities () const
 Number of dual infeasibilities.
int numberDualInfeasibilitiesWithoutFree () const
 Number of dual infeasibilities (without free).
int numberPrimalInfeasibilities () const
 Number of primal infeasibilities.
int perturbation () const
bool primalFeasible () const
 If problem is primal feasible.
int restoreModel (const char *fileName)
CoinIndexedVectorrowArray (int index) const
 Useful row length arrays (0,1,2,3,4,5).
int saveModel (const char *fileName)
void setAlgorithm (int value)
 Set algorithm.
void setDualBound (double value)
void setFactorizationFrequency (int value)
void setInfeasibilityCost (double value)
void setNumberDualInfeasibilities (int value)
void setNumberPrimalInfeasibilities (int value)
void setPerturbation (int value)
void setSparseFactorization (bool value)
void setSumDualInfeasibilities (double value)
void setSumOfRelaxedDualInfeasibilities (double value)
void setSumOfRelaxedPrimalInfeasibilities (double value)
void setSumPrimalInfeasibilities (double value)
bool sparseFactorization () const
 Sparsity on or off.
double sumDualInfeasibilities () const
 Sum of dual infeasibilities.
double sumOfRelaxedDualInfeasibilities () const
 Sum of relaxed dual infeasibilities.
double sumOfRelaxedPrimalInfeasibilities () const
 Sum of relaxed primal infeasibilities.
double sumPrimalInfeasibilities () const
 Sum of primal infeasibilities.
most useful gets and sets
double alpha () const
 Alpha (pivot element) for use by classes e.g. steepestedge.
double alphaAccuracy () const
 Initial value for alpha accuracy calculation (-1.0 off).
bool automaticScaling () const
 If automatic scaling on.
double currentDualTolerance () const
 Current dual tolerance.
double currentPrimalTolerance () const
 Current primal tolerance.
ClpDisasterHandlerdisasterHandler () const
 Get disaster handler.
double dualIn () const
 Reduced cost of last incoming for use by classes e.g. steepestedge.
double largestDualError () const
 Largest error on basic duals.
double largestPrimalError () const
 Largest error on Ax-b.
double largeValue () const
 Large bound value (for complementarity etc).
int numberRefinements () const
 How many iterative refinements to do.
int pivotRow () const
 Pivot Row for use by classes e.g. steepestedge.
int * pivotVariable () const
 Basic variables pivoting on which rows.
void setAlpha (double value)
void setAlphaAccuracy (double value)
void setAutomaticScaling (bool onOff)
void setCurrentDualTolerance (double value)
void setCurrentPrimalTolerance (double value)
void setDisasterHandler (ClpDisasterHandler *handler)
 Objective value.
void setLargestDualError (double value)
 Largest error on basic duals.
void setLargestPrimalError (double value)
 Largest error on Ax-b.
void setLargeValue (double value)
void setNumberRefinements (int value)
void setPivotRow (int value)
void setZeroTolerance (double value)
 Set zero tolerance.
double valueIncomingDual () const
 value of incoming variable (in Dual)
double zeroTolerance () const
 Get zero tolerance.
For advanced users
bool alwaysOptimal () const
void alwaysOptimal (bool onOff)
 Do not change infeasibility cost and always say optimal.
bool exactOutgoing () const
void exactOutgoing (bool onOff)
Functions most useful to user
int barrier (bool crossover=true)
int cleanup (int cleanupScaling)
void copyFactorization (ClpFactorization &factorization)
 Copies in factorization to existing one.
int crash (double gap, int pivot)
double doubleCheck ()
 Double checks OK.
int dual (int ifValuesPass=0, int startFinishOptions=0)
int dualDebug (int ifValuesPass=0, int startFinishOptions=0)
int dualRanging (int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease, double *valueIncrease=NULL, double *valueDecrease=NULL)
ClpSimplexfastCrunch (ClpNodeStuff *stuff, int mode)
int fastDual2 (ClpNodeStuff *stuff)
 Like Fast dual.
int fathom (void *stuff)
 Fathom - 1 if solution.
int fathomMany (void *stuff)
CoinWarmStartBasisgetBasis () const
 Returns a basis (to be deleted by user).
int initialBarrierNoCrossSolve ()
 Barrier initial solve, not to be followed by crossover.
int initialBarrierSolve ()
 Barrier initial solve.
int initialDualSolve ()
 Dual initial solve.
int initialPrimalSolve ()
 Primal initial solve.
int initialSolve ()
 Default initial solve.
int initialSolve (ClpSolve &options)
int loadProblem (CoinStructuredModel &modelObject, bool originalOrder=true, bool keepSolution=false)
int nonlinearSLP (int numberConstraints, ClpConstraint **constraints, int numberPasses, double deltaTolerance)
int nonlinearSLP (int numberPasses, double deltaTolerance)
int primalRanging (int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease)
int readBasis (const char *filename)
int reducedGradient (int phase=0)
void setDualRowPivotAlgorithm (ClpDualRowPivot &choice)
 Sets row pivot choice algorithm in dual.
void setFactorization (ClpFactorization &factorization)
 Passes in factorization.
void setPrimalColumnPivotAlgorithm (ClpPrimalColumnPivot &choice)
 Sets column pivot choice algorithm in primal.
int solve (CoinStructuredModel *model)
 Solve using structure of model and maybe in parallel.
int startFastDual2 (ClpNodeStuff *stuff)
 Starts Fast dual2.
void stopFastDual2 (ClpNodeStuff *stuff)
 Stops Fast dual2.
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)
ClpFactorizationswapFactorization (ClpFactorization *factorization)
int tightenPrimalBounds (double factor=0.0, int doTight=0, bool tightIntegers=false)
int writeBasis (const char *filename, bool writeValues=false, int formatType=0) const
Constructors and destructor and copy
ClpSimplexbaseModel () const
 See if we have base model.
void borrowModel (ClpSimplex &otherModel)
void borrowModel (ClpModel &otherModel)
void deleteBaseModel ()
 Switch off base model.
void getbackSolution (const ClpSimplex &smallModel, const int *whichRow, const int *whichColumn)
 Puts solution back into small model.
int loadNonLinear (void *info, int &numberConstraints, ClpConstraint **&constraints)
int loadProblem (CoinModel &modelObject, bool keepSolution=false)
void loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const int *length, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
 This one is for after presolve to save memory.
void 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)
void loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
void loadProblem (const ClpMatrixBase &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
void makeBaseModel ()
 Save a copy of model with certain state - normally without cuts.
void originalModel (ClpSimplex *miniModel)
void passInEventHandler (const ClpEventHandler *eventHandler)
 Pass in Event handler (cloned and deleted at end).
int readGMPL (const char *filename, const char *dataName, bool keepNames=false)
 Read GMPL files from the given filenames.
int readLp (const char *filename, const double epsilon=1e-5)
int readMps (const char *filename, bool keepNames=false, bool ignoreErrors=false)
 Read an mps file from the given filename.
void setPersistenceFlag (int value)
void setToBaseModel (ClpSimplex *model=NULL)
public methods
double bestPossibleImprovement () const
double cost (int sequence)
double & costAddress (int sequence)
 Return address of row or column cost.
double * costRegion () const
double * costRegion (int section) const
int directionIn () const
int directionOut () const
double * djRegion () const
double * djRegion (int section) const
Status getStatus (int sequence) const
bool initialDenseFactorization () const
int isColumn (int sequence) const
 Returns 1 if sequence indicates column.
double lower (int sequence)
double & lowerAddress (int sequence)
 Return address of row or column lower bound.
double * lowerRegion () const
double * lowerRegion (int section) const
int moreSpecialOptions () const
ClpNonLinearCost * nonLinearCost () const
 Return pointer to details of costs.
double originalLower (int iSequence) const
 Return original lower bound.
double originalUpper (int iSequence) const
 Return original lower bound.
double reducedCost (int sequence)
double & reducedCostAddress (int sequence)
int sequenceIn () const
int sequenceOut () const
int sequenceWithin (int sequence) const
 Returns sequence number within section.
void setDirectionIn (int direction)
void setDirectionOut (int direction)
void setInitialDenseFactorization (bool onOff)
void setMoreSpecialOptions (int value)
void setSequenceIn (int sequence)
void setSequenceOut (int sequence)
void setStatus (int sequence, Status newstatus)
double solution (int sequence)
 Return row or column values.
double & solutionAddress (int sequence)
 Return address of row or column values.
double * solutionRegion () const
 Return region as single array.
double * solutionRegion (int section) const
bool startPermanentArrays ()
 Start or reset using maximumRows_ and Columns_ - true if change.
double theta () const
 Theta (pivot change).
double upper (int sequence)
double & upperAddress (int sequence)
 Return address of row or column upper bound.
double * upperRegion () const
double * upperRegion (int section) const
double valueOut () const
 Value of Out variable.
Functions used in primal
int checkUnbounded (CoinIndexedVector *ray, CoinIndexedVector *spare, double changeCost)
void clearAll ()
 Clears all bits and clears rowArray[1] etc.
int lexSolve ()
 Sort of lexicographic resolve.
int nextSuperBasic (int superBasicType, CoinIndexedVector *columnArray)
void perturb (int type)
 Perturbs problem (method depends on perturbation()).
int pivotResult (int ifValuesPass=0)
void primalColumn (CoinIndexedVector *updateArray, CoinIndexedVector *spareRow1, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
void primalRay (CoinIndexedVector *rowArray)
 Create primal ray.
void primalRow (CoinIndexedVector *rowArray, CoinIndexedVector *rhsArray, CoinIndexedVector *spareArray, int valuesPass)
void statusOfProblemInPrimal (int &lastCleaned, int type, ClpSimplexProgress *progress, bool doFactorization, int ifValuesPass, ClpSimplex *saveModel=NULL)
int unflag ()
 Unflag all variables and return number unflagged.
bool unPerturb ()
 Take off effect of perturbation and say whether to try dual.
int updatePrimalsInPrimal (CoinIndexedVector *rowArray, double theta, double &objectiveChange, int valuesPass)
int whileIterating (int valuesOption)
Message handling
CoinMessages coinMessages () const
 Return Coin messages.
CoinMessagescoinMessagesPointer ()
 Return pointer to Coin messages.
const std::string & columnName (int iColumn) const
const std::vector< std::string > * columnNames () const
 Column names.
bool defaultHandler () const
 Return true if default handler.
int emptyProblem (int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
ClpEventHandlereventHandler () const
 Event handler.
std::string getColumnName (int iColumn) const
 Return name or Cnnnnnnn.
std::string getRowName (int iRow) const
 Return name or Rnnnnnnn.
int lengthNames () const
 length of names (0 means no names0
int logLevel () const
CoinMessageHandlermessageHandler () const
 Return handler.
CoinMessages messages () const
 Return messages.
CoinMessagesmessagesPointer ()
 Return pointer to messages.
CoinThreadRandommutableRandomNumberGenerator ()
 Thread specific random number generator.
void newLanguage (CoinMessages::Language language)
 Set language.
ClpObjectiveobjectiveAsObject () const
 Objective methods.
void passInMessageHandler (CoinMessageHandler *handler)
 Pass in Message handler (not deleted at end).
void popMessageHandler (CoinMessageHandler *oldHandler, bool oldDefault)
 back to previous message handler
CoinMessageHandlerpushMessageHandler (CoinMessageHandler *handler, bool &oldDefault)
 Pass in Message handler (not deleted at end) and return current.
CoinThreadRandomrandomNumberGenerator ()
 Thread specific random number generator.
const std::string & rowName (int iRow) const
const std::vector< std::string > * rowNames () const
 Row names.
void setLanguage (CoinMessages::Language language)
void setLengthNames (int value)
 length of names (0 means no names0
void setLogLevel (int value)
void setObjective (ClpObjective *objective)
void setObjectivePointer (ClpObjective *newobjective)
void setRandomSeed (int value)
 Set seed for thread specific random number generator.
Needed for functionality of OsiSimplexInterface
void defaultFactorizationFrequency ()
 If user left factorization frequency then compute.
int dualPivotResult ()
void finish (int startFinishOptions=0)
int pivot ()
int primalPivotResult ()
int startup (int ifValuesPass, int startFinishOptions=0)
bool statusOfProblem (bool initial=false)
gets and sets
double * dualColumnSolution () const
 Reduced costs.
double dualObjectiveLimit () const
 Dual objective limit.
double * dualRowSolution () const
 Dual row solution.
double dualTolerance () const
 Dual tolerance to use.
const double * getColSolution () const
int getIterationCount () const
int getNumCols () const
 Number of columns.
int getNumRows () const
double getObjSense () const
const double * getReducedCost () const
const double * getRowActivity () const
const double * getRowLower () const
const double * getRowPrice () const
const double * getRowUpper () const
bool hitMaximumIterations () const
 Returns true if hit maximum iterations (or time).
bool isAbandoned () const
 Are there a numerical difficulties?
bool isDualObjectiveLimitReached () const
 Is the given dual objective limit reached?
bool isIterationLimitReached () const
 Iteration limit reached?
bool isPrimalObjectiveLimitReached () const
 Is the given primal objective limit reached?
bool isProvenDualInfeasible () const
 Is dual infeasiblity proven?
bool isProvenOptimal () const
 Is optimality proven?
bool isProvenPrimalInfeasible () const
 Is primal infeasiblity proven?
int maximumIterations () const
 Maximum number of iterations.
double maximumSeconds () const
 Maximum time in seconds (from when set called).
int numberColumns () const
int numberIterations () const
 Number of iterations.
int numberRows () const
 Number of rows.
double objectiveOffset () const
 Objective offset.
double optimizationDirection () const
 Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
double presolveTolerance () const
 Presolve tolerance to use.
double * primalColumnSolution () const
 Primal column solution.
double primalObjectiveLimit () const
 Primal objective limit.
double * primalRowSolution () const
 Primal row solution.
double primalTolerance () const
 Primal tolerance to use.
std::string problemName () const
int problemStatus () const
double * rowLower () const
 Row lower.
double * rowUpper () const
 Row upper.
int secondaryStatus () const
void setColSolution (const double *input)
void setDualObjectiveLimit (double value)
void setDualTolerance (double value)
void setMaximumIterations (int value)
void setMaximumSeconds (double value)
void setNumberIterations (int numberIterationsNew)
void setObjectiveOffset (double value)
void setOptimizationDirection (double value)
void setPrimalObjectiveLimit (double value)
void setPrimalTolerance (double value)
void setProblemStatus (int problemStatusNew)
 Set problem status.
void setSecondaryStatus (int newstatus)
void setSolveType (int type)
int solveType () const
int status () const
Parameter set/get methods
The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver.

The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false.

once it has been decided where solver sits this may be redone

void generateCpp (FILE *fp)
 Create C++ lines to get to current state.
bool getDblParam (ClpDblParam key, double &value) const
bool getIntParam (ClpIntParam key, int &value) const
bool getStrParam (ClpStrParam key, std::string &value) const
bool inCbcBranchAndBound () const
bool setDblParam (ClpDblParam key, double value)
 Set an double parameter.
bool setIntParam (ClpIntParam key, int value)
 Set an integer parameter.
void setSpecialOptions (unsigned int value)
bool setStrParam (ClpStrParam key, const std::string &value)
 Set an string parameter.
unsigned int specialOptions () const
Basis handling
void getBasics (int *index)
void getBInvACol (int col, double *vec)
 Get a column of the tableau.
void getBInvARow (int row, double *z, double *slack=NULL)
 Get a row of the tableau (slack part in slack if not NULL).
void getBInvCol (int col, double *vec)
 Get a column of the basis inverse.
void getBInvRow (int row, double *z)
 Get a row of the basis inverse.
Description of algorithm
int primal (int ifValuesPass=0, int startFinishOptions=0)
Changing bounds on variables and constraints
void resize (int newNumberRows, int newNumberColumns)
 Resizes rim part of model.
void setColBounds (int elementIndex, double newlower, double newupper)
void setColLower (int elementIndex, double elementValue)
void setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
void setColumnBounds (int elementIndex, double lower, double upper)
void setColumnLower (int elementIndex, double elementValue)
void setColumnSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
void setColumnUpper (int elementIndex, double elementValue)
void setColUpper (int elementIndex, double elementValue)
void setObjCoeff (int elementIndex, double elementValue)
void setObjectiveCoefficient (int elementIndex, double elementValue)
void setRowBounds (int elementIndex, double lower, double upper)
void setRowLower (int elementIndex, double elementValue)
void setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
void setRowUpper (int elementIndex, double elementValue)
Matrix times vector methods
They can be faster if scalar is +- 1 These are covers so user need not worry about scaling Also for simplex I am not using basic/non-basic split

void times (double scalar, const double *x, double *y) const
void transposeTimes (double scalar, const double *x, double *y) const

Protected Member Functions

private or protected methods
const char *const * columnNamesAsChar () const
 Create column names as char **.
void deleteNamesAsChar (const char *const *names, int number) const
 Delete char * version of names.
void getRowBound (int iRow, double &lower, double &upper) const
 gets lower and upper bounds on rows
void gutsOfCopy (const ClpModel &rhs, int trueCopy=1)
void gutsOfLoadModel (int numberRows, int numberColumns, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
 puts in format I like - 4 array matrix - may make row copy
void gutsOfScaling ()
 Does much of scaling.
void onStopped ()
 On stopped - sets secondary status.
bool permanentArrays () const
 If we are using maximumRows_ and Columns_.
const char *const * rowNamesAsChar () const
 Create row names as char **.
void stopPermanentArrays ()
 Stop using maximumRows_ and Columns_.
protected methods
bool createRim (int what, bool makeRowCopy=false, int startFinishOptions=0)
void createRim1 (bool initial)
 Does rows and columns.
void createRim4 (bool initial)
 Does objective.
void createRim5 (bool initial)
 Does rows and columns and objective.
void deleteRim (int getRidOfFactorizationData=2)
void gutsOfCopy (const ClpSimplex &rhs)
 Does most of copying.
void gutsOfDelete (int type)
 Does most of deletion (0 = all, 1 = most, 2 most + factorization).
int gutsOfSolution (double *givenDuals, const double *givenPrimals, bool valuesPass=false)
bool sanityCheck ()
 Sanity check on input rim data (after scaling) - returns true if okay.

Protected Attributes

CoinPackedMatrix baseMatrix_
 Base packed matrix.
CoinPackedMatrix baseRowCopy_
 Base row copy.
CoinMessages coinMessages_
 Coin messages.
double * columnActivity_
 Column activities.
double * columnLower_
 Column Lower.
std::vector< std::string > columnNames_
 Column names.
double * columnScale_
 Column scale factors.
double * columnUpper_
 Column Upper.
double dblParam_ [ClpLastDblParam]
 Array of double parameters.
bool defaultHandler_
 Flag to say if default handler (so delete).
double * dual_
 Event handler.
 Message handler.
char * integerType_
 Integer information.
int intParam_ [ClpLastIntParam]
 Array of integer parameters.
double * inverseColumnScale_
 Inverse column scale factors for matrix (end of columnScale_).
double * inverseRowScale_
 Inverse row scale factors for matrix (end of rowScale_).
int lengthNames_
 length of names (0 means no names)
 Packed matrix.
int maximumColumns_
 Maximum number of columns in model.
int maximumInternalColumns_
 Maximum number of columns (internal arrays) in model.
int maximumInternalRows_
 Maximum number of rows (internal arrays) in model.
int maximumRows_
 Maximum number of rows in model.
CoinMessages messages_
int numberColumns_
 Number of columns.
int numberIterations_
 Number of iterations.
int numberRows_
 Number of rows.
int numberThreads_
 Number of threads (not very operational).
double objectiveScale_
 Scaling of objective.
double objectiveValue_
 Objective value.
double optimizationDirection_
 Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int problemStatus_
 Status of problem.
CoinThreadRandom randomNumberGenerator_
 Thread specific random number generator.
double * ray_
 Infeasible/unbounded ray.
double * reducedCost_
 Reduced costs.
double rhsScale_
 Scaling of rhs and bounds.
double * rowActivity_
 Row activities.
 Row copy if wanted.
double * rowLower_
 Row lower.
std::vector< std::string > rowNames_
 Row names.
double * rowObjective_
 Row Objective (? sign) - may be NULL.
double * rowScale_
 Row scale factors for matrix.
double * rowUpper_
 Row upper.
double * savedColumnScale_
 Saved column scale factors.
double * savedRowScale_
 Saved row scale factors for matrix.
ClpPackedMatrix * scaledMatrix_
 Scaled packed matrix.
int scalingFlag_
int secondaryStatus_
 Secondary status of problem.
double smallElement_
 Small element value.
int solveType_
unsigned int specialOptions_
unsigned char * status_
std::string strParam_ [ClpLastStrParam]
 Array of string parameters.
 Trusted user pointer e.g. for heuristics.
void * userPointer_
 User pointer for whatever reason.
unsigned int whatsChanged_

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

Generated by  Doxygen 1.6.0   Back to index