ClpSimplexOther.hpp
Go to the documentation of this file.
1 /* $Id: ClpSimplexOther.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 
5 /*
6  Authors
7 
8  John Forrest
9 
10  */
11 #ifndef ClpSimplexOther_H
12 #define ClpSimplexOther_H
13 
14 #include "ClpSimplex.hpp"
15 
23 class ClpSimplexOther : public ClpSimplex {
24 
25 public:
26 
49  void dualRanging(int numberCheck, const int * which,
50  double * costIncrease, int * sequenceIncrease,
51  double * costDecrease, int * sequenceDecrease,
52  double * valueIncrease = NULL, double * valueDecrease = NULL);
67  void primalRanging(int numberCheck, const int * which,
68  double * valueIncrease, int * sequenceIncrease,
69  double * valueDecrease, int * sequenceDecrease);
83  int parametrics(double startingTheta, double & endingTheta, double reportIncrement,
84  const double * changeLowerBound, const double * changeUpperBound,
85  const double * changeLowerRhs, const double * changeUpperRhs,
86  const double * changeObjective);
87 private:
96  int parametricsLoop(double startingTheta, double & endingTheta, double reportIncrement,
97  const double * changeLower, const double * changeUpper,
98  const double * changeObjective, ClpDataSave & data,
99  bool canTryQuick);
118  int whileIterating(double startingTheta, double & endingTheta, double reportIncrement,
119  const double * changeLower, const double * changeUpper,
120  const double * changeObjective);
125  int nextTheta(int type, double maxTheta, double * primalChange, double * dualChange,
126  const double * changeLower, const double * changeUpper,
127  const double * changeObjective);
133  void checkDualRatios(CoinIndexedVector * rowArray,
134  CoinIndexedVector * columnArray,
135  double & costIncrease, int & sequenceIncrease, double & alphaIncrease,
136  double & costDecrease, int & sequenceDecrease, double & alphaDecrease);
141  void checkPrimalRatios(CoinIndexedVector * rowArray,
142  int direction);
144  double primalRanging1(int whichIn, int whichOther);
145 
146 public:
161  int writeBasis(const char *filename,
162  bool writeValues = false,
163  int formatType = 0) const;
165  int readBasis(const char *filename);
171  ClpSimplex * dualOfModel(double fractionRowRanges = 1.0, double fractionColumnRanges = 1.0) const;
175  int restoreFromDual(const ClpSimplex * dualProblem);
179  ClpSimplex * crunch(double * rhs, int * whichRows, int * whichColumns,
180  int & nBound, bool moreBounds = false, bool tightenBounds = false);
184  void afterCrunch(const ClpSimplex & small,
185  const int * whichRows, const int * whichColumns,
186  int nBound);
188  void cleanupAfterPostsolve();
191  int tightenIntegerBounds(double * rhsSpace);
202  int expandKnapsack(int knapsackRow, int & numberOutput,
203  double * buildObj, CoinBigIndex * buildStart,
204  int * buildRow, double * buildElement, int reConstruct = -1) const;
206 };
207 #endif
void checkPrimalRatios(CoinIndexedVector *rowArray, int direction)
Row array has pivot column This is used in primal ranging.
ClpDataSave saveData()
Save data.
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1217
void cleanupAfterPostsolve()
Quick try at cleaning up duals if postsolve gets wrong.
int nextTheta(int type, double maxTheta, double *primalChange, double *dualChange, const double *changeLower, const double *changeUpper, const double *changeObjective)
Computes next theta and says if objective or bounds (0= bounds, 1 objective, -1 none).
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:618
int parametricsLoop(double startingTheta, double &endingTheta, double reportIncrement, const double *changeLower, const double *changeUpper, const double *changeObjective, ClpDataSave &data, bool canTryQuick)
Parametrics - inner loop This first attempt is when reportIncrement non zero and may not report endin...
ClpSimplex * crunch(double *rhs, int *whichRows, int *whichColumns, int &nBound, bool moreBounds=false, bool tightenBounds=false)
Does very cursory presolve.
void dualRanging(int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease, double *valueIncrease=NULL, double *valueDecrease=NULL)
Dual ranging.
void primalRanging(int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease)
Primal ranging.
int restoreFromDual(const ClpSimplex *dualProblem)
Restores solution from dualized problem non-zero return code indicates minor problems.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
double primalRanging1(int whichIn, int whichOther)
Returns new value of whichOther when whichIn enters basis.
int writeBasis(const char *filename, bool writeValues=false, int formatType=0) const
Write the basis in MPS format to the specified file.
void afterCrunch(const ClpSimplex &small, const int *whichRows, const int *whichColumns, int nBound)
After very cursory presolve.
ClpSimplex * dualOfModel(double fractionRowRanges=1.0, double fractionColumnRanges=1.0) const
Creates dual of a problem if looks plausible (defaults will always create model) fractionRowRanges is...
int tightenIntegerBounds(double *rhsSpace)
Tightens integer bounds - returns number tightened or -1 if infeasible.
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:614
int parametrics(double startingTheta, double &endingTheta, double reportIncrement, const double *changeLowerBound, const double *changeUpperBound, const double *changeLowerRhs, const double *changeUpperRhs, const double *changeObjective)
Parametrics This is an initial slow version.
int expandKnapsack(int knapsackRow, int &numberOutput, double *buildObj, CoinBigIndex *buildStart, int *buildRow, double *buildElement, int reConstruct=-1) const
Expands out all possible combinations for a knapsack If buildObj NULL then just computes space needed...
int whileIterating(double startingTheta, double &endingTheta, double reportIncrement, const double *changeLower, const double *changeUpper, const double *changeObjective)
This has the flow between re-factorizations.
void statusOfProblemInParametrics(int type, ClpDataSave &saveData)
Refactorizes if necessary Checks if finished.
This is for Simplex stuff which is neither dual nor primal.
int readBasis(const char *filename)
Read a basis from the given filename.
void checkDualRatios(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, double &costIncrease, int &sequenceIncrease, double &alphaIncrease, double &costDecrease, int &sequenceDecrease, double &alphaDecrease)
Row array has row part of pivot row Column array has column part.