double primalToleranceToGetOptimal_
Primal tolerance needed to make dual feasible (
void setToBaseModel(ClpSimplex *model=NULL)
Reset to base model (just size and arrays needed) If model NULL use internal copy.
int crash(double gap, int pivot)
Crash - at present just aimed at dual, returns -2 if dual preferred and crash basis created -1 if dua...
int algorithm() const
Current (or last) algorithm.
int lastBadIteration_
So we know when to be cautious.
int fastDual2(ClpNodeStuff *stuff)
Like Fast dual.
int numberPrimalInfeasibilities() const
Number of primal infeasibilities.
double sumPrimalInfeasibilities_
Sum of primal infeasibilities.
int baseIteration() const
Iteration when we entered dual or primal.
int numberDualInfeasibilitiesWithoutFree_
Number of dual infeasibilities (without free)
double acceptablePivot_
Acceptable pivot value just after factorization.
int numberDualInfeasibilities_
Number of dual infeasibilities.
void setUpperOut(double value)
Set upper of out variable.
ClpFactorization * swapFactorization(ClpFactorization *factorization)
General solve algorithm which can do presolve.
double * columnLower_
Column Lower.
ClpDisasterHandler * disasterArea_
Disaster handler.
double * columnUpperWork_
Column upper bounds - working copy.
void setStatus(int sequence, Status newstatus)
Return row or column sections - not as much needed as it once was.
void getBInvACol(int col, double *vec)
Get a column of the tableau.
int primalRanging(int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease)
Primal ranging.
int tightenPrimalBounds(double factor=0.0, int doTight=0, bool tightIntegers=false)
Tightens primal bounds to make dual faster.
void checkDualSolution()
This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Dual) ...
void clearPivoted(int sequence)
To flag a variable (not inline to allow for column generation)
double largestDualError_
Largest error on basic duals.
double * solution_
Working copy of primal solution (Owner of arrays below)
void computeDuals(double *givenDjs)
Computes duals from scratch.
int startFastDual2(ClpNodeStuff *stuff)
Starts Fast dual2.
double valueIncomingDual() const
value of incoming variable (in Dual)
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5)
void ClpSimplexUnitTest(const std::string &mpsDir)
A function that tests the methods in the ClpSimplex class.
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 i...
int lastFlaggedIteration_
So we know when to open up again.
void setDirectionIn(int direction)
Set directionIn or Out.
void setZeroTolerance(double value)
Set zero tolerance.
double theta() const
Theta (pivot change)
Status
enums for status of various sorts.
Status getColumnStatus(int sequence) const
To flag a variable (not inline to allow for column generation)
int internalFactorize(int solveType)
Factorizes using current basis.
void setLargestDualError(double value)
Largest error on basic duals.
void setFactorization(ClpFactorization &factorization)
Passes in factorization.
void generateCpp(FILE *fp, bool defaultFactor=false)
Create C++ lines to get to current state.
void setSequenceIn(int sequence)
Set sequenceIn or Out.
ClpSimplex * baseModel_
A copy of model with certain state - normally without cuts.
double * rowObjectiveWork_
Row objective - working copy.
double sumDualInfeasibilities() const
Sum of dual infeasibilities.
int numberColumns() const
Number of rows.
void setNumberPrimalInfeasibilities(int value)
If problem is primal feasible.
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
double largeValue_
Large bound value (for complementarity etc)
bool initialDenseFactorization() 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.
ClpSimplex * baseModel() const
See if we have base model.
int sequenceWithin(int sequence) const
Returns sequence number within section.
double * rowUpperWork_
Row upper bounds - working copy.
void borrowModel(ClpModel &otherModel)
Borrow model.
double lowerOut_
Lower Bound on Out variable.
double dualIn_
Reduced cost of In variable.
int initialDualSolve()
Dual initial solve.
int maximumPerturbationSize_
Maximum perturbation array size (take out when code rewritten)
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
double bestPossibleImprovement() const
Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (...
double valueIn_
Value of In variable.
Base class for Clp disaster handling.
void setTheta(double value)
Set theta of out variable.
int numberRefinements() const
How many iterative refinements to do.
void deleteBaseModel()
Switch off base model.
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
double * solutionRegion() const
Return region as single array.
void setNumberDualInfeasibilities(int value)
If problem is primal feasible.
int progressFlag() const
Progress flag - at present 0 bit says artificials out.
void setFlagged(int sequence)
To flag a variable (not inline to allow for column generation)
int getSolution()
Given an existing factorization computes and checks primal and dual solutions.
int saveModel(const char *fileName)
Save model to file, returns 0 if success.
ClpDualRowPivot * dualRowPivot() const
dual row pivot choice
void setActive(int iRow)
To say row active in primal pivot row choice.
double objectiveValue_
Objective value.
int numberFake_
Can be used for count of fake bounds (dual) or fake costs (primal)
void setDirectionOut(int direction)
Return row or column sections - not as much needed as it once was.
int sequenceIn_
Sequence of In variable.
double * upper_
Working copy of upper bounds (Owner of arrays below)
void setFakeBound(int sequence, FakeBound fakeBound)
To flag a variable (not inline to allow for column generation)
void setMoreSpecialOptions(int value)
Set more special options 1 bit - if presolve says infeasible in ClpSolve return 2 bit - if presolved ...
int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format from file with name filename.
int fathomMany(void *stuff)
Do up to N deep - returns -1 - no solution nNodes_ valid nodes >= if solution and that node gives sol...
int initialBarrierSolve()
Barrier initial solve.
int directionIn() const
Return direction In or Out.
int dual(int ifValuesPass=0, int startFinishOptions=0)
Dual algorithm - see ClpSimplexDual.hpp for method.
ClpSimplexProgress progress_
For dealing with all issues of cycling etc.
double * solutionRegion(int section) const
Return row or column sections - not as much needed as it once was.
bool statusOfProblem(bool initial=false)
Factorizes and returns true if optimal.
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
int initialSolve()
Default initial solve.
double computeInternalObjectiveValue()
Compute minimization objective value from internal solution without perturbation. ...
double sumOfRelaxedPrimalInfeasibilities() const
Sum of relaxed primal infeasibilities.
friend void ClpSimplexUnitTest(const std::string &mpsDir)
A function that tests the methods in the ClpSimplex class.
This solves LPs using the simplex method.
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
int startup(int ifValuesPass, int startFinishOptions=0)
Common bits of coding for dual and primal.
double dualBound_
Dual bound.
double * upperRegion() const
Return row or column sections - not as much needed as it once was.
int automaticScale_
Automatic scaling of objective and rhs and bounds.
void checkSolution(int setToBounds=0)
Just check solution (for external use) - sets sum of infeasibilities etc.
void finish(int startFinishOptions=0)
Pivot in a variable and out a variable.
void createRim1(bool initial)
Does rows and columns.
double spareDoubleArray_[4]
Spare double array for passing information [0]!=0 switches on.
Base class for Clp event handling.
void moveInfo(const ClpSimplex &rhs, bool justStatus=false)
Move status and solution across.
void setAlgorithm(int value)
Set algorithm.
ClpPrimalColumnPivot * primalColumnPivot() const
primal column pivot choice
int dualRanging(int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease, double *valueIncrease=NULL, double *valueDecrease=NULL)
Dual ranging.
Abstract base class for Clp Matrices.
double sumOfRelaxedDualInfeasibilities_
Sum of Dual infeasibilities using tolerance based on error in duals.
int initialBarrierNoCrossSolve()
Barrier initial solve, not to be followed by crossover.
int moreSpecialOptions() const
Return more special options 1 bit - if presolve says infeasible in ClpSolve return 2 bit - if presolv...
Status getRowStatus(int sequence) const
To flag a variable (not inline to allow for column generation)
void originalModel(ClpSimplex *miniModel)
This copies back stuff from miniModel and then deletes miniModel.
double alphaAccuracy_
For computing whether to re-factorize.
int directionOut_
Direction of Out, 1 to upper bound, -1 to lower bound, 0 - superbasic.
int progressFlag_
Progress flag - at present 0 bit says artificials out, 1 free in.
double doubleCheck()
Double checks OK.
void setDualBound(double value)
If problem is primal feasible.
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
void setInitialDenseFactorization(bool onOff)
Normally the first factorization does sparse coding because the factorization could be singular...
int dualPivotResult()
Pivot out a variable and choose an incoing one.
void unpackPacked(CoinIndexedVector *rowArray)
Unpacks one column of the matrix into indexed array as packed vector Uses sequenceIn_ Also applies sc...
int spareIntArray_[4]
Spare int array for passing information [0]!=0 switches on.
double upperOut_
Upper Bound on Out variable.
bool primalFeasible() const
If problem is primal feasible.
void copyFactorization(ClpFactorization &factorization)
Copies in factorization to existing one.
double dualIn() const
Reduced cost of last incoming for use by classes e.g. steepestedge.
bool sparseFactorization() const
Sparsity on or off.
double * objectiveWork_
Column objective - working copy.
int solveDW(CoinStructuredModel *model)
Solve using Dantzig-Wolfe decomposition and maybe in parallel.
double * upperRegion(int section) const
Return row or column sections - not as much needed as it once was.
void getBInvCol(int col, double *vec)
Get a column of the basis inverse.
void setPivotRow(int value)
If problem is primal feasible.
double valueOut() const
Value of Out variable.
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
void getBInvRow(int row, double *z)
Get a row of the basis inverse.
double theta_
Theta (pivot change)
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
void deleteRim(int getRidOfFactorizationData=2)
releases above arrays and does solution scaling out.
double dualBound() const
Dual bound.
double reducedCost(int sequence)
Return row or column sections - not as much needed as it once was.
bool goodAccuracy() const
Returns true if model looks OK.
double upper(int sequence)
Return row or column sections - not as much needed as it once was.
int factorizationFrequency() const
Factorization frequency.
double * costRegion(int section) const
Return row or column sections - not as much needed as it once was.
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
ClpFactorization * getEmptyFactorization()
Gets clean and emptyish factorization.
void makeBaseModel()
Save a copy of model with certain state - normally without cuts.
void setColBounds(int elementIndex, double newlower, double newupper)
Set a single column lower and upper bound.
double * rowLowerWork_
Row lower bounds - working copy.
void setPerturbation(int value)
If problem is primal feasible.
int directionIn_
Direction of In, 1 going up, -1 going down, 0 not a clude.
void dropNames()
Drops names - makes lengthnames 0 and names empty.
double * rowLower_
Row lower.
void computeObjectiveValue(bool useWorkingSolution=false)
Compute objective value from solution and put in objectiveValue_.
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5)
double * lower_
Working copy of lower bounds (Owner of arrays below)
void setColumnStatus(int sequence, Status newstatus)
To flag a variable (not inline to allow for column generation)
int factorize()
Factorizes using current basis. For external use.
int lastGoodIteration_
Last good iteration (immediately after a re-factorization)
int pivotRow() const
Pivot Row for use by classes e.g. steepestedge.
int solve(CoinStructuredModel *model)
Solve using structure of model and maybe in parallel.
int algorithm_
Algorithm >0 == Primal, <0 == Dual.
double alpha() const
Alpha (pivot element) for use by classes e.g. steepestedge.
double upperIn_
Upper Bound on In variable.
bool dualFeasible() const
If problem is dual feasible.
double sumOfRelaxedDualInfeasibilities() const
Sum of relaxed dual infeasibilities.
int sequenceOut_
Sequence of Out variable.
int sequenceIn() const
Return sequence In or Out.
int perturbation() const
Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - ver...
void setDisasterHandler(ClpDisasterHandler *handler)
Objective value.
int numberDualInfeasibilitiesWithoutFree() const
Number of dual infeasibilities (without free)
double bestPossibleImprovement_
Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (...
void cleanStatus()
Clean up status.
void allSlackBasis(bool resetSolution=false)
Sets up all slack basis and resets solution to as it was after initial load or readMps.
int numberDualInfeasibilities() const
Number of dual infeasibilities.
void setLargeValue(double value)
If problem is primal feasible.
int maximumBasic_
Maximum number of basic variables - can be more than number of rows if GUB.
bool createRim(int what, bool makeRowCopy=false, int startFinishOptions=0)
puts in format I like (rowLower,rowUpper) also see StandardMatrix 1 bit does rows (now and columns)...
double & costAddress(int sequence)
Return address of row or column cost.
void getbackSolution(const ClpSimplex &smallModel, const int *whichRow, const int *whichColumn)
Puts solution back into small model.
double dualTolerance_
Current dual tolerance for algorithm.
int perturbation_
Perturbation: -50 to +50 - perturb by this power of ten (-6 sounds good) 100 - auto perturb if takes ...
ClpDualRowPivot * dualRowPivot_
dual row pivot choice
CoinIndexedVector * rowArray_[6]
Useful row length arrays.
int * pivotVariable_
Basic variables pivoting on which rows.
double currentPrimalTolerance() const
Current primal tolerance.
bool isObjectiveLimitTestValid() const
Return true if the objective limit test can be relied upon.
int numberExtraRows() const
Number of extra rows.
int nonlinearSLP(int numberPasses, double deltaTolerance)
Solves nonlinear problem using SLP - may be used as crash for other algorithms when number of iterati...
int primalPivotResult()
Pivot in a variable and choose an outgoing one.
int loadNonLinear(void *info, int &numberConstraints, ClpConstraint **&constraints)
Load nonlinear part of problem from AMPL info Returns 0 if linear 1 if quadratic objective 2 if quadr...
double infeasibilityCost_
Weight assigned to being infeasible in primal.
double lower(int sequence)
Return row or column sections - not as much needed as it once was.
void unpack(CoinIndexedVector *rowArray) const
Unpacks one column of the matrix into indexed array Uses sequenceIn_ Also applies scaling if needed...
void createRim5(bool initial)
Does rows and columns and objective.
int solveBenders(CoinStructuredModel *model)
Solve using Benders decomposition and maybe in parallel.
ClpFactorization * factorization() const
factorization
double & lowerAddress(int sequence)
Return address of row or column lower bound.
This just implements CoinFactorization when an ClpMatrixBase object is passed.
unsigned char * saveStatus_
Saved status regions.
void getBInvARow(int row, double *z, double *slack=NULL)
Get a row of the tableau (slack part in slack if not NULL)
int numberTimesOptimal_
Number of times code has tentatively thought optimal.
int sequenceOut() const
Return row or column sections - not as much needed as it once was.
ClpPrimalColumnPivot * primalColumnPivot_
primal column pivot choice
double alphaAccuracy() const
Initial value for alpha accuracy calculation (-1.0 off)
void setSumPrimalInfeasibilities(double value)
If problem is primal feasible.
void clearFlagged(int sequence)
To flag a variable (not inline to allow for column generation)
int restoreModel(const char *fileName)
Restore model from file, returns 0 if success, deletes current model.
double infeasibilityCost() const
Infeasibility cost.
double primalTolerance_
Current primal tolerance for algorithm.
void setEmptyFactorization()
May delete or may make clean and emptyish factorization.
double * djRegion() const
Return row or column sections - not as much needed as it once was.
int initialPrimalSolve()
Primal initial solve.
void setAutomaticScaling(bool onOff)
If problem is primal feasible.
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
double * dj_
Working copy of reduced costs (Owner of arrays below)